aboutsummaryrefslogtreecommitdiff
path: root/src/midi_sequencer_impl.hpp
diff options
context:
space:
mode:
authorJP Cimalando <jpcima@users.noreply.github.com>2018-08-28 10:26:21 +0200
committerJP Cimalando <jpcima@users.noreply.github.com>2018-08-28 10:26:21 +0200
commit66d2b296616663603a64d4196bfd00f9c5f039da (patch)
tree7a939cbff6c5739cdb9c14b29f314b53972f522c /src/midi_sequencer_impl.hpp
parent6c495486cdd3c3c8f5c3c945e79233128a7479f9 (diff)
downloadlibADLMIDI-66d2b296616663603a64d4196bfd00f9c5f039da.tar.gz
libADLMIDI-66d2b296616663603a64d4196bfd00f9c5f039da.tar.bz2
libADLMIDI-66d2b296616663603a64d4196bfd00f9c5f039da.zip
sequencer: enable end silence skipping
Diffstat (limited to 'src/midi_sequencer_impl.hpp')
-rw-r--r--src/midi_sequencer_impl.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/midi_sequencer_impl.hpp b/src/midi_sequencer_impl.hpp
index 0fe6192..e54c7ee 100644
--- a/src/midi_sequencer_impl.hpp
+++ b/src/midi_sequencer_impl.hpp
@@ -614,6 +614,19 @@ bool BW_MidiSequencer::buildSmfTrackData(const std::vector<std::vector<uint8_t>
}
}
+#ifdef ENABLE_END_SILENCE_SKIPPING
+ //Have track end on its own row? Clear any delay on the row before
+ if(event.subtype == MidiEvent::ST_ENDTRACK && evtPos.events.size() == 1)
+ {
+ if (!m_trackData[tk].empty())
+ {
+ MidiTrackRow &previous = m_trackData[tk].back();
+ previous.delay = 0;
+ previous.timeDelay = 0;
+ }
+ }
+#endif
+
if((evtPos.delay > 0) || (event.subtype == MidiEvent::ST_ENDTRACK))
{
evtPos.absPos = abs_position;