diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-11 03:48:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-11 03:48:14 +0000 |
commit | 0fb8c89eeb785427d2af08c49ad7b79bb5fb1330 (patch) | |
tree | c24b54fb9dd98388d49b06df33eac050948c7d93 /libs | |
parent | bfd2ee48ce8e4e2061e00a1b83c6e37fa4d0ddad (diff) |
fix propagation of parameter changes from Plugin to PluginInsert so that automation will record parameter changes performed in a plugin GUI (#4976)
git-svn-id: svn://localhost/ardour2/branches/3.0@13026 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/plugin_insert.h | 4 | ||||
-rw-r--r-- | libs/ardour/audio_unit.cc | 22 | ||||
-rw-r--r-- | libs/ardour/plugin_insert.cc | 35 |
3 files changed, 33 insertions, 28 deletions
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 5b4a5294f2..0146604327 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -137,12 +137,12 @@ class PluginInsert : public Processor Split, ///< we copy one of our insert's inputs to multiple plugin inputs Hide, ///< we `hide' some of the plugin's inputs by feeding them silence }; - + private: /* disallow copy construction */ PluginInsert (const PluginInsert&); - void parameter_changed (Evoral::Parameter, float); + void parameter_changed (uint32_t, float); void set_parameter (Evoral::Parameter param, float val); float get_parameter (Evoral::Parameter param); diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index e02a00c28e..a76bcc4aae 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -2787,9 +2787,21 @@ AUPlugin::_parameter_change_listener (void* arg, void* src, const AudioUnitEvent void AUPlugin::parameter_change_listener (void* /*arg*/, void* /*src*/, const AudioUnitEvent* event, UInt64 /*host_time*/, Float32 new_value) { - ParameterMap::iterator i = parameter_map.find (event->mArgument.mParameter.mParameterID); - - if (i != parameter_map.end()) { - ParameterChanged (i->second, new_value); - } + ParameterMap::iterator i; + + switch (event->mEventType) { + case kAudioUnitEvent_BeginParameterChangeGesture: + break; + case kAudioUnitEvent_EndParameterChangeGesture: + break; + case kAudioUnitEvent_ParameterValueChange: + i = parameter_map.find (event->mArgument.mParameter.mParameterID); + + if (i != parameter_map.end()) { + ParameterChanged (i->second, new_value); + } + break; + default: + break; + } } diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 1ef32d6127..baaa632d2b 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -262,31 +262,24 @@ PluginInsert::create_automatable_parameters () } void -PluginInsert::parameter_changed (Evoral::Parameter which, float val) +PluginInsert::parameter_changed (uint32_t which, float val) { - if (which.type() != PluginAutomation) { - return; - } - - cerr << "Param change: " << which << endl; + boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, which)); - 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(); - - /* don't set the first plugin, just all the slaves */ - - if (i != _plugins.end()) { - ++i; - for (; i != _plugins.end(); ++i) { - (*i)->set_parameter (which, val); - } - } + + Plugins::iterator i = _plugins.begin(); + + /* don't set the first plugin, just all the slaves */ + + if (i != _plugins.end()) { + ++i; + for (; i != _plugins.end(); ++i) { + (*i)->set_parameter (which, val); + } + } + } } int |