summaryrefslogtreecommitdiff
path: root/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp')
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp404
1 files changed, 202 insertions, 202 deletions
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp
index 612bc4d308..c77322dcbf 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp
@@ -2,14 +2,14 @@
File: AUBase.cpp
Abstract: AUBase.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 "AUDispatch.h"
@@ -88,7 +88,7 @@ SInt32 AUBase::sVectorUnitType = kVecUninitialized;
//_____________________________________________________________________________
//
-AUBase::AUBase( AudioComponentInstance inInstance,
+AUBase::AUBase( AudioComponentInstance inInstance,
UInt32 numInputElements,
UInt32 numOutputElements,
UInt32 numGroupElements) :
@@ -96,7 +96,7 @@ AUBase::AUBase( AudioComponentInstance inInstance,
mElementsCreated(false),
mInitialized(false),
mHasBegunInitializing(false),
- mInitNumInputEls(numInputElements), mInitNumOutputEls(numOutputElements),
+ mInitNumInputEls(numInputElements), mInitNumOutputEls(numOutputElements),
#if !CA_BASIC_AU_FEATURES
mInitNumGroupEls(numGroupElements),
#endif
@@ -115,7 +115,7 @@ AUBase::AUBase( AudioComponentInstance inInstance,
#endif
{
ResetRenderTime ();
-
+
if(!sAUBaseCFStringsInitialized)
{
kUntitledString = CFSTR("Untitled");
@@ -137,11 +137,11 @@ AUBase::AUBase( AudioComponentInstance inInstance,
}
mAudioUnitAPIVersion = 2;
-
+
SetMaxFramesPerSlice(kAUDefaultMaxFramesPerSlice);
GlobalScope().Initialize(this, kAudioUnitScope_Global, 1);
-
+
#if !CA_NO_AU_UI_FEATURES
memset (&mHostCallbackInfo, 0, sizeof (mHostCallbackInfo));
#endif
@@ -175,7 +175,7 @@ void AUBase::CreateElements()
Groups().Initialize(this, kAudioUnitScope_Group, mInitNumGroupEls);
#endif
CreateExtendedElements();
-
+
mElementsCreated = true;
}
}
@@ -202,7 +202,7 @@ OSStatus AUBase::CanSetMaxFrames() const
void AUBase::ReallocateBuffers()
{
CreateElements();
-
+
UInt32 nOutputs = Outputs().GetNumberOfElements();
for (UInt32 i = 0; i < nOutputs; ++i) {
AUOutputElement *output = GetOutput(i);
@@ -241,7 +241,7 @@ void AUBase::DeallocateIOBuffers()
OSStatus AUBase::DoInitialize()
{
OSStatus result = noErr;
-
+
if (!mInitialized) {
result = Initialize();
if (result == noErr) {
@@ -279,7 +279,7 @@ void AUBase::DoCleanup()
{
if (mInitialized)
Cleanup();
-
+
DeallocateIOBuffers();
ResetRenderTime ();
@@ -312,22 +312,22 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
{
OSStatus result = noErr;
bool validateElement = true;
-
+
switch (inID) {
case kAudioUnitProperty_MakeConnection:
ca_require(inScope == kAudioUnitScope_Input || inScope == kAudioUnitScope_Global, InvalidScope);
outDataSize = sizeof(AudioUnitConnection);
outWritable = true;
break;
-
-
+
+
case kAudioUnitProperty_SetRenderCallback:
ca_require(AudioUnitAPIVersion() > 1, InvalidProperty);
ca_require(inScope == kAudioUnitScope_Input || inScope == kAudioUnitScope_Global, InvalidScope);
outDataSize = sizeof(AURenderCallbackStruct);
outWritable = true;
break;
-
+
case kAudioUnitProperty_StreamFormat:
outDataSize = sizeof(CAStreamBasicDescription);
outWritable = IsStreamFormatWritable(inScope, inElement);
@@ -352,7 +352,7 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
outWritable = false;
}
break;
-
+
case kAudioUnitProperty_PresentPreset:
#if !CA_USE_AUDIO_PLUGIN_ONLY
#ifndef __LP64__
@@ -363,23 +363,23 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
outDataSize = sizeof(AUPreset);
outWritable = true;
break;
-
+
case kAudioUnitProperty_ElementName:
outDataSize = sizeof (CFStringRef);
outWritable = true;
break;
-
+
case kAudioUnitProperty_ParameterList:
{
UInt32 nparams = 0;
result = GetParameterList(inScope, NULL, nparams);
-
+
outDataSize = sizeof(AudioUnitParameterID) * nparams;
outWritable = false;
validateElement = false;
}
break;
-
+
case kAudioUnitProperty_ParameterInfo:
outDataSize = sizeof(AudioUnitParameterInfo);
outWritable = false;
@@ -397,13 +397,13 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
outWritable = BusCountWritable(inScope);
validateElement = false;
break;
-
+
case kAudioUnitProperty_Latency:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
outDataSize = sizeof(Float64);
outWritable = false;
break;
-
+
case kAudioUnitProperty_TailTime:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
if (SupportsTail()) {
@@ -412,19 +412,19 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
} else
goto InvalidProperty;
break;
-
+
case kAudioUnitProperty_MaximumFramesPerSlice:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
outDataSize = sizeof(UInt32);
outWritable = true;
break;
-
+
case kAudioUnitProperty_LastRenderError:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
outDataSize = sizeof(OSStatus);
outWritable = false;
break;
-
+
case kAudioUnitProperty_SupportedNumChannels:
{
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
@@ -437,7 +437,7 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
outWritable = false;
break;
}
-
+
case kAudioUnitProperty_SupportedChannelLayoutTags:
{
UInt32 numLayouts = GetChannelLayoutTags(inScope, inElement, NULL);
@@ -450,7 +450,7 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
validateElement = false; //already done it
break;
}
-
+
case kAudioUnitProperty_AudioChannelLayout:
{
outWritable = false;
@@ -490,11 +490,11 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
if (outDataSize == 0)
goto InvalidProperty;
outDataSize *= sizeof (AudioComponentDescription);
-
+
outWritable = false;
break;
#endif
-
+
case kAudioUnitProperty_ParameterValueStrings:
result = GetParameterValueStrings(inScope, inElement, NULL);
if (result == noErr) {
@@ -517,7 +517,7 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
outDataSize = sizeof(CFStringRef);
outWritable = true;
break;
-
+
case kAudioUnitProperty_IconLocation:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
outWritable = false;
@@ -537,7 +537,7 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
outDataSize = sizeof(Float64);
outWritable = false;
break;
-
+
case kAudioUnitProperty_NickName:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
outDataSize = sizeof(CFStringRef);
@@ -551,9 +551,9 @@ OSStatus AUBase::DispatchGetPropertyInfo(AudioUnitPropertyID inID,
}
if (result == noErr && validateElement) {
- ca_require(GetElement(inScope, inElement) != NULL, InvalidElement);
+ ca_require(GetElement(inScope, inElement) != NULL, InvalidElement);
}
-
+
return result;
InvalidProperty:
return kAudioUnitErr_InvalidProperty;
@@ -579,11 +579,11 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
case kAudioUnitProperty_StreamFormat:
*(CAStreamBasicDescription *)outData = GetStreamFormat(inScope, inElement);
break;
-
+
case kAudioUnitProperty_SampleRate:
*(Float64 *)outData = GetStreamFormat(inScope, inElement).mSampleRate;
break;
-
+
case kAudioUnitProperty_ParameterList:
{
UInt32 nparams = 0;
@@ -615,7 +615,7 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
result = GetPresets ((CFArrayRef *)outData);
}
break;
-
+
case kAudioUnitProperty_PresentPreset:
#if !CA_USE_AUDIO_PLUGIN_ONLY
#ifndef __LP64__
@@ -624,15 +624,15 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
#endif
{
*(AUPreset *)outData = mCurrentPreset;
-
+
// retain current string (as client owns a reference to it and will release it)
- if (inID == kAudioUnitProperty_PresentPreset && mCurrentPreset.presetName)
+ if (inID == kAudioUnitProperty_PresentPreset && mCurrentPreset.presetName)
CFRetain (mCurrentPreset.presetName);
result = noErr;
}
break;
-
+
case kAudioUnitProperty_ElementName:
{
AUElement * element = GetElement(inScope, inElement);
@@ -648,7 +648,7 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
case kAudioUnitProperty_ElementCount:
*(UInt32 *)outData = GetScope(inScope).GetNumberOfElements();
break;
-
+
case kAudioUnitProperty_Latency:
*(Float64 *)outData = GetLatency();
break;
@@ -659,7 +659,7 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
else
result = kAudioUnitErr_InvalidProperty;
break;
-
+
case kAudioUnitProperty_MaximumFramesPerSlice:
*(UInt32 *)outData = mMaxFramesPerSlice;
break;
@@ -686,9 +686,9 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
result = kAudioUnitErr_InvalidProperty;
}
break;
-
+
case kAudioUnitProperty_AudioChannelLayout:
- {
+ {
AudioChannelLayout* ptr = outData ? static_cast<AudioChannelLayout*>(outData) : NULL;
Boolean writable;
UInt32 dataSize = GetAudioChannelLayout(inScope, inElement, ptr, writable);
@@ -710,7 +710,7 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
case kAudioUnitProperty_ParameterValueStrings:
result = GetParameterValueStrings(inScope, inElement, (CFArrayRef *)outData);
break;
-
+
#if !CA_USE_AUDIO_PLUGIN_ONLY
case kAudioUnitProperty_FastDispatch:
if (!IsCMgrObject()) result = kAudioUnitErr_InvalidProperty;
@@ -765,21 +765,21 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
result = kAudioUnitErr_InvalidPropertyValue;
}
break;
-
+
case kAudioUnitProperty_ParameterClumpName:
{
AudioUnitParameterNameInfo * ioClumpInfo = (AudioUnitParameterNameInfo*) outData;
if (ioClumpInfo->inID == kAudioUnitClumpID_System) // this ID value is reserved
result = kAudioUnitErr_InvalidPropertyValue;
- else
+ else
{
result = CopyClumpName(inScope, ioClumpInfo->inID, ioClumpInfo->inDesiredLength, &ioClumpInfo->outName);
-
+
// this is provided for compatbility with existing implementations that don't know
// about this new mechanism
if (result == kAudioUnitErr_InvalidProperty)
result = GetProperty (inID, inScope, inElement, outData);
- }
+ }
}
break;
@@ -794,7 +794,7 @@ OSStatus AUBase::DispatchGetProperty( AudioUnitPropertyID inID,
if (mNickName) CFRetain(mNickName);
*(CFStringRef*)outData = mNickName;
break;
-
+
default:
result = GetProperty(inID, inScope, inElement, outData);
break;
@@ -822,7 +822,7 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
}
break;
-
+
case kAudioUnitProperty_SetRenderCallback:
{
ca_require(inDataSize >= sizeof(AURenderCallbackStruct), InvalidPropertyValue);
@@ -840,7 +840,7 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
PropertyChanged(inID, inScope, inElement);
}
break;
-
+
case kAudioUnitProperty_MaximumFramesPerSlice:
ca_require(inDataSize == sizeof(UInt32), InvalidPropertyValue);
result = CanSetMaxFrames();
@@ -862,14 +862,14 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
ca_require(ValidFormat(inScope, inElement, newDesc), InvalidFormat);
const CAStreamBasicDescription curDesc = GetStreamFormat(inScope, inElement);
-
+
if ( !curDesc.IsEqual(newDesc, false) ) {
ca_require(IsStreamFormatWritable(inScope, inElement), NotWritable);
result = ChangeStreamFormat(inScope, inElement, curDesc, newDesc);
}
}
break;
-
+
case kAudioUnitProperty_SampleRate:
{
ca_require(inDataSize == sizeof(Float64), InvalidPropertyValue);
@@ -878,9 +878,9 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
const CAStreamBasicDescription curDesc = GetStreamFormat(inScope, inElement);
CAStreamBasicDescription newDesc = curDesc;
newDesc.mSampleRate = *(Float64 *)inData;
-
+
ca_require(ValidFormat(inScope, inElement, newDesc), InvalidFormat);
-
+
if ( !curDesc.IsEqual(newDesc, false) ) {
ca_require(IsStreamFormatWritable(inScope, inElement), NotWritable);
result = ChangeStreamFormat(inScope, inElement, curDesc, newDesc);
@@ -892,14 +892,14 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
{
const AudioChannelLayout *layout = static_cast<const AudioChannelLayout *>(inData);
size_t headerSize = sizeof(AudioChannelLayout) - sizeof(AudioChannelDescription);
-
+
ca_require(inDataSize >= headerSize + layout->mNumberChannelDescriptions * sizeof(AudioChannelDescription), InvalidPropertyValue);
result = SetAudioChannelLayout(inScope, inElement, layout);
if (result == noErr)
PropertyChanged(inID, inScope, inElement);
break;
}
-
+
case kAudioUnitProperty_ClassInfo:
ca_require(inDataSize == sizeof(CFPropertyListRef *), InvalidPropertyValue);
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
@@ -916,7 +916,7 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
ca_require(inDataSize == sizeof(AUPreset), InvalidPropertyValue);
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
AUPreset & newPreset = *(AUPreset *)inData;
-
+
if (newPreset.presetNumber >= 0)
{
result = NewFactoryPresetSet(newPreset);
@@ -935,7 +935,7 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
result = kAudioUnitErr_InvalidPropertyValue;
}
break;
-
+
case kAudioUnitProperty_ElementName:
{
ca_require(GetElement(inScope, inElement) != NULL, InvalidElement);
@@ -1003,7 +1003,7 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
break;
#endif // !CA_NO_AU_UI_FEATURES
-
+
case kAudioUnitProperty_NickName:
{
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
@@ -1015,12 +1015,12 @@ OSStatus AUBase::DispatchSetProperty( AudioUnitPropertyID inID,
PropertyChanged(inID, inScope, inElement);
break;
}
-
+
default:
result = SetProperty(inID, inScope, inElement, inData, inDataSize);
if (result == noErr)
PropertyChanged(inID, inScope, inElement);
-
+
break;
}
return result;
@@ -1062,7 +1062,7 @@ OSStatus AUBase::DispatchRemovePropertyValue (AudioUnitPropertyID inID,
PropertyChanged(inID, inScope, inElement);
break;
}
-
+
#if !CA_NO_AU_HOST_CALLBACKS
case kAudioUnitProperty_HostCallbacks:
{
@@ -1088,7 +1088,7 @@ OSStatus AUBase::DispatchRemovePropertyValue (AudioUnitPropertyID inID,
mContextName = NULL;
result = noErr;
break;
-
+
#endif // !CA_NO_AU_UI_FEATURES
case kAudioUnitProperty_NickName:
@@ -1104,10 +1104,10 @@ OSStatus AUBase::DispatchRemovePropertyValue (AudioUnitPropertyID inID,
}
default:
- result = RemovePropertyValue (inID, inScope, inElement);
+ result = RemovePropertyValue (inID, inScope, inElement);
break;
}
-
+
return result;
#if !CA_NO_AU_UI_FEATURES || !CA_NO_AU_HOST_CALLBACKS
InvalidScope:
@@ -1157,7 +1157,7 @@ OSStatus AUBase::RemovePropertyValue ( AudioUnitPropertyID inID,
{
return kAudioUnitErr_InvalidPropertyValue;
}
-
+
//_____________________________________________________________________________
//
OSStatus AUBase::AddPropertyListener( AudioUnitPropertyID inID,
@@ -1165,11 +1165,11 @@ OSStatus AUBase::AddPropertyListener( AudioUnitPropertyID inID,
void * inProcRefCon)
{
PropertyListener pl;
-
+
pl.propertyID = inID;
pl.listenerProc = inProc;
pl.listenerRefCon = inProcRefCon;
-
+
if (mPropertyListeners.empty())
mPropertyListeners.reserve(32);
mPropertyListeners.push_back(pl);
@@ -1196,7 +1196,7 @@ OSStatus AUBase::RemovePropertyListener( AudioUnitPropertyID inID,
//_____________________________________________________________________________
//
void AUBase::PropertyChanged( AudioUnitPropertyID inID,
- AudioUnitScope inScope,
+ AudioUnitScope inScope,
AudioUnitElement inElement)
{
for (PropertyListeners::iterator it = mPropertyListeners.begin(); it != mPropertyListeners.end(); ++it)
@@ -1239,7 +1239,7 @@ OSStatus AUBase::GetParameter( AudioUnitParameterID inID,
return noErr;
}
-
+
//_____________________________________________________________________________
//
OSStatus AUBase::SetParameter( AudioUnitParameterID inID,
@@ -1259,22 +1259,22 @@ OSStatus AUBase::ScheduleParameter ( const AudioUnitParameterEvent *inParamet
UInt32 inNumEvents)
{
bool canScheduleParameters = CanScheduleParameters();
-
- for (UInt32 i = 0; i < inNumEvents; ++i)
+
+ for (UInt32 i = 0; i < inNumEvents; ++i)
{
if (inParameterEvent[i].eventType == kParameterEvent_Immediate)
{
SetParameter (inParameterEvent[i].parameter,
- inParameterEvent[i].scope,
+ inParameterEvent[i].scope,
inParameterEvent[i].element,
- inParameterEvent[i].eventValues.immediate.value,
+ inParameterEvent[i].eventValues.immediate.value,
inParameterEvent[i].eventValues.immediate.bufferOffset);
}
if (canScheduleParameters) {
mParamList.push_back (inParameterEvent[i]);
}
}
-
+
return noErr;
}
@@ -1297,9 +1297,9 @@ OSStatus AUBase::ProcessForScheduledParams( ParameterEventList &inParamList,
void *inUserData )
{
OSStatus result = noErr;
-
+
int totalFramesToProcess = inFramesToProcess;
-
+
int framesRemaining = totalFramesToProcess;
unsigned int currentStartFrame = 0; // start of the whole buffer
@@ -1310,23 +1310,23 @@ OSStatus AUBase::ProcessForScheduledParams( ParameterEventList &inParamList,
std::sort(inParamList.begin(), inParamList.end(), SortParameterEventList);
ParameterEventList::iterator iter = inParamList.begin();
-
-
+
+
while(framesRemaining > 0 )
{
// first of all, go through the ramped automation events and find out where the next
// division of our whole buffer will be
-
+
int currentEndFrame = totalFramesToProcess; // start out assuming we'll process all the way to
// the end of the buffer
-
+
iter = inParamList.begin();
-
+
// find the next break point
while(iter != inParamList.end() )
{
AudioUnitParameterEvent &event = *iter;
-
+
int offset = event.eventType == kParameterEvent_Immediate ? event.eventValues.immediate.bufferOffset : event.eventValues.ramp.startBufferOffset;
if(offset > (int)currentStartFrame && offset < currentEndFrame )
@@ -1339,7 +1339,7 @@ OSStatus AUBase::ProcessForScheduledParams( ParameterEventList &inParamList,
if(event.eventType == kParameterEvent_Ramped )
{
offset = event.eventValues.ramp.startBufferOffset + event.eventValues.ramp.durationInFrames;
-
+
if(offset > (int)currentStartFrame && offset < currentEndFrame )
{
currentEndFrame = offset;
@@ -1348,31 +1348,31 @@ OSStatus AUBase::ProcessForScheduledParams( ParameterEventList &inParamList,
iter++;
}
-
+
int framesThisTime = currentEndFrame - currentStartFrame;
- // next, setup the parameter maps to be current for the ramp parameters active during
+ // next, setup the parameter maps to be current for the ramp parameters active during
// this time segment...
-
+
for(ParameterEventList::iterator iter2 = inParamList.begin(); iter2 != inParamList.end(); iter2++ )
{
AudioUnitParameterEvent &event = *iter2;
-
+
bool eventFallsInSlice;
-
-
+
+
if(event.eventType == kParameterEvent_Ramped)
- eventFallsInSlice = event.eventValues.ramp.startBufferOffset < currentEndFrame
+ eventFallsInSlice = event.eventValues.ramp.startBufferOffset < currentEndFrame
&& event.eventValues.ramp.startBufferOffset + event.eventValues.ramp.durationInFrames > currentStartFrame;
else /* kParameterEvent_Immediate */
// actually, for the same parameter, there may be future immediate events which override this one,
// but it's OK since the event list is sorted in time order, we're guaranteed to end up with the current one
eventFallsInSlice = event.eventValues.immediate.bufferOffset <= currentStartFrame;
-
+
if(eventFallsInSlice)
{
AUElement *element = GetElement(event.scope, event.element );
-
+
if(element) element->SetScheduledEvent( event.parameter,
event,
currentStartFrame,
@@ -1383,18 +1383,18 @@ OSStatus AUBase::ProcessForScheduledParams( ParameterEventList &inParamList,
// Finally, actually do the processing for this slice.....
-
+
result = ProcessScheduledSlice( inUserData,
currentStartFrame,
framesThisTime,
inFramesToProcess );
-
+
if(result != noErr) break;
-
+
framesRemaining -= framesThisTime;
currentStartFrame = currentEndFrame; // now start from where we left off last time
}
-
+
return result;
}
@@ -1402,9 +1402,9 @@ OSStatus AUBase::ProcessForScheduledParams( ParameterEventList &inParamList,
//
void AUBase::SetWantsRenderThreadID (bool inFlag)
{
- if (inFlag == mWantsRenderThreadID)
+ if (inFlag == mWantsRenderThreadID)
return;
-
+
mWantsRenderThreadID = inFlag;
if (!mWantsRenderThreadID)
mRenderThreadID = NULL;
@@ -1423,10 +1423,10 @@ OSStatus AUBase::DoRender( AudioUnitRenderActionFlags & ioActionFlags,
{
OSStatus theError;
RenderCallbackList::iterator rcit;
-
+
AUTRACE(kCATrace_AUBaseRenderStart, mComponentInstance, (uintptr_t)this, inBusNumber, inFramesToProcess, (uintptr_t)ioData.mBuffers[0].mData);
DISABLE_DENORMALS
-
+
try {
ca_require(IsInitialized(), Uninitialized);
ca_require(mAudioUnitAPIVersion >= 2, ParamErr);
@@ -1468,7 +1468,7 @@ OSStatus AUBase::DoRender( AudioUnitRenderActionFlags & ioActionFlags,
buf.mDataByteSize = expectedBufferByteSize;
}
}
-
+
if (WantsRenderThreadID())
{
#if TARGET_OS_MAC
@@ -1477,7 +1477,7 @@ OSStatus AUBase::DoRender( AudioUnitRenderActionFlags & ioActionFlags,
mRenderThreadID = GetCurrentThreadId();
#endif
}
-
+
AudioUnitRenderActionFlags flags;
if (mRenderCallbacksTouched) {
mRenderCallbacks.update();
@@ -1485,26 +1485,26 @@ OSStatus AUBase::DoRender( AudioUnitRenderActionFlags & ioActionFlags,
for (rcit = mRenderCallbacks.begin(); rcit != mRenderCallbacks.end(); ++rcit) {
RenderCallback &rc = *rcit;
AUTRACE(kCATrace_AUBaseRenderCallbackStart, mComponentInstance, (intptr_t)this, (intptr_t)rc.mRenderNotify, 1, 0);
- (*(AURenderCallback)rc.mRenderNotify)(rc.mRenderNotifyRefCon,
+ (*(AURenderCallback)rc.mRenderNotify)(rc.mRenderNotifyRefCon,
&flags,
&inTimeStamp, inBusNumber, inFramesToProcess, &ioData);
AUTRACE(kCATrace_AUBaseRenderCallbackEnd, mComponentInstance, (intptr_t)this, (intptr_t)rc.mRenderNotify, 1, 0);
}
}
-
+
theError = DoRenderBus(ioActionFlags, inTimeStamp, inBusNumber, output, inFramesToProcess, ioData);
-
+
if (mRenderCallbacksTouched) {
flags = ioActionFlags | kAudioUnitRenderAction_PostRender;
-
+
if (SetRenderError (theError)) {
- flags |= kAudioUnitRenderAction_PostRenderError;
+ flags |= kAudioUnitRenderAction_PostRenderError;
}
-
+
for (rcit = mRenderCallbacks.begin(); rcit != mRenderCallbacks.end(); ++rcit) {
RenderCallback &rc = *rcit;
AUTRACE(kCATrace_AUBaseRenderCallbackStart, mComponentInstance, (intptr_t)this, (intptr_t)rc.mRenderNotify, 2, 0);
- (*(AURenderCallback)rc.mRenderNotify)(rc.mRenderNotifyRefCon,
+ (*(AURenderCallback)rc.mRenderNotify)(rc.mRenderNotifyRefCon,
&flags,
&inTimeStamp, inBusNumber, inFramesToProcess, &ioData);
AUTRACE(kCATrace_AUBaseRenderCallbackEnd, mComponentInstance, (intptr_t)this, (intptr_t)rc.mRenderNotify, 2, 0);
@@ -1527,12 +1527,12 @@ OSStatus AUBase::DoRender( AudioUnitRenderActionFlags & ioActionFlags,
theError = -1;
goto errexit;
}
-done:
+done:
RESTORE_DENORMALS
AUTRACE(kCATrace_AUBaseRenderEnd, mComponentInstance, (intptr_t)this, theError, ioActionFlags, CATrace::ablData(ioData));
-
+
return theError;
-
+
Uninitialized: theError = kAudioUnitErr_Uninitialized; goto errexit;
ParamErr: theError = kAudio_ParamError; goto errexit;
TooManyFrames: theError = kAudioUnitErr_TooManyFramesToProcess; goto errexit;
@@ -1553,8 +1553,8 @@ OSStatus AUBase::DoProcess ( AudioUnitRenderActionFlags & ioActionFlags,
AUTRACE(kCATrace_AUBaseRenderStart, mComponentInstance, (intptr_t)this, -1, inFramesToProcess, 0);
DISABLE_DENORMALS
- try {
-
+ try {
+
if (!(ioActionFlags & (1 << 9)/*kAudioUnitRenderAction_DoNotCheckRenderArgs*/)) {
ca_require(IsInitialized(), Uninitialized);
ca_require(inFramesToProcess <= mMaxFramesPerSlice, TooManyFrames);
@@ -1587,7 +1587,7 @@ OSStatus AUBase::DoProcess ( AudioUnitRenderActionFlags & ioActionFlags,
}
}
}
-
+
if (WantsRenderThreadID())
{
#if TARGET_OS_MAC
@@ -1596,12 +1596,12 @@ OSStatus AUBase::DoProcess ( AudioUnitRenderActionFlags & ioActionFlags,
mRenderThreadID = GetCurrentThreadId();
#endif
}
-
+
if (NeedsToRender (inTimeStamp)) {
theError = ProcessBufferLists (ioActionFlags, ioData, ioData, inFramesToProcess);
} else
theError = noErr;
-
+
}
catch (OSStatus err) {
theError = err;
@@ -1611,12 +1611,12 @@ OSStatus AUBase::DoProcess ( AudioUnitRenderActionFlags & ioActionFlags,
theError = -1;
goto errexit;
}
-done:
+done:
RESTORE_DENORMALS
AUTRACE(kCATrace_AUBaseRenderEnd, mComponentInstance, (intptr_t)this, theError, ioActionFlags, CATrace::ablData(ioData));
-
+
return theError;
-
+
Uninitialized: theError = kAudioUnitErr_Uninitialized; goto errexit;
ParamErr: theError = kAudio_ParamError; goto errexit;
TooManyFrames: theError = kAudioUnitErr_TooManyFramesToProcess; goto errexit;
@@ -1636,25 +1636,25 @@ OSStatus AUBase::DoProcessMultiple ( AudioUnitRenderActionFlags & ioActionFlags
{
OSStatus theError;
DISABLE_DENORMALS
-
+
try {
-
+
if (!(ioActionFlags & (1 << 9)/*kAudioUnitRenderAction_DoNotCheckRenderArgs*/)) {
ca_require(IsInitialized(), Uninitialized);
ca_require(inFramesToProcess <= mMaxFramesPerSlice, TooManyFrames);
ca_require (!UsesFixedBlockSize() || inFramesToProcess == GetMaxFramesPerSlice(), ParamErr);
-
+
for (unsigned ibl = 0; ibl < inNumberInputBufferLists; ++ibl) {
if (inInputBufferLists[ibl] != NULL) {
AUInputElement *input = GetInput(ibl); // will throw if non-existant
unsigned expectedBufferByteSize = inFramesToProcess * input->GetStreamFormat().mBytesPerFrame;
-
+
if (input->GetStreamFormat().NumberChannelStreams() != inInputBufferLists[ibl]->mNumberBuffers) {
DebugMessageN5("%s:%d inInputBufferLists[%u]->mNumberBuffers=%u, input->GetStreamFormat().NumberChannelStreams()=%u; kAudio_ParamError",
__FILE__, __LINE__, ibl, (unsigned)inInputBufferLists[ibl]->mNumberBuffers, (unsigned)input->GetStreamFormat().NumberChannelStreams());
goto ParamErr;
}
-
+
for (unsigned ibuf = 0; ibuf < inInputBufferLists[ibl]->mNumberBuffers; ++ibuf) {
const AudioBuffer &buf = inInputBufferLists[ibl]->mBuffers[ibuf];
if (buf.mData != NULL) {
@@ -1673,7 +1673,7 @@ OSStatus AUBase::DoProcessMultiple ( AudioUnitRenderActionFlags & ioActionFlags
// skip NULL input audio buffer list
}
}
-
+
for (unsigned obl = 0; obl < inNumberOutputBufferLists; ++obl) {
if (ioOutputBufferLists[obl] != NULL) {
AUOutputElement *output = GetOutput(obl); // will throw if non-existant
@@ -1684,7 +1684,7 @@ OSStatus AUBase::DoProcessMultiple ( AudioUnitRenderActionFlags & ioActionFlags
__FILE__, __LINE__, obl, (unsigned)ioOutputBufferLists[obl]->mNumberBuffers, (unsigned)output->GetStreamFormat().NumberChannelStreams());
goto ParamErr;
}
-
+
for (unsigned obuf = 0; obuf < ioOutputBufferLists[obl]->mNumberBuffers; ++obuf) {
AudioBuffer &buf = ioOutputBufferLists[obl]->mBuffers[obuf];
if (buf.mData != NULL) {
@@ -1708,7 +1708,7 @@ OSStatus AUBase::DoProcessMultiple ( AudioUnitRenderActionFlags & ioActionFlags
}
}
}
-
+
if (WantsRenderThreadID())
{
#if TARGET_OS_MAC
@@ -1717,7 +1717,7 @@ OSStatus AUBase::DoProcessMultiple ( AudioUnitRenderActionFlags & ioActionFlags
mRenderThreadID = GetCurrentThreadId();
#endif
}
-
+
if (NeedsToRender (inTimeStamp)) {
theError = ProcessMultipleBufferLists (ioActionFlags, inFramesToProcess, inNumberInputBufferLists, inInputBufferLists, inNumberOutputBufferLists, ioOutputBufferLists);
} else
@@ -1731,11 +1731,11 @@ OSStatus AUBase::DoProcessMultiple ( AudioUnitRenderActionFlags & ioActionFlags
theError = -1;
goto errexit;
}
-done:
+done:
RESTORE_DENORMALS
-
+
return theError;
-
+
Uninitialized: theError = kAudioUnitErr_Uninitialized; goto errexit;
ParamErr: theError = kAudio_ParamError; goto errexit;
TooManyFrames: theError = kAudioUnitErr_TooManyFramesToProcess; goto errexit;
@@ -1748,15 +1748,15 @@ errexit:
//_____________________________________________________________________________
//
OSStatus AUBase::SetInputCallback( UInt32 inPropertyID,
- AudioUnitElement inElement,
+ AudioUnitElement inElement,
AURenderCallback inProc,
void * inRefCon)
{
AUInputElement *input = GetInput(inElement); // may throw
-
+
input->SetInputCallback(inProc, inRefCon);
PropertyChanged(inPropertyID, kAudioUnitScope_Input, inElement);
-
+
return noErr;
}
@@ -1767,7 +1767,7 @@ OSStatus AUBase::SetConnection( const AudioUnitConnection & inConnection)
OSStatus err;
AUInputElement *input = GetInput(inConnection.destInputNumber); // may throw
-
+
if (inConnection.sourceAudioUnit) {
// connecting, not disconnecting
CAStreamBasicDescription sourceDesc;
@@ -1779,19 +1779,19 @@ OSStatus AUBase::SetConnection( const AudioUnitConnection & inConnection)
inConnection.sourceOutputNumber,
&sourceDesc,
&size), errexit);
- ca_require_noerr(err = DispatchSetProperty (kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input, inConnection.destInputNumber,
+ ca_require_noerr(err = DispatchSetProperty (kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Input, inConnection.destInputNumber,
&sourceDesc, sizeof(CAStreamBasicDescription)), errexit);
}
input->SetConnection(inConnection);
-
+
PropertyChanged(kAudioUnitProperty_MakeConnection, kAudioUnitScope_Input, inConnection.destInputNumber);
return noErr;
errexit:
return err;
}
-
+
//_____________________________________________________________________________
//
UInt32 AUBase::SupportedNumChannels ( const AUChannelInfo** outInfo)
@@ -1838,7 +1838,7 @@ const CAStreamBasicDescription &
{
//#warning "aliasing of global scope format should be pushed to subclasses"
AUIOElement *element;
-
+
switch (inScope) {
case kAudioUnitScope_Input:
element = Inputs().GetIOElement(inElement);
@@ -1858,9 +1858,9 @@ const CAStreamBasicDescription &
OSStatus AUBase::SetBusCount( AudioUnitScope inScope,
UInt32 inCount)
{
- if (IsInitialized())
+ if (IsInitialized())
return kAudioUnitErr_Initialized;
-
+
GetScope(inScope).SetNumberOfElements(inCount);
return noErr;
}
@@ -1874,7 +1874,7 @@ OSStatus AUBase::ChangeStreamFormat( AudioUnitScope inScope,
{
//#warning "aliasing of global scope format should be pushed to subclasses"
AUIOElement *element;
-
+
switch (inScope) {
case kAudioUnitScope_Input:
element = Inputs().GetIOElement(inElement);
@@ -1921,7 +1921,7 @@ OSStatus AUBase::RemoveAudioChannelLayout( AudioUnitScope inScope,
return result;
}
-OSStatus AUBase::SetAudioChannelLayout( AudioUnitScope inScope,
+OSStatus AUBase::SetAudioChannelLayout( AudioUnitScope inScope,
AudioUnitElement inElement,
const AudioChannelLayout * inLayout)
{
@@ -1946,7 +1946,7 @@ OSStatus AUBase::SetAudioChannelLayout( AudioUnitScope inScope,
}
}
free(tags);
-
+
if (foundTag == false)
return kAudioUnitErr_InvalidPropertyValue;
@@ -1966,7 +1966,7 @@ OSStatus AUBase::SaveState( CFPropertyListRef * outData)
{
AudioComponentDescription desc = GetComponentDescription();
- CFMutableDictionaryRef dict = CFDictionaryCreateMutable (NULL, 0,
+ CFMutableDictionaryRef dict = CFDictionaryCreateMutable (NULL, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
// first step -> save the version to the data ref
@@ -1979,24 +1979,24 @@ OSStatus AUBase::SaveState( CFPropertyListRef * outData)
value = desc.componentSubType;
AddNumToDictionary (dict, kSubtypeString, value);
-
+
value = desc.componentManufacturer;
AddNumToDictionary (dict, kManufacturerString, value);
-
+
// fourth step -> save the state of all parameters on all scopes and elements
CFMutableDataRef data = CFDataCreateMutable(NULL, 0);
for (AudioUnitScope iscope = 0; iscope < 3; ++iscope) {
AUScope &scope = GetScope(iscope);
scope.SaveState (data);
}
-
+
SaveExtendedScopes(data);
// save all this in the data section of the dictionary
CFDictionarySetValue(dict, kDataString, data);
CFRelease (data);
-
-//OK - now we're going to do some properties
+
+//OK - now we're going to do some properties
//save the preset name...
CFDictionarySetValue (dict, kNameString, mCurrentPreset.presetName);
@@ -2006,44 +2006,44 @@ OSStatus AUBase::SaveState( CFPropertyListRef * outData)
kAudioUnitScope_Global,
0,
&value);
-
+
if (result == noErr) {
AddNumToDictionary (dict, kRenderQualityString, value);
}
-
+
// Does the unit support the CPULoad Quality property - if so, save it...
Float32 cpuLoad;
result = DispatchGetProperty (6/*kAudioUnitProperty_CPULoad*/,
kAudioUnitScope_Global,
0,
&cpuLoad);
-
+
if (result == noErr) {
CFNumberRef num = CFNumberCreate (NULL, kCFNumberFloatType, &cpuLoad);
CFDictionarySetValue (dict, kCPULoadString, num);
CFRelease (num);
}
-// Do we have any element names for any of our scopes?
+// Do we have any element names for any of our scopes?
// first check to see if we have any names...
bool foundName = false;
for (AudioUnitScope i = 0; i < kNumScopes; ++i) {
foundName = GetScope (i).HasElementWithName();
- if (foundName)
+ if (foundName)
break;
}
// OK - we found a name away we go...
if (foundName) {
- CFMutableDictionaryRef nameDict = CFDictionaryCreateMutable (NULL, 0,
+ CFMutableDictionaryRef nameDict = CFDictionaryCreateMutable (NULL, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
for (AudioUnitScope i = 0; i < kNumScopes; ++i) {
GetScope (i).AddElementNamesToDict (nameDict);
}
-
+
CFDictionarySetValue (dict, kElementNameString, nameDict);
CFRelease (nameDict);
}
-
+
// we're done!!!
*outData = dict;
@@ -2055,16 +2055,16 @@ OSStatus AUBase::SaveState( CFPropertyListRef * outData)
OSStatus AUBase::RestoreState( CFPropertyListRef plist)
{
if (CFGetTypeID(plist) != CFDictionaryGetTypeID()) return kAudioUnitErr_InvalidPropertyValue;
-
+
AudioComponentDescription desc = GetComponentDescription();
-
+
CFDictionaryRef dict = static_cast<CFDictionaryRef>(plist);
// zeroeth step - make sure the Part key is NOT present, as this method is used
-// to restore the GLOBAL state of the dictionary
+// to restore the GLOBAL state of the dictionary
if (CFDictionaryContainsKey (dict, kPartString))
return kAudioUnitErr_InvalidPropertyValue;
-
+
// first step -> check the saved version in the data ref
// at this point we're only dealing with version==0
CFNumberRef cfnum = reinterpret_cast<CFNumberRef>(CFDictionaryGetValue (dict, kVersionString));
@@ -2087,22 +2087,22 @@ OSStatus AUBase::RestoreState( CFPropertyListRef plist)
CFNumberGetValue (cfnum, kCFNumberSInt32Type, &value);
if (UInt32(value) != desc.componentManufacturer) return kAudioUnitErr_InvalidPropertyValue;
-// fourth step -> restore the state of all of the parameters for each scope and element
+// fourth step -> restore the state of all of the parameters for each scope and element
CFDataRef data = reinterpret_cast<CFDataRef>(CFDictionaryGetValue (dict, kDataString));
- if (data != NULL)
+ if (data != NULL)
{
const UInt8 *p, *pend;
-
+
p = CFDataGetBytePtr(data);
pend = p + CFDataGetLength(data);
-
+
// we have a zero length data, which may just mean there were no parameters to save!
- // if (p >= pend) return noErr;
-
+ // if (p >= pend) return noErr;
+
while (p < pend) {
UInt32 scopeIdx = CFSwapInt32BigToHost(*(UInt32 *)p);
p += sizeof(UInt32);
-
+
AUScope &scope = GetScope(scopeIdx);
p = scope.RestoreState(p);
}
@@ -2116,12 +2116,12 @@ OSStatus AUBase::RestoreState( CFPropertyListRef plist)
{
mCurrentPreset.presetName = name;
mCurrentPreset.presetNumber = -1;
- }
+ }
else { // no name entry make the default one
mCurrentPreset.presetName = kUntitledString;
mCurrentPreset.presetNumber = -1;
}
-
+
CFRetain (mCurrentPreset.presetName);
#if !CA_USE_AUDIO_PLUGIN_ONLY
#ifndef __LP64__
@@ -2130,8 +2130,8 @@ OSStatus AUBase::RestoreState( CFPropertyListRef plist)
#endif
PropertyChanged(kAudioUnitProperty_PresentPreset, kAudioUnitScope_Global, 0);
-// Does the dict contain render quality information?
- if (CFDictionaryGetValueIfPresent (dict, kRenderQualityString, reinterpret_cast<const void**>(&cfnum)))
+// Does the dict contain render quality information?
+ if (CFDictionaryGetValueIfPresent (dict, kRenderQualityString, reinterpret_cast<const void**>(&cfnum)))
{
CFNumberGetValue (cfnum, kCFNumberSInt32Type, &value);
DispatchSetProperty (kAudioUnitProperty_RenderQuality,
@@ -2140,9 +2140,9 @@ OSStatus AUBase::RestoreState( CFPropertyListRef plist)
&value,
sizeof(value));
}
-
+
// Does the unit support the CPULoad Quality property - if so, save it...
- if (CFDictionaryGetValueIfPresent (dict, kCPULoadString, reinterpret_cast<const void**>(&cfnum)))
+ if (CFDictionaryGetValueIfPresent (dict, kCPULoadString, reinterpret_cast<const void**>(&cfnum)))
{
Float32 floatValue;
CFNumberGetValue (cfnum, kCFNumberFloatType, &floatValue);
@@ -2155,24 +2155,24 @@ OSStatus AUBase::RestoreState( CFPropertyListRef plist)
// Do we have any element names for any of our scopes?
CFDictionaryRef nameDict;
- if (CFDictionaryGetValueIfPresent (dict, kElementNameString, reinterpret_cast<const void**>(&nameDict)))
+ if (CFDictionaryGetValueIfPresent (dict, kElementNameString, reinterpret_cast<const void**>(&nameDict)))
{
char string[64];
- for (int i = 0; i < kNumScopes; ++i)
+ for (int i = 0; i < kNumScopes; ++i)
{
snprintf (string, sizeof(string), "%d", i);
CFStringRef key = CFStringCreateWithCString (NULL, string, kCFStringEncodingASCII);
CFDictionaryRef elementDict;
- if (CFDictionaryGetValueIfPresent (nameDict, key, reinterpret_cast<const void**>(&elementDict)))
+ if (CFDictionaryGetValueIfPresent (nameDict, key, reinterpret_cast<const void**>(&elementDict)))
{
bool didAddElements = GetScope (i).RestoreElementNames (elementDict);
if (didAddElements)
PropertyChanged (kAudioUnitProperty_ElementCount, i, 0);
}
- CFRelease (key);
+ CFRelease (key);
}
}
-
+
return noErr;
}
@@ -2206,18 +2206,18 @@ bool AUBase::SetAFactoryPresetAsCurrent (const AUPreset & inPreset)
}
#if !CA_USE_AUDIO_PLUGIN_ONLY
-int AUBase::GetNumCustomUIComponents ()
+int AUBase::GetNumCustomUIComponents ()
{
return 0;
}
void AUBase::GetUIComponentDescs (ComponentDescription* inDescArray) {}
#endif
-
-bool AUBase::HasIcon ()
+
+bool AUBase::HasIcon ()
{
#if !CA_NO_AU_UI_FEATURES
- CFURLRef url = CopyIconLocation();
+ CFURLRef url = CopyIconLocation();
if (url) {
CFRelease (url);
return true;
@@ -2226,11 +2226,11 @@ bool AUBase::HasIcon ()
return false;
}
-CFURLRef AUBase::CopyIconLocation ()
+CFURLRef AUBase::CopyIconLocation ()
{
return NULL;
}
-
+
//_____________________________________________________________________________
//
OSStatus AUBase::GetParameterList( AudioUnitScope inScope,
@@ -2240,7 +2240,7 @@ OSStatus AUBase::GetParameterList( AudioUnitScope inScope,
AUScope &scope = GetScope(inScope);
AUElement *elementWithMostParameters = NULL;
UInt32 maxNumParams = 0;
-
+
int nElems = scope.GetNumberOfElements();
for (int ielem = 0; ielem < nElems; ++ielem) {
AUElement *element = scope.GetElement(ielem);
@@ -2250,10 +2250,10 @@ OSStatus AUBase::GetParameterList( AudioUnitScope inScope,
elementWithMostParameters = element;
}
}
-
+
if (outParameterList != NULL && elementWithMostParameters != NULL)
elementWithMostParameters->GetParameterList(outParameterList);
-
+
outNumParameters = maxNumParams;
return noErr;
}
@@ -2289,8 +2289,8 @@ OSStatus AUBase::GetParameterHistoryInfo( AudioUnitScope inScope,
//_____________________________________________________________________________
//
-OSStatus AUBase::CopyClumpName( AudioUnitScope inScope,
- UInt32 inClumpID,
+OSStatus AUBase::CopyClumpName( AudioUnitScope inScope,
+ UInt32 inClumpID,
UInt32 inDesiredNameLength,
CFStringRef * outClumpName)
{
@@ -2328,7 +2328,7 @@ AUElement * AUBase::CreateElement( AudioUnitScope scope,
#endif
}
COMPONENT_THROW(kAudioUnitErr_InvalidScope);
-
+
return NULL; // get rid of compiler warning
}
@@ -2374,9 +2374,9 @@ const Float64 AUBase::kNoLastRenderedSampleTime = -1.;
char* AUBase::GetLoggingString () const
{
if (mLogString) return mLogString;
-
+
AudioComponentDescription desc = GetComponentDescription();
-
+
const size_t logStringSize = 256;
const_cast<AUBase*>(this)->mLogString = new char[logStringSize];
char str[24];