diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-11 00:23:55 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-11 00:23:55 +0000 |
commit | bfd2ee48ce8e4e2061e00a1b83c6e37fa4d0ddad (patch) | |
tree | 71e3575a62b533f4a22c00df839ec8abaf52d733 /libs/ardour | |
parent | 67f8063256567e717a21cfdb42b5b1ce4a8b6bcd (diff) |
improved version of last commit, for tracking plugin control changes and mapping them to PluginInsert automation controls
git-svn-id: svn://localhost/ardour2/branches/3.0@13025 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/audio_unit.cc | 5 | ||||
-rw-r--r-- | libs/ardour/plugin_insert.cc | 17 |
2 files changed, 16 insertions, 6 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 2119e4c375..e02a00c28e 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -2790,11 +2790,6 @@ AUPlugin::parameter_change_listener (void* /*arg*/, void* /*src*/, const AudioUn ParameterMap::iterator i = parameter_map.find (event->mArgument.mParameter.mParameterID); if (i != parameter_map.end()) { - boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, i->second)); - if (ac) { - cerr << "updating " << ac->name() << " to << new_value << endl; - ac->set_double (new_value); - } ParameterChanged (i->second, new_value); } } diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index a33dee2dbf..1ef32d6127 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -264,8 +264,18 @@ PluginInsert::create_automatable_parameters () void PluginInsert::parameter_changed (Evoral::Parameter which, float val) { - if (which.type() != PluginAutomation) + if (which.type() != PluginAutomation) { return; + } + + cerr << "Param change: " << which << endl; + + boost::shared_ptr<AutomationControl> ac = automation_control (which); + + if (ac) { + cerr << "updating " << ac->name() << " to " << val << endl; + ac->set_double (val); + } Plugins::iterator i = _plugins.begin(); @@ -1258,6 +1268,11 @@ void PluginInsert::add_plugin (boost::shared_ptr<Plugin> plugin) { plugin->set_insert_info (this); + + if (_plugins.empty()) { + plugin->ParameterChanged.connect_same_thread (*this, boost::bind (&PluginInsert::parameter_changed, this, _1, _2)); + } + _plugins.push_back (plugin); } |