diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-11-06 16:00:00 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-11-06 16:00:31 -0700 |
commit | febaa1ff2d1f5150d30902f7ccc8b5dfcfb3c913 (patch) | |
tree | 8fa79254ff807577eb6977987f834edfed8905fb /libs/ardour/disk_reader.cc | |
parent | 9694f8996643e8845393aa60548f97ccc416d4e1 (diff) |
fix unconditional note resolution during DiskReader::realtime_locate()
When looping, we do not want to resolve notes at the end of the loop via ::realtime_locate() -
::get_midi_playback() has already taken care of this. But when not looping, we need this. So,
add an argument to tell all interested parties whether the locate is for a loop end or not
Diffstat (limited to 'libs/ardour/disk_reader.cc')
-rw-r--r-- | libs/ardour/disk_reader.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 0790b7279e..919fdd8669 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -166,8 +166,12 @@ DiskReader::realtime_handle_transport_stopped () } void -DiskReader::realtime_locate () +DiskReader::realtime_locate (bool for_loop_end) { + if (!for_loop_end) { + boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack>(_track); + _tracker.resolve_notes (mt->immediate_events(), 0); + } } float @@ -1122,14 +1126,13 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, sample cnt -= this_read; effective_start += this_read; - DEBUG_TRACE (DEBUG::MidiDiskIO, string_compose ("%1 MDS events LOOP read %2 range %3 .. %4 cnt now %5\n", _name, events_read, effective_start, effective_end, cnt)); - + DEBUG_TRACE (DEBUG::MidiDiskIO, string_compose ("%1 MDS events LOOP read %2 cnt now %3\n", _name, events_read, cnt)); if (cnt) { /* We re going to have to read across the loop end. Resolve any notes the extend across the loop end. * Time is relative to start_sample. */ - _tracker.resolve_notes (*target, (loc->end() - 1) - start_sample); + _tracker.resolve_notes (*target, effective_end - start_sample); } } while (cnt); |