From 04b3f11979da485fd9d682ede0c6c601b3b8f24e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 7 Apr 2011 15:40:44 +0000 Subject: remove recently added, but bogus, property listener stuff from appleutility libs git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@9322 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/appleutility/CAAudioFile.h | 1 - libs/appleutility/CAAudioUnit.cpp | 82 +-------------------------------------- libs/appleutility/CAAudioUnit.h | 19 --------- 3 files changed, 2 insertions(+), 100 deletions(-) (limited to 'libs') diff --git a/libs/appleutility/CAAudioFile.h b/libs/appleutility/CAAudioFile.h index ce22bfe466..594545a9d1 100644 --- a/libs/appleutility/CAAudioFile.h +++ b/libs/appleutility/CAAudioFile.h @@ -114,7 +114,6 @@ public: // or the file's sample rate is 0 (unknown) #if CAAF_USE_EXTAUDIOFILE -#warning HERE WE ARE public: CAAudioFile() : mExtAF(NULL) { std::cerr << "Constructing CAAudioFile\n"; } virtual ~CAAudioFile() { std::cerr << "Destroying CAAudiofile @ " << this << std::endl; if (mExtAF) Close(); } diff --git a/libs/appleutility/CAAudioUnit.cpp b/libs/appleutility/CAAudioUnit.cpp index 0e2cdbfe49..db1056da84 100644 --- a/libs/appleutility/CAAudioUnit.cpp +++ b/libs/appleutility/CAAudioUnit.cpp @@ -223,102 +223,24 @@ CAAudioUnit::CAAudioUnit (const AudioUnit& inUnit) } CAAudioUnit::CAAudioUnit (const CAComponent& inComp) - : mComp (inComp), mDataPtr (0), mPropertyCallback (0) + : mComp (inComp), mDataPtr (0) { mDataPtr = new AUState (mComp.Comp()); } CAAudioUnit::CAAudioUnit (const AUNode &inNode, const AudioUnit& inUnit) - : mComp (inUnit), mDataPtr(new AUState (inNode, inUnit)), mPropertyCallback (0) + : mComp (inUnit), mDataPtr(new AUState (inNode, inUnit)) { } CAAudioUnit::~CAAudioUnit () { - dropPropertyListens (); - if (mDataPtr) { mDataPtr->release(); mDataPtr = NULL; } } -void -CAAudioUnit::addPropertyListen (AudioUnitPropertyID id) -{ - if (mPropertyCallback == 0) { - return; - } - - if (mWatching.find (id) != mWatching.end()) { - return; - } - - if (AudioUnitAddPropertyListener (AU(), id, PropertyCallback, this) == noErr) { - mWatching.insert (id); - } -} - -void -CAAudioUnit::removePropertyListen (AudioUnitPropertyID id) -{ - if (!mPropertyCallback) { - return; - } - std::set::iterator i = mWatching.find (id); - if (i != mWatching.end()) { - mWatching.erase (i); - } - /* this is for 10.6 and above ... - AudioUnitRemovePropertyListenerWithUserData (AU(), id, PropertyCallback, this); - */ - AudioUnitRemovePropertyListener (AU(), id, PropertyCallback); -} - -void -CAAudioUnit::dropPropertyListens () -{ - for (std::set::iterator i = mWatching.begin(); i != mWatching.end(); ++i) { - /* this is for 10.6 and above ... - AudioUnitRemovePropertyListenerWithUserData (AU(), *i, PropertyCallback, this); - */ - AudioUnitRemovePropertyListener (AU(), *i, PropertyCallback); - } - mWatching.clear (); -} - -void -CAAudioUnit::SetPropertyCallback (void (*prop_callback)(void*, int32_t, float, void*), void* arg) -{ - dropPropertyListens (); - mPropertyCallback = prop_callback; - mPropertyCallbackArg = arg; -} - -void -CAAudioUnit::PropertyCallback (void *inRefCon, - AudioUnit inUnit, - AudioUnitPropertyID inID, - AudioUnitScope inScope, - AudioUnitElement inElement) -{ - static_cast(inRefCon)-> - DoPropertyCallback (inUnit, inID, inScope, inElement); -} - -void -CAAudioUnit::DoPropertyCallback (AudioUnit inUnit, - AudioUnitPropertyID inID, - AudioUnitScope inScope, - AudioUnitElement inElement) -{ - if (mPropertyCallback) { - float value; - AudioUnitGetParameter (inUnit, inID, inScope, inElement, &value); - mPropertyCallback (this, inID, value, mPropertyCallbackArg); - } -} - CAAudioUnit& CAAudioUnit::operator= (const CAAudioUnit &a) { if (mDataPtr != a.mDataPtr) { diff --git a/libs/appleutility/CAAudioUnit.h b/libs/appleutility/CAAudioUnit.h index 9f6f5905e1..b3493a5110 100644 --- a/libs/appleutility/CAAudioUnit.h +++ b/libs/appleutility/CAAudioUnit.h @@ -330,31 +330,12 @@ public: void Print () const { Print (stdout); } void Print (FILE* file) const; - void SetPropertyCallback (void (*param_callback)(void*, int32_t, float, void*), void* arg); - void addPropertyListen (AudioUnitPropertyID); - void removePropertyListen (AudioUnitPropertyID); - private: CAComponent mComp; class AUState; AUState* mDataPtr; - void (*mPropertyCallback)(void* Unit, int32_t which, float val, void*); - void* mPropertyCallbackArg; - std::set mWatching; - void dropPropertyListens (); - static void PropertyCallback ( - void *inRefCon, - AudioUnit inUnit, - AudioUnitPropertyID inID, - AudioUnitScope inScope, - AudioUnitElement inElement); - void DoPropertyCallback (AudioUnit inUnit, - AudioUnitPropertyID inID, - AudioUnitScope inScope, - AudioUnitElement inElement); - // this can throw - so wrap this up in a static that returns a result code... CAAudioUnit (const CAComponent& inComp); -- cgit v1.2.3