diff options
author | David Robillard <d@drobilla.net> | 2014-11-19 19:24:07 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-19 19:24:16 -0500 |
commit | a9936205b182faf1b32b06dbf312b4c9c77f4872 (patch) | |
tree | fce3d5526ddf749b82aabe3350be6b5278a31448 /libs/ardour/midi_region.cc | |
parent | 4ffdc99c5fee8e8f62cddd4f815b132c06c83711 (diff) |
Fix dropped MIDI events, especially with record enabled.
I am not precisely sure why the cached iterator was causing this problem, it
shouldn't be invalidated, and the times make sense. It may be some lock
related issue since the iterator holds a lock on the source.
In any case, this cached iterator was just to avoid repeated linear search of
the model, but since the model has a logarithmic search, instead just scrap all
this problematic persistent state and search for the appropriate start time
every read. No need to be careful about invalidating when anything changes.
Diffstat (limited to 'libs/ardour/midi_region.cc')
-rw-r--r-- | libs/ardour/midi_region.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 03db3eaaa7..cb0d103b1e 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -414,20 +414,13 @@ MidiRegion::model_automation_state_changed (Evoral::Parameter const & p) /* Update our filtered parameters list after a change to a parameter's AutoState */ boost::shared_ptr<AutomationControl> ac = model()->automation_control (p); - assert (ac); - - if (ac->alist()->automation_state() == Play) { + if (!ac || ac->alist()->automation_state() == Play) { + /* It should be "impossible" for ac to be NULL, but if it is, don't + filter the parameter so events aren't lost. */ _filtered_parameters.erase (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. |