summaryrefslogtreecommitdiff
path: root/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase
diff options
context:
space:
mode:
Diffstat (limited to 'libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase')
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp404
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h260
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp66
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.h12
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.cpp24
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.h16
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.cpp14
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.h12
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp72
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.h12
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.cpp108
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.h134
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp56
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h68
14 files changed, 629 insertions, 629 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];
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h
index 0c78221cc8..8cc600fc64 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h
@@ -2,14 +2,14 @@
File: AUBase.h
Abstract: Part of CoreAudio Utility Classes
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.
-
+
*/
#ifndef __AUBase_h__
#define __AUBase_h__
@@ -81,7 +81,7 @@
#ifndef AUTRACE
#define AUTRACE(code, obj, a, b, c, d)
-#endif
+#endif
#include "AUPlugInDispatch.h"
@@ -92,11 +92,11 @@
#define kAUDefaultSampleRate 44100.0
#if !TARGET_OS_WIN32
-#define kAUDefaultMaxFramesPerSlice 1156
+#define kAUDefaultMaxFramesPerSlice 1156
//this allows enough default frames for a 512 dest 44K and SRC from 96K
// add a padding of 4 frames for any altivec rounding
#else
-#define kAUDefaultMaxFramesPerSlice 2048
+#define kAUDefaultMaxFramesPerSlice 2048
#endif
// ________________________________________________________________________
@@ -106,16 +106,16 @@ class AUBase : public ComponentBase {
public:
/*! @ctor AUBase */
- AUBase( AudioComponentInstance inInstance,
+ AUBase( AudioComponentInstance inInstance,
UInt32 numInputElements,
UInt32 numOutputElements,
UInt32 numGroupElements = 0);
/*! @dtor AUBase */
virtual ~AUBase();
-
+
/*! @method PostConstructor */
virtual void PostConstructor() { CreateElements(); }
-
+
/*! @method PreDestructor */
virtual void PreDestructor();
@@ -133,7 +133,7 @@ public:
// ________________________________________________________________________
// Virtual methods (mostly) directly corresponding to the entry points. Many of these
// have useful implementations here and will not need overriding.
-
+
/*! @method DoInitialize */
OSStatus DoInitialize();
// this implements the entry point and makes sure that initialization
@@ -143,16 +143,16 @@ public:
virtual OSStatus Initialize();
// ... so that overrides to this method can assume that they will only
// be called exactly once.
-
+
/*! @method IsInitialized */
bool IsInitialized() const { return mInitialized; }
/*! @method HasBegunInitializing */
bool HasBegunInitializing() const { return mHasBegunInitializing; }
-
+
/*! @method DoCleanup */
void DoCleanup();
// same pattern as with Initialize
-
+
/*! @method Cleanup */
virtual void Cleanup();
@@ -161,7 +161,7 @@ public:
AudioUnitElement inElement);
// Note about GetPropertyInfo, GetProperty, SetProperty:
- // Certain properties are trapped out in these dispatch functions and handled with different virtual
+ // Certain properties are trapped out in these dispatch functions and handled with different virtual
// methods. (To discourage hacks and keep vtable size down, these are non-virtual)
/*! @method DispatchGetPropertyInfo */
@@ -183,7 +183,7 @@ public:
AudioUnitElement inElement,
const void * inData,
UInt32 inDataSize);
-
+
OSStatus DispatchRemovePropertyValue( AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement);
@@ -207,7 +207,7 @@ public:
AudioUnitElement inElement,
const void * inData,
UInt32 inDataSize);
-
+
/*! @method ClearPropertyUsage */
virtual OSStatus RemovePropertyValue ( AudioUnitPropertyID inID,
AudioUnitScope inScope,
@@ -217,28 +217,28 @@ public:
virtual OSStatus AddPropertyListener( AudioUnitPropertyID inID,
AudioUnitPropertyListenerProc inProc,
void * inProcRefCon);
-
+
/*! @method RemovePropertyListener */
virtual OSStatus RemovePropertyListener( AudioUnitPropertyID inID,
AudioUnitPropertyListenerProc inProc,
void * inProcRefCon,
bool refConSpecified);
-
+
/*! @method SetRenderNotification */
virtual OSStatus SetRenderNotification( AURenderCallback inProc,
void * inRefCon);
-
+
/*! @method RemoveRenderNotification */
virtual OSStatus RemoveRenderNotification(
AURenderCallback inProc,
void * inRefCon);
-
+
/*! @method GetParameter */
virtual OSStatus GetParameter( AudioUnitParameterID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
AudioUnitParameterValue & outValue);
-
+
/*! @method SetParameter */
virtual OSStatus SetParameter( AudioUnitParameterID inID,
AudioUnitScope inScope,
@@ -252,7 +252,7 @@ public:
/*! @method ScheduleParameter */
virtual OSStatus ScheduleParameter ( const AudioUnitParameterEvent *inParameterEvent,
UInt32 inNumEvents);
-
+
/*! @method DoRender */
OSStatus DoRender( AudioUnitRenderActionFlags & ioActionFlags,
@@ -260,14 +260,14 @@ public:
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList & ioData);
-
+
/*! @method Process */
OSStatus DoProcess ( AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
UInt32 inFramesToProcess,
AudioBufferList & ioData);
-
+
/*! @method ProcessMultiple */
OSStatus DoProcessMultiple ( AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
@@ -276,7 +276,7 @@ public:
const AudioBufferList ** inInputBufferLists,
UInt32 inNumberOutputBufferLists,
AudioBufferList ** ioOutputBufferLists);
-
+
/*! @method ProcessBufferLists */
virtual OSStatus ProcessBufferLists( AudioUnitRenderActionFlags & ioActionFlags,
const AudioBufferList & inBuffer,
@@ -288,26 +288,26 @@ public:
/*! @method ProcessMultipleBufferLists */
virtual OSStatus ProcessMultipleBufferLists( AudioUnitRenderActionFlags & ioActionFlags,
- UInt32 inFramesToProcess,
+ UInt32 inFramesToProcess,
UInt32 inNumberInputBufferLists,
const AudioBufferList ** inInputBufferLists,
UInt32 inNumberOutputBufferLists,
- AudioBufferList ** ioOutputBufferLists)
+ AudioBufferList ** ioOutputBufferLists)
{
return kAudio_UnimplementedError;
}
-
+
/*! @method ComplexRender */
- virtual OSStatus ComplexRender( AudioUnitRenderActionFlags & ioActionFlags,
- const AudioTimeStamp & inTimeStamp,
- UInt32 inOutputBusNumber,
- UInt32 inNumberOfPackets,
- UInt32 * outNumberOfPackets,
- AudioStreamPacketDescription * outPacketDescriptions,
- AudioBufferList & ioData,
- void * outMetadata,
- UInt32 * outMetadataByteSize)
- {
+ virtual OSStatus ComplexRender( AudioUnitRenderActionFlags & ioActionFlags,
+ const AudioTimeStamp & inTimeStamp,
+ UInt32 inOutputBusNumber,
+ UInt32 inNumberOfPackets,
+ UInt32 * outNumberOfPackets,
+ AudioStreamPacketDescription * outPacketDescriptions,
+ AudioBufferList & ioData,
+ void * outMetadata,
+ UInt32 * outMetadataByteSize)
+ {
return kAudio_UnimplementedError;
}
@@ -316,7 +316,7 @@ public:
// Otherwise, override Render().
//
// N.B. Implementations of this method can assume that the output's buffer list has already been
- // prepared and access it with GetOutput(inBusNumber)->GetBufferList() instead of
+ // prepared and access it with GetOutput(inBusNumber)->GetBufferList() instead of
// GetOutput(inBusNumber)->PrepareBuffer(nFrames) -- if PrepareBuffer is called, a
// copy may occur after rendering.
/*! @method RenderBus */
@@ -331,7 +331,7 @@ public:
}
// N.B. For a unit with only one output bus, it can assume in its implementation of this
- // method that the output's buffer list has already been prepared and access it with
+ // method that the output's buffer list has already been prepared and access it with
// GetOutput(0)->GetBufferList() instead of GetOutput(0)->PrepareBuffer(nFrames)
// -- if PrepareBuffer is called, a copy may occur after rendering.
/*! @method Render */
@@ -342,7 +342,7 @@ public:
return noErr;
}
-
+
#pragma mark -
#pragma mark Property Dispatch
@@ -361,10 +361,10 @@ public:
/*! @method SetConnection */
virtual OSStatus SetConnection( const AudioUnitConnection & inConnection);
-
+
/*! @method SetInputCallback */
virtual OSStatus SetInputCallback( UInt32 inPropertyID,
- AudioUnitElement inElement,
+ AudioUnitElement inElement,
AURenderCallback inProc,
void * inRefCon);
@@ -386,7 +386,7 @@ public:
/*! @method SaveState */
virtual OSStatus SaveState( CFPropertyListRef * outData);
-
+
/*! @method SaveExtendedScopes */
virtual void SaveExtendedScopes( CFMutableDataRef outData) {};
@@ -399,8 +399,8 @@ public:
CFArrayRef * outStrings);
/*! @method CopyClumpName */
- virtual OSStatus CopyClumpName( AudioUnitScope inScope,
- UInt32 inClumpID,
+ virtual OSStatus CopyClumpName( AudioUnitScope inScope,
+ UInt32 inClumpID,
UInt32 inDesiredNameLength,
CFStringRef * outClumpName);
@@ -411,14 +411,14 @@ public:
// and the name should be valid, or the preset WON'T take
/*! @method SetAFactoryPresetAsCurrent */
bool SetAFactoryPresetAsCurrent (const AUPreset & inPreset);
-
+
// Called when someone sets a new, valid preset
// If this is a valid preset, then the subclass sets its state to that preset
// and returns noErr.
// If not a valid preset, return an error, and the pre-existing preset is restored
/*! @method NewFactoryPresetSet */
virtual OSStatus NewFactoryPresetSet (const AUPreset & inNewFactoryPreset);
-
+
/*! @method NewCustomPresetSet */
virtual OSStatus NewCustomPresetSet (const AUPreset & inNewCustomPreset);
@@ -429,10 +429,10 @@ public:
/*! @method GetUIComponentDescs */
virtual void GetUIComponentDescs (ComponentDescription* inDescArray);
#endif
-
+
/*! @method CopyIconLocation */
virtual CFURLRef CopyIconLocation ();
-
+
// default is no latency, and unimplemented tail time
/*! @method GetLatency */
virtual Float64 GetLatency() {return 0.0;}
@@ -444,18 +444,18 @@ public:
/*! @method IsStreamFormatWritable */
bool IsStreamFormatWritable( AudioUnitScope scope,
AudioUnitElement element);
-
+
/*! @method StreamFormatWritable */
virtual bool StreamFormatWritable( AudioUnitScope scope,
AudioUnitElement element) = 0;
// scope will always be input or output
-
+
// pass in a pointer to get the struct, and num channel infos
// you can pass in NULL to just get the number
// a return value of 0 (the default in AUBase) means the property is not supported...
/*! @method SupportedNumChannels */
virtual UInt32 SupportedNumChannels ( const AUChannelInfo** outInfo);
-
+
/*! @method ValidFormat */
virtual bool ValidFormat( AudioUnitScope inScope,
AudioUnitElement inElement,
@@ -466,7 +466,7 @@ public:
// native-endian 32-bit float, any sample rate,
// any number of channels; override when other
// formats are supported. A subclass's override can
- // choose to always return true and trap invalid
+ // choose to always return true and trap invalid
// formats in ChangeStreamFormat.
@@ -489,7 +489,7 @@ public:
const CAStreamBasicDescription & inNewFormat);
// Will only be called after StreamFormatWritable
// and ValidFormat have succeeded.
-
+
// ________________________________________________________________________
#if !CA_USE_AUDIO_PLUGIN_ONLY
@@ -500,7 +500,7 @@ public:
// ________________________________________________________________________
// Methods useful for subclasses
-
+
/*! @method GetScope */
AUScope & GetScope( AudioUnitScope inScope)
{
@@ -511,10 +511,10 @@ public:
}
return mScopes[inScope];
}
-
+
/*! @method GetScopeExtended */
virtual AUScope * GetScopeExtended (AudioUnitScope inScope) { return NULL; }
-
+
/*! @method GlobalScope */
AUScope & GlobalScope() { return mScopes[kAudioUnitScope_Global]; }
/*! @method Inputs */
@@ -527,7 +527,7 @@ public:
#endif
/*! @method Globals */
AUElement * Globals() { return mScopes[kAudioUnitScope_Global].GetElement(0); }
-
+
/*! @method SetNumberOfElements */
void SetNumberOfElements( AudioUnitScope inScope,
UInt32 numElements);
@@ -538,14 +538,14 @@ public:
{
return GetScope(inScope).GetElement(inElement);
}
-
+
/*! @method GetIOElement */
AUIOElement * GetIOElement( AudioUnitScope inScope,
AudioUnitElement inElement)
{
return GetScope(inScope).GetIOElement(inElement);
}
-
+
/*! @method SafeGetElement */
AUElement * SafeGetElement( AudioUnitScope inScope,
AudioUnitElement inElement)
@@ -558,13 +558,13 @@ public:
{
return static_cast<AUInputElement *>(Inputs().SafeGetElement(inElement));
}
-
+
/*! @method GetOutput */
AUOutputElement * GetOutput( AudioUnitElement inElement)
{
return static_cast<AUOutputElement *>(Outputs().SafeGetElement(inElement));
}
-
+
#if !CA_BASIC_AU_FEATURES
/*! @method GetGroup */
AUElement * GetGroup( AudioUnitElement inElement)
@@ -572,7 +572,7 @@ public:
return Groups().SafeGetElement(inElement);
}
#endif
-
+
/*! @method PullInput */
OSStatus PullInput( UInt32 inBusNumber,
AudioUnitRenderActionFlags &ioActionFlags,
@@ -589,7 +589,7 @@ public:
bool UsesFixedBlockSize() const { return mUsesFixedBlockSize; }
/*! @method SetUsesFixedBlockSize */
void SetUsesFixedBlockSize(bool inUsesFixedBlockSize) { mUsesFixedBlockSize = inUsesFixedBlockSize; }
-
+
/*! @method GetVectorUnitType */
static SInt32 GetVectorUnitType() { return sVectorUnitType; }
/*! @method HasVectorUnit */
@@ -600,12 +600,12 @@ public:
static bool HasSSE2() { return sVectorUnitType >= kVecSSE2; }
/*! @method HasSSE3 */
static bool HasSSE3() { return sVectorUnitType >= kVecSSE3; }
-
+
/*! @method AudioUnitAPIVersion */
UInt8 AudioUnitAPIVersion() const { return mAudioUnitAPIVersion; }
-
+
/*! @method IsRenderThread */
- bool InRenderThread () const
+ bool InRenderThread () const
{
#if TARGET_OS_MAC
return (mRenderThreadID ? pthread_equal (mRenderThreadID, pthread_self()) : false);
@@ -623,7 +623,7 @@ public:
/*! @method PropertyChanged */
virtual void PropertyChanged( AudioUnitPropertyID inID,
- AudioUnitScope inScope,
+ AudioUnitScope inScope,
AudioUnitElement inElement);
#if !CA_NO_AU_UI_FEATURES
@@ -634,12 +634,12 @@ public:
// as this can save work in the host.
/*! @method CallHostBeatAndTempo */
- OSStatus CallHostBeatAndTempo (Float64 *outCurrentBeat,
+ OSStatus CallHostBeatAndTempo (Float64 *outCurrentBeat,
Float64 *outCurrentTempo)
{
- return (mHostCallbackInfo.beatAndTempoProc
- ? (*mHostCallbackInfo.beatAndTempoProc) (mHostCallbackInfo.hostUserData,
- outCurrentBeat,
+ return (mHostCallbackInfo.beatAndTempoProc
+ ? (*mHostCallbackInfo.beatAndTempoProc) (mHostCallbackInfo.hostUserData,
+ outCurrentBeat,
outCurrentTempo)
: -1);
}
@@ -650,14 +650,14 @@ public:
UInt32 *outTimeSig_Denominator,
Float64 *outCurrentMeasureDownBeat)
{
- return (mHostCallbackInfo.musicalTimeLocationProc
+ return (mHostCallbackInfo.musicalTimeLocationProc
? (*mHostCallbackInfo.musicalTimeLocationProc) (mHostCallbackInfo.hostUserData,
outDeltaSampleOffsetToNextBeat,
outTimeSig_Numerator,
outTimeSig_Denominator,
outCurrentMeasureDownBeat)
: -1);
- }
+ }
/*! @method CallHostTransportState */
OSStatus CallHostTransportState (Boolean *outIsPlaying,
@@ -667,7 +667,7 @@ public:
Float64 *outCycleStartBeat,
Float64 *outCycleEndBeat)
{
- return (mHostCallbackInfo.transportStateProc
+ return (mHostCallbackInfo.transportStateProc
? (*mHostCallbackInfo.transportStateProc) (mHostCallbackInfo.hostUserData,
outIsPlaying,
outTransportStateChanged,
@@ -680,7 +680,7 @@ public:
#endif
char* GetLoggingString () const;
-
+
CAMutex* GetMutex() { return mAUMutex; }
// ________________________________________________________________________
@@ -698,7 +698,7 @@ public:
virtual OSStatus Start() { return kAudio_UnimplementedError; }
/*! @method Stop */
virtual OSStatus Stop() { return kAudio_UnimplementedError; }
-
+
#if !CA_BASIC_AU_FEATURES
#pragma mark -
#pragma mark AU Music Base Dispatch
@@ -711,38 +711,38 @@ public:
/*! @method PrepareInstrument */
virtual OSStatus ReleaseInstrument(MusicDeviceInstrumentID inInstrument) { return kAudio_UnimplementedError; }
#endif
-
+
// ________________________________________________________________________
// ________________________________________________________________________
// ________________________________________________________________________
// music device/music effect methods -- incomplete
/*! @method MIDIEvent */
- virtual OSStatus MIDIEvent( UInt32 inStatus,
- UInt32 inData1,
- UInt32 inData2,
+ virtual OSStatus MIDIEvent( UInt32 inStatus,
+ UInt32 inData1,
+ UInt32 inData2,
UInt32 inOffsetSampleFrame) { return kAudio_UnimplementedError; }
/*! @method SysEx */
- virtual OSStatus SysEx( const UInt8 * inData,
+ virtual OSStatus SysEx( const UInt8 * inData,
UInt32 inLength) { return kAudio_UnimplementedError;}
-
+
/*! @method StartNote */
- virtual OSStatus StartNote( MusicDeviceInstrumentID inInstrument,
- MusicDeviceGroupID inGroupID,
- NoteInstanceID * outNoteInstanceID,
- UInt32 inOffsetSampleFrame,
+ virtual OSStatus StartNote( MusicDeviceInstrumentID inInstrument,
+ MusicDeviceGroupID inGroupID,
+ NoteInstanceID * outNoteInstanceID,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams) { return kAudio_UnimplementedError; }
/*! @method StopNote */
- virtual OSStatus StopNote( MusicDeviceGroupID inGroupID,
- NoteInstanceID inNoteInstanceID,
+ virtual OSStatus StopNote( MusicDeviceGroupID inGroupID,
+ NoteInstanceID inNoteInstanceID,
UInt32 inOffsetSampleFrame) { return kAudio_UnimplementedError; }
#endif
// ________________________________________________________________________
// ________________________________________________________________________
// ________________________________________________________________________
-
+
protected:
#pragma mark -
#pragma mark Implementation methods
@@ -751,7 +751,7 @@ protected:
virtual void ReallocateBuffers();
// needs to be called when mMaxFramesPerSlice changes
virtual void DeallocateIOBuffers();
-
+
/*! @method FillInParameterName */
static void FillInParameterName (AudioUnitParameterInfo& ioInfo, CFStringRef inName, bool inShouldRelease)
{
@@ -761,25 +761,25 @@ protected:
ioInfo.flags |= kAudioUnitParameterFlag_CFNameRelease;
CFStringGetCString (inName, ioInfo.name, offsetof (AudioUnitParameterInfo, clumpID), kCFStringEncodingUTF8);
}
-
- static void HasClump (AudioUnitParameterInfo& ioInfo, UInt32 inClumpID)
+
+ static void HasClump (AudioUnitParameterInfo& ioInfo, UInt32 inClumpID)
{
ioInfo.clumpID = inClumpID;
ioInfo.flags |= kAudioUnitParameterFlag_HasClump;
}
-
+
/*! @method SetMaxFramesPerSlice */
virtual void SetMaxFramesPerSlice(UInt32 nFrames);
/*! @method CanSetMaxFrames */
virtual OSStatus CanSetMaxFrames() const;
-
+
/*! @method WantsRenderThreadID */
bool WantsRenderThreadID () const { return mWantsRenderThreadID; }
-
+
/*! @method SetWantsRenderThreadID */
void SetWantsRenderThreadID (bool inFlag);
-
+
/*! @method SetRenderError */
OSStatus SetRenderError (OSStatus inErr)
{
@@ -789,7 +789,7 @@ protected:
}
return inErr;
}
-
+
private:
/*! @method DoRenderBus */
// shared between Render and RenderSlice, inlined to minimize function call overhead
@@ -829,13 +829,13 @@ private:
memset (&mCurrentRenderTime, 0, sizeof(mCurrentRenderTime));
mCurrentRenderTime.mSampleTime = kNoLastRenderedSampleTime;
}
-
+
protected:
/*! @method GetAudioChannelLayout */
virtual UInt32 GetChannelLayoutTags( AudioUnitScope scope,
AudioUnitElement element,
AudioChannelLayoutTag * outLayoutTags);
-
+
/*! @method GetAudioChannelLayout */
virtual UInt32 GetAudioChannelLayout( AudioUnitScope scope,
AudioUnitElement element,
@@ -843,13 +843,13 @@ protected:
Boolean & outWritable);
/*! @method SetAudioChannelLayout */
- virtual OSStatus SetAudioChannelLayout( AudioUnitScope scope,
+ virtual OSStatus SetAudioChannelLayout( AudioUnitScope scope,
AudioUnitElement element,
const AudioChannelLayout * inLayout);
/*! @method RemoveAudioChannelLayout */
virtual OSStatus RemoveAudioChannelLayout(AudioUnitScope scope, AudioUnitElement element);
-
+
/*! @method NeedsToRender */
bool NeedsToRender( const AudioTimeStamp & inTimeStamp)
{
@@ -858,7 +858,7 @@ protected:
mCurrentRenderTime = inTimeStamp;
return needsToRender;
}
-
+
// Scheduled parameter implementation:
typedef std::vector<AudioUnitParameterEvent> ParameterEventList;
@@ -869,14 +869,14 @@ protected:
// for which the DSP code depends. ProcessForScheduledParams() will call (potentially repeatedly)
// virtual method ProcessScheduledSlice() to perform the actual DSP for a given sub-division of
// the buffer. The job of ProcessForScheduledParams() is to sub-divide the buffer into smaller
- // pieces according to the scheduled times found in the ParameterEventList (usually coming
+ // pieces according to the scheduled times found in the ParameterEventList (usually coming
// directly from a previous call to ScheduleParameter() ), setting the appropriate immediate or
// ramped parameter values for the corresponding scopes and elements, then calling ProcessScheduledSlice()
// to do the actual DSP for each of these divisions.
virtual OSStatus ProcessForScheduledParams( ParameterEventList &inParamList,
UInt32 inFramesToProcess,
void *inUserData );
-
+
// This method is called (potentially repeatedly) by ProcessForScheduledParams()
// in order to perform the actual DSP required for this portion of the entire buffer
// being processed. The entire buffer can be divided up into smaller "slices"
@@ -889,11 +889,11 @@ protected:
UInt32 inStartFrameInBuffer,
UInt32 inSliceFramesToProcess,
UInt32 inTotalBufferFrames ) {return noErr;}; // default impl does nothing...
-
-
+
+
/*! @method CurrentRenderTime */
const AudioTimeStamp & CurrentRenderTime () const { return mCurrentRenderTime; }
-
+
// ________________________________________________________________________
// Private data members to discourage hacking in subclasses
private:
@@ -902,23 +902,23 @@ private:
mRenderNotify(proc),
mRenderNotifyRefCon(ref)
{ }
-
+
AURenderCallback mRenderNotify;
void * mRenderNotifyRefCon;
-
+
bool operator == (const RenderCallback &other) {
return this->mRenderNotify == other.mRenderNotify &&
this->mRenderNotifyRefCon == other.mRenderNotifyRefCon;
}
};
typedef TThreadSafeList<RenderCallback> RenderCallbackList;
-
+
#if !CA_BASIC_AU_FEATURES
enum { kNumScopes = 4 };
#else
enum { kNumScopes = 3 };
#endif
-
+
/*! @var mElementsCreated */
bool mElementsCreated;
protected:
@@ -929,7 +929,7 @@ protected:
private:
/*! @var mAudioUnitAPIVersion */
UInt8 mAudioUnitAPIVersion;
-
+
/*! @var mInitNumInputEls */
const UInt32 mInitNumInputEls;
/*! @var mInitNumOutputEls */
@@ -940,36 +940,36 @@ private:
#endif
/*! @var mScopes */
AUScope mScopes[kNumScopes];
-
+
/*! @var mRenderCallbacks */
RenderCallbackList mRenderCallbacks;
bool mRenderCallbacksTouched;
-
+
/*! @var mRenderThreadID */
#if TARGET_OS_MAC
pthread_t mRenderThreadID;
#elif TARGET_OS_WIN32
UInt32 mRenderThreadID;
#endif
-
+
/*! @var mWantsRenderThreadID */
bool mWantsRenderThreadID;
-
+
/*! @var mCurrentRenderTime */
AudioTimeStamp mCurrentRenderTime;
-
+
/*! @var mMaxFramesPerSlice */
UInt32 mMaxFramesPerSlice;
-
+
/*! @var mLastRenderError */
OSStatus mLastRenderError;
/*! @var mCurrentPreset */
AUPreset mCurrentPreset;
-
+
protected:
/*! @var mUsesFixedBlockSize */
bool mUsesFixedBlockSize;
-
+
struct PropertyListener {
AudioUnitPropertyID propertyID;
AudioUnitPropertyListenerProc listenerProc;
@@ -981,10 +981,10 @@ protected:
ParameterEventList mParamList;
/*! @var mPropertyListeners */
PropertyListeners mPropertyListeners;
-
+
/*! @var mBuffersAllocated */
bool mBuffersAllocated;
-
+
/*! @var mLogString */
// if this is NOT null, it will contain identifying info about this AU.
char* mLogString;
@@ -1012,7 +1012,7 @@ protected:
#endif
};
-inline OSStatus AUInputElement::PullInputWithBufferList(
+inline OSStatus AUInputElement::PullInputWithBufferList(
AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
AudioUnitElement inElement,
@@ -1020,7 +1020,7 @@ inline OSStatus AUInputElement::PullInputWithBufferList(
AudioBufferList * inBufferList)
{
OSStatus theResult;
-
+
if (HasConnection()) {
// only support connections for V2 audio units
#if !CA_USE_AUDIO_PLUGIN_ONLY
@@ -1036,7 +1036,7 @@ inline OSStatus AUInputElement::PullInputWithBufferList(
theResult = (mInputProc)(
mInputProcRefCon, &ioActionFlags, &inTimeStamp, inElement, nFrames, inBufferList);
}
-
+
if (mInputType == kNoInput) // defense: the guy upstream could have disconnected
// it's a horrible thing to do, but may happen!
return kAudioUnitErr_NoConnection;
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;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.h
index 5acd96250a..fcdc29e76e 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.h
@@ -2,14 +2,14 @@
File: AUDispatch.h
Abstract: Part of CoreAudio Utility Classes
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.
-
+
*/
#ifndef __AUDispatch_h__
#define __AUDispatch_h__
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.cpp
index 2e148e8ba7..688e404bfe 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.cpp
@@ -2,14 +2,14 @@
File: AUInputElement.cpp
Abstract: AUInputElement.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"
@@ -76,8 +76,8 @@ void AUInputElement::SetConnection(const AudioUnitConnection &conn)
if (conn.sourceAudioUnit == 0) {
Disconnect();
return;
- }
-
+ }
+
mInputType = kFromConnection;
mConnection = conn;
AllocateBuffer();
@@ -136,16 +136,16 @@ OSStatus AUInputElement::PullInput( AudioUnitRenderActionFlags & ioActionFlag
const AudioTimeStamp & inTimeStamp,
AudioUnitElement inElement,
UInt32 nFrames)
-{
+{
if (!IsActive())
return kAudioUnitErr_NoConnection;
-
+
AudioBufferList *pullBuffer;
-
+
if (HasConnection() || !WillAllocateBuffer())
pullBuffer = &mIOBuffer.PrepareNullBuffer(mStreamFormat, nFrames);
else
pullBuffer = &mIOBuffer.PrepareBuffer(mStreamFormat, nFrames);
-
+
return PullInputWithBufferList (ioActionFlags, inTimeStamp, inElement, nFrames, pullBuffer);
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.h
index 891e4c60b7..128efe5b16 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.h
@@ -2,14 +2,14 @@
File: AUInputElement.h
Abstract: Part of CoreAudio Utility Classes
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.
-
+
*/
#ifndef __AUInput_h__
#define __AUInput_h__
@@ -53,7 +53,7 @@
/*! @class AUInputElement */
class AUInputElement : public AUIOElement {
public:
-
+
/*! @ctor AUInputElement */
AUInputElement(AUBase *audioUnit);
/*! @dtor ~AUInputElement */
@@ -103,7 +103,7 @@ protected:
AURenderCallback mInputProc;
/*! @var mInputProcRefCon */
void * mInputProcRefCon;
-
+
// if from connection:
/*! @var mConnection */
AudioUnitConnection mConnection;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.cpp
index 5eb34a1c20..080fa63e56 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.cpp
@@ -2,14 +2,14 @@
File: AUOutputElement.cpp
Abstract: AUOutputElement.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,14 +40,14 @@
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 "AUOutputElement.h"
#include "AUBase.h"
-AUOutputElement::AUOutputElement(AUBase *audioUnit) :
+AUOutputElement::AUOutputElement(AUBase *audioUnit) :
AUIOElement(audioUnit)
{
AllocateBuffer();
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.h
index 3e6a938fff..42ae842dcf 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.h
@@ -2,14 +2,14 @@
File: AUOutputElement.h
Abstract: Part of CoreAudio Utility Classes
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.
-
+
*/
#ifndef __AUOutput_h__
#define __AUOutput_h__
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp
index 3bab198369..c75d208718 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp
@@ -2,14 +2,14 @@
File: AUPlugInDispatch.cpp
Abstract: AUPlugInDispatch.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 "AUPlugInDispatch.h"
#include "CAXException.h"
@@ -83,7 +83,7 @@ static OSStatus AUMethodGetPropertyInfo(void *self, AudioUnitPropertyID prop, Au
try {
UInt32 dataSize = 0; // 13517289 GetPropetyInfo was returning an uninitialized value when there is an error. This is a problem for auval.
Boolean writable = false;
-
+
AUI_LOCK
result = AUI->DispatchGetPropertyInfo(prop, scope, elem, dataSize, writable);
if (outDataSize != NULL)
@@ -103,7 +103,7 @@ static OSStatus AUMethodGetProperty(void *self, AudioUnitPropertyID inID, AudioU
Boolean writable;
char *tempBuffer;
void *destBuffer;
-
+
AUI_LOCK
if (ioDataSize == NULL) {
ca_debug_string("AudioUnitGetProperty: null size pointer");
@@ -112,12 +112,12 @@ static OSStatus AUMethodGetProperty(void *self, AudioUnitPropertyID inID, AudioU
}
if (outData == NULL) {
UInt32 dataSize;
-
+
result = AUI->DispatchGetPropertyInfo(inID, inScope, inElement, dataSize, writable);
*ioDataSize = dataSize;
goto finishGetProperty;
}
-
+
clientBufferSize = *ioDataSize;
if (clientBufferSize == 0)
{
@@ -126,12 +126,12 @@ static OSStatus AUMethodGetProperty(void *self, AudioUnitPropertyID inID, AudioU
result = kAudio_ParamError;
goto finishGetProperty;
}
-
+
result = AUI->DispatchGetPropertyInfo(inID, inScope, inElement, actualPropertySize, writable);
- if (result != noErr)
+ if (result != noErr)
goto finishGetProperty;
-
- if (clientBufferSize < actualPropertySize)
+
+ if (clientBufferSize < actualPropertySize)
{
tempBuffer = new char[actualPropertySize];
destBuffer = tempBuffer;
@@ -139,9 +139,9 @@ static OSStatus AUMethodGetProperty(void *self, AudioUnitPropertyID inID, AudioU
tempBuffer = NULL;
destBuffer = outData;
}
-
+
result = AUI->DispatchGetProperty(inID, inScope, inElement, destBuffer);
-
+
if (result == noErr) {
if (clientBufferSize < actualPropertySize && tempBuffer != NULL)
{
@@ -285,7 +285,7 @@ static OSStatus AUMethodRender(void *self, AudioUnitRenderActionFlags *ioActionF
#endif
// this is a processing method; no lock
AudioUnitRenderActionFlags tempFlags;
-
+
if (inTimeStamp == NULL || ioData == NULL)
result = kAudio_ParamError;
else {
@@ -313,7 +313,7 @@ static OSStatus AUMethodComplexRender(void *self, AudioUnitRenderActionFlags *io
#endif
// this is a processing method; no lock
AudioUnitRenderActionFlags tempFlags;
-
+
if (inTimeStamp == NULL || ioData == NULL)
result = kAudio_ParamError;
else {
@@ -362,7 +362,7 @@ static OSStatus AUMethodProcess (void *self, AudioUnitRenderActionFlags *ioActio
if (*ioActionFlags & (1 << 9)/*kAudioUnitRenderAction_DoNotCheckRenderArgs*/)
doParamCheck = false;
}
-
+
if (doParamCheck && (inTimeStamp == NULL || ioData == NULL))
result = kAudio_ParamError;
else {
@@ -380,15 +380,15 @@ static OSStatus AUMethodProcess (void *self, AudioUnitRenderActionFlags *ioActio
static OSStatus AUMethodProcessMultiple (void *self, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inNumberFrames, UInt32 inNumberInputBufferLists, const AudioBufferList **inInputBufferLists, UInt32 inNumberOutputBufferLists, AudioBufferList **ioOutputBufferLists)
{
OSStatus result = noErr;
-
+
#if !TARGET_OS_IPHONE
try {
#endif
// this is a processing method; no lock
bool doParamCheck = true;
-
+
AudioUnitRenderActionFlags tempFlags;
-
+
if (ioActionFlags == NULL) {
tempFlags = 0;
ioActionFlags = &tempFlags;
@@ -402,7 +402,7 @@ static OSStatus AUMethodProcessMultiple (void *self, AudioUnitRenderActionFlags
else {
result = AUI->DoProcessMultiple(*ioActionFlags, *inTimeStamp, inNumberFrames, inNumberInputBufferLists, inInputBufferLists, inNumberOutputBufferLists, ioOutputBufferLists);
}
-
+
#if !TARGET_OS_IPHONE
}
COMPONENT_CATCH
@@ -465,7 +465,7 @@ static OSStatus AUMethodStartNote(void *self, MusicDeviceInstrumentID inInstrume
OSStatus result = noErr;
try {
// this is a potential render-time method; no lock
- if (inParams == NULL || outNoteInstanceID == NULL)
+ if (inParams == NULL || outNoteInstanceID == NULL)
result = kAudio_ParamError;
else
result = AUI->StartNote(inInstrument, inGroupID, outNoteInstanceID, inOffsetSampleFrame, *inParams);
@@ -559,10 +559,10 @@ AudioComponentMethod AUComplexOutputLookup::Lookup (SInt16 selector)
{
AudioComponentMethod method = AUBaseLookup::Lookup(selector);
if (method) return method;
-
+
method = AUOutputLookup::Lookup(selector);
if (method) return method;
-
+
if (selector == kAudioUnitComplexRenderSelect)
return (AudioComponentMethod)AUMethodComplexRender;
return NULL;
@@ -572,10 +572,10 @@ AudioComponentMethod AUBaseProcessLookup::Lookup (SInt16 selector)
{
AudioComponentMethod method = AUBaseLookup::Lookup(selector);
if (method) return method;
-
+
if (selector == kAudioUnitProcessSelect)
return (AudioComponentMethod)AUMethodProcess;
-
+
return NULL;
}
@@ -583,10 +583,10 @@ AudioComponentMethod AUBaseProcessMultipleLookup::Lookup (SInt16 selector)
{
AudioComponentMethod method = AUBaseLookup::Lookup(selector);
if (method) return method;
-
+
if (selector == kAudioUnitProcessMultipleSelect)
return (AudioComponentMethod)AUMethodProcessMultiple;
-
+
return NULL;
}
@@ -597,7 +597,7 @@ AudioComponentMethod AUBaseProcessAndMultipleLookup::Lookup (SInt16 selector)
method = AUBaseProcessMultipleLookup::Lookup(selector);
if (method) return method;
-
+
method = AUBaseProcessLookup::Lookup(selector);
if (method) return method;
@@ -620,7 +620,7 @@ AudioComponentMethod AUMIDILookup::Lookup (SInt16 selector)
{
AudioComponentMethod method = AUBaseLookup::Lookup(selector);
if (method) return method;
-
+
return MIDI_Lookup(selector);
}
@@ -628,7 +628,7 @@ AudioComponentMethod AUMIDIProcessLookup::Lookup (SInt16 selector)
{
AudioComponentMethod method = AUBaseProcessLookup::Lookup(selector);
if (method) return method;
-
+
return MIDI_Lookup(selector);
}
@@ -644,7 +644,7 @@ AudioComponentMethod AUMusicLookup::Lookup (SInt16 selector)
case kMusicDevicePrepareInstrumentSelect: return (AudioComponentMethod)AUMethodPrepareInstrument;
case kMusicDeviceReleaseInstrumentSelect: return (AudioComponentMethod)AUMethodReleaseInstrument;
#endif
- default:
+ default:
break;
}
return MIDI_Lookup (selector);
@@ -656,10 +656,10 @@ AudioComponentMethod AUAuxBaseLookup::Lookup (SInt16 selector)
case kAudioUnitGetPropertyInfoSelect: return (AudioComponentMethod)AUMethodGetPropertyInfo;
case kAudioUnitGetPropertySelect: return (AudioComponentMethod)AUMethodGetProperty;
case kAudioUnitSetPropertySelect: return (AudioComponentMethod)AUMethodSetProperty;
-
+
case kAudioUnitGetParameterSelect: return (AudioComponentMethod)AUMethodGetParameter;
case kAudioUnitSetParameterSelect: return (AudioComponentMethod)AUMethodSetParameter;
-
+
default:
break;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.h
index 6ebea75fd6..1ce471b399 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.h
@@ -2,14 +2,14 @@
File: AUPlugInDispatch.h
Abstract: Part of CoreAudio Utility Classes
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.
-
+
*/
#ifndef __AUPlugInBase_h__
#define __AUPlugInBase_h__
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.cpp
index 24bd18e434..99d359ff8c 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.cpp
@@ -2,14 +2,14 @@
File: AUScopeElement.cpp
Abstract: AUScopeElement.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 "AUScopeElement.h"
#include "AUBase.h"
@@ -57,7 +57,7 @@
//
void AUElement::UseIndexedParameters(int inNumberOfParameters)
{
- mIndexedParameters.resize (inNumberOfParameters);
+ mIndexedParameters.resize (inNumberOfParameters);
mUseIndexedParameters = true;
}
@@ -69,12 +69,12 @@ void AUElement::UseIndexedParameters(int inNumberOfParameters)
inline ParameterMapEvent& AUElement::GetParamEvent(AudioUnitParameterID paramID)
{
ParameterMapEvent *event;
-
+
if(mUseIndexedParameters)
{
if(paramID >= mIndexedParameters.size() )
COMPONENT_THROW(kAudioUnitErr_InvalidParameter);
-
+
event = &mIndexedParameters[paramID];
}
else
@@ -82,10 +82,10 @@ inline ParameterMapEvent& AUElement::GetParamEvent(AudioUnitParameterID paramID)
ParameterMap::iterator i = mParameters.find(paramID);
if (i == mParameters.end())
COMPONENT_THROW(kAudioUnitErr_InvalidParameter);
-
+
event = &(*i).second;
}
-
+
return *event;
}
@@ -95,19 +95,19 @@ inline ParameterMapEvent& AUElement::GetParamEvent(AudioUnitParameterID paramID)
// returns whether the specified paramID is known to the element
//
bool AUElement::HasParameterID (AudioUnitParameterID paramID) const
-{
+{
if(mUseIndexedParameters)
{
if(paramID >= mIndexedParameters.size() )
return false;
-
+
return true;
}
-
+
ParameterMap::const_iterator i = mParameters.find(paramID);
if (i == mParameters.end())
return false;
-
+
return true;
}
@@ -118,7 +118,7 @@ bool AUElement::HasParameterID (AudioUnitParameterID paramID) const
AudioUnitParameterValue AUElement::GetParameter(AudioUnitParameterID paramID)
{
ParameterMapEvent &event = GetParamEvent(paramID);
-
+
return event.GetValue();
}
@@ -132,7 +132,7 @@ void AUElement::GetRampSliceStartEnd( AudioUnitParameterID paramID,
{
ParameterMapEvent &event = GetParamEvent(paramID);
-
+
// works even if the value is constant (immediate parameter value)
event.GetRampSliceStartEnd(outStartValue, outEndValue, outValuePerFrameDelta );
}
@@ -143,7 +143,7 @@ AudioUnitParameterValue AUElement::GetEndValue( AudioUnitParameterID paramID)
{
ParameterMapEvent &event = GetParamEvent(paramID);
-
+
// works even if the value is constant (immediate parameter value)
return event.GetEndValue();
}
@@ -160,21 +160,21 @@ void AUElement::SetParameter(AudioUnitParameterID paramID, AudioUnitParameterV
else
{
ParameterMap::iterator i = mParameters.find(paramID);
-
+
if (i == mParameters.end())
{
if (mAudioUnit->IsInitialized() && !okWhenInitialized) {
// The AU should not be creating new parameters once initialized.
- // If a client tries to set an undefined parameter, we could throw as follows,
+ // If a client tries to set an undefined parameter, we could throw as follows,
// but this might cause a regression. So it is better to just fail silently.
// COMPONENT_THROW(kAudioUnitErr_InvalidParameter);
#if DEBUG
- fprintf(stderr, "WARNING: %s SetParameter for undefined param ID %d while initialized. Ignoring..\n",
+ fprintf(stderr, "WARNING: %s SetParameter for undefined param ID %d while initialized. Ignoring..\n",
mAudioUnit->GetLoggingString(), (int)paramID);
#endif
} else {
// create new entry in map for the paramID (only happens first time)
- ParameterMapEvent event(inValue);
+ ParameterMapEvent event(inValue);
mParameters[paramID] = event;
}
}
@@ -203,21 +203,21 @@ void AUElement::SetScheduledEvent( AudioUnitParameterID paramID,
else
{
ParameterMap::iterator i = mParameters.find(paramID);
-
+
if (i == mParameters.end())
{
if (mAudioUnit->IsInitialized() && !okWhenInitialized) {
// The AU should not be creating new parameters once initialized.
- // If a client tries to set an undefined parameter, we could throw as follows,
+ // If a client tries to set an undefined parameter, we could throw as follows,
// but this might cause a regression. So it is better to just fail silently.
// COMPONENT_THROW(kAudioUnitErr_InvalidParameter);
#if DEBUG
- fprintf(stderr, "WARNING: %s SetScheduledEvent for undefined param ID %d while initialized. Ignoring..\n",
+ fprintf(stderr, "WARNING: %s SetScheduledEvent for undefined param ID %d while initialized. Ignoring..\n",
mAudioUnit->GetLoggingString(), (int)paramID);
#endif
} else {
// create new entry in map for the paramID (only happens first time)
- ParameterMapEvent event(inEvent, inSliceOffsetInBuffer, inSliceDurationFrames);
+ ParameterMapEvent event(inEvent, inSliceOffsetInBuffer, inSliceDurationFrames);
mParameters[paramID] = event;
}
}
@@ -225,7 +225,7 @@ void AUElement::SetScheduledEvent( AudioUnitParameterID paramID,
{
// paramID already exists in map so simply change its value
ParameterMapEvent &event = (*i).second;
-
+
event.SetScheduledEvent(inEvent, inSliceOffsetInBuffer, inSliceDurationFrames );
}
}
@@ -259,7 +259,7 @@ void AUElement::SaveState(CFMutableDataRef data)
UInt32 nparams = static_cast<UInt32>(mIndexedParameters.size());
UInt32 theData = CFSwapInt32HostToBig(nparams);
CFDataAppendBytes(data, (UInt8 *)&theData, sizeof(nparams));
-
+
for (UInt32 i = 0; i < nparams; i++)
{
struct {
@@ -267,12 +267,12 @@ void AUElement::SaveState(CFMutableDataRef data)
//CFSwappedFloat32 value; crashes gcc3 PFE
UInt32 value; // really a big-endian float
} entry;
-
+
entry.paramID = CFSwapInt32HostToBig(i);
-
+
AudioUnitParameterValue v = mIndexedParameters[i].GetValue();
entry.value = CFSwapInt32HostToBig(*(UInt32 *)&v );
-
+
CFDataAppendBytes(data, (UInt8 *)&entry, sizeof(entry));
}
}
@@ -280,19 +280,19 @@ void AUElement::SaveState(CFMutableDataRef data)
{
UInt32 nparams = CFSwapInt32HostToBig(static_cast<uint32_t>(mParameters.size()));
CFDataAppendBytes(data, (UInt8 *)&nparams, sizeof(nparams));
-
+
for (ParameterMap::iterator i = mParameters.begin(); i != mParameters.end(); ++i) {
struct {
UInt32 paramID;
//CFSwappedFloat32 value; crashes gcc3 PFE
UInt32 value; // really a big-endian float
} entry;
-
+
entry.paramID = CFSwapInt32HostToBig((*i).first);
-
+
AudioUnitParameterValue v = (*i).second.GetValue();
entry.value = CFSwapInt32HostToBig(*(UInt32 *)&v );
-
+
CFDataAppendBytes(data, (UInt8 *)&entry, sizeof(entry));
}
}
@@ -306,20 +306,20 @@ const UInt8 * AUElement::RestoreState(const UInt8 *state)
const UInt8 *p = state;
UInt32 nparams = CFSwapInt32BigToHost(*(UInt32 *)p);
p += sizeof(UInt32);
-
+
for (UInt32 i = 0; i < nparams; ++i) {
struct {
AudioUnitParameterID paramID;
AudioUnitParameterValue value;
} entry;
-
+
entry.paramID = CFSwapInt32BigToHost(*(UInt32 *)p);
p += sizeof(UInt32);
FloatInt32 temp;
temp.i = CFSwapInt32BigToHost(*(UInt32 *)p);
entry.value = temp.f;
p += sizeof(AudioUnitParameterValue);
-
+
SetParameter(entry.paramID, entry.value);
}
return p;
@@ -327,10 +327,10 @@ const UInt8 * AUElement::RestoreState(const UInt8 *state)
//_____________________________________________________________________________
//
-void AUElement::SetName (CFStringRef inName)
-{
+void AUElement::SetName (CFStringRef inName)
+{
if (mElementName) CFRelease (mElementName);
- mElementName = inName;
+ mElementName = inName;
if (mElementName) CFRetain (mElementName);
}
@@ -362,9 +362,9 @@ void AUIOElement::AllocateBuffer(UInt32 inFramesToAllocate)
if (GetAudioUnit()->HasBegunInitializing())
{
UInt32 framesToAllocate = inFramesToAllocate > 0 ? inFramesToAllocate : GetAudioUnit()->GetMaxFramesPerSlice();
-
+
// printf ("will allocate: %d\n", (int)((mWillAllocate && NeedsBufferSpace()) ? framesToAllocate : 0));
-
+
mIOBuffer.Allocate(mStreamFormat, (mWillAllocate && NeedsBufferSpace()) ? framesToAllocate : 0);
}
}
@@ -381,21 +381,21 @@ void AUIOElement::DeallocateBuffer()
// AudioChannelLayout support
// outLayoutTagsPtr WILL be NULL if called to find out how many
-// layouts that Audio Unit will report
+// layouts that Audio Unit will report
// return 0 (ie. NO channel layouts) if the AU doesn't require channel layout knowledge
UInt32 AUIOElement::GetChannelLayoutTags (AudioChannelLayoutTag *outLayoutTagsPtr)
{
return 0;
}
-
-// As the AudioChannelLayout can be a variable length structure
+
+// As the AudioChannelLayout can be a variable length structure
// (though in most cases it won't be!!!)
// The size of the ACL is always returned by the method
-// if outMapPtr is NOT-NULL, then AU should copy into this pointer (outMapPtr) the current ACL that it has in use.
+// if outMapPtr is NOT-NULL, then AU should copy into this pointer (outMapPtr) the current ACL that it has in use.
// the AU should also return whether the property is writable (that is the client can provide any arbitrary ACL that the audio unit will then honour)
// or if the property is read only - which is the generally preferred mode.
// If the AU doesn't require an AudioChannelLayout, then just return 0.
-UInt32 AUIOElement::GetAudioChannelLayout (AudioChannelLayout *outMapPtr,
+UInt32 AUIOElement::GetAudioChannelLayout (AudioChannelLayout *outMapPtr,
Boolean &outWritable)
{
return 0;
@@ -500,7 +500,7 @@ bool AUScope::RestoreElementNames (CFDictionaryRef& inNameDict)
//first we have to see if we have enough elements
bool didAddElements = false;
unsigned int maxElNum = GetNumberOfElements();
-
+
int dictSize = static_cast<int>(CFDictionaryGetCount(inNameDict));
CFStringRef * keys = (CFStringRef*)CA_malloc (dictSize * sizeof (CFStringRef));
CFDictionaryGetKeysAndValues (inNameDict, reinterpret_cast<const void**>(keys), NULL);
@@ -519,7 +519,7 @@ bool AUScope::RestoreElementNames (CFDictionaryRef& inNameDict)
}
}
free (keys);
-
+
return didAddElements;
}
@@ -534,11 +534,11 @@ void AUScope::SaveState(CFMutableDataRef data)
UInt32 scope;
UInt32 element;
} hdr;
-
+
hdr.scope = CFSwapInt32HostToBig(GetScope());
hdr.element = CFSwapInt32HostToBig(ielem);
CFDataAppendBytes(data, (UInt8 *)&hdr, sizeof(hdr));
-
+
element->SaveState(data);
}
}
@@ -556,10 +556,10 @@ const UInt8 * AUScope::RestoreState(const UInt8 *state)
} entry;
UInt32 nparams = CFSwapInt32BigToHost(*(UInt32 *)p);
p += sizeof(UInt32);
-
+
p += nparams * sizeof(entry);
} else
p = element->RestoreState(p);
-
+
return p;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.h
index 47ebe2f338..ae493f217b 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.h
@@ -2,14 +2,14 @@
File: AUScopeElement.h
Abstract: Part of CoreAudio Utility Classes
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.
-
+
*/
#ifndef __AUScopeElement_h__
#define __AUScopeElement_h__
@@ -69,15 +69,15 @@ class ParameterMapEvent
{
public:
/*! @ctor ParameterMapEvent */
- ParameterMapEvent()
- : mEventType(kParameterEvent_Immediate), mBufferOffset(0), mDurationInFrames(0), mValue1(0.0f), mValue2(0.0f), mSliceDurationFrames(0)
+ ParameterMapEvent()
+ : mEventType(kParameterEvent_Immediate), mBufferOffset(0), mDurationInFrames(0), mValue1(0.0f), mValue2(0.0f), mSliceDurationFrames(0)
{}
/*! @ctor ParameterMapEvent */
ParameterMapEvent(AudioUnitParameterValue inValue)
- : mEventType(kParameterEvent_Immediate), mBufferOffset(0), mDurationInFrames(0), mValue1(inValue), mValue2(inValue), mSliceDurationFrames(0)
+ : mEventType(kParameterEvent_Immediate), mBufferOffset(0), mDurationInFrames(0), mValue1(inValue), mValue2(inValue), mSliceDurationFrames(0)
{}
-
+
// constructor for scheduled event
/*! @ctor ParameterMapEvent */
ParameterMapEvent( const AudioUnitParameterEvent &inEvent,
@@ -86,7 +86,7 @@ public:
{
SetScheduledEvent(inEvent, inSliceOffsetInBuffer, inSliceDurationFrames );
};
-
+
/*! @method SetScheduledEvent */
void SetScheduledEvent( const AudioUnitParameterEvent &inEvent,
UInt32 inSliceOffsetInBuffer,
@@ -94,7 +94,7 @@ public:
{
mEventType = inEvent.eventType;
mSliceDurationFrames = inSliceDurationFrames;
-
+
if(mEventType == kParameterEvent_Immediate )
{
// constant immediate value for the whole slice
@@ -111,9 +111,9 @@ public:
mValue2 = inEvent.eventValues.ramp.endValue;
}
};
-
-
-
+
+
+
/*! @method GetEventType */
AUParameterEventType GetEventType() const {return mEventType;};
@@ -122,13 +122,13 @@ public:
/*! @method GetEndValue */
AudioUnitParameterValue GetEndValue() const {return mValue2;}; // only valid if immediate event type
/*! @method SetValue */
- void SetValue(AudioUnitParameterValue inValue)
+ void SetValue(AudioUnitParameterValue inValue)
{
- mEventType = kParameterEvent_Immediate;
- mValue1 = inValue;
+ mEventType = kParameterEvent_Immediate;
+ mValue1 = inValue;
mValue2 = inValue;
}
-
+
// interpolates the start and end values corresponding to the current processing slice
// most ramp parameter implementations will want to use this method
// the start value will correspond to the start of the slice
@@ -140,7 +140,7 @@ public:
{
if (mEventType == kParameterEvent_Ramped) {
outValuePerFrameDelta = (mValue2 - mValue1) / mDurationInFrames;
-
+
outStartValue = mValue1 + outValuePerFrameDelta * (-mBufferOffset); // corresponds to frame 0 of this slice
outEndValue = outStartValue + outValuePerFrameDelta * mSliceDurationFrames;
} else {
@@ -178,15 +178,15 @@ public:
}
#endif
-private:
+private:
AUParameterEventType mEventType;
-
+
SInt32 mBufferOffset; // ramp start offset relative to start of this slice (may be negative)
UInt32 mDurationInFrames; // total duration of ramp parameter
AudioUnitParameterValue mValue1; // value if immediate : startValue if ramp
AudioUnitParameterValue mValue2; // endValue (only used for ramp)
-
- UInt32 mSliceDurationFrames; // duration of this processing slice
+
+ UInt32 mSliceDurationFrames; // duration of this processing slice
};
@@ -201,10 +201,10 @@ public:
/*! @ctor AUElement */
AUElement(AUBase *audioUnit) : mAudioUnit(audioUnit),
mUseIndexedParameters(false), mElementName(0) { }
-
+
/*! @dtor ~AUElement */
virtual ~AUElement() { if (mElementName) CFRelease (mElementName); }
-
+
/*! @method GetNumberOfParameters */
virtual UInt32 GetNumberOfParameters()
{
@@ -214,12 +214,12 @@ public:
virtual void GetParameterList(AudioUnitParameterID *outList);
/*! @method HasParameterID */
bool HasParameterID (AudioUnitParameterID paramID) const;
-
+
/*! @method GetParameter */
AudioUnitParameterValue GetParameter(AudioUnitParameterID paramID);
/*! @method SetParameter */
void SetParameter(AudioUnitParameterID paramID, AudioUnitParameterValue value, bool okWhenInitialized = false);
- // Only set okWhenInitialized to true when you know the outside world cannot access this element. Otherwise the parameter map could get corrupted.
+ // Only set okWhenInitialized to true when you know the outside world cannot access this element. Otherwise the parameter map could get corrupted.
// interpolates the start and end values corresponding to the current processing slice
// most ramp parameter implementations will want to use this method
@@ -228,7 +228,7 @@ public:
AudioUnitParameterValue & outStartValue,
AudioUnitParameterValue & outEndValue,
AudioUnitParameterValue & outValuePerFrameDelta );
-
+
/*! @method GetEndValue */
AudioUnitParameterValue GetEndValue( AudioUnitParameterID paramID);
@@ -238,7 +238,7 @@ public:
UInt32 inSliceOffsetInBuffer,
UInt32 inSliceDurationFrames,
bool okWhenInitialized = false );
- // Only set okWhenInitialized to true when you know the outside world cannot access this element. Otherwise the parameter map could get corrupted.
+ // Only set okWhenInitialized to true when you know the outside world cannot access this element. Otherwise the parameter map could get corrupted.
/*! @method GetAudioUnit */
@@ -259,13 +259,13 @@ public:
/*! @method AsIOElement*/
virtual AUIOElement* AsIOElement () { return NULL; }
-
+
protected:
inline ParameterMapEvent& GetParamEvent(AudioUnitParameterID paramID);
-
+
private:
typedef std::map<AudioUnitParameterID, ParameterMapEvent, std::less<AudioUnitParameterID> > ParameterMap;
-
+
/*! @var mAudioUnit */
AUBase * mAudioUnit;
/*! @var mParameters */
@@ -275,7 +275,7 @@ private:
bool mUseIndexedParameters;
/*! @var mIndexedParameters */
std::vector<ParameterMapEvent> mIndexedParameters;
-
+
/*! @var mElementName */
CFStringRef mElementName;
};
@@ -292,7 +292,7 @@ public:
/*! @method GetStreamFormat */
const CAStreamBasicDescription &GetStreamFormat() const { return mStreamFormat; }
-
+
/*! @method SetStreamFormat */
virtual OSStatus SetStreamFormat(const CAStreamBasicDescription &desc);
@@ -304,14 +304,14 @@ public:
virtual bool NeedsBufferSpace() const = 0;
/*! @method SetWillAllocateBuffer */
- void SetWillAllocateBuffer(bool inFlag) {
- mWillAllocate = inFlag;
+ void SetWillAllocateBuffer(bool inFlag) {
+ mWillAllocate = inFlag;
}
/*! @method WillAllocateBuffer */
- bool WillAllocateBuffer() const {
- return mWillAllocate;
+ bool WillAllocateBuffer() const {
+ return mWillAllocate;
}
-
+
/*! @method UseExternalBuffer */
void UseExternalBuffer(const AudioUnitExternalBuffer &buf) {
mIOBuffer.UseExternalBuffer(mStreamFormat, buf);
@@ -392,7 +392,7 @@ public:
/*! @method SetAudioChannelLayout */
virtual OSStatus SetAudioChannelLayout (const AudioChannelLayout &inData);
-
+
/*! @method RemoveAudioChannelLayout */
virtual OSStatus RemoveAudioChannelLayout ();
@@ -416,32 +416,32 @@ protected:
class AUScopeDelegate {
public:
/*! @ctor AUScopeDelegate */
- AUScopeDelegate() : mCreator(NULL), mScope(0) { }
+ AUScopeDelegate() : mCreator(NULL), mScope(0) { }
/*! @dtor ~AUScopeDelegate */
virtual ~AUScopeDelegate() {}
-
+
/*! @method Initialize */
- void Initialize( AUBase *creator,
- AudioUnitScope scope,
+ void Initialize( AUBase *creator,
+ AudioUnitScope scope,
UInt32 numElements)
{
mCreator = creator;
mScope = scope;
SetNumberOfElements(numElements);
}
-
+
/*! @method SetNumberOfElements */
virtual void SetNumberOfElements(UInt32 numElements) = 0;
-
+
/*! @method GetNumberOfElements */
virtual UInt32 GetNumberOfElements() = 0;
-
+
/*! @method GetElement */
virtual AUElement * GetElement(UInt32 elementIndex) = 0;
-
+
AUBase * GetCreator() const { return mCreator; }
AudioUnitScope GetScope() const { return mScope; }
-
+
private:
/*! @var mCreator */
@@ -458,13 +458,13 @@ private:
class AUScope {
public:
/*! @ctor AUScope */
- AUScope() : mCreator(NULL), mScope(0), mDelegate(0) { }
+ AUScope() : mCreator(NULL), mScope(0), mDelegate(0) { }
/*! @dtor ~AUScope */
~AUScope();
-
+
/*! @method Initialize */
- void Initialize(AUBase *creator,
- AudioUnitScope scope,
+ void Initialize(AUBase *creator,
+ AudioUnitScope scope,
UInt32 numElements)
{
mCreator = creator;
@@ -472,22 +472,22 @@ public:
if (mDelegate)
return mDelegate->Initialize(creator, scope, numElements);
-
+
SetNumberOfElements(numElements);
}
-
+
/*! @method SetNumberOfElements */
void SetNumberOfElements(UInt32 numElements);
-
+
/*! @method GetNumberOfElements */
- UInt32 GetNumberOfElements() const
+ UInt32 GetNumberOfElements() const
{
if (mDelegate)
return mDelegate->GetNumberOfElements();
-
+
return static_cast<UInt32>(mElements.size());
}
-
+
/*! @method GetElement */
AUElement * GetElement(UInt32 elementIndex) const
{
@@ -498,7 +498,7 @@ public:
// catch passing -1 in as the elementIndex - causes a wrap around
return (i >= mElements.end() || i < mElements.begin()) ? NULL : *i;
}
-
+
/*! @method SafeGetElement */
AUElement * SafeGetElement(UInt32 elementIndex)
{
@@ -507,7 +507,7 @@ public:
COMPONENT_THROW(kAudioUnitErr_InvalidElement);
return element;
}
-
+
/*! @method GetIOElement */
AUIOElement * GetIOElement(UInt32 elementIndex) const
{
@@ -517,15 +517,15 @@ public:
COMPONENT_THROW (kAudioUnitErr_InvalidElement);
return ioel;
}
-
+
/*! @method HasElementWithName */
bool HasElementWithName () const;
-
+
/*! @method AddElementNamesToDict */
void AddElementNamesToDict (CFMutableDictionaryRef & inNameDict);
-
+
bool RestoreElementNames (CFDictionaryRef& inNameDict);
-
+
AudioUnitScope GetScope() const { return mScope; }
void SetDelegate(AUScopeDelegate* inDelegate) { mDelegate = inDelegate; }
@@ -535,7 +535,7 @@ public:
/*! @method RestoreState */
const UInt8 * RestoreState(const UInt8 *state);
-
+
private:
typedef std::vector<AUElement *> ElementVector;
/*! @var mCreator */
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp
index fc987335dc..37328fe791 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp
@@ -2,14 +2,14 @@
File: ComponentBase.cpp
Abstract: ComponentBase.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 "ComponentBase.h"
#include "CAXException.h"
@@ -72,11 +72,11 @@ static OSStatus CB_GetComponentDescription (const AudioComponentInstance inInsta
static OSStatus CMgr_GetComponentDescription (const AudioComponentInstance inInstance, AudioComponentDescription * outDesc);
#endif
-ComponentBase::ComponentBase(AudioComponentInstance inInstance)
- : mComponentInstance(inInstance),
- mInstanceType(sNewInstanceType)
-{
- GetComponentDescription();
+ComponentBase::ComponentBase(AudioComponentInstance inInstance)
+ : mComponentInstance(inInstance),
+ mInstanceType(sNewInstanceType)
+{
+ GetComponentDescription();
}
ComponentBase::~ComponentBase()
@@ -99,7 +99,7 @@ OSStatus ComponentBase::AP_Open(void *self, AudioUnit compInstance)
OSStatus result = noErr;
try {
ComponentInitLocker lock;
-
+
ComponentBase::sNewInstanceType = ComponentBase::kAudioComponentInstance;
ComponentBase *cb = (ComponentBase *)(*ACPI->mConstruct)(&ACPI->mInstanceStorage, compInstance);
cb->PostConstructor(); // allows base class to do additional initialization
@@ -137,13 +137,13 @@ OSStatus ComponentBase::ComponentEntryDispatch(ComponentParameters *p, Componen
if (This == NULL) return kAudio_ParamError;
OSStatus result = noErr;
-
+
switch (p->what) {
case kComponentCloseSelect:
This->PreDestructor();
delete This;
break;
-
+
case kComponentVersionSelect:
result = This->Version();
break;
@@ -158,7 +158,7 @@ OSStatus ComponentBase::ComponentEntryDispatch(ComponentParameters *p, Componen
default:
return 0;
}
-
+
default:
result = badComponentSelector;
break;
@@ -169,7 +169,7 @@ OSStatus ComponentBase::ComponentEntryDispatch(ComponentParameters *p, Componen
SInt16 ComponentBase::GetSelectorForCanDo(ComponentParameters *params)
{
if (params->what != kComponentCanDoSelect) return 0;
-
+
#if TARGET_CPU_X86
SInt16 sel = params->params[0];
#elif TARGET_CPU_X86_64
@@ -179,9 +179,9 @@ SInt16 ComponentBase::GetSelectorForCanDo(ComponentParameters *params)
#else
SInt16 sel = params->params[0];
#endif
-
+
return sel;
-/*
+/*
printf ("flags:%d, paramSize: %d, what: %d\n\t", params->flags, params->paramSize, params->what);
for (int i = 0; i < params->paramSize; ++i) {
printf ("[%d]:%d(0x%x), ", i, params->params[i], params->params[i]);
@@ -192,7 +192,7 @@ SInt16 ComponentBase::GetSelectorForCanDo(ComponentParameters *params)
#endif
-#if CA_DO_NOT_USE_AUDIO_COMPONENT
+#if CA_DO_NOT_USE_AUDIO_COMPONENT
static OSStatus ComponentBase_GetComponentDescription (const AudioComponentInstance & inInstance, AudioComponentDescription &outDesc);
#endif
@@ -200,20 +200,20 @@ AudioComponentDescription ComponentBase::GetComponentDescription() const
{
AudioComponentDescription desc;
OSStatus result = 1;
-
+
if (IsPluginObject()) {
ca_require_noerr(result = CB_GetComponentDescription (mComponentInstance, &desc), home);
}
#if !CA_USE_AUDIO_PLUGIN_ONLY
else {
- ca_require_noerr(result = CMgr_GetComponentDescription (mComponentInstance, &desc), home);
+ ca_require_noerr(result = CMgr_GetComponentDescription (mComponentInstance, &desc), home);
}
#endif
home:
if (result)
memset (&desc, 0, sizeof(AudioComponentDescription));
-
+
return desc;
}
@@ -239,13 +239,13 @@ static OSStatus CB_GetComponentDescription (const AudioComponentInstance inInsta
{
typedef AudioComponent (*AudioComponentInstanceGetComponentProc) (AudioComponentInstance);
static AudioComponentInstanceGetComponentProc aciGCProc = NULL;
-
+
typedef OSStatus (*AudioComponentGetDescriptionProc)(AudioComponent, AudioComponentDescription *);
static AudioComponentGetDescriptionProc acGDProc = NULL;
-
+
static int doneInit = 0;
if (doneInit == 0) {
- doneInit = 1;
+ doneInit = 1;
void* theImage = dlopen("/System/Library/Frameworks/AudioUnit.framework/AudioUnit", RTLD_LAZY);
if (theImage != NULL)
{
@@ -255,13 +255,13 @@ static OSStatus CB_GetComponentDescription (const AudioComponentInstance inInsta
}
}
}
-
+
OSStatus result = kAudio_UnimplementedError;
if (acGDProc && aciGCProc) {
AudioComponent comp = (*aciGCProc)(inInstance);
if (comp)
result = (*acGDProc)(comp, outDesc);
- }
+ }
#if !CA_USE_AUDIO_PLUGIN_ONLY
else {
result = CMgr_GetComponentDescription (inInstance, outDesc);
@@ -317,7 +317,7 @@ static void CSInit ()
dispatch_once_f(&sCSInitOnce, NULL, CSInitOnce);
}
-#else
+#else
static void CSInit ()
{
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h
index 67417aa9d1..f8c5511f16 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h
@@ -2,14 +2,14 @@
File: ComponentBase.h
Abstract: Part of CoreAudio Utility Classes
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.
-
+
*/
#ifndef __ComponentBase_h__
#define __ComponentBase_h__
@@ -57,7 +57,7 @@
#if !CA_USE_AUDIO_PLUGIN_ONLY
#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/Components.h>
-
+
#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5)
#define AudioComponentInstance ComponentInstance
#define AudioComponentDescription ComponentDescription
@@ -115,13 +115,13 @@ public:
/*! @ctor ComponentBase */
ComponentBase(AudioComponentInstance inInstance);
-
+
/*! @dtor ~ComponentBase */
virtual ~ComponentBase();
-
+
/*! @method PostConstructor */
virtual void PostConstructor();
-
+
/*! @method PreDestructor */
virtual void PreDestructor();
@@ -135,14 +135,14 @@ public:
/*! GetSelectorForCanDo */
static SInt16 GetSelectorForCanDo(ComponentParameters *params);
#endif
-
+
/*! @method GetComponentInstance */
AudioComponentInstance GetComponentInstance() const { return mComponentInstance; }
/*! @method GetComponentDescription */
AudioComponentDescription GetComponentDescription() const;
- // This global variable is so that new instances know how they were instantiated: via the Component Manager,
+ // This global variable is so that new instances know how they were instantiated: via the Component Manager,
// or as AudioComponents. It's ugly, but preferable to altering the constructor of every class in the hierarchy.
// It's safe because construction is protected by ComponentInitLocker.
enum EInstanceType { kComponentMgrInstance, kAudioComponentInstance };
@@ -158,27 +158,27 @@ public:
/*! @method AP_Close */
static OSStatus AP_Close(void *self);
-
+
protected:
/*! @var mComponentInstance */
AudioComponentInstance mComponentInstance;
EInstanceType mInstanceType;
};
-class ComponentInitLocker
+class ComponentInitLocker
{
#if TARGET_OS_MAC
public:
- ComponentInitLocker()
- {
+ ComponentInitLocker()
+ {
pthread_once(&sOnce, InitComponentInitLocker);
- pthread_mutex_lock(&sComponentOpenMutex);
+ pthread_mutex_lock(&sComponentOpenMutex);
mPreviousNewInstanceType = ComponentBase::sNewInstanceType;
}
- ~ComponentInitLocker()
- {
+ ~ComponentInitLocker()
+ {
ComponentBase::sNewInstanceType = mPreviousNewInstanceType;
- pthread_mutex_unlock(&sComponentOpenMutex);
+ pthread_mutex_unlock(&sComponentOpenMutex);
}
// There are situations (11844772) where we need to be able to release the lock early.
@@ -190,7 +190,7 @@ public:
}
~Unlocker()
{
- pthread_mutex_lock(&sComponentOpenMutex);
+ pthread_mutex_lock(&sComponentOpenMutex);
}
};
@@ -198,7 +198,7 @@ private:
static pthread_mutex_t sComponentOpenMutex;
static pthread_once_t sOnce;
static void InitComponentInitLocker();
-
+
#elif TARGET_OS_WIN32
public:
bool sNeedsUnlocking;
@@ -207,12 +207,12 @@ public:
private:
static CAGuard sComponentOpenGuard;
#endif
-
+
private:
ComponentBase::EInstanceType mPreviousNewInstanceType;
};
-/*! @class AudioComponentPlugInInstance */
+/*! @class AudioComponentPlugInInstance */
struct AudioComponentPlugInInstance {
AudioComponentPlugInInterface mPlugInInterface;
void * (*mConstruct)(void *memory, AudioComponentInstance ci);
@@ -222,7 +222,7 @@ struct AudioComponentPlugInInstance {
// this member is just a placeholder. it is aligned to a 16byte boundary
};
-/*! @class APFactory */
+/*! @class APFactory */
template <class APMethodLookup, class Implementor>
class APFactory {
public:
@@ -230,7 +230,7 @@ public:
{
return new(memory) Implementor(compInstance);
}
-
+
static void Destruct(void *memory)
{
((Implementor *)memory)->~Implementor();
@@ -240,7 +240,7 @@ public:
// The actual implementation object is not created until Open().
static AudioComponentPlugInInterface *Factory(const AudioComponentDescription * /* inDesc */)
{
- AudioComponentPlugInInstance *acpi =
+ AudioComponentPlugInInstance *acpi =
(AudioComponentPlugInInstance *)malloc( offsetof(AudioComponentPlugInInstance, mInstanceStorage) + sizeof(Implementor) );
acpi->mPlugInInterface.Open = ComponentBase::AP_Open;
acpi->mPlugInInterface.Close = ComponentBase::AP_Close;
@@ -252,17 +252,17 @@ public:
acpi->mPad[1] = NULL;
return (AudioComponentPlugInInterface*)acpi;
}
-
+
// This is for runtime registration (not for plug-ins loaded from bundles).
static AudioComponent Register(UInt32 type, UInt32 subtype, UInt32 manuf, CFStringRef name, UInt32 vers, UInt32 flags=0)
{
AudioComponentDescription desc = { type, subtype, manuf, flags, 0 };
- return AudioComponentRegister(&desc, name, vers, Factory);
+ return AudioComponentRegister(&desc, name, vers, Factory);
}
};
#if !CA_USE_AUDIO_PLUGIN_ONLY
-/*! @class ComponentEntryPoint
+/*! @class ComponentEntryPoint
* @discussion This is only used for a component manager version
*/
template <class Class>
@@ -272,7 +272,7 @@ public:
static OSStatus Dispatch(ComponentParameters *params, Class *obj)
{
OSStatus result = noErr;
-
+
try {
if (params->what == kComponentOpenSelect) {
// solve a host of initialization thread safety issues.
@@ -283,16 +283,16 @@ public:
Class *This = new Class((AudioComponentInstance)ci);
This->PostConstructor(); // allows base class to do additional initialization
// once the derived class is fully constructed
-
+
CMgr_SetComponentInstanceStorage(ci, (Handle)This);
} else
result = Class::ComponentEntryDispatch(params, obj);
}
COMPONENT_CATCH
-
+
return result;
}
-
+
/*! @method Register */
static Component Register(OSType compType, OSType subType, OSType manufacturer)
{