Mercurial > hg > svcore
comparison data/fileio/MIDIFileReader.h @ 1450:a12fd0456f0c streaming-csv-writer
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 17 Apr 2018 10:35:42 +0100 |
parents | 48e9f538e6e9 |
children | 1dc64d3d323c |
comparison
equal
deleted
inserted
replaced
1449:deabf9fd3d28 | 1450:a12fd0456f0c |
---|---|
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; |