diff options
author | Wohlstand <admin@wohlnet.ru> | 2017-10-26 03:17:15 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2017-10-26 03:17:15 +0300 |
commit | d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9 (patch) | |
tree | 7fc7899b2a68250666b939bc151ae797814e5f8f /src/adlmidi_load.cpp | |
parent | 650d6b913504f37ed84c5f855a85aa00d9dc34d8 (diff) | |
download | libADLMIDI-d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9.tar.gz libADLMIDI-d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9.tar.bz2 libADLMIDI-d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9.zip |
Continue works on loop points and some clean-up
- Added more detailed error information while parsing MIDI file
- Added abiltiy to retrieve loop points time positions
- Added ability to change playing tempo by giving multiplier
- Removed old commented code
TODO:
- implement meta-information store and a way to retreive it
- implement hook-ability for every MIDI event
- implement ability to mute/solo every channel
Diffstat (limited to 'src/adlmidi_load.cpp')
-rw-r--r-- | src/adlmidi_load.cpp | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/src/adlmidi_load.cpp b/src/adlmidi_load.cpp index 5bc2ba0..08892a5 100644 --- a/src/adlmidi_load.cpp +++ b/src/adlmidi_load.cpp @@ -48,53 +48,6 @@ uint64_t MIDIplay::ReadLEint(const void *buffer, size_t nbytes) return result; } -//uint64_t MIDIplay::ReadVarLenEx(size_t tk, bool &ok) -//{ -// uint64_t result = 0; -// ok = false; - -// for(;;) -// { -// if(tk >= TrackData.size()) -// return 1; - -// if(tk >= CurrentPosition.track.size()) -// return 2; - -// size_t ptr = CurrentPosition.track[tk].ptr; - -// if(ptr >= TrackData[tk].size()) -// return 3; - -// unsigned char byte = TrackData[tk][CurrentPosition.track[tk].ptr++]; -// result = (result << 7) + (byte & 0x7F); - -// if(!(byte & 0x80)) break; -// } - -// ok = true; -// return result; -//} - -uint64_t MIDIplay::ReadVarLenEx(uint8_t **ptr, uint8_t *end, bool &ok) -{ - uint64_t result = 0; - ok = false; - - for(;;) - { - if(*ptr >= end) - return 2; - unsigned char byte = *((*ptr)++); - result = (result << 7) + (byte & 0x7F); - if(!(byte & 0x80)) break; - } - - ok = true; - return result; -} - - bool MIDIplay::LoadBank(const std::string &filename) { fileReader file; @@ -388,6 +341,7 @@ bool MIDIplay::LoadMIDI(MIDIplay::fileReader &fr) ADL_UNUSED(fsize); //! Temp buffer for conversion AdlMIDI_CPtr<uint8_t> cvt_buf; + errorString.clear(); #ifdef DISABLE_EMBEDDED_BANKS if((opl.AdlBank != ~0u) || (opl.dynamic_metainstruments.size() < 256)) @@ -792,7 +746,7 @@ InvFmt: //Build new MIDI events table (ALPHA!!!) if(!buildTrackData()) { - ADLMIDI_ErrorString = fr._fileName + ": MIDI data parsing error has occouped!"; + ADLMIDI_ErrorString = fr._fileName + ": MIDI data parsing error has occouped!\n" + errorString; return false; } |