diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-11 15:31:02 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-11 15:31:02 +0000 |
commit | 8d6d3c309d75f5280bf32cffcab271a287827c01 (patch) | |
tree | b303256e444f26db230ff4b0e31982930894bf2a /libs/ardour/plugin_insert.cc | |
parent | a782dd36e74b3a346c82ba82bf0e9d9533255691 (diff) |
add StartTouch and EndTouch signals to Plugin class; make PluginInsert handle these signals and mark the start end of touch/gestures for a given AutomationControl; net result is that touch automation now works for AudioUnit plugins, at least those whose GUIs send kAudioUnitEvent_{Begin,End}ParameterGesture events
git-svn-id: svn://localhost/ardour2/branches/3.0@13028 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r-- | libs/ardour/plugin_insert.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index baaa632d2b..6e7cfe373f 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -1263,7 +1263,12 @@ PluginInsert::add_plugin (boost::shared_ptr<Plugin> plugin) plugin->set_insert_info (this); if (_plugins.empty()) { + /* first (and probably only) plugin instance - connect to relevant signals + */ + plugin->ParameterChanged.connect_same_thread (*this, boost::bind (&PluginInsert::parameter_changed, this, _1, _2)); + plugin->StartTouch.connect_same_thread (*this, boost::bind (&PluginInsert::start_touch, this, _1)); + plugin->EndTouch.connect_same_thread (*this, boost::bind (&PluginInsert::end_touch, this, _1)); } _plugins.push_back (plugin); @@ -1292,3 +1297,21 @@ PluginInsert::monitoring_changed () (*i)->monitoring_changed (); } } + +void +PluginInsert::start_touch (uint32_t param_id) +{ + boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id)); + if (ac) { + ac->start_touch (session().audible_frame()); + } +} + +void +PluginInsert::end_touch (uint32_t param_id) +{ + boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id)); + if (ac) { + ac->stop_touch (true, session().audible_frame()); + } +} |