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
This commit is contained in:
@@ -169,8 +169,11 @@ void
|
||||
DiskReader::realtime_locate (bool for_loop_end)
|
||||
{
|
||||
if (!for_loop_end) {
|
||||
std::cerr << name() << "DO note resolve on locate for loop\n";
|
||||
boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack>(_track);
|
||||
_tracker.resolve_notes (mt->immediate_events(), 0);
|
||||
} else {
|
||||
std::cerr << name() << "skip note resolve on locate for loop\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ MidiStateTracker::resolve_notes (MidiBuffer &dst, samplepos_t time)
|
||||
return;
|
||||
}
|
||||
|
||||
PBD::stacktrace (std::cerr, 20);
|
||||
|
||||
for (int channel = 0; channel < 16; ++channel) {
|
||||
for (int note = 0; note < 128; ++note) {
|
||||
while (_active_notes[note + 128 * channel]) {
|
||||
|
||||
@@ -391,9 +391,13 @@ Plugin::realtime_handle_transport_stopped ()
|
||||
}
|
||||
|
||||
void
|
||||
Plugin::realtime_locate (bool)
|
||||
Plugin::realtime_locate (bool for_loop_end)
|
||||
{
|
||||
resolve_midi ();
|
||||
std::cerr << name() << " RL fle = " << for_loop_end << std::endl;
|
||||
|
||||
//if (!for_loop_end) {
|
||||
resolve_midi ();
|
||||
//}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -180,9 +180,10 @@ RTMidiBuffer::read (MidiBuffer& dst, samplepos_t start, samplepos_t end, MidiSta
|
||||
|
||||
#ifndef NDEBUG
|
||||
TimeType unadjusted_time;
|
||||
Item* last = iend; --last;
|
||||
#endif
|
||||
|
||||
DEBUG_TRACE (DEBUG::MidiRingBuffer, string_compose ("read from %1 .. %2 .. initial index = %3 (time = %4) (range in list of %7 %5..%6)\n", start, end, item - _data, item->timestamp, _data->timestamp, iend->timestamp, _size));
|
||||
DEBUG_TRACE (DEBUG::MidiRingBuffer, string_compose ("read from %1 .. %2 .. initial index = %3 (time = %4) (range in list of %7 %5..%6)\n", start, end, item - _data, item->timestamp, _data->timestamp, last->timestamp, _size));
|
||||
|
||||
while ((item < iend) && (item->timestamp < end)) {
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ void
|
||||
TransportFSM::locate_for_loop (Event const & l)
|
||||
{
|
||||
assert (l.type == Locate);
|
||||
DEBUG_TRACE (DEBUG::TFSMEvents, "locate_for_loop\n");
|
||||
DEBUG_TRACE (DEBUG::TFSMEvents, string_compose ("locate_for_loop, wl = %1\n", l.with_loop));
|
||||
current_roll_after_locate_status = l.with_roll;
|
||||
api->locate (l.target, l.with_roll, l.with_flush, l.with_loop, l.force);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user