From 4bc0d1c475f4f8c87b0fea690e5105d31337d6f4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 20 Nov 2014 15:36:11 -0500 Subject: Fix lost MIDI note offs and controllers. Fix initial read of discrete MIDI controllers. Fix spurious note offs when starting to play in the middle of a note. Faster search for initial event when cached iterator is invalid. So much for dropping the cached iterator. The iterator is responsible for handling note offs, so that doesn't work. This design means we have some stuck note issues at the source read level, but they should be taken care of by the state tracker anyway. --- libs/ardour/midi_region.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/ardour/midi_region.cc') diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index cb0d103b1e..71fd796b81 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -421,6 +421,13 @@ MidiRegion::model_automation_state_changed (Evoral::Parameter const & p) } else { _filtered_parameters.insert (p); } + + /* the source will have an iterator into the model, and that iterator will have been set up + for a given set of filtered_parameters, so now that we've changed that list we must invalidate + the iterator. + */ + Glib::Threads::Mutex::Lock lm (midi_source(0)->mutex()); + midi_source(0)->invalidate (); } /** This is called when a trim drag has resulted in a -ve _start time for this region. -- cgit v1.2.3