diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-20 10:12:21 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-20 10:23:49 -0400 |
commit | f806f059b3c229004cfbac50234062333fc38229 (patch) | |
tree | fbb4c0eb166bcfbb951acd36728001435aa37665 /libs/ardour/audio_unit.cc | |
parent | 7804a524dc106ec1540fa5f02e26f84c71cbef9a (diff) |
rename Plugin::ParameterChanged to ParameterChangedExternally to reflect its intent, and clean up the libardour side of result.
The signal exists to notify listeners that something outside of the host's control (e.g. a plugin's own GUI for AU or VST)
has modified a plugin parameter. Previous code had strange feedback loops and ambiguous semantics.
Diffstat (limited to 'libs/ardour/audio_unit.cc')
-rw-r--r-- | libs/ardour/audio_unit.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 600a6fecbb..045669b29b 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -924,7 +924,7 @@ AUPlugin::set_parameter (uint32_t which, float val) theEvent.mArgument.mParameter.mElement = d.element; DEBUG_TRACE (DEBUG::AudioUnits, "notify about parameter change\n"); - AUEventListenerNotify (NULL, NULL, &theEvent); + AUEventListenerNotify (NULL, this, &theEvent); Plugin::set_parameter (which, val); } @@ -3078,7 +3078,7 @@ 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) +AUPlugin::parameter_change_listener (void* /*arg*/, void* src, const AudioUnitEvent* event, UInt64 /*host_time*/, Float32 new_value) { ParameterMap::iterator i; @@ -3094,7 +3094,12 @@ AUPlugin::parameter_change_listener (void* /*arg*/, void* /*src*/, const AudioUn EndTouch (i->second); break; case kAudioUnitEvent_ParameterValueChange: - ParameterChanged (i->second, new_value); + if (src != this) { + std::cerr << "something changed " << i->second << " to " << new_value << std::endl; + ParameterChangedExternally (i->second, new_value); + } else { + std::cerr << "plugin changed " << i->second << " ignore it\n"; + } break; default: break; |