summaryrefslogtreecommitdiff
path: root/libs/ardour/plugin.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-12-26 17:01:31 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-12-26 17:01:31 +0000
commit5558b3cf06b98060438d1e68c8d5d2f4a9c2f8f6 (patch)
treef760d3daccb5e4fdafe73c013a1c8bc11684a015 /libs/ardour/plugin.cc
parentbda0f938fbf640ad60b6f1d3bc7ed18bcb2a0c2b (diff)
a grab bag of changes correcting and improving the way MIDI note on/off tracking is done. may/should fix a number of problem with spurious note-offs under a variety of circumstances
git-svn-id: svn://localhost/ardour2/branches/3.0@11074 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/plugin.cc')
-rw-r--r--libs/ardour/plugin.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc
index 8c8bf248e0..bac014df38 100644
--- a/libs/ardour/plugin.cc
+++ b/libs/ardour/plugin.cc
@@ -70,6 +70,7 @@ Plugin::Plugin (AudioEngine& e, Session& s)
, _have_pending_stop_events (false)
, _parameter_changed_since_last_preset (false)
{
+ _pending_stop_events.ensure_buffers (DataType::MIDI, 1, 4096);
}
Plugin::Plugin (const Plugin& other)
@@ -83,12 +84,11 @@ Plugin::Plugin (const Plugin& other)
, _have_pending_stop_events (false)
, _parameter_changed_since_last_preset (false)
{
-
+ _pending_stop_events.ensure_buffers (DataType::MIDI, 1, 4096);
}
Plugin::~Plugin ()
{
-
}
void
@@ -242,8 +242,10 @@ Plugin::connect_and_run (BufferSet& bufs,
if (bufs.count().n_midi() > 0) {
/* Track notes that we are sending to the plugin */
+
MidiBuffer& b = bufs.get_midi (0);
bool looped;
+
_tracker.track (b.begin(), b.end(), looped);
if (_have_pending_stop_events) {
@@ -259,11 +261,28 @@ Plugin::connect_and_run (BufferSet& bufs,
void
Plugin::realtime_handle_transport_stopped ()
{
+ resolve_midi ();
+}
+
+void
+Plugin::realtime_locate ()
+{
+ resolve_midi ();
+}
+
+void
+Plugin::monitoring_changed ()
+{
+ resolve_midi ();
+}
+
+void
+Plugin::resolve_midi ()
+{
/* Create note-offs for any active notes and put them in _pending_stop_events, to be picked
up on the next call to connect_and_run ().
*/
- _pending_stop_events.ensure_buffers (DataType::MIDI, 1, 4096);
_pending_stop_events.get_midi(0).clear ();
_tracker.resolve_notes (_pending_stop_events.get_midi (0), 0);
_have_pending_stop_events = true;
@@ -345,3 +364,5 @@ Plugin::set_info (PluginInfoPtr info)
{
_info = info;
}
+
+