diff options
Diffstat (limited to 'libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp')
-rw-r--r-- | libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp index 1f0f01c7d5..ed27327050 100644 --- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp +++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp @@ -2,14 +2,14 @@ File: AUDispatch.cpp Abstract: AUDispatch.h Version: 1.1 - + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - + In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the @@ -25,13 +25,13 @@ implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS @@ -40,9 +40,9 @@ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + Copyright (C) 2014 Apple Inc. All Rights Reserved. - + */ #include "AUBase.h" #include "CAXException.h" @@ -101,19 +101,19 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th case kAudioUnitRenderSelect: result = (This->AudioUnitAPIVersion() > 1); break; - + default: return ComponentBase::ComponentEntryDispatch(params, This); } break; - + case kAudioUnitInitializeSelect: { CAMutex::Locker lock2(This->GetMutex()); result = This->DoInitialize(); } break; - + case kAudioUnitUninitializeSelect: { CAMutex::Locker lock2(This->GetMutex()); @@ -136,7 +136,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th // always assume they're non-null UInt32 dataSize; Boolean writable; - + result = This->DispatchGetPropertyInfo(pinID, pinScope, pinElement, dataSize, writable); if (poutDataSize != NULL) *poutDataSize = dataSize; @@ -158,7 +158,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th Boolean writable; char *tempBuffer; void *destBuffer; - + if (pioDataSize == NULL) { ca_debug_string("AudioUnitGetProperty: null size pointer"); result = kAudio_ParamError; @@ -166,12 +166,12 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th } if (poutData == NULL) { UInt32 dataSize; - + result = This->DispatchGetPropertyInfo(pinID, pinScope, pinElement, dataSize, writable); *pioDataSize = dataSize; goto finishGetProperty; } - + clientBufferSize = *pioDataSize; if (clientBufferSize == 0) { @@ -180,13 +180,13 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th result = kAudio_ParamError; goto finishGetProperty; } - - result = This->DispatchGetPropertyInfo(pinID, pinScope, pinElement, + + result = This->DispatchGetPropertyInfo(pinID, pinScope, pinElement, actualPropertySize, writable); - if (result) + if (result) goto finishGetProperty; - - if (clientBufferSize < actualPropertySize) + + if (clientBufferSize < actualPropertySize) { tempBuffer = new char[actualPropertySize]; destBuffer = tempBuffer; @@ -194,9 +194,9 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th tempBuffer = NULL; destBuffer = poutData; } - + result = This->DispatchGetProperty(pinID, pinScope, pinElement, destBuffer); - + if (result == noErr) { if (clientBufferSize < actualPropertySize && tempBuffer != NULL) { @@ -213,7 +213,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th } break; - + case kAudioUnitSetPropertySelect: { CAMutex::Locker lock(This->GetMutex()); @@ -222,7 +222,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th PARAM(AudioUnitElement, pinElement, 2, 5); PARAM(const void *, pinData, 3, 5); PARAM(UInt32, pinDataSize, 4, 5); - + if (pinData && pinDataSize) result = This->DispatchSetProperty(pinID, pinScope, pinElement, pinData, pinDataSize); else { @@ -247,7 +247,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th } break; - + case kAudioUnitAddPropertyListenerSelect: { CAMutex::Locker lock(This->GetMutex()); @@ -278,7 +278,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th result = This->RemovePropertyListener(pinID, pinProc, pinProcRefCon, true); } break; - + case kAudioUnitAddRenderNotifySelect: { CAMutex::Locker lock(This->GetMutex()); @@ -344,7 +344,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th PARAM(UInt32, pinNumberFrames, 3, 5); PARAM(AudioBufferList *, pioData, 4, 5); AudioUnitRenderActionFlags tempFlags; - + if (pinTimeStamp == NULL || pioData == NULL) result = kAudio_ParamError; else { @@ -354,7 +354,7 @@ OSStatus AUBase::ComponentEntryDispatch(ComponentParameters *params, AUBase *Th } result = This->DoRender(*pinActionFlags, *pinTimeStamp, pinOutputBusNumber, pinNumberFrames, *pioData); } - } + } } break; @@ -385,13 +385,13 @@ OSStatus CMgr_AudioUnitBaseGetParameter( AUBase * This, float *outValue) { OSStatus result = AUBase::noErr; - + try { if (This == NULL || outValue == NULL) return kAudio_ParamError; result = This->GetParameter(inID, inScope, inElement, *outValue); } COMPONENT_CATCH - + return result; } @@ -403,13 +403,13 @@ OSStatus CMgr_AudioUnitBaseSetParameter( AUBase * This, UInt32 inBufferOffset) { OSStatus result = AUBase::noErr; - + try { if (This == NULL) return kAudio_ParamError; result = This->SetParameter(inID, inScope, inElement, inValue, inBufferOffset); } COMPONENT_CATCH - + return result; } @@ -421,10 +421,10 @@ OSStatus CMgr_AudioUnitBaseRender( AUBase * This, AudioBufferList * ioData) { if (inTimeStamp == NULL || ioData == NULL) return kAudio_ParamError; - + OSStatus result = AUBase::noErr; AudioUnitRenderActionFlags tempFlags; - + try { if (ioActionFlags == NULL) { tempFlags = 0; @@ -433,6 +433,6 @@ OSStatus CMgr_AudioUnitBaseRender( AUBase * This, result = This->DoRender(*ioActionFlags, *inTimeStamp, inBusNumber, inNumberFrames, *ioData); } COMPONENT_CATCH - + return result; } |