comparison data/fileio/MIDIFileReader.h @ 1429:48e9f538e6e9

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents 1c9bbbb6116a
children 1dc64d3d323c
comparison
equal deleted inserted replaced
1428:87ae75da6527 1429:48e9f538e6e9
73 typedef std::map<unsigned int, MIDITrack> MIDIComposition; 73 typedef std::map<unsigned int, MIDITrack> MIDIComposition;
74 typedef std::pair<RealTime, double> TempoChange; // time, qpm 74 typedef std::pair<RealTime, double> TempoChange; // time, qpm
75 typedef std::map<unsigned long, TempoChange> TempoMap; // key is MIDI time 75 typedef std::map<unsigned long, TempoChange> TempoMap; // key is MIDI time
76 76
77 typedef enum { 77 typedef enum {
78 MIDI_SINGLE_TRACK_FILE = 0x00, 78 MIDI_SINGLE_TRACK_FILE = 0x00,
79 MIDI_SIMULTANEOUS_TRACK_FILE = 0x01, 79 MIDI_SIMULTANEOUS_TRACK_FILE = 0x01,
80 MIDI_SEQUENTIAL_TRACK_FILE = 0x02, 80 MIDI_SEQUENTIAL_TRACK_FILE = 0x02,
81 MIDI_FILE_BAD_FORMAT = 0xFF 81 MIDI_FILE_BAD_FORMAT = 0xFF
82 } MIDIFileFormatType; 82 } MIDIFileFormatType;
83 83
84 bool parseFile(); 84 bool parseFile();
85 bool parseHeader(const std::string &midiHeader); 85 bool parseHeader(const std::string &midiHeader);
86 bool parseTrack(unsigned int &trackNum); 86 bool parseTrack(unsigned int &trackNum);
87 87
88 Model *loadTrack(unsigned int trackNum, 88 Model *loadTrack(unsigned int trackNum,
89 Model *existingModel = 0, 89 Model *existingModel = 0,
90 int minProgress = 0, 90 int minProgress = 0,
91 int progressAmount = 100) const; 91 int progressAmount = 100) const;
92 92
93 bool consolidateNoteOffEvents(unsigned int track); 93 bool consolidateNoteOffEvents(unsigned int track);
94 void updateTempoMap(unsigned int track); 94 void updateTempoMap(unsigned int track);
95 void calculateTempoTimestamps(); 95 void calculateTempoTimestamps();
96 RealTime getTimeForMIDITime(unsigned long midiTime) const; 96 RealTime getTimeForMIDITime(unsigned long midiTime) const;