File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ class EXPORT ImportFilter : public Plugin
78
78
return m_file.read ( _data, _len );
79
79
}
80
80
81
+ inline QByteArray readAllData ()
82
+ {
83
+ return m_file.readAll ();
84
+ }
85
+
81
86
inline void ungetChar ( char _ch )
82
87
{
83
88
m_file.ungetChar ( _ch );
Original file line number Diff line number Diff line change 26
26
#include < QDomDocument>
27
27
#include < QDir>
28
28
#include < QApplication>
29
+ #include < QFile>
29
30
#include < QMessageBox>
30
31
#include < QProgressDialog>
31
32
33
+ #include < sstream>
34
+
32
35
#include " MidiImport.h"
33
36
#include " TrackContainer.h"
34
37
#include " InstrumentTrack.h"
@@ -279,8 +282,6 @@ class smfMidiChannel
279
282
280
283
bool MidiImport::readSMF ( TrackContainer* tc )
281
284
{
282
- QString filename = file ().fileName ();
283
- closeFile ();
284
285
285
286
const int preTrackSteps = 2 ;
286
287
QProgressDialog pd ( TrackContainer::tr ( " Importing MIDI-file..." ),
@@ -291,7 +292,11 @@ bool MidiImport::readSMF( TrackContainer* tc )
291
292
292
293
pd.setValue ( 0 );
293
294
294
- Alg_seq_ptr seq = new Alg_seq (filename.toLocal8Bit (), true );
295
+ std::stringstream stream;
296
+ QByteArray arr = readAllData ();
297
+ stream.str (std::string (arr.constData (), arr.size ()));
298
+
299
+ Alg_seq_ptr seq = new Alg_seq (stream, true );
295
300
seq->convert_to_beats ();
296
301
297
302
pd.setMaximum ( seq->tracks () + preTrackSteps );
You can’t perform that action at this time.
0 commit comments