22 #ifndef _MIDI_FILE_READER_H_ 23 #define _MIDI_FILE_READER_H_ 51 (QStringList trackNames,
bool haveSomePercussion,
52 QString &singleTrack)
const = 0;
54 virtual void showError(QString error) = 0;
65 int mainModelSampleRate);
68 virtual bool isOK()
const;
76 typedef std::map<unsigned long, TempoChange>
TempoMap;
90 Model *existingModel = 0,
92 int progressAmount = 100)
const;
137 #endif // _MIDI_FILE_READER_H_
std::set< unsigned int > m_percussionTracks
Model * loadTrack(unsigned int trackNum, Model *existingModel=0, int minProgress=0, int progressAmount=100) const
std::pair< RealTime, double > TempoChange
std::map< unsigned long, TempoChange > TempoMap
MIDIComposition m_midiComposition
unsigned int m_numberOfTracks
virtual QString getError() const
bool parseHeader(const std::string &midiHeader)
MIDIFileFormatType m_format
virtual ~MIDIFileImportPreferenceAcquirer()
long midiBytesToLong(const std::string &bytes)
MIDIFileReader(QString path, MIDIFileImportPreferenceAcquirer *pref, int mainModelSampleRate)
long getNumberFromMIDIBytes(int firstByte=-1)
RealTime getTimeForMIDITime(unsigned long midiTime) const
int m_mainModelSampleRate
std::ifstream * m_midiFile
MIDIFileImportPreferenceAcquirer * m_acquirer
int midiBytesToInt(const std::string &bytes)
virtual TrackPreference getTrackImportPreference(QStringList trackNames, bool haveSomePercussion, QString &singleTrack) const =0
bool parseTrack(unsigned int &trackNum)
Model is the base class for all data models that represent any sort of data on a time scale based on ...
bool consolidateNoteOffEvents(unsigned int track)
void calculateTempoTimestamps()
std::map< int, QString > m_trackNames
void updateTempoMap(unsigned int track)
virtual bool isOK() const
Return true if the file appears to be of the correct type.
virtual void showError(QString error)=0
virtual ~MIDIFileReader()
std::string getMIDIBytes(unsigned long bytes)
virtual Model * load() const
Read the file and return the corresponding data model.
std::set< unsigned int > m_loadableTracks
std::map< unsigned int, MIDITrack > MIDIComposition
std::vector< MIDIEvent * > MIDITrack
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...