diff options
author | Wohlstand <admin@wohlnet.ru> | 2017-10-27 01:36:59 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2017-10-27 01:36:59 +0300 |
commit | 78b48a4f7250f94b62a5c995f8c714804bb66eef (patch) | |
tree | 9d882d4eb5e94a88b77b4c95d4932af0101c635c /src | |
parent | cb647dc07631c95c0b88658796e3ddd67b5ee92c (diff) | |
download | libADLMIDI-78b48a4f7250f94b62a5c995f8c714804bb66eef.tar.gz libADLMIDI-78b48a4f7250f94b62a5c995f8c714804bb66eef.tar.bz2 libADLMIDI-78b48a4f7250f94b62a5c995f8c714804bb66eef.zip |
Repair the ability to skip silence in a begin,
...But keep it be togglable through macro definition
Diffstat (limited to 'src')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 7b9094a..577e8b8 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -533,9 +533,11 @@ uint64_t MIDIplay::ReadVarLenEx(uint8_t **ptr, uint8_t *end, bool &ok) double MIDIplay::Tick(double s, double granularity) { s *= tempoMultiplier; - //if(CurrentPositionNew.began) + #ifdef ENABLE_BEGIN_SILENCE_SKIPPING + if(CurrentPositionNew.began) + #endif CurrentPositionNew.wait -= s; - CurrentPositionNew.absTimePosition += s; + CurrentPositionNew.absTimePosition += s; int antiFreezeCounter = 10000;//Limit 10000 loops to avoid freezing while((CurrentPositionNew.wait <= granularity * 0.5) && (antiFreezeCounter > 0)) @@ -1297,8 +1299,10 @@ bool MIDIplay::ProcessEventsNew(bool isSeek) for(size_t i = 0; i < track.pos->events.size(); i++) { MidiEvent &evt = track.pos->events[i]; + #ifdef ENABLE_BEGIN_SILENCE_SKIPPING if(!CurrentPositionNew.began && (evt.type == MidiEvent::T_NOTEON)) CurrentPositionNew.began = true; + #endif if(isSeek && (evt.type == MidiEvent::T_NOTEON)) continue; HandleEvent(tk, evt, track.status); @@ -1351,9 +1355,12 @@ bool MIDIplay::ProcessEventsNew(bool isSeek) fraction<uint64_t> t = shortest * Tempo; - //if(CurrentPositionNew.began) + #ifdef ENABLE_BEGIN_SILENCE_SKIPPING + if(CurrentPositionNew.began) + #endif CurrentPositionNew.wait += t.value(); + //if(shortest > 0) UI.PrintLn("Delay %ld (%g)", shortest, (double)t.valuel()); if(loopStart) { @@ -1779,11 +1786,8 @@ long MIDIplay::CalculateAdlChannelGoodness(unsigned c, uint16_t ins, uint16_t) c ++m) { if(m->second.sustained) continue; - if(m->second.vibdelay >= 200) continue; - if(m->second.ins != j->second.ins) continue; - n_evacuation_stations += 1; } } |