summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_model.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-20 15:36:11 -0500
committerDavid Robillard <d@drobilla.net>2014-11-20 15:36:11 -0500
commit4bc0d1c475f4f8c87b0fea690e5105d31337d6f4 (patch)
treefe0aed2c39451cfcea385d91166bc43d82a97b74 /libs/ardour/midi_model.cc
parent8bba63282a4d641287d6da945fc7ce49b583038c (diff)
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.
Diffstat (limited to 'libs/ardour/midi_model.cc')
-rw-r--r--libs/ardour/midi_model.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index 8e17e1d3ec..259a04bc0f 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -1630,6 +1630,7 @@ MidiModel::edit_lock()
assert (ms);
Glib::Threads::Mutex::Lock* source_lock = new Glib::Threads::Mutex::Lock (ms->mutex());
+ ms->invalidate(); // Release cached iterator's read lock on model
return WriteLock(new WriteLockImpl(source_lock, _lock, _control_lock));
}
@@ -1853,6 +1854,10 @@ MidiModel::set_midi_source (boost::shared_ptr<MidiSource> s)
{
boost::shared_ptr<MidiSource> old = _midi_source.lock ();
+ if (old) {
+ old->invalidate ();
+ }
+
_midi_source_connections.drop_connections ();
_midi_source = s;