diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-11 01:04:02 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-11 01:04:02 +0000 |
commit | 343acfcaa1bb2604c8329846a4bd3a9128f28255 (patch) | |
tree | 99d5e56494516a30eb93130ca1a8a63ccf38fb15 | |
parent | 47be62fc4f9f9c2254c606f85b4c84d499d1103f (diff) |
working version of AU parameter change notification, presets too
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6058 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/audio_unit.cc | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index d09537e828..dfb21b1de9 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1,6 +1,7 @@ /* Copyright (C) 2006-2009 Paul Davis - + Some portions Copyright (C) Sophia Poirier. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -45,6 +46,7 @@ #include <CoreFoundation/CoreFoundation.h> #include <CoreServices/CoreServices.h> #include <AudioUnit/AudioUnit.h> +#include <AudioToolbox/AudioUnitUtilities.h> #include "i18n.h" @@ -632,8 +634,15 @@ AUPlugin::set_parameter (uint32_t which, float val) /* tell the world what we did */ - const AudioUnitParameter inParameter = { unit, d.id, d.scope, d.element }; - AUParameterListenerNotify (0, 0, &inParameter); + AudioUnitEvent theEvent; + + theEvent.mEventType = kAudioUnitEvent_ParameterValueChange; + theEvent.mArgument.mParameter.mAudioUnit = unit->AU(); + theEvent.mArgument.mParameter.mParameterID = d.id; + theEvent.mArgument.mParameter.mScope = d.scope; + theEvent.mArgument.mParameter.mElement = d.element; + + AUEventListenerNotify (NULL, NULL, &theEvent); } } @@ -1337,6 +1346,13 @@ AUPlugin::set_state(const XMLNode& node) if (propertyList) { if (unit->SetAUPreset (propertyList) == noErr) { ret = 0; + + /* tell the world */ + + AudioUnitParameter changedUnit; + changedUnit.mAudioUnit = unit->AU(); + changedUnit.mParameterID = kAUParameterListener_AnyParameter; + AUParameterListenerNotify (NULL, NULL, &changedUnit); } CFRelease (propertyList); } @@ -1383,10 +1399,16 @@ AUPlugin::load_preset (const string preset_label) if (unit->SetPresentPreset (preset) == 0) { ret = true; + + /* tell the world */ + + AudioUnitParameter changedUnit; + changedUnit.mAudioUnit = unit->AU(); + changedUnit.mParameterID = kAUParameterListener_AnyParameter; + AUParameterListenerNotify (NULL, NULL, &changedUnit); } } - - + return ret; #else if (!seen_loading_message) { |