summaryrefslogtreecommitdiff
path: root/libs/appleutility/CoreAudio/AudioUnits/AUPublic
diff options
context:
space:
mode:
Diffstat (limited to 'libs/appleutility/CoreAudio/AudioUnits/AUPublic')
-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
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp90
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.h38
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp222
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.h70
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp18
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.cpp120
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.h38
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp20
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.h14
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.cpp140
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.h100
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/LockFreeFIFO.h54
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/MIDIControlHandler.h18
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.cpp50
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h62
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthEvent.h44
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.cpp42
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.h38
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.cpp20
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.h48
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUViewBase/AUViewLocalizedStringKeys.h28
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.cpp80
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.h90
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp96
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h62
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp34
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.h14
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.cpp16
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.h14
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.cpp164
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.h48
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp52
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h28
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp28
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h12
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.cpp20
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.h46
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUInputFormatConverter.h26
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUMIDIDefs.h22
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUSilentTimeout.h16
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.cpp38
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h44
56 files changed, 1741 insertions, 1741 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)
{
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp
index 332475335d..d3394ee19d 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp
@@ -2,14 +2,14 @@
File: AUCarbonViewBase.cpp
Abstract: AUCarbonViewBase.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 "AUCarbonViewBase.h"
#include "AUCarbonViewControl.h"
@@ -59,11 +59,11 @@ AUCarbonViewBase::AUCarbonViewBase(AudioUnitCarbonView inInstance, Float32 inNot
mTimerUPP (NULL),
mCarbonWindow(NULL),
mCarbonPane(NULL),
- mXOffset(0),
+ mXOffset(0),
mYOffset(0)
{
AUEventListenerCreate (ParameterListener, this,
- CFRunLoopGetCurrent(), kCFRunLoopCommonModes,
+ CFRunLoopGetCurrent(), kCFRunLoopCommonModes,
inNotificationInterval, inNotificationInterval,
&mParameterListener);
}
@@ -82,12 +82,12 @@ AUCarbonViewBase::~AUCarbonViewBase()
if (mTimerRef)
::RemoveEventLoopTimer (mTimerRef);
-
+
if (mTimerUPP)
DisposeEventLoopTimerUPP (mTimerUPP);
#endif
}
-
+
void AUCarbonViewBase::AddControl(AUCarbonViewControl *control)
{
ControlList::iterator it = find(mControlList.begin(), mControlList.end(), control);
@@ -126,7 +126,7 @@ void AUCarbonViewBase::ParameterListener(void * inCallbackRefCon,
}
}
-
+
OSStatus AUCarbonViewBase::CreateCarbonView(AudioUnit inAudioUnit, WindowRef inWindow, ControlRef inParentControl, const Float32Point &inLocation, const Float32Point &inSize, ControlRef &outParentControl)
{
#if !__LP64__
@@ -140,19 +140,19 @@ OSStatus AUCarbonViewBase::CreateCarbonView(AudioUnit inAudioUnit, WindowRef i
Rect area;
area.left = short(inLocation.x); area.top = short(inLocation.y);
area.right = short(area.left + inSize.x); area.bottom = short(area.top + inSize.y);
- OSStatus err = ::CreateUserPaneControl(inWindow, &area,
+ OSStatus err = ::CreateUserPaneControl(inWindow, &area,
kControlSupportsEmbedding,
&mCarbonPane); // subclass can resize mCarbonPane to taste
verify_noerr(err);
if (err) return err;
outParentControl = mCarbonPane;
-
+
// register for mouse-down in our pane -- we want to clear focus
EventTypeSpec paneEvents[] = {
{ kEventClassControl, kEventControlClick }
};
WantEventTypes(GetControlEventTarget(mCarbonPane), GetEventTypeCount(paneEvents), paneEvents);
-
+
if (IsCompositWindow()) {
verify_noerr(::HIViewAddSubview(inParentControl, mCarbonPane));
mXOffset = 0;
@@ -164,7 +164,7 @@ OSStatus AUCarbonViewBase::CreateCarbonView(AudioUnit inAudioUnit, WindowRef i
mYOffset = inLocation.y;
}
mBottomRight.h = mBottomRight.v = 0;
-
+
SizeControl(mCarbonPane, 0, 0);
if (err = CreateUI(mXOffset, mYOffset))
return err;
@@ -187,12 +187,12 @@ OSStatus AUCarbonViewBase::CreateCarbonView(AudioUnit inAudioUnit, WindowRef i
{ kEventClassScrollable, kEventScrollableGetInfo },
{ kEventClassScrollable, kEventScrollableScrollTo }
};
-
+
WantEventTypes(GetControlEventTarget(mCarbonPane), GetEventTypeCount(scrollEvents), scrollEvents);
-
+
mCurrentScrollPoint.x = mCurrentScrollPoint.y = 0.0f;
}
-
+
return err;
#else
return noErr;
@@ -212,10 +212,10 @@ OSStatus AUCarbonViewBase::EmbedControl(ControlRef ctl)
if (r.right > mBottomRight.h) mBottomRight.h = r.right;
if (r.bottom > mBottomRight.v) mBottomRight.v = r.bottom;
- if (IsCompositWindow())
+ if (IsCompositWindow())
return ::HIViewAddSubview(mCarbonPane, ctl);
- else
- return ::EmbedControl(ctl, mCarbonPane);
+ else
+ return ::EmbedControl(ctl, mCarbonPane);
#else
return noErr;
#endif
@@ -224,19 +224,19 @@ OSStatus AUCarbonViewBase::EmbedControl(ControlRef ctl)
void AUCarbonViewBase::AddCarbonControl(AUCarbonViewControl::ControlType type, const CAAUParameter &param, ControlRef control)
{
verify_noerr(EmbedControl(control));
-
+
AUCarbonViewControl *auvc = new AUCarbonViewControl(this, mParameterListener, type, param, control);
auvc->Bind();
AddControl(auvc);
}
bool AUCarbonViewBase::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef event)
-{
+{
#if !__LP64__
UInt32 eclass = GetEventClass(event);
UInt32 ekind = GetEventKind(event);
ControlRef control;
-
+
switch (eclass) {
case kEventClassControl:
{
@@ -250,7 +250,7 @@ bool AUCarbonViewBase::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef ev
}
}
break;
-
+
case kEventClassScrollable:
{
switch (ekind) {
@@ -262,7 +262,7 @@ bool AUCarbonViewBase::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef ev
*/
HISize originalSize = { mBottomRight.h, mBottomRight.v };
verify_noerr(SetEventParameter(event, kEventParamImageSize, typeHISize, sizeof(HISize), &originalSize));
-
+
// [2/4]
/* <-- kEventParamViewSize (out, typeHISize)
* On exit, contains the amount of the scrollable view that is
@@ -274,7 +274,7 @@ bool AUCarbonViewBase::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef ev
//HISize windowSize = { float(windowBounds.right - windowBounds.left),
// float(windowBounds.bottom - windowBounds.top) };
verify_noerr(SetEventParameter(event, kEventParamViewSize, typeHISize, sizeof(HISize), &(parentBounds.size)));
-
+
// [3/4]
/* <-- kEventParamLineSize (out, typeHISize)
* On exit, contains the amount that should be scrolled in
@@ -282,7 +282,7 @@ bool AUCarbonViewBase::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef ev
*/
HISize scrollIncrementSize = { 16.0f, float(20) };
verify_noerr(SetEventParameter(event, kEventParamLineSize, typeHISize, sizeof(HISize), &scrollIncrementSize));
-
+
// [4/4]
/* <-- kEventParamOrigin (out, typeHIPoint)
* On exit, contains the scrollable viewÕs current origin (the
@@ -294,17 +294,17 @@ bool AUCarbonViewBase::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef ev
verify_noerr(SetEventParameter(event, kEventParamOrigin, typeHIPoint, sizeof(HIPoint), &mCurrentScrollPoint));
}
return true;
-
+
case kEventScrollableScrollTo:
{
/*
* kEventClassScrollable / kEventScrollableScrollTo
- *
+ *
* Summary:
* Requests that an HIScrollViewÕs scrollable view should scroll to
* a particular origin.
*/
-
+
/* --> kEventParamOrigin (in, typeHIPoint)
* The new origin for the scrollable view. The origin
* coordinates will vary from (0,0) to scrollable viewÕs image
@@ -312,24 +312,24 @@ bool AUCarbonViewBase::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef ev
*/
HIPoint pointToScrollTo;
verify_noerr(GetEventParameter(event, kEventParamOrigin, typeHIPoint, NULL, sizeof(HIPoint), NULL, &pointToScrollTo));
-
+
float xDelta = mCurrentScrollPoint.x - pointToScrollTo.x;
float yDelta = mCurrentScrollPoint.y - pointToScrollTo.y;
// move visible portion the appropriate amount
verify_noerr(HIViewScrollRect(mCarbonPane, NULL, xDelta, yDelta));
// set new content to be drawn
verify_noerr(HIViewSetBoundsOrigin(mCarbonPane, pointToScrollTo.x, pointToScrollTo.y));
-
+
mCurrentScrollPoint = pointToScrollTo;
}
return true;
-
+
default:
break;
}
}
break;
-
+
default:
break;
}
@@ -352,7 +352,7 @@ void AUCarbonViewBase::TellListener (const CAAUParameter &auvp, AudioUnitCarbonV
} else {
auEvent.mEventType = kAudioUnitEvent_EndParameterChangeGesture;
}
- AUEventListenerNotify(mParameterListener, this, &auEvent);
+ AUEventListenerNotify(mParameterListener, this, &auEvent);
}
@@ -370,34 +370,34 @@ pascal void AUCarbonViewBase::TheTimerProc (EventLoopTimerRef inTimer, void *in
This->RespondToEventTimer (inTimer);
}
-void AUCarbonViewBase::RespondToEventTimer (EventLoopTimerRef inTimer)
+void AUCarbonViewBase::RespondToEventTimer (EventLoopTimerRef inTimer)
{}
-/*
+/*
THESE are reasonable values for these two times
- 0.005 // delay
+ 0.005 // delay
0.050 // interval
*/
-OSStatus AUCarbonViewBase::CreateEventLoopTimer (Float32 inDelay, Float32 inInterval)
+OSStatus AUCarbonViewBase::CreateEventLoopTimer (Float32 inDelay, Float32 inInterval)
{
if (mTimerUPP)
return noErr;
-
+
mTimerUPP = NewEventLoopTimerUPP(TheTimerProc);
-
+
EventLoopRef mainEventLoop = GetMainEventLoop();
-
+
//doesn't seem to like too small a value
if (inDelay < 0.005)
inDelay = 0.005;
-
+
OSStatus timerResult = ::InstallEventLoopTimer(
mainEventLoop,
inDelay,
inInterval,
mTimerUPP,
this,
- &mTimerRef);
+ &mTimerRef);
return timerResult;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.h
index 910e53ffa6..0afc5fc074 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.h
@@ -2,14 +2,14 @@
File: AUCarbonViewBase.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 __AUCarbonViewBase_h__
#define __AUCarbonViewBase_h__
@@ -62,7 +62,7 @@ public:
Float32 inNotificationInterval = kDefaultNotificationInterval /* in seconds */);
/*! @dtor ~AUCarbonViewBase */
virtual ~AUCarbonViewBase();
-
+
// AUViewBase overrides
/*! @method CreateCarbonView */
virtual OSStatus CreateCarbonView (AudioUnit inAudioUnit, WindowRef inWindow, ControlRef inParentControl, const Float32Point &inLocation, const Float32Point &inSize, ControlRef &outParentControl);
@@ -73,7 +73,7 @@ public:
/*! @method HandleEvent */
virtual bool HandleEvent (EventHandlerCallRef inHandlerRef, EventRef event);
-
+
/*! @method GetEditAudioUnit */
const AudioUnit GetEditAudioUnit () const { return mEditAudioUnit; }
//
@@ -84,8 +84,8 @@ public:
/*! @method AddCarbonControl */
void AddCarbonControl (
- AUCarbonViewControl::ControlType type,
- const CAAUParameter & param,
+ AUCarbonViewControl::ControlType type,
+ const CAAUParameter & param,
ControlRef control);
/*! @method GetCarbonWindow */
@@ -94,27 +94,27 @@ public:
ControlRef GetCarbonPane () { return mCarbonPane; }
/*! @method EmbedControl */
OSStatus EmbedControl (ControlRef ctl);
-
+
/*! @method TellListener */
void TellListener (const CAAUParameter &auvp, AudioUnitCarbonViewEventID event, void *evpar);
-
+
// pass in true if wanting an update to the view and you're calling this from a thread
// that is safe to do UI in.
// If you don't know, pass in false!
/*! @method Update */
void Update (bool inUIThread);
-
+
/*! @method GetXOffset */
Float32 GetXOffset () { return mXOffset; }
/*! @method GetYOffset */
Float32 GetYOffset () { return mYOffset; }
-
+
/*! @method ClearControls */
void ClearControls ();
-
+
/*! @method IsCompositWindow */
bool IsCompositWindow () const { return mCompositWindow; }
-
+
protected:
#if !__LP64__
/*! @method SetEventListener */
@@ -131,15 +131,15 @@ protected:
void RemoveControl (AUCarbonViewControl *control);
OSStatus CreateEventLoopTimer (Float32 inDelay, Float32 inInterval);
-
+
/*! @method ParameterListener */
static void ParameterListener (void * inCallbackRefCon,
void * inObject,
const AudioUnitEvent * inEvent,
UInt64 inEventHostTime,
Float32 inParameterValue);
-
- static pascal void TheTimerProc ( EventLoopTimerRef inTimer,
+
+ static pascal void TheTimerProc ( EventLoopTimerRef inTimer,
void * inUserData);
virtual void RespondToEventTimer (EventLoopTimerRef inTimer);
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp
index 981347b0f1..c22c50c4a3 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp
@@ -2,14 +2,14 @@
File: AUCarbonViewControl.cpp
Abstract: AUCarbonViewControl.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 "AUCarbonViewControl.h"
#include "AUCarbonViewBase.h"
@@ -74,11 +74,11 @@ void AUCarbonViewControl::Bind()
mInControlInitialization = 1; // true
AUListenerAddParameter(mListener, this, &mParam);
// will cause an almost-immediate callback
-
+
EventTypeSpec events[] = {
{ kEventClassControl, kEventControlValueFieldChanged } // N.B. OS X only
};
-
+
WantEventTypes(GetControlEventTarget(mControl), GetEventTypeCount(events), events);
if (mType == kTypeContinuous || mType == kTypeText || mType == kTypeDiscrete) {
@@ -88,18 +88,18 @@ void AUCarbonViewControl::Bind()
{ kEventClassControl, kEventControlTrack }
};
WantEventTypes(GetControlEventTarget(mControl), GetEventTypeCount(events), events);
- }
+ }
if (mType == kTypeText) {
EventTypeSpec events[] = {
{ kEventClassControl, kEventControlSetFocusPart }
};
- WantEventTypes(GetControlEventTarget(mControl), GetEventTypeCount(events), events);
+ WantEventTypes(GetControlEventTarget(mControl), GetEventTypeCount(events), events);
ControlKeyFilterUPP proc = mParam.ValuesHaveStrings() ? StdKeyFilterCallback : NumericKeyFilterCallback;
// this will fail for a static text field
SetControlData(mControl, 0, kControlEditTextKeyFilterTag, sizeof(proc), &proc);
}
-
+
Update(true);
mInControlInitialization = 0; // false
#endif
@@ -116,7 +116,7 @@ void AUCarbonViewControl::ParameterToControl(Float32 paramValue)
case kTypeDiscrete:
{
long value = long(paramValue);
-
+
// special case [1] -- menu parameters
if (mParam.HasNamedParams()) {
// if we're dealing with menus they behave differently!
@@ -124,17 +124,17 @@ void AUCarbonViewControl::ParameterToControl(Float32 paramValue)
// first menu item always reports a control value of 1
ControlKind ctrlKind;
if (GetControlKind(mControl, &ctrlKind) == noErr) {
- if ((ctrlKind.kind == kControlKindPopupArrow)
- || (ctrlKind.kind == kControlKindPopupButton))
+ if ((ctrlKind.kind == kControlKindPopupArrow)
+ || (ctrlKind.kind == kControlKindPopupButton))
{
value = value - long(mParam.ParamInfo().minValue) + 1;
}
}
}
-
+
// special case [2] -- Write-only boolean parameters
AudioUnitParameterInfo AUPI = mParam.ParamInfo();
-
+
bool isWriteOnlyBoolParameter = ( (AUPI.unit == kAudioUnitParameterUnit_Boolean) &&
(AUPI.flags & kAudioUnitParameterFlag_IsWritable) &&
!(AUPI.flags & kAudioUnitParameterFlag_IsReadable) );
@@ -148,7 +148,7 @@ void AUCarbonViewControl::ParameterToControl(Float32 paramValue)
CFStringRef cfstr = mParam.GetStringFromValueCopy(&paramValue);
if ( !(mParam.ParamInfo().flags & kAudioUnitParameterFlag_IsWritable) //READ ONLY PARAMS
- && (mParam.ParamInfo().flags & kAudioUnitParameterFlag_IsReadable))
+ && (mParam.ParamInfo().flags & kAudioUnitParameterFlag_IsReadable))
{
if (mParam.GetParamTag()) {
CFMutableStringRef str = CFStringCreateMutableCopy(NULL, 256, cfstr);
@@ -184,7 +184,7 @@ void AUCarbonViewControl::ControlToParameter()
case kTypeDiscrete:
{
long value = GetValue();
-
+
// special case [1] -- Menus
if (mParam.HasNamedParams()) {
// if we're dealing with menus they behave differently!
@@ -192,24 +192,24 @@ void AUCarbonViewControl::ControlToParameter()
// first menu item always reports a control value of 1
ControlKind ctrlKind;
if (GetControlKind(mControl, &ctrlKind) == noErr) {
- if ((ctrlKind.kind == kControlKindPopupArrow)
- || (ctrlKind.kind == kControlKindPopupButton))
+ if ((ctrlKind.kind == kControlKindPopupArrow)
+ || (ctrlKind.kind == kControlKindPopupButton))
{
value = value + long(mParam.ParamInfo().minValue) - 1;
}
}
}
-
+
// special case [2] -- Write-only boolean parameters
AudioUnitParameterInfo AUPI = mParam.ParamInfo();
-
+
bool isWriteOnlyBoolParameter = ( (AUPI.unit == kAudioUnitParameterUnit_Boolean) &&
(AUPI.flags & kAudioUnitParameterFlag_IsWritable) &&
!(AUPI.flags & kAudioUnitParameterFlag_IsReadable) );
if (isWriteOnlyBoolParameter) {
value = 1;
}
-
+
mParam.SetValue (mListener, this, value);
}
break;
@@ -284,25 +284,25 @@ long AUCarbonViewControl::GetValue()
#endif
}
-/* Notes on event handling
-
+/* Notes on event handling
+
Button (Click and release on button)
kEventControlClick received
kEventControlTrack received
kEventControlValueFieldChanged received
kEventControlHit received
-
+
Button (Click and release outside of button bounds)
kEventControlClick received
kEventControlTrack received
-
+
Slider (Click, drag, and release)
kEventControlClick received
kEventControlTrack received
kEventControlValueFieldChanged received
kEventControlValueFieldChanged received
kEventControlHit received
-
+
Slider (Click, release without changing value)
kEventControlClick received
kEventControlTrack received
@@ -313,16 +313,16 @@ bool AUCarbonViewControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef
UInt32 ekind = GetEventKind(event);
ControlRef control;
bool handled = true;
-
+
switch (eclass) {
case kEventClassControl:
{
AudioUnitParameterInfo AUPI = mParam.ParamInfo();
-
+
bool isWriteOnlyBoolParameter = ( (AUPI.unit == kAudioUnitParameterUnit_Boolean) &&
(AUPI.flags & kAudioUnitParameterFlag_IsWritable) &&
!(AUPI.flags & kAudioUnitParameterFlag_IsReadable) );
-
+
switch (ekind) {
case kEventControlSetFocusPart: // tab
handled = !handled; // fall through to next case
@@ -331,7 +331,7 @@ bool AUCarbonViewControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef
GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
verify(control == mControl);
ControlToParameter();
- return handled;
+ return handled;
case kEventControlClick:
if (isWriteOnlyBoolParameter) {
GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
@@ -341,7 +341,7 @@ bool AUCarbonViewControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef
if (mLastControl != NULL) {
mLastControl->Update(false);
}
- mLastControl = this;
+ mLastControl = this;
}
mOwnerView->TellListener(mParam, kAudioUnitCarbonViewEvent_MouseDownInControl, NULL);
break; // don't return true, continue normal processing
@@ -349,17 +349,17 @@ bool AUCarbonViewControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef
if (mLastControl != this) {
if (mLastControl != NULL)
mLastControl->Update(false);
- mLastControl = this;
- }
+ mLastControl = this;
+ }
mOwnerView->TellListener(mParam, kAudioUnitCarbonViewEvent_MouseUpInControl, NULL);
break; // don't return true, continue normal processing
- case kEventControlTrack:
+ case kEventControlTrack:
if (mLastControl != this) {
if (mLastControl != NULL)
mLastControl->Update(false);
- mLastControl = this;
+ mLastControl = this;
}
-
+
CallNextEventHandler(inHandlerRef, event);
ControlToParameter(); // new code
mOwnerView->TellListener(mParam, kAudioUnitCarbonViewEvent_MouseUpInControl, NULL);
@@ -379,8 +379,8 @@ pascal void AUCarbonViewControl::SliderTrackProc(ControlRef theControl, ControlP
// AUCarbonViewControl *This = (AUCarbonViewControl *)GetControlReference(theControl);
}
-pascal ControlKeyFilterResult AUCarbonViewControl::StdKeyFilterCallback(ControlRef theControl,
- SInt16 *keyCode, SInt16 *charCode,
+pascal ControlKeyFilterResult AUCarbonViewControl::StdKeyFilterCallback(ControlRef theControl,
+ SInt16 *keyCode, SInt16 *charCode,
EventModifiers *modifiers)
{
#if !__LP64__
@@ -397,8 +397,8 @@ pascal ControlKeyFilterResult AUCarbonViewControl::StdKeyFilterCallback(ControlR
return kControlKeyFilterBlockKey;
}
-pascal ControlKeyFilterResult AUCarbonViewControl::NumericKeyFilterCallback(ControlRef theControl,
- SInt16 *keyCode, SInt16 *charCode,
+pascal ControlKeyFilterResult AUCarbonViewControl::NumericKeyFilterCallback(ControlRef theControl,
+ SInt16 *keyCode, SInt16 *charCode,
EventModifiers *modifiers)
{
#if !__LP64__
@@ -420,43 +420,43 @@ Boolean AUCarbonViewControl::SizeControlToFit(ControlRef inControl, SInt16 *outW
{
#if !__LP64__
if (inControl == 0) return false;
-
+
Boolean bValue = false;
// this only works on text controls -- returns an error for other controls, but doesn't do anything,
// so the error is irrelevant
SetControlData(inControl, kControlEntireControl, 'stim' /* kControlStaticTextIsMultilineTag */, sizeof(Boolean), &bValue);
-
+
SInt16 baseLineOffset;
Rect bestRect;
- OSErr err = GetBestControlRect(inControl, &bestRect, &baseLineOffset);
+ OSErr err = GetBestControlRect(inControl, &bestRect, &baseLineOffset);
if (err != noErr) return false;
-
+
int width = (bestRect.right - bestRect.left) + 1;
int height = (bestRect.bottom - bestRect.top) + 1;
-
+
Rect boundsRect;
GetControlBounds (inControl, &boundsRect);
-
+
Rect newRect;
newRect.top = boundsRect.top;
newRect.bottom = newRect.top + height;
newRect.left = boundsRect.left;
newRect.right = newRect.left + width;
-
+
SetControlBounds (inControl, &newRect);
-
+
if (outWidth)
*outWidth = width;
-
+
if (outHeight)
*outHeight = height;
-#endif
+#endif
return true;
}
#pragma mark ___AUPropertyControl
bool AUPropertyControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef event)
-{
+{
UInt32 eclass = GetEventClass(event);
UInt32 ekind = GetEventKind(event);
switch (eclass) {
@@ -477,14 +477,14 @@ void AUPropertyControl::RegisterEvents ()
EventTypeSpec events[] = {
{ kEventClassControl, kEventControlValueFieldChanged } // N.B. OS X only
};
-
+
WantEventTypes(GetControlEventTarget(mControl), GetEventTypeCount(events), events);
#endif
}
-void AUPropertyControl::EmbedControl (ControlRef theControl)
-{
- mView->EmbedControl (theControl);
+void AUPropertyControl::EmbedControl (ControlRef theControl)
+{
+ mView->EmbedControl (theControl);
}
WindowRef AUPropertyControl::GetCarbonWindow()
@@ -498,11 +498,11 @@ static CFStringRef kStringFactoryPreset = kAUViewLocalizedStringKey_FactoryPrese
static bool sAUVPresetLocalized = false;
#endif
-AUVPresets::AUVPresets (AUCarbonViewBase* inParentView,
+AUVPresets::AUVPresets (AUCarbonViewBase* inParentView,
CFArrayRef& inPresets,
- Point inLocation,
- int nameWidth,
- int controlWidth,
+ Point inLocation,
+ int nameWidth,
+ int controlWidth,
ControlFontStyleRec & inFontStyle)
: AUPropertyControl (inParentView),
mPresets (inPresets),
@@ -510,13 +510,13 @@ AUVPresets::AUVPresets (AUCarbonViewBase* inParentView,
{
#if !__LP64__
Rect r;
-
+
// ok we now have an array of factory presets
// get their strings and display them
r.top = inLocation.v; r.bottom = r.top;
r.left = inLocation.h; r.right = r.left;
-
+
// localize as necessary
if (!sAUVPresetLocalized) {
CFBundleRef mainBundle = CFBundleGetBundleWithIdentifier(kLocalizedStringBundle_AUView);
@@ -527,86 +527,86 @@ AUVPresets::AUVPresets (AUCarbonViewBase* inParentView,
sAUVPresetLocalized = true;
}
}
-
+
// create localized title string
CFMutableStringRef factoryPresetsTitle = CFStringCreateMutable(NULL, 0);
CFStringAppend(factoryPresetsTitle, kStringFactoryPreset);
CFStringAppend(factoryPresetsTitle, kAUViewUnlocalizedString_TitleSeparator);
-
+
ControlRef theControl;
verify_noerr(CreateStaticTextControl(mView->GetCarbonWindow(), &r, factoryPresetsTitle, &inFontStyle, &theControl));
SInt16 width = 0;
AUCarbonViewControl::SizeControlToFit(theControl, &width, &mHeight);
CFRelease(factoryPresetsTitle);
EmbedControl(theControl);
-
+
r.top -= 2;
r.left += width + 10;
r.right = r.left;
r.bottom = r.top;
-
- verify_noerr(CreatePopupButtonControl ( mView->GetCarbonWindow(), &r, NULL,
+
+ verify_noerr(CreatePopupButtonControl ( mView->GetCarbonWindow(), &r, NULL,
-12345, // DON'T GET MENU FROM RESOURCE mMenuID,!!!
- FALSE, // variableWidth,
- 0, // titleWidth,
- 0, // titleJustification,
- 0, // titleStyle,
+ FALSE, // variableWidth,
+ 0, // titleWidth,
+ 0, // titleJustification,
+ 0, // titleStyle,
&mControl));
-
+
MenuRef menuRef;
verify_noerr(CreateNewMenu(1, 0, &menuRef));
-
+
int numPresets = CFArrayGetCount(mPresets);
-
+
for (int i = 0; i < numPresets; ++i)
{
AUPreset* preset = (AUPreset*) CFArrayGetValueAtIndex (mPresets, i);
verify_noerr(AppendMenuItemTextWithCFString (menuRef, preset->presetName, 0, 0, 0));
}
-
+
verify_noerr(SetControlData(mControl, 0, kControlPopupButtonMenuRefTag, sizeof(menuRef), &menuRef));
verify_noerr (SetControlFontStyle (mControl, &inFontStyle));
-
+
SetControl32BitMaximum (mControl, numPresets);
-
+
// size popup
SInt16 height = 0;
-
+
AUCarbonViewControl::SizeControlToFit(mControl, &width, &height);
-
+
if (height > mHeight) mHeight = height;
if (mHeight < 0) mHeight = 0;
-
+
// find which menu item is the Default preset
UInt32 propertySize = sizeof(AUPreset);
AUPreset defaultPreset;
- OSStatus result = AudioUnitGetProperty (mView->GetEditAudioUnit(),
+ OSStatus result = AudioUnitGetProperty (mView->GetEditAudioUnit(),
kAudioUnitProperty_PresentPreset,
- kAudioUnitScope_Global,
- 0,
- &defaultPreset,
+ kAudioUnitScope_Global,
+ 0,
+ &defaultPreset,
&propertySize);
-
+
mPropertyID = kAudioUnitProperty_PresentPreset;
-#endif
+#endif
#ifndef __LP64__
if (result != noErr) { // if the PresentPreset property is not implemented, fall back to the CurrentPreset property
- OSStatus result = AudioUnitGetProperty (mView->GetEditAudioUnit(),
+ OSStatus result = AudioUnitGetProperty (mView->GetEditAudioUnit(),
kAudioUnitProperty_CurrentPreset,
- kAudioUnitScope_Global,
- 0,
- &defaultPreset,
+ kAudioUnitScope_Global,
+ 0,
+ &defaultPreset,
&propertySize);
mPropertyID = kAudioUnitProperty_CurrentPreset;
if (result == noErr)
CFRetain (defaultPreset.presetName);
- }
+ }
#endif
-#if !__LP64__
+#if !__LP64__
EmbedControl (mControl);
-
+
HandlePropertyChange(defaultPreset);
-
+
RegisterEvents();
#endif
}
@@ -620,7 +620,7 @@ void AUVPresets::AddInterest (AUEventListenerRef inListener,
e.mArgument.mProperty.mPropertyID = mPropertyID;
e.mArgument.mProperty.mScope = kAudioUnitScope_Global;
e.mArgument.mProperty.mElement = 0;
-
+
AUEventListenerAddEventType(inListener, inObject, &e);
}
@@ -644,14 +644,14 @@ void AUVPresets::HandleControlChange ()
if (i > 0)
{
AUPreset* preset = (AUPreset*) CFArrayGetValueAtIndex (mPresets, i-1);
-
- verify_noerr(AudioUnitSetProperty (mView->GetEditAudioUnit(),
+
+ verify_noerr(AudioUnitSetProperty (mView->GetEditAudioUnit(),
mPropertyID, // either currentPreset or PresentPreset depending on which is supported
- kAudioUnitScope_Global,
- 0,
- preset,
+ kAudioUnitScope_Global,
+ 0,
+ preset,
sizeof(AUPreset)));
-
+
// when we change a preset we can't expect the AU to update its state
// as it isn't meant to know that its being viewed!
// so we broadcast a notification to all listeners that all parameters on this AU have changed
@@ -663,12 +663,12 @@ void AUVPresets::HandleControlChange ()
#endif
}
-void AUVPresets::HandlePropertyChange(AUPreset &preset)
+void AUVPresets::HandlePropertyChange(AUPreset &preset)
{
#if !__LP64__
// check to see if the preset is in our menu
int numPresets = CFArrayGetCount(mPresets);
- if (preset.presetNumber < 0) {
+ if (preset.presetNumber < 0) {
SetControl32BitValue (mControl, 0); //controls are one-based
} else {
for (SInt32 i = 0; i < numPresets; ++i) {
@@ -679,7 +679,7 @@ void AUVPresets::HandlePropertyChange(AUPreset &preset)
}
}
}
-
+
if (preset.presetName)
CFRelease (preset.presetName);
#endif
@@ -687,16 +687,16 @@ void AUVPresets::HandlePropertyChange(AUPreset &preset)
bool AUVPresets::HandlePropertyChange (const AudioUnitProperty &inProp)
{
- if (inProp.mPropertyID == mPropertyID)
+ if (inProp.mPropertyID == mPropertyID)
{
UInt32 theSize = sizeof(AUPreset);
AUPreset currentPreset;
-
- OSStatus result = AudioUnitGetProperty(inProp.mAudioUnit,
- inProp.mPropertyID,
- inProp.mScope,
+
+ OSStatus result = AudioUnitGetProperty(inProp.mAudioUnit,
+ inProp.mPropertyID,
+ inProp.mScope,
inProp.mElement, &currentPreset, &theSize);
-
+
if (result == noErr) {
#ifndef __LP64__
if (inProp.mPropertyID == kAudioUnitProperty_CurrentPreset && currentPreset.presetName)
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.h
index 3d5f975614..b22e992ede 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.h
@@ -2,14 +2,14 @@
File: AUCarbonViewControl.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 __AUCarbonViewControl_h__
#define __AUCarbonViewControl_h__
@@ -69,7 +69,7 @@ public:
kTypeDiscrete, // e.g. pop-up menu
kTypeText
};
-
+
AUCarbonViewControl(AUCarbonViewBase *ownerView, AUParameterListenerRef listener, ControlType type, const CAAUParameter &param, ControlRef control);
~AUCarbonViewControl();
@@ -80,7 +80,7 @@ public:
virtual void ControlToParameter();
/*! @method ParameterToControl */
virtual void ParameterToControl(Float32 newValue);
-
+
/*! @method SetValueFract */
virtual void SetValueFract(double value);
/*! @method GetValueFract */
@@ -93,34 +93,34 @@ public:
virtual void SetValue(long value);
/*! @method GetValue */
virtual long GetValue();
-
+
/*! @method GetOwnerView */
AUCarbonViewBase * GetOwnerView() {return mOwnerView;}
/*! @method Update */
- void Update (bool inUIThread)
- {
+ void Update (bool inUIThread)
+ {
if (inUIThread)
ParameterToControl (mParam.GetValue());
else
AUParameterListenerNotify (mListener, this, &mParam);
}
-
-
+
+
// CarbonEventHandler overrides
/*! @method HandleEvent */
virtual bool HandleEvent(EventHandlerCallRef inHandlerRef, EventRef event);
-
+
/*! @method ControlRef */
operator ControlRef() { return mControl; }
-
+
/*! @method SizeControlToFit */
static Boolean SizeControlToFit(ControlRef inControl, SInt16 *outWidth = NULL, SInt16 *outHeight = NULL);
-
+
/*! @method SliderTrackProc */
static pascal void SliderTrackProc(ControlRef theControl, ControlPartCode partCode);
/*! @method NumericKeyFilterCallback */
- static pascal ControlKeyFilterResult NumericKeyFilterCallback(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode,
+ static pascal ControlKeyFilterResult NumericKeyFilterCallback(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode,
EventModifiers *modifiers);
protected:
/*! @method ParamInfo */
@@ -137,12 +137,12 @@ protected:
/*! @var mControl */
ControlRef mControl;
-
+
/*! @method StdKeyFilterCallback */
- static pascal ControlKeyFilterResult StdKeyFilterCallback(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode,
+ static pascal ControlKeyFilterResult StdKeyFilterCallback(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode,
EventModifiers *modifiers);
SInt16 mInControlInitialization;
-
+
static AUCarbonViewControl* mLastControl;
};
@@ -151,34 +151,34 @@ class AUPropertyControl : public CarbonEventHandler {
public:
/*! @ctor AUPropertyControl */
AUPropertyControl (AUCarbonViewBase * inBase) : mControl(0), mView (inBase), mHeight(0) {}
-
+
/*! @method HandleEvent */
virtual bool HandleEvent(EventHandlerCallRef inHandlerRef, EventRef event);
/*! @method HandlePropertyChange */
virtual bool HandlePropertyChange (const AudioUnitProperty &inProp) = 0;
-
+
/*! @method AddInterest */
virtual void AddInterest (AUEventListenerRef inListener,
void * inObject) = 0;
-
+
/*! @method RemoveInterest */
virtual void RemoveInterest (AUEventListenerRef inListener,
void * inObject) = 0;
-
+
/*! @method GetHeight */
int GetHeight() { return mHeight;}
-
+
protected:
/*! @method HandleControlChange */
- virtual void HandleControlChange () = 0;
+ virtual void HandleControlChange () = 0;
/*! @method RegisterEvents */
void RegisterEvents ();
/*! @method EmbedControl */
void EmbedControl (ControlRef theControl);
-
+
/*! @method GetCarbonWindow */
WindowRef GetCarbonWindow();
@@ -194,30 +194,30 @@ protected:
class AUVPresets : public AUPropertyControl {
public:
/*! @ctor HandleControlChange */
- AUVPresets (AUCarbonViewBase * inBase,
+ AUVPresets (AUCarbonViewBase * inBase,
CFArrayRef& inPresets,
- Point inLocation,
- int nameWidth,
- int controlWidth,
+ Point inLocation,
+ int nameWidth,
+ int controlWidth,
ControlFontStyleRec & inFontStyle);
virtual ~AUVPresets () { CFRelease (mPresets); }
/*! @method HandlePropertyChange */
virtual bool HandlePropertyChange (const AudioUnitProperty &inProp);
-
+
/*! @method AddInterest */
virtual void AddInterest (AUEventListenerRef inListener,
void * inObject);
-
+
/*! @method RemoveInterest */
virtual void RemoveInterest (AUEventListenerRef inListener,
void * inObject);
protected:
/*! @method HandleControlChange */
- virtual void HandleControlChange ();
-
+ virtual void HandleControlChange ();
+
/*! @var mPresets */
CFArrayRef mPresets;
/*! @var mView */
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp
index 15a04e827e..2762a675d1 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp
@@ -2,14 +2,14 @@
File: AUCarbonViewDispatch.cpp
Abstract: AUCarbonViewDispatch.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 "AUCarbonViewBase.h"
@@ -93,7 +93,7 @@ OSStatus AUCarbonViewBase::ComponentEntryDispatch(ComponentParameters *p, AUCar
if (This == NULL) return paramErr;
OSStatus result = noErr;
-
+
switch (p->what) {
case kAudioUnitCarbonViewCreateSelect:
{
@@ -104,7 +104,7 @@ OSStatus AUCarbonViewBase::ComponentEntryDispatch(ComponentParameters *p, AUCar
CheckNull(pb->inSize);
CheckNull(pb->inLocation);
CheckNull(pb->outControl);
- result = This->CreateCarbonView(pb->inAudioUnit, pb->inWindow, pb->inParentControl,
+ result = This->CreateCarbonView(pb->inAudioUnit, pb->inWindow, pb->inParentControl,
*pb->inLocation, *pb->inSize, *pb->outControl);
}
break;
@@ -116,7 +116,7 @@ OSStatus AUCarbonViewBase::ComponentEntryDispatch(ComponentParameters *p, AUCar
}
break;
#endif
-
+
default:
result = ComponentBase::ComponentEntryDispatch(p, This);
break;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.cpp
index 8976b401c0..d0b7b4107a 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.cpp
@@ -2,14 +2,14 @@
File: AUControlGroup.cpp
Abstract: AUControlGroup.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 <Carbon/Carbon.h>
#include "AUCarbonViewBase.h"
@@ -59,10 +59,10 @@ static bool sLocalized = false;
#endif
void AUControlGroup::CreateLabelledSlider(
- AUCarbonViewBase * auView,
- const CAAUParameter & auvp,
- const Rect & area,
- Point labelSize,
+ AUCarbonViewBase * auView,
+ const CAAUParameter & auvp,
+ const Rect & area,
+ Point labelSize,
const ControlFontStyleRec & inFontStyle)
{
#if !__LP64__
@@ -73,14 +73,14 @@ void AUControlGroup::CreateLabelledSlider(
CFStringRef cfstr;
int sliderValueMax, sliderValueMin, sliderValueDefault;
AUCarbonViewControl::ControlType sliderType;
-
+
bool horizontal = (width > height);
if (horizontal) {
maxValRect.top = minValRect.top = area.top + (height - labelSize.v) / 2;
minValRect.left = area.left;
maxValRect.left = area.right - labelSize.h;
-
+
minValRect.bottom = minValRect.top + labelSize.v;
minValRect.right = minValRect.left + labelSize.h;
maxValRect.bottom = maxValRect.top + labelSize.v;
@@ -104,12 +104,12 @@ void AUControlGroup::CreateLabelledSlider(
maxValRect.left = minValRect.left = area.left + (width - labelSize.h) / 2;
maxValRect.top = area.top;
minValRect.top = area.bottom - labelSize.v;
-
+
minValRect.bottom = minValRect.top + labelSize.v;
minValRect.right = minValRect.left + labelSize.h;
maxValRect.bottom = maxValRect.top + labelSize.v;
maxValRect.right = maxValRect.left + labelSize.h;
-
+
sliderRect.left = area.left + (width - kSliderThinDimension) / 2;
sliderRect.right = sliderRect.left + kSliderThinDimension + 4;
sliderRect.top = maxValRect.bottom + kLabelAndSliderSpacing;
@@ -117,7 +117,7 @@ void AUControlGroup::CreateLabelledSlider(
if (auvp.IsIndexedParam ()) {
sliderValueMin = sliderValueDefault = int(auvp.ParamInfo().minValue);
- sliderValueMax = int(auvp.ParamInfo().maxValue);
+ sliderValueMax = int(auvp.ParamInfo().maxValue);
sliderType = AUCarbonViewControl::kTypeDiscrete;
} else {
sliderValueMin = sliderValueDefault = 0;
@@ -134,7 +134,7 @@ void AUControlGroup::CreateLabelledSlider(
verify_noerr(CreateStaticTextControl(auView->GetCarbonWindow(), &minValRect, cfstr, &fontStyle, &newControl));
CFRelease(cfstr);
verify_noerr(auView->EmbedControl(newControl));
-
+
// maximum value label
cfstr = auvp.GetStringFromValueCopy(&auvp.ParamInfo().maxValue);
fontStyle.just = horizontal ? teFlushLeft : teCenter;
@@ -142,7 +142,7 @@ void AUControlGroup::CreateLabelledSlider(
CFRelease(cfstr);
verify_noerr(auView->EmbedControl(newControl));
}
-
+
// slider
verify_noerr(CreateSliderControl(auView->GetCarbonWindow(), &sliderRect, sliderValueDefault, sliderValueMin, sliderValueMax, kControlSliderDoesNotPoint, 0, true, AUCarbonViewControl::SliderTrackProc, &newControl));
@@ -154,10 +154,10 @@ void AUControlGroup::CreateLabelledSlider(
}
void AUControlGroup::CreateLabelledSliderAndEditText(
- AUCarbonViewBase * auView,
- const CAAUParameter & auvp,
- const Rect & area,
- Point labelSize,
+ AUCarbonViewBase * auView,
+ const CAAUParameter & auvp,
+ const Rect & area,
+ Point labelSize,
Point editTextSize,
const ControlFontStyleRec & inFontStyle)
{
@@ -166,7 +166,7 @@ void AUControlGroup::CreateLabelledSliderAndEditText(
Rect sliderArea, textArea;
ControlRef newControl;
int width = area.right - area.left, height = area.bottom - area.top;
-
+
bool horizontal = (width > height);
sliderArea = area;
@@ -188,55 +188,55 @@ void AUControlGroup::CreateLabelledSliderAndEditText(
textArea.right = textArea.left + editTextSize.h;
}
CreateLabelledSlider(auView, auvp, sliderArea, labelSize, fontStyle);
-
- verify_noerr(CreateEditUnicodeTextControl(auView->GetCarbonWindow(), &textArea, CFSTR(""), false,
+
+ verify_noerr(CreateEditUnicodeTextControl(auView->GetCarbonWindow(), &textArea, CFSTR(""), false,
&fontStyle, &newControl));
auView->AddCarbonControl(AUCarbonViewControl::kTypeText, auvp, newControl);
#endif
}
-void AUControlGroup::CreatePopupMenu (AUCarbonViewBase * auView,
- const CAAUParameter & auvp,
- const Rect & area,
+void AUControlGroup::CreatePopupMenu (AUCarbonViewBase * auView,
+ const CAAUParameter & auvp,
+ const Rect & area,
const ControlFontStyleRec & inFontStyle,
const bool inSizeToFit)
{
#if !__LP64__
ControlRef thePopUp;
-
- verify_noerr(CreatePopupButtonControl (auView->GetCarbonWindow(), &area, NULL,
+
+ verify_noerr(CreatePopupButtonControl (auView->GetCarbonWindow(), &area, NULL,
-12345, // DON'T GET MENU FROM RESOURCE mMenuID
- FALSE, // variableWidth,
- 0, // titleWidth,
- 0, // titleJustification,
- 0, // titleStyle,
+ FALSE, // variableWidth,
+ 0, // titleWidth,
+ 0, // titleJustification,
+ 0, // titleStyle,
&thePopUp));
-
+
ControlSize small = kControlSizeSmall;
SetControlData(thePopUp, kControlEntireControl, kControlSizeTag, sizeof(ControlSize), &small);
-
+
MenuRef menuRef;
verify_noerr(CreateNewMenu( 1, 0, &menuRef));
-
+
for (int i = 0; i < auvp.GetNumIndexedParams(); ++i) {
verify_noerr(AppendMenuItemTextWithCFString (menuRef, auvp.GetParamName(i), kMenuItemAttrIgnoreMeta, 0, 0));
}
-
+
verify_noerr(SetControlData(thePopUp, 0, kControlPopupButtonMenuRefTag, sizeof(menuRef), &menuRef));
SetControl32BitMaximum(thePopUp, auvp.GetNumIndexedParams());
verify_noerr (SetControlFontStyle (thePopUp, &inFontStyle));
-
+
if (inSizeToFit) {
AUCarbonViewControl::SizeControlToFit(thePopUp);
}
-
+
auView->AddCarbonControl(AUCarbonViewControl::kTypeDiscrete, auvp, thePopUp);
#endif
}
-void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
- const Point & inLocation,
+void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
+ const Point & inLocation,
const SInt16 inRightOffset,
const SInt16 inTotalWidth)
{
@@ -245,14 +245,14 @@ void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
ComponentDescription desc;
Handle h1 = NewHandleClear(4);
OSStatus err = GetComponentInfo ((Component)auView->GetEditAudioUnit(), &desc, h1, 0, 0);
-
- if (err == noErr) {
+
+ if (err == noErr) {
// Get the manufacturer's name... look for the ':' character convention
HLock(h1);
char* ptr1 = *h1;
int len = *ptr1++;
char* displayStr = 0;
-
+
for (int i = 0; i < len; ++i) {
if (ptr1[i] == ':') { // found the name
ptr1[i++] = 0;
@@ -260,7 +260,7 @@ void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
break;
}
}
-
+
// localize as necessary:
if (!sLocalized) {
CFBundleRef mainBundle = CFBundleGetBundleWithIdentifier(kLocalizedStringBundle_AUView);
@@ -271,7 +271,7 @@ void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
sLocalized = true;
}
}
-
+
// display strings
ControlRef newControl;
Rect r;
@@ -279,7 +279,7 @@ void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
ControlFontStyleRec fontStyle;
fontStyle.flags = kControlUseFontMask | kControlUseJustMask;
fontStyle.font = kControlFontSmallBoldSystemFont;
-
+
// display manufacturer string
if (displayStr) {
CFMutableStringRef mfrstring = CFStringCreateMutable(NULL, 0);
@@ -291,15 +291,15 @@ void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
CFStringAppend(mfrstring, mfrname); // "Manufacturer: MFRName"
CFRelease (mfrname);
}
-
- r.left = inLocation.h + inRightOffset;
+
+ r.left = inLocation.h + inRightOffset;
r.right = inLocation.h + inTotalWidth - 28;
fontStyle.just = teFlushRight;
-
+
verify_noerr(CreateStaticTextControl(auView->GetCarbonWindow(), &r, mfrstring, &fontStyle, &newControl));
verify_noerr(auView->EmbedControl(newControl));
CFRelease (mfrstring);
-
+
//move displayStr ptr past the manu, to the name
// we move the characters down an index, because the handle doesn't have any room
// at the end for the \0
@@ -316,42 +316,42 @@ void AUControlGroup::AddAUInfo ( AUCarbonViewBase * auView,
displayStr[j] = displayStr[i];
++j; ++i;
} while (i < len);
-
+
displayStr[j] = 0;
}
-
+
// display AudioUnit string
r.left = inLocation.h; r.right = r.left + inRightOffset;
fontStyle.just = 0;
-
+
CFMutableStringRef cfstr = CFStringCreateMutable(NULL, 0);
CFStringAppend(cfstr, kAUViewLocalizedStringKey_AudioUnit); // "Audio Unit"
CFStringAppend(cfstr, kAUViewUnlocalizedString_TitleSeparator);
// "Audio Unit: "
-
+
CFStringRef auname = CFStringCreateWithCString(NULL, displayStr, kCFStringEncodingUTF8);
CFStringAppend(cfstr, auname); // "Audio Unit: AUName"
CFRelease (auname);
-
+
verify_noerr(CreateStaticTextControl(auView->GetCarbonWindow(), &r, cfstr, &fontStyle, &newControl));
-
+
// size text control correctly
Boolean bValue = false;
SetControlData(newControl, kControlEntireControl, 'stim' /* kControlStaticTextIsMultilineTag */, sizeof(Boolean), &bValue);
SInt16 baseLineOffset;
Rect bestRect;
- err = GetBestControlRect(newControl, &bestRect, &baseLineOffset);
+ err = GetBestControlRect(newControl, &bestRect, &baseLineOffset);
if (err == noErr)
{
int width = (bestRect.right - bestRect.left) + 1;
int height = (bestRect.bottom - bestRect.top) + 1;
SizeControl (newControl, width, height);
}
-
+
verify_noerr(auView->EmbedControl(newControl));
CFRelease (cfstr);
}
-
+
DisposeHandle (h1);
#endif
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.h
index 0e16100d2a..89ef4f29b7 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.h
@@ -2,14 +2,14 @@
File: AUControlGroup.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 __AUControlGroup_h__
#define __AUControlGroup_h__
@@ -57,31 +57,31 @@ class CAAUParameter;
class AUControlGroup {
public:
/*! @method CreateLabelledSlider */
- static void CreateLabelledSlider( AUCarbonViewBase * auView,
- const CAAUParameter & auvp,
- const Rect & area,
- Point labelSize,
+ static void CreateLabelledSlider( AUCarbonViewBase * auView,
+ const CAAUParameter & auvp,
+ const Rect & area,
+ Point labelSize,
const ControlFontStyleRec & fontStyle);
/*! @method CreateLabelledSliderAndEditText */
static void CreateLabelledSliderAndEditText(
- AUCarbonViewBase * auView,
- const CAAUParameter & auvp,
- const Rect & area,
- Point labelSize,
+ AUCarbonViewBase * auView,
+ const CAAUParameter & auvp,
+ const Rect & area,
+ Point labelSize,
Point editTextSize,
const ControlFontStyleRec & fontStyle);
/*! @method CreatePopupMenu */
- static void CreatePopupMenu ( AUCarbonViewBase * auView,
- const CAAUParameter & auvp,
- const Rect & area,
+ static void CreatePopupMenu ( AUCarbonViewBase * auView,
+ const CAAUParameter & auvp,
+ const Rect & area,
const ControlFontStyleRec & inFontStyle,
const bool inSizeToFit = false);
/*! @method AddAUInfo */
- static void AddAUInfo ( AUCarbonViewBase * auView,
- const Point & inLocation,
+ static void AddAUInfo ( AUCarbonViewBase * auView,
+ const Point & inLocation,
const SInt16 inRightOffset,
const SInt16 inTotalWidth);
};
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp
index fe9a731d1d..c935e3351b 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp
@@ -2,14 +2,14 @@
File: CarbonEventHandler.cpp
Abstract: CarbonEventHandler.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 "CarbonEventHandler.h"
@@ -65,22 +65,22 @@ CarbonEventHandler::~CarbonEventHandler()
int count = static_cast<int>(CFDictionaryGetCount(mHandlers));
EventHandlerRef *theHandlers = (EventHandlerRef*) malloc(count * sizeof(EventHandlerRef));
CFDictionaryGetKeysAndValues(mHandlers, NULL, (const void **)theHandlers);
-
+
for (int i = 0; i < count; i++)
RemoveEventHandler(theHandlers[i]);
CFDictionaryRemoveAllValues(mHandlers);
CFRelease (mHandlers);
free(theHandlers);
- }
+ }
}
void CarbonEventHandler::WantEventTypes(EventTargetRef target, UInt32 inNumTypes, const EventTypeSpec *inList)
{
if (mHandlers == NULL)
mHandlers = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
-
+
EventHandlerRef handler;
-
+
if (CFDictionaryGetValueIfPresent (mHandlers, target, (const void **)&handler)) // if there is already a handler for the target, add the type
verify_noerr(AddEventTypesToHandler(handler, inNumTypes, inList));
else {
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.h
index 9225e1acd7..b3231a8182 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.h
@@ -2,14 +2,14 @@
File: CarbonEventHandler.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 __CarbonEventHandler_h__
#define __CarbonEventHandler_h__
@@ -56,7 +56,7 @@ public:
CarbonEventHandler();
/*! @dtor ~CarbonEventHandler */
virtual ~CarbonEventHandler();
-
+
/*! @method WantEventTypes */
virtual void WantEventTypes(EventTargetRef target, UInt32 inNumTypes, const EventTypeSpec *inList);
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.cpp
index 1ce8b308b4..74336d92e0 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.cpp
@@ -2,14 +2,14 @@
File: AUInstrumentBase.cpp
Abstract: AUInstrumentBase.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 "AUInstrumentBase.h"
#include "AUMIDIDefs.h"
@@ -58,12 +58,12 @@
const UInt32 kEventQueueSize = 1024;
AUInstrumentBase::AUInstrumentBase(
- AudioComponentInstance inInstance,
+ AudioComponentInstance inInstance,
UInt32 numInputs,
UInt32 numOutputs,
UInt32 numGroups,
UInt32 numParts)
- : MusicDeviceBase(inInstance, numInputs, numOutputs, numGroups),
+ : MusicDeviceBase(inInstance, numInputs, numOutputs, numGroups),
mAbsoluteSampleFrame(0),
mEventQueue(kEventQueueSize),
mNumNotes(0),
@@ -79,7 +79,7 @@ AUInstrumentBase::AUInstrumentBase(
mFreeNotes.mState = kNoteState_Free;
SetWantsRenderThreadID(true);
}
-
+
AUInstrumentBase::~AUInstrumentBase()
{
@@ -100,12 +100,12 @@ AUElement * AUInstrumentBase::CreateElement(AudioUnitScope inScope, AudioUnitEle
return MusicDeviceBase::CreateElement(inScope, element);
}
-void AUInstrumentBase::CreateExtendedElements()
+void AUInstrumentBase::CreateExtendedElements()
{
Parts().Initialize(this, kAudioUnitScope_Part, mInitNumPartEls);
}
-AUScope * AUInstrumentBase::GetScopeExtended (AudioUnitScope inScope)
+AUScope * AUInstrumentBase::GetScopeExtended (AudioUnitScope inScope)
{
if (inScope == kAudioUnitScope_Part)
return &mPartScope;
@@ -122,7 +122,7 @@ void AUInstrumentBase::SetNotes(UInt32 inNumNotes, UInt32 inMaxActiveNotes, Syn
mMaxActiveNotes = inMaxActiveNotes;
mNoteSize = inNoteDataSize;
mNotes = inNotes;
-
+
for (UInt32 i=0; i<mNumNotes; ++i)
{
SynthNote *note = GetNote(i);
@@ -138,7 +138,7 @@ UInt32 AUInstrumentBase::CountActiveNotes()
for (UInt32 i=0; i<mNumNotes; ++i)
{
SynthNote *note = GetNote(i);
- if (note->GetState() <= kNoteState_Released)
+ if (note->GetState() <= kNoteState_Released)
sum++;
}
return sum;
@@ -165,16 +165,16 @@ OSStatus AUInstrumentBase::Initialize()
TO DO:
Currently ValidFormat will check and validate that the num channels is not being
changed if the AU doesn't support the SupportedNumChannels property - which is correct
-
+
What needs to happen here is that IFF the AU does support this property, (ie, the AU
can be configured to have different num channels than its original configuration) then
the state of the AU at Initialization needs to be validated.
-
+
This is work still to be done - see AUEffectBase for the kind of logic that needs to be applied here
*/
// override to call SetNotes
-
+
mNoteIDCounter = 128; // reset this every time we initialise
mAbsoluteSampleFrame = 0;
return noErr;
@@ -199,7 +199,7 @@ OSStatus AUInstrumentBase::Reset( AudioUnitScope inScope,
for (UInt32 i=0; i<mNumNotes; ++i)
{
SynthNote *note = GetNote(i);
- if (note->IsSounding())
+ if (note->IsSounding())
note->Kill(0);
note->ListRemove();
mFreeNotes.AddNote(note);
@@ -225,7 +225,7 @@ void AUInstrumentBase::PerformEvents(const AudioTimeStamp& inTimeStamp)
#endif
SynthEvent *event;
SynthGroupElement *group;
-
+
while ((event = mEventQueue.ReadItem()) != NULL)
{
#if DEBUG_PRINT_RENDER
@@ -270,12 +270,12 @@ void AUInstrumentBase::PerformEvents(const AudioTimeStamp& inTimeStamp)
group->ResetAllControllers(event->GetOffsetSampleFrame());
break;
}
-
+
mEventQueue.AdvanceReadPtr();
}
}
-
+
OSStatus AUInstrumentBase::Render( AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
UInt32 inNumberFrames)
@@ -311,18 +311,18 @@ OSStatus AUInstrumentBase::Render( AudioUnitRenderActionFlags & ioActionFlag
bool AUInstrumentBase::ValidFormat( AudioUnitScope inScope,
AudioUnitElement inElement,
const CAStreamBasicDescription & inNewFormat)
-{
+{
// if the AU supports this, then we should just let this go through to the Init call
- if (SupportedNumChannels (NULL))
+ if (SupportedNumChannels (NULL))
return MusicDeviceBase::ValidFormat(inScope, inElement, inNewFormat);
bool isGood = MusicDeviceBase::ValidFormat (inScope, inElement, inNewFormat);
if (!isGood) return false;
-
+
// if we get to here, then the basic criteria is that the
// num channels cannot change on an existing bus
AUIOElement *el = GetIOElement (inScope, inElement);
- return (el->GetStreamFormat().NumberChannels() == inNewFormat.NumberChannels());
+ return (el->GetStreamFormat().NumberChannels() == inNewFormat.NumberChannels());
}
@@ -333,8 +333,8 @@ bool AUInstrumentBase::StreamFormatWritable( AudioUnitScope scope,
}
OSStatus AUInstrumentBase::RealTimeStartNote( SynthGroupElement *inGroup,
- NoteInstanceID inNoteInstanceID,
- UInt32 inOffsetSampleFrame,
+ NoteInstanceID inNoteInstanceID,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams)
{
return noErr;
@@ -358,10 +358,10 @@ SynthGroupElement * AUInstrumentBase::GetElForGroupID (MusicDeviceGroupID inGrou
AUScope & groups = Groups();
unsigned int numEls = groups.GetNumberOfElements();
SynthGroupElement* unassignedEl = NULL;
-
+
for (unsigned int i = 0; i < numEls; ++i) {
SynthGroupElement* el = reinterpret_cast<SynthGroupElement*>(groups.GetElement(i));
- if (el->GroupID() == inGroupID)
+ if (el->GroupID() == inGroupID)
return el;
if (el->GroupID() == SynthGroupElement::kUnassignedGroup) {
unassignedEl = el;
@@ -376,14 +376,14 @@ SynthGroupElement * AUInstrumentBase::GetElForGroupID (MusicDeviceGroupID inGrou
}
OSStatus AUInstrumentBase::RealTimeStopNote(
- MusicDeviceGroupID inGroupID,
- NoteInstanceID inNoteInstanceID,
+ MusicDeviceGroupID inGroupID,
+ NoteInstanceID inNoteInstanceID,
UInt32 inOffsetSampleFrame)
{
#if DEBUG_PRINT
printf("AUInstrumentBase::RealTimeStopNote ch %d id %d\n", inGroupID, inNoteInstanceID);
#endif
-
+
SynthGroupElement *gp = (inGroupID == kMusicNoteEvent_Unused
? GetElForNoteID (inNoteInstanceID)
: GetElForGroupID(inGroupID));
@@ -391,7 +391,7 @@ OSStatus AUInstrumentBase::RealTimeStopNote(
{
gp->NoteOff (inNoteInstanceID, inOffsetSampleFrame);
}
-
+
return noErr;
}
@@ -402,7 +402,7 @@ SynthGroupElement * AUInstrumentBase::GetElForNoteID (NoteInstanceID inNoteID)
#endif
AUScope & groups = Groups();
unsigned int numEls = groups.GetNumberOfElements();
-
+
for (unsigned int i = 0; i < numEls; ++i) {
SynthGroupElement* el = reinterpret_cast<SynthGroupElement*>(groups.GetElement(i));
if (el->GetNote(inNoteID) != NULL) // searches for any note state
@@ -411,27 +411,27 @@ SynthGroupElement * AUInstrumentBase::GetElForNoteID (NoteInstanceID inNoteID)
throw static_cast<OSStatus>(kAudioUnitErr_InvalidElement);
}
-OSStatus AUInstrumentBase::StartNote( MusicDeviceInstrumentID inInstrument,
- MusicDeviceGroupID inGroupID,
- NoteInstanceID * outNoteInstanceID,
- UInt32 inOffsetSampleFrame,
+OSStatus AUInstrumentBase::StartNote( MusicDeviceInstrumentID inInstrument,
+ MusicDeviceGroupID inGroupID,
+ NoteInstanceID * outNoteInstanceID,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams)
{
OSStatus err = noErr;
-
- NoteInstanceID noteID;
+
+ NoteInstanceID noteID;
if (outNoteInstanceID) {
noteID = NextNoteID();
*outNoteInstanceID = noteID;
} else
noteID = (UInt32)inParams.mPitch;
-
+
#if DEBUG_PRINT
printf("AUInstrumentBase::StartNote ch %u, key %u, offset %u\n", inGroupID, (unsigned) inParams.mPitch, inOffsetSampleFrame);
#endif
if (InRenderThread ())
- {
+ {
err = RealTimeStartNote(
GetElForGroupID(inGroupID),
noteID,
@@ -450,14 +450,14 @@ OSStatus AUInstrumentBase::StartNote( MusicDeviceInstrumentID inInstrument,
inOffsetSampleFrame,
&inParams
);
-
+
mEventQueue.AdvanceWritePtr();
}
return err;
}
-OSStatus AUInstrumentBase::StopNote( MusicDeviceGroupID inGroupID,
- NoteInstanceID inNoteInstanceID,
+OSStatus AUInstrumentBase::StopNote( MusicDeviceGroupID inGroupID,
+ NoteInstanceID inNoteInstanceID,
UInt32 inOffsetSampleFrame)
{
#if DEBUG_PRINT
@@ -466,7 +466,7 @@ OSStatus AUInstrumentBase::StopNote( MusicDeviceGroupID inGroupID,
OSStatus err = noErr;
if (InRenderThread ())
- {
+ {
err = RealTimeStopNote(
inGroupID,
inNoteInstanceID,
@@ -484,7 +484,7 @@ OSStatus AUInstrumentBase::StopNote( MusicDeviceGroupID inGroupID,
inOffsetSampleFrame,
NULL
);
-
+
mEventQueue.AdvanceWritePtr();
}
return err;
@@ -492,13 +492,13 @@ OSStatus AUInstrumentBase::StopNote( MusicDeviceGroupID inGroupID,
OSStatus AUInstrumentBase::SendPedalEvent(MusicDeviceGroupID inGroupID, UInt32 inEventType, UInt32 inOffsetSampleFrame)
{
-
+
if (InRenderThread ())
{
SynthGroupElement *group = GetElForGroupID(inGroupID);
if (!group)
return kAudioUnitErr_InvalidElement;
-
+
switch (inEventType)
{
case SynthEvent::kEventType_SustainOn :
@@ -532,7 +532,7 @@ OSStatus AUInstrumentBase::SendPedalEvent(MusicDeviceGroupID inGroupID, UInt32 i
if (!event) return -1; // queue full
event->Set(inEventType, inGroupID, 0, 0, NULL);
-
+
mEventQueue.AdvanceWritePtr();
}
return noErr;
@@ -576,7 +576,7 @@ OSStatus AUInstrumentBase::HandleControlChange( UInt8 inChannel,
}
return noErr;
}
-
+
OSStatus AUInstrumentBase::HandlePitchWheel( UInt8 inChannel,
UInt8 inPitch1, // LSB
UInt8 inPitch2, // MSB
@@ -592,7 +592,7 @@ OSStatus AUInstrumentBase::HandlePitchWheel( UInt8 inChannel,
return kAudioUnitErr_InvalidElement;
}
-
+
OSStatus AUInstrumentBase::HandleChannelPressure(UInt8 inChannel,
UInt8 inValue,
UInt32 inStartFrame)
@@ -647,13 +647,13 @@ OSStatus AUInstrumentBase::HandleResetAllControllers( UInt8 inChannel)
return SendPedalEvent (inChannel, SynthEvent::kEventType_ResetAllControllers, 0);
}
-
+
OSStatus AUInstrumentBase::HandleAllNotesOff( UInt8 inChannel)
{
return SendPedalEvent (inChannel, SynthEvent::kEventType_AllNotesOff, 0);
}
-
+
OSStatus AUInstrumentBase::HandleAllSoundOff( UInt8 inChannel)
{
return SendPedalEvent (inChannel, SynthEvent::kEventType_AllSoundOff, 0);
@@ -670,7 +670,7 @@ SynthNote* AUInstrumentBase::GetAFreeNote(UInt32 inFrame)
mFreeNotes.RemoveNote(note);
return note;
}
-
+
return VoiceStealing(inFrame, true);
}
@@ -724,13 +724,13 @@ SynthNote* AUInstrumentBase::VoiceStealing(UInt32 inFrame, bool inKillIt)
#if DEBUG_PRINT_NOTE
printf("no notes to steal????\n");
#endif
- return NULL; // It should be impossible to get here. It means there were no notes to kill in any state.
+ return NULL; // It should be impossible to get here. It means there were no notes to kill in any state.
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
AUMonotimbralInstrumentBase::AUMonotimbralInstrumentBase(
- AudioComponentInstance inInstance,
+ AudioComponentInstance inInstance,
UInt32 numInputs,
UInt32 numOutputs,
UInt32 numGroups,
@@ -739,28 +739,28 @@ AUMonotimbralInstrumentBase::AUMonotimbralInstrumentBase(
{
}
-OSStatus AUMonotimbralInstrumentBase::RealTimeStartNote(
- SynthGroupElement *inGroup,
- NoteInstanceID inNoteInstanceID,
- UInt32 inOffsetSampleFrame,
+OSStatus AUMonotimbralInstrumentBase::RealTimeStartNote(
+ SynthGroupElement *inGroup,
+ NoteInstanceID inNoteInstanceID,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams)
{
#if DEBUG_PRINT_RENDER
printf("AUMonotimbralInstrumentBase::RealTimeStartNote %d\n", inNoteInstanceID);
#endif
- if (NumActiveNotes() + 1 > MaxActiveNotes())
+ if (NumActiveNotes() + 1 > MaxActiveNotes())
{
VoiceStealing(inOffsetSampleFrame, false);
}
SynthNote *note = GetAFreeNote(inOffsetSampleFrame);
if (!note) return -1;
-
+
SynthPartElement *part = GetPartElement (0); // Only one part for monotimbral
-
+
IncNumActiveNotes();
inGroup->NoteOn(note, part, inNoteInstanceID, inOffsetSampleFrame, inParams);
-
+
return noErr;
}
@@ -774,8 +774,8 @@ OSStatus AUMultitimbralInstrumentBase::GetPropertyInfo(AudioUnitPropertyID inI
Boolean & outWritable)
{
OSStatus result = noErr;
-
- switch (inID)
+
+ switch (inID)
{
#if !TARGET_OS_IPHONE
case kMusicDeviceProperty_PartGroup:
@@ -797,7 +797,7 @@ OSStatus AUMultitimbralInstrumentBase::GetProperty( AudioUnitPropertyID inID,
{
OSStatus result = noErr;
- switch (inID)
+ switch (inID)
{
#if !TARGET_OS_IPHONE
case kMusicDeviceProperty_PartGroup:
@@ -809,7 +809,7 @@ OSStatus AUMultitimbralInstrumentBase::GetProperty( AudioUnitPropertyID inID,
default:
result = AUInstrumentBase::GetProperty (inID, inScope, inElement, outData);
}
-
+
return result;
}
@@ -823,7 +823,7 @@ OSStatus AUMultitimbralInstrumentBase::SetProperty( AudioUnitPropertyID in
{
OSStatus result = noErr;
- switch (inID)
+ switch (inID)
{
#if !TARGET_OS_IPHONE
case kMusicDeviceProperty_PartGroup:
@@ -835,7 +835,7 @@ OSStatus AUMultitimbralInstrumentBase::SetProperty( AudioUnitPropertyID in
default:
result = MusicDeviceBase::SetProperty (inID, inScope, inElement, inData, inDataSize);
}
-
+
return result;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.h
index 3ad7e03a66..7e3bfbf66c 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/AUInstrumentBase.h
@@ -2,14 +2,14 @@
File: AUInstrumentBase.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 __AUInstrumentBase__
#define __AUInstrumentBase__
@@ -66,7 +66,7 @@ class AUInstrumentBase : public MusicDeviceBase
{
public:
AUInstrumentBase(
- AudioComponentInstance inInstance,
+ AudioComponentInstance inInstance,
UInt32 numInputs,
UInt32 numOutputs,
UInt32 numGroups = 16,
@@ -74,7 +74,7 @@ public:
virtual ~AUInstrumentBase();
virtual OSStatus Initialize();
-
+
/*! @method Parts */
AUScope & Parts() { return mPartScope; }
@@ -92,10 +92,10 @@ public:
virtual void CreateExtendedElements();
virtual void Cleanup();
-
+
virtual OSStatus Reset( AudioUnitScope inScope,
AudioUnitElement inElement);
-
+
virtual bool ValidFormat( AudioUnitScope inScope,
AudioUnitElement inElement,
const CAStreamBasicDescription & inNewFormat);
@@ -109,35 +109,35 @@ public:
const AudioTimeStamp & inTimeStamp,
UInt32 inNumberFrames);
- 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);
- virtual OSStatus StopNote( MusicDeviceGroupID inGroupID,
- NoteInstanceID inNoteInstanceID,
+ virtual OSStatus StopNote( MusicDeviceGroupID inGroupID,
+ NoteInstanceID inNoteInstanceID,
UInt32 inOffsetSampleFrame);
virtual OSStatus RealTimeStartNote( SynthGroupElement *inGroup,
- NoteInstanceID inNoteInstanceID,
- UInt32 inOffsetSampleFrame,
+ NoteInstanceID inNoteInstanceID,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams);
-
- virtual OSStatus RealTimeStopNote( MusicDeviceGroupID inGroupID,
- NoteInstanceID inNoteInstanceID,
+
+ virtual OSStatus RealTimeStopNote( MusicDeviceGroupID inGroupID,
+ NoteInstanceID inNoteInstanceID,
UInt32 inOffsetSampleFrame);
-
+
virtual OSStatus HandleControlChange( UInt8 inChannel,
UInt8 inController,
UInt8 inValue,
UInt32 inStartFrame);
-
+
virtual OSStatus HandlePitchWheel( UInt8 inChannel,
UInt8 inPitch1,
UInt8 inPitch2,
UInt32 inStartFrame);
-
+
virtual OSStatus HandleChannelPressure( UInt8 inChannel,
UInt8 inValue,
UInt32 inStartFrame);
@@ -151,31 +151,31 @@ public:
UInt32 inStartFrame);
virtual OSStatus HandleResetAllControllers( UInt8 inChannel);
-
+
virtual OSStatus HandleAllNotesOff( UInt8 inChannel);
-
+
virtual OSStatus HandleAllSoundOff( UInt8 inChannel);
- SynthNote* GetNote(UInt32 inIndex)
- {
+ SynthNote* GetNote(UInt32 inIndex)
+ {
if (!mNotes)
throw std::runtime_error("no notes");
- return (SynthNote*)((char*)mNotes + inIndex * mNoteSize);
+ return (SynthNote*)((char*)mNotes + inIndex * mNoteSize);
}
-
+
SynthNote* GetAFreeNote(UInt32 inFrame);
void AddFreeNote(SynthNote* inNote);
-
+
friend class SynthGroupElement;
protected:
UInt32 NextNoteID() { return OSAtomicIncrement32((int32_t *)&mNoteIDCounter); }
-
-
- // call SetNotes in your Initialize() method to give the base class your note structures and to set the maximum
+
+
+ // call SetNotes in your Initialize() method to give the base class your note structures and to set the maximum
// number of active notes. inNoteData should be an array of size inMaxActiveNotes.
void SetNotes(UInt32 inNumNotes, UInt32 inMaxActiveNotes, SynthNote* inNotes, UInt32 inNoteSize);
-
+
void PerformEvents( const AudioTimeStamp & inTimeStamp);
OSStatus SendPedalEvent(MusicDeviceGroupID inGroupID, UInt32 inEventType, UInt32 inOffsetSampleFrame);
virtual SynthNote* VoiceStealing(UInt32 inFrame, bool inKillIt);
@@ -184,29 +184,29 @@ protected:
void IncNumActiveNotes() { ++mNumActiveNotes; }
void DecNumActiveNotes() { --mNumActiveNotes; }
UInt32 CountActiveNotes();
-
+
SynthPartElement * GetPartElement (AudioUnitElement inPartElement);
-
+
// this call throws if there's no assigned element for the group ID
virtual SynthGroupElement * GetElForGroupID (MusicDeviceGroupID inGroupID);
virtual SynthGroupElement * GetElForNoteID (NoteInstanceID inNoteID);
SInt64 mAbsoluteSampleFrame;
-
+
private:
-
+
SInt32 mNoteIDCounter;
-
+
SynthEventQueue mEventQueue;
-
+
UInt32 mNumNotes;
UInt32 mNumActiveNotes;
UInt32 mMaxActiveNotes;
- SynthNote* mNotes;
+ SynthNote* mNotes;
SynthNoteList mFreeNotes;
UInt32 mNoteSize;
-
+
AUScope mPartScope;
const UInt32 mInitNumPartEls;
};
@@ -217,15 +217,15 @@ class AUMonotimbralInstrumentBase : public AUInstrumentBase
{
public:
AUMonotimbralInstrumentBase(
- AudioComponentInstance inInstance,
+ AudioComponentInstance inInstance,
UInt32 numInputs,
UInt32 numOutputs,
UInt32 numGroups = 16,
UInt32 numParts = 1);
-
- virtual OSStatus RealTimeStartNote( SynthGroupElement *inGroup,
- NoteInstanceID inNoteInstanceID,
- UInt32 inOffsetSampleFrame,
+
+ virtual OSStatus RealTimeStartNote( SynthGroupElement *inGroup,
+ NoteInstanceID inNoteInstanceID,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams);
};
@@ -236,12 +236,12 @@ class AUMultitimbralInstrumentBase : public AUInstrumentBase
{
public:
AUMultitimbralInstrumentBase(
- AudioComponentInstance inInstance,
+ AudioComponentInstance inInstance,
UInt32 numInputs,
UInt32 numOutputs,
UInt32 numGroups,
UInt32 numParts);
-
+
virtual OSStatus GetPropertyInfo( AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/LockFreeFIFO.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/LockFreeFIFO.h
index ea6c4c26e1..f9a0ec2dfe 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/LockFreeFIFO.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/LockFreeFIFO.h
@@ -2,14 +2,14 @@
File: LockFreeFIFO.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.
-
+
*/
#include <libkern/OSAtomic.h>
@@ -58,22 +58,22 @@ public:
mItems = new ITEM[inMaxSize];
mMask = inMaxSize - 1;
}
-
+
~LockFreeFIFOWithFree()
{
delete [] mItems;
}
-
- void Reset()
+
+ void Reset()
{
FreeItems();
mReadIndex = 0;
mWriteIndex = 0;
mFreeIndex = 0;
}
-
- ITEM* WriteItem()
+
+ ITEM* WriteItem()
{
//printf("WriteItem %d %d\n", mReadIndex, mWriteIndex);
FreeItems(); // free items on the write thread.
@@ -81,8 +81,8 @@ public:
if (nextWriteIndex == mFreeIndex) return NULL;
return &mItems[mWriteIndex];
}
-
- ITEM* ReadItem()
+
+ ITEM* ReadItem()
{
//printf("ReadItem %d %d\n", mReadIndex, mWriteIndex);
if (mReadIndex == mWriteIndex) return NULL;
@@ -91,14 +91,14 @@ public:
void AdvanceWritePtr() { OSAtomicCompareAndSwap32(mWriteIndex, (mWriteIndex + 1) & mMask, &mWriteIndex); }
void AdvanceReadPtr() { OSAtomicCompareAndSwap32(mReadIndex, (mReadIndex + 1) & mMask, &mReadIndex); }
private:
- ITEM* FreeItem()
+ ITEM* FreeItem()
{
if (mFreeIndex == mReadIndex) return NULL;
return &mItems[mFreeIndex];
}
void AdvanceFreePtr() { OSAtomicCompareAndSwap32(mFreeIndex, (mFreeIndex + 1) & mMask, &mFreeIndex); }
-
- void FreeItems()
+
+ void FreeItems()
{
ITEM* item;
while ((item = FreeItem()) != NULL)
@@ -107,7 +107,7 @@ private:
AdvanceFreePtr();
}
}
-
+
volatile int32_t mReadIndex, mWriteIndex, mFreeIndex;
int32_t mMask;
ITEM *mItems;
@@ -129,38 +129,38 @@ public:
mItems = new ITEM[inMaxSize];
mMask = inMaxSize - 1;
}
-
+
~LockFreeFIFO()
{
delete [] mItems;
}
-
- void Reset()
+
+ void Reset()
{
mReadIndex = 0;
mWriteIndex = 0;
}
-
- ITEM* WriteItem()
+
+ ITEM* WriteItem()
{
int32_t nextWriteIndex = (mWriteIndex + 1) & mMask;
if (nextWriteIndex == mReadIndex) return NULL;
return &mItems[mWriteIndex];
}
-
- ITEM* ReadItem()
+
+ ITEM* ReadItem()
{
if (mReadIndex == mWriteIndex) return NULL;
return &mItems[mReadIndex];
}
-
+
// the CompareAndSwap will always succeed. We use CompareAndSwap because it calls the PowerPC sync instruction,
// plus any processor bug workarounds for various CPUs.
void AdvanceWritePtr() { OSAtomicCompareAndSwap32(mWriteIndex, (mWriteIndex + 1) & mMask, &mWriteIndex); }
void AdvanceReadPtr() { OSAtomicCompareAndSwap32(mReadIndex, (mReadIndex + 1) & mMask, &mReadIndex); }
-
+
private:
-
+
volatile int32_t mReadIndex, mWriteIndex;
int32_t mMask;
ITEM *mItems;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/MIDIControlHandler.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/MIDIControlHandler.h
index 0f8003fcd5..408108c548 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/MIDIControlHandler.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/MIDIControlHandler.h
@@ -2,14 +2,14 @@
File: MIDIControlHandler.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 __MIDICONTROLHANDLER_H__
#define __MIDICONTROLHANDLER_H__
@@ -62,11 +62,11 @@ public:
virtual bool SetPolyPressure(UInt8 inKey, UInt8 inValue) = 0;
virtual bool SetController(UInt8 inControllerNumber, UInt8 inValue) = 0;
virtual bool SetSysex(void *inSysexMsg) = 0;
-
+
virtual float GetPitchBend() const = 0;
/*! Default controller values. These represent MSB values unless indicated in the name */
-
+
enum
{
kDefault_Midpoint = 0x40, //! Used for all center-null-point controllers
@@ -78,7 +78,7 @@ public:
kDefault_ChannelPressure = 0,
kDefault_ReverbSend = 40,
kDefault_ChorusSend = 0,
-
+
kDefault_RPN_LSB = 0x7f,
kDefault_RPN_MSB = 0x7f,
kDefault_PitchBendRange = 2,
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.cpp
index fd329f84e8..cef3a50bf7 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.cpp
@@ -2,14 +2,14 @@
File: SynthElement.cpp
Abstract: SynthElement.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 "SynthElement.h"
#include "AUInstrumentBase.h"
@@ -78,7 +78,7 @@ void MidiControls::Reset()
}
-SynthElement::SynthElement(AUInstrumentBase *audioUnit, UInt32 inElement)
+SynthElement::SynthElement(AUInstrumentBase *audioUnit, UInt32 inElement)
: AUElement(audioUnit), mIndex(inElement)
{
}
@@ -87,7 +87,7 @@ SynthElement::~SynthElement()
{
}
-SynthGroupElement::SynthGroupElement(AUInstrumentBase *audioUnit, UInt32 inElement, MIDIControlHandler *inHandler)
+SynthGroupElement::SynthGroupElement(AUInstrumentBase *audioUnit, UInt32 inElement, MIDIControlHandler *inHandler)
: SynthElement(audioUnit, inElement),
mCurrentAbsoluteFrame(-1),
mMidiControlHandler(inHandler),
@@ -109,7 +109,7 @@ void SynthGroupElement::SetGroupID (MusicDeviceGroupID inGroup)
mGroupID = inGroup;
}
-void SynthGroupElement::Reset()
+void SynthGroupElement::Reset()
{
#if DEBUG_PRINT
printf("SynthGroupElement::Reset\n");
@@ -119,7 +119,7 @@ void SynthGroupElement::Reset()
mNoteList[i].Empty();
}
-SynthPartElement::SynthPartElement(AUInstrumentBase *audioUnit, UInt32 inElement)
+SynthPartElement::SynthPartElement(AUInstrumentBase *audioUnit, UInt32 inElement)
: SynthElement(audioUnit, inElement)
{
}
@@ -132,7 +132,7 @@ SynthNote *SynthGroupElement::GetNote(NoteInstanceID inNoteID, bool unreleasedOn
#if DEBUG_PRINT_RENDER
printf("SynthGroupElement::GetNote %d, unreleased = %d\n", inNoteID, unreleasedOnly);
#endif
- const UInt32 lastNoteState = unreleasedOnly ?
+ const UInt32 lastNoteState = unreleasedOnly ?
(mSostenutoIsOn ? kNoteState_Sostenutoed : kNoteState_Attacked)
: kNoteState_Released;
SynthNote *note = NULL;
@@ -176,7 +176,7 @@ void SynthGroupElement::NoteOn(SynthNote *note,
}
void SynthGroupElement::NoteOff(NoteInstanceID inNoteID, UInt32 inFrame)
-{
+{
#if DEBUG_PRINT_NOTE
printf("SynthGroupElement::NoteOff %d\n", inNoteID);
#endif
@@ -217,7 +217,7 @@ void SynthGroupElement::NoteEnded(SynthNote *inNote, UInt32 inFrame)
SynthNoteList *list = &mNoteList[inNote->GetState()];
list->RemoveNote(inNote);
}
-
+
GetAUInstrument()->AddFreeNote(inNote);
}
@@ -245,7 +245,7 @@ bool SynthGroupElement::ChannelMessage(UInt16 controllerID, UInt16 inValue)
// Sustain and sostenuto are "pedal events", and are handled during render cycle
if (controllerID <= kMidiController_RPN_MSB && controllerID != kMidiController_Sustain && controllerID != kMidiController_Sostenuto)
handled = mMidiControlHandler->SetController(controllerID, UInt8(inValue));
- else
+ else
{
switch (controllerID)
{
@@ -296,7 +296,7 @@ void SynthGroupElement::SostenutoOff(UInt32 inFrame)
mMidiControlHandler->SetController(kMidiController_Sostenuto, 0);
mSostenutoIsOn = false;
mNoteList[kNoteState_Attacked].TransferAllFrom(&mNoteList[kNoteState_Sostenutoed], inFrame);
- if (mSustainIsOn)
+ if (mSustainIsOn)
mNoteList[kNoteState_ReleasedButSustained].TransferAllFrom(&mNoteList[kNoteState_ReleasedButSostenutoed], inFrame);
else
mNoteList[kNoteState_Released].TransferAllFrom(&mNoteList[kNoteState_ReleasedButSostenutoed], inFrame);
@@ -323,7 +323,7 @@ void SynthGroupElement::SustainOff(UInt32 inFrame)
if (mSustainIsOn) {
mMidiControlHandler->SetController(kMidiController_Sustain, 0);
mSustainIsOn = false;
-
+
mNoteList[kNoteState_Released].TransferAllFrom(&mNoteList[kNoteState_ReleasedButSustained], inFrame);
}
}
@@ -342,14 +342,14 @@ void SynthGroupElement::AllNotesOff(UInt32 inFrame)
while (note)
{
SynthNote *nextNote = note->mNext;
-
+
mNoteList[i].RemoveNote(note);
note->Release(inFrame);
mNoteList[newState].AddNote(note);
-
+
note = nextNote;
}
- }
+ }
}
void SynthGroupElement::AllSoundOff(UInt32 inFrame)
@@ -358,21 +358,21 @@ void SynthGroupElement::AllSoundOff(UInt32 inFrame)
printf("SynthGroupElement::AllSoundOff\n");
#endif
SynthNote *note;
-
+
for (UInt32 i=0 ; i<kNumberOfActiveNoteStates; ++i)
{
note = mNoteList[i].mHead;
while (note)
{
SynthNote *nextNote = note->mNext;
-
+
mNoteList[i].RemoveNote(note);
note->FastRelease(inFrame);
mNoteList[kNoteState_FastReleased].AddNote(note);
GetAUInstrument()->DecNumActiveNotes();
note = nextNote;
}
- }
+ }
}
void SynthGroupElement::ResetAllControllers(UInt32 inFrame)
@@ -395,7 +395,7 @@ OSStatus SynthGroupElement::Render(SInt64 inAbsoluteSampleFrame, UInt32 inNumber
{
buffArray[outBus] = &GetAudioUnit()->GetOutput(outBus)->GetBufferList();
}
-
+
for (UInt32 i=0 ; i<kNumberOfSoundingNoteStates; ++i)
{
SynthNote *note = mNoteList[i].mHead;
@@ -405,10 +405,10 @@ OSStatus SynthGroupElement::Render(SInt64 inAbsoluteSampleFrame, UInt32 inNumber
printf("SynthGroupElement::Render: state %d, note %p\n", i, note);
#endif
SynthNote *nextNote = note->mNext;
-
+
OSStatus err = note->Render(inAbsoluteSampleFrame, inNumberFrames, buffArray, numOutputs);
if (err) return err;
-
+
note = nextNote;
}
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h
index 4ca3643106..8f844a5bf4 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h
@@ -2,14 +2,14 @@
File: SynthElement.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 __SynthElement__
#define __SynthElement__
@@ -62,9 +62,9 @@ public:
virtual ~SynthElement();
UInt32 GetIndex() const { return mIndex; }
-
+
AUInstrumentBase* GetAUInstrument() { return (AUInstrumentBase*)GetAudioUnit(); }
-
+
private:
UInt32 mIndex;
};
@@ -98,11 +98,11 @@ public:
virtual float GetPitchBend() const { return mFPitchBend * mFPitchBendDepth; }
- SInt16 GetHiResControl(UInt32 inIndex) const
- {
+ SInt16 GetHiResControl(UInt32 inIndex) const
+ {
return ((mControls[inIndex] & 127) << 7) | (mControls[inIndex + 32] & 127);
}
-
+
float GetControl(UInt32 inIndex) const
{
if (inIndex < 32) {
@@ -111,10 +111,10 @@ public:
return (float)mControls[inIndex];
}
}
-
-
+
+
private:
-
+
UInt8 mControls[128];
UInt8 mPolyPressure[128];
UInt8 mMonoPressure;
@@ -124,17 +124,17 @@ private:
UInt16 mActiveNRPN;
UInt16 mActiveRPValue;
UInt16 mActiveNRPValue;
-
+
UInt16 mPitchBendDepth;
float mFPitchBendDepth;
float mFPitchBend;
-
+
void SetHiResControl(UInt32 inIndex, UInt8 inMSB, UInt8 inLSB)
- {
+ {
mControls[inIndex] = inMSB;
mControls[inIndex + 32] = inLSB;
}
-
+
};
@@ -144,7 +144,7 @@ public:
enum {
kUnassignedGroup = 0xFFFFFFFF
};
-
+
SynthGroupElement(AUInstrumentBase *audioUnit, UInt32 inElement, MIDIControlHandler *inHandler);
virtual ~SynthGroupElement();
@@ -157,27 +157,27 @@ public:
void NoteEnded(SynthNote *inNote, UInt32 inFrame);
void NoteFastReleased(SynthNote *inNote);
-
+
virtual bool ChannelMessage(UInt16 controlID, UInt16 controlValue);
virtual void AllNotesOff(UInt32 inFrame);
virtual void AllSoundOff(UInt32 inFrame);
void ResetAllControllers(UInt32 inFrame);
-
+
SynthNote * GetNote(NoteInstanceID inNoteID, bool unreleasedOnly=false, UInt32 *outNoteState=NULL);
-
+
void Reset();
-
+
virtual OSStatus Render(SInt64 inAbsoluteSampleFrame, UInt32 inNumberFrames, AUScope &outputs);
-
+
float GetPitchBend() const { return mMidiControlHandler->GetPitchBend(); }
SInt64 GetCurrentAbsoluteFrame() const { return mCurrentAbsoluteFrame; }
-
+
MusicDeviceGroupID GroupID () const { return mGroupID; }
virtual void SetGroupID (MusicDeviceGroupID inGroup);
MIDIControlHandler * GetMIDIControlHandler() const { return mMidiControlHandler; }
-
-protected:
+
+protected:
SInt64 mCurrentAbsoluteFrame;
SynthNoteList mNoteList[kNumberOfSoundingNoteStates];
MIDIControlHandler *mMidiControlHandler;
@@ -186,7 +186,7 @@ private:
friend class AUInstrumentBase;
friend class AUMonotimbralInstrumentBase;
friend class AUMultitimbralInstrumentBase;
-
+
bool mSustainIsOn;
bool mSostenutoIsOn;
UInt32 mOutputBus;
@@ -213,15 +213,15 @@ public:
UInt32 GetGroupIndex() const { return mGroupIndex; }
bool InRange(Float32 inNote, Float32 inVelocity);
-
+
UInt32 GetMaxPolyphony() const { return mMaxPolyphony; }
void SetMaxPolyphony(UInt32 inMaxPolyphony) { mMaxPolyphony = inMaxPolyphony; }
-
+
private:
UInt32 mGroupIndex;
UInt32 mPatchIndex;
UInt32 mMaxPolyphony;
- SynthKeyZone mKeyZone;
+ SynthKeyZone mKeyZone;
};
#endif
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthEvent.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthEvent.h
index 9c27aee04f..abb7886b12 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthEvent.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthEvent.h
@@ -2,14 +2,14 @@
File: SynthEvent.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.
-
+
*/
/* You can either fill in code here or remove this and create or add new files. */
@@ -76,7 +76,7 @@ public:
SynthEvent() {}
~SynthEvent() {}
- void Set(
+ void Set(
UInt32 inEventType,
MusicDeviceGroupID inGroupID,
NoteInstanceID inNoteID,
@@ -88,20 +88,20 @@ public:
mGroupID = inGroupID;
mNoteID = inNoteID;
mOffsetSampleFrame = inOffsetSampleFrame;
-
+
if (inNoteParams)
{
- UInt32 paramSize = offsetof(MusicDeviceNoteParams, mControls) + (inNoteParams->argCount-2)*sizeof(NoteParamsControlValue);
- mNoteParams = inNoteParams->argCount > 3
- ? (MusicDeviceNoteParams*)malloc(paramSize)
+ UInt32 paramSize = offsetof(MusicDeviceNoteParams, mControls) + (inNoteParams->argCount-2)*sizeof(NoteParamsControlValue);
+ mNoteParams = inNoteParams->argCount > 3
+ ? (MusicDeviceNoteParams*)malloc(paramSize)
: &mSmallNoteParams;
memcpy(mNoteParams, inNoteParams, paramSize);
}
- else
+ else
mNoteParams = NULL;
}
-
-
+
+
void Free()
{
if (mNoteParams)
@@ -111,27 +111,27 @@ public:
mNoteParams = NULL;
}
}
-
+
UInt32 GetEventType() const { return mEventType; }
MusicDeviceGroupID GetGroupID() const { return mGroupID; }
NoteInstanceID GetNoteID() const { return mNoteID; }
UInt32 GetOffsetSampleFrame() const { return mOffsetSampleFrame; }
-
+
MusicDeviceNoteParams* GetParams() const { return mNoteParams; }
UInt32 GetArgCount() const { return mNoteParams->argCount; }
UInt32 NumberParameters() const { return mNoteParams->argCount - 2; }
-
+
Float32 GetNote() const { return mNoteParams->mPitch; }
Float32 GetVelocity() const { return mNoteParams->mVelocity; }
-
- NoteParamsControlValue GetParameter(UInt32 inIndex) const
+
+ NoteParamsControlValue GetParameter(UInt32 inIndex) const
{
- if (inIndex >= NumberParameters())
+ if (inIndex >= NumberParameters())
throw std::runtime_error("index out of range");
- return mNoteParams->mControls[inIndex];
+ return mNoteParams->mControls[inIndex];
}
-
+
private:
UInt32 mEventType;
MusicDeviceGroupID mGroupID;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.cpp
index 96a24d33c2..9ecced6b73 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.cpp
@@ -2,14 +2,14 @@
File: SynthNote.cpp
Abstract: SynthNote.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 "SynthNote.h"
#include "SynthElement.h"
@@ -51,9 +51,9 @@
bool SynthNote::AttackNote(
SynthPartElement * inPart,
SynthGroupElement * inGroup,
- NoteInstanceID inNoteID,
- UInt64 inAbsoluteSampleFrame,
- UInt32 inOffsetSampleFrame,
+ NoteInstanceID inNoteID,
+ UInt64 inAbsoluteSampleFrame,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams)
{
#if DEBUG_PRINT
@@ -70,8 +70,8 @@ bool SynthNote::AttackNote(
mPitch = inParams.mPitch;
mVelocity = inParams.mVelocity;
-
-
+
+
return Attack(inParams);
}
@@ -116,25 +116,25 @@ double SynthNote::SampleRate()
return GetAudioUnit()->GetOutput(0)->GetStreamFormat().mSampleRate;
}
-AUInstrumentBase* SynthNote::GetAudioUnit() const
-{
- return (AUInstrumentBase*)mGroup->GetAudioUnit();
+AUInstrumentBase* SynthNote::GetAudioUnit() const
+{
+ return (AUInstrumentBase*)mGroup->GetAudioUnit();
}
-Float32 SynthNote::GetGlobalParameter(AudioUnitParameterID inParamID) const
+Float32 SynthNote::GetGlobalParameter(AudioUnitParameterID inParamID) const
{
return mGroup->GetAudioUnit()->Globals()->GetParameter(inParamID);
}
-void SynthNote::NoteEnded(UInt32 inFrame)
-{
+void SynthNote::NoteEnded(UInt32 inFrame)
+{
mGroup->NoteEnded(this, inFrame);
- mNoteID = 0xFFFFFFFF;
+ mNoteID = 0xFFFFFFFF;
}
-float SynthNote::GetPitchBend() const
-{
- return mGroup->GetPitchBend();
+float SynthNote::GetPitchBend() const
+{
+ return mGroup->GetPitchBend();
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.h
index cec6377217..89179b14f4 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNote.h
@@ -2,14 +2,14 @@
File: SynthNote.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 __SynthNote__
#define __SynthNote__
@@ -84,7 +84,7 @@ enum SynthNoteState {
end of note any state free
soft voice stealing any state fast released
hard voice stealing any state free
-
+
soft voice stealing happens when there is a note on event and NumActiveNotes > MaxActiveNotes
hard voice stealing happens when there is a note on event and NumActiveNotes == NumNotes (no free notes)
voice stealing removes the quietest note in the highest numbered state that has sounding notes.
@@ -108,20 +108,20 @@ struct SynthNote
mVelocity(0.0f)
{
}
-
+
virtual ~SynthNote() {}
-
+
virtual void Reset();
//! Returns true if active note resulted from this call, otherwise false
virtual bool AttackNote(
SynthPartElement * inPart,
SynthGroupElement * inGroup,
- NoteInstanceID inNoteID,
- UInt64 inAbsoluteSampleFrame,
- UInt32 inOffsetSampleFrame,
+ NoteInstanceID inNoteID,
+ UInt64 inAbsoluteSampleFrame,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams
);
-
+
virtual OSStatus Render(UInt64 inAbsoluteSampleFrame, UInt32 inNumFrames, AudioBufferList** inBufferList, UInt32 inOutBusCount) = 0;
//! Returns true if active note resulted from this call, otherwise false
virtual bool Attack(const MusicDeviceNoteParams &inParams) = 0;
@@ -134,7 +134,7 @@ struct SynthNote
SynthGroupElement* GetGroup() const { return mGroup; }
SynthPartElement* GetPart() const { return mPart; }
-
+
AUInstrumentBase* GetAudioUnit() const;
Float32 GetGlobalParameter(AudioUnitParameterID inParamID) const;
@@ -143,7 +143,7 @@ struct SynthNote
SynthNoteState GetState() const { return mState; }
UInt8 GetMidiKey() const { return (UInt8) mPitch; }
UInt8 GetMidiVelocity() const { return (UInt8) mVelocity; }
-
+
Boolean IsSounding() const { return mState < kNumberOfSoundingNoteStates; }
Boolean IsActive() const { return mState < kNumberOfActiveNoteStates; }
UInt64 GetAbsoluteStartFrame() const { return mAbsoluteStartFrame; }
@@ -155,7 +155,7 @@ struct SynthNote
float GetPitchBend() const;
double TuningA() const;
-
+
Float32 GetPitch() const { return mPitch; } // returns raw pitch from MusicDeviceNoteParams
virtual double Frequency(); // returns the frequency of note + pitch bend.
virtual double SampleRate();
@@ -163,7 +163,7 @@ struct SynthNote
// linked list pointers
SynthNote *mPrev;
SynthNote *mNext;
-
+
friend class SynthGroupElement;
friend struct SynthNoteList;
protected:
@@ -171,14 +171,14 @@ protected:
private:
SynthPartElement* mPart;
SynthGroupElement* mGroup;
-
+
NoteInstanceID mNoteID;
SynthNoteState mState;
UInt64 mAbsoluteStartFrame;
SInt32 mRelativeStartFrame;
SInt32 mRelativeReleaseFrame;
SInt32 mRelativeKillFrame;
-
+
Float32 mPitch;
Float32 mVelocity;
};
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.cpp
index 849abd266b..7e49da970e 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.cpp
@@ -2,14 +2,14 @@
File: SynthNoteList.cpp
Abstract: SynthNoteList.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 "SynthNoteList.h"
#include <stdexcept>
@@ -52,23 +52,23 @@ void SynthNoteList::SanityCheck() const
if (mState >= kNoteState_Unset) {
throw std::runtime_error("SanityCheck: mState is bad");
}
-
+
if (mHead == NULL) {
- if (mTail != NULL)
+ if (mTail != NULL)
throw std::runtime_error("SanityCheck: mHead is NULL but not mTail");
return;
}
if (mTail == NULL) {
throw std::runtime_error("SanityCheck: mTail is NULL but not mHead");
}
-
+
if (mHead->mPrev) {
throw std::runtime_error("SanityCheck: mHead has a mPrev");
}
if (mTail->mNext) {
throw std::runtime_error("SanityCheck: mTail has a mNext");
}
-
+
SynthNote *note = mHead;
while (note)
{
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.h
index 47a3593018..6718f18530 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthNoteList.h
@@ -2,14 +2,14 @@
File: SynthNoteList.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 __SynthNoteList__
#define __SynthNoteList__
@@ -61,26 +61,26 @@
struct SynthNoteList
{
SynthNoteList() : mState(kNoteState_Unset), mHead(0), mTail(0) {}
-
+
bool NotEmpty() const { return mHead != NULL; }
bool IsEmpty() const { return mHead == NULL; }
- void Empty() {
+ void Empty() {
#if USE_SANITY_CHECK
SanityCheck();
#endif
- mHead = mTail = NULL;
+ mHead = mTail = NULL;
}
-
+
UInt32 Length() const {
#if USE_SANITY_CHECK
SanityCheck();
#endif
UInt32 length = 0;
- for (SynthNote* note = mHead; note; note = note->mNext)
+ for (SynthNote* note = mHead; note; note = note->mNext)
length++;
return length;
};
-
+
void AddNote(SynthNote *inNote)
{
#if DEBUG_PRINT
@@ -92,14 +92,14 @@ struct SynthNoteList
inNote->SetState(mState);
inNote->mNext = mHead;
inNote->mPrev = NULL;
-
+
if (mHead) { mHead->mPrev = inNote; mHead = inNote; }
else mHead = mTail = inNote;
#if USE_SANITY_CHECK
SanityCheck();
#endif
}
-
+
void RemoveNote(SynthNote *inNote)
{
#if DEBUG_PRINT
@@ -113,7 +113,7 @@ struct SynthNoteList
if (inNote->mNext) inNote->mNext->mPrev = inNote->mPrev;
else mTail = inNote->mPrev;
-
+
inNote->mPrev = 0;
inNote->mNext = 0;
#if USE_SANITY_CHECK
@@ -131,7 +131,7 @@ struct SynthNoteList
inNoteList->SanityCheck();
#endif
if (!inNoteList->mTail) return;
-
+
if (mState == kNoteState_Released)
{
for (SynthNote* note = inNoteList->mHead; note; note = note->mNext)
@@ -150,14 +150,14 @@ struct SynthNoteList
note->SetState(mState);
}
}
-
+
inNoteList->mTail->mNext = mHead;
-
+
if (mHead) mHead->mPrev = inNoteList->mTail;
else mTail = inNoteList->mTail;
-
+
mHead = inNoteList->mHead;
-
+
inNoteList->mHead = NULL;
inNoteList->mTail = NULL;
#if USE_SANITY_CHECK
@@ -165,7 +165,7 @@ struct SynthNoteList
inNoteList->SanityCheck();
#endif
}
-
+
SynthNote* FindOldestNote()
{
#if DEBUG_PRINT
@@ -186,7 +186,7 @@ struct SynthNoteList
}
return oldestNote;
}
-
+
SynthNote* FindMostQuietNote()
{
#if DEBUG_PRINT
@@ -219,9 +219,9 @@ struct SynthNoteList
#endif
return mostQuietNote;
}
-
+
void SanityCheck() const;
-
+
SynthNoteState mState;
SynthNote * mHead;
SynthNote * mTail;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUViewBase/AUViewLocalizedStringKeys.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUViewBase/AUViewLocalizedStringKeys.h
index 741be00fe0..995b9fb1f3 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUViewBase/AUViewLocalizedStringKeys.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUViewBase/AUViewLocalizedStringKeys.h
@@ -2,14 +2,14 @@
File: AUViewLocalizedStringKeys.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 __AUViewLocalizedStringKeys_h__
#define __AUViewLocalizedStringKeys_h__
@@ -53,27 +53,27 @@
// UNLOCALIZED STRINGS:
#define kAUViewUnlocalizedString_TitleSeparator CFSTR(": ")
-
+
// Generic View:
#define kAUViewLocalizedStringKey_AudioUnit CFSTR("Audio Unit")
#define kAUViewLocalizedStringKey_Manufacturer CFSTR("Manufacturer")
-
+
#define kAUViewLocalizedStringKey_FactoryPreset CFSTR("Factory Preset")
-
+
#define kAUViewLocalizedStringKey_Properties CFSTR("Properties")
#define kAUViewLocalizedStringKey_Parameters CFSTR("Parameters")
-
+
#define kAUViewLocalizedStringKey_Standard CFSTR("Standard")
#define kAUViewLocalizedStringKey_Expert CFSTR("Expert")
-
+
// AULoadCPU:
#define kAUViewLocalizedStringKey_RestrictCPULoad CFSTR("Restrict CPU Load")
#define kAUViewLocalizedStringKey_PercentSymbol CFSTR("%")
#define kAUViewLocalizedStringKey_NotApplicable CFSTR("n/a")
-
+
// AUDiskStreamingCheckbox:
#define kAUViewLocalizedStringKey_StreamFromDisk CFSTR("Stream From Disk")
-
+
// AURenderQualityPopup:
#define kAUViewLocalizedStringKey_RenderQuality CFSTR("Render Quality")
#define kAUViewLocalizedStringKey_Maximum CFSTR("Maximum")
@@ -84,5 +84,5 @@
// AUChannelLayoutPopUp:
#define kAUViewLocalizedStringKey_AudioChannelLayout CFSTR("Audio Channel Layout")
-
+
#endif //__AUViewLocalizedStringKeys_h__
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.cpp
index 010082fc3f..c7a8c651ab 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.cpp
@@ -2,14 +2,14 @@
File: AUEffectBase.cpp
Abstract: AUEffectBase.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,15 +40,15 @@
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 "AUEffectBase.h"
-/*
+/*
This class does not deal as well as it should with N-M effects...
-
+
The problem areas are (if the channels don't match):
ProcessInPlace if the channels don't match - there will be problems if InputChan != OutputChan
Bypass - its just passing the buffers through when not processing them
@@ -84,7 +84,7 @@ void AUEffectBase::Cleanup()
{
for (KernelList::iterator it = mKernelList.begin(); it != mKernelList.end(); ++it)
delete *it;
-
+
mKernelList.clear();
mMainOutput = NULL;
mMainInput = NULL;
@@ -113,7 +113,7 @@ OSStatus AUEffectBase::Initialize()
if ((configNumInputs < 0) && (configNumOutputs < 0))
{
// unit accepts any number of channels on input and output
- if (((configNumInputs == -1) && (configNumOutputs == -2))
+ if (((configNumInputs == -1) && (configNumOutputs == -2))
|| ((configNumInputs == -2) && (configNumOutputs == -1)))
{
foundMatch = true;
@@ -129,7 +129,7 @@ OSStatus AUEffectBase::Initialize()
}
else
{
- // the -1 case on either scope is saying that the unit doesn't care about the
+ // the -1 case on either scope is saying that the unit doesn't care about the
// number of channels on that scope
bool inputMatch = (auNumInputs == configNumInputs) || (configNumInputs == -1);
bool outputMatch = (auNumOutputs == configNumOutputs) || (configNumOutputs == -1);
@@ -152,14 +152,14 @@ OSStatus AUEffectBase::Initialize()
}
MaintainKernels();
-
+
mMainOutput = GetOutput(0);
mMainInput = GetInput(0);
-
+
const CAStreamBasicDescription& format = GetStreamFormat(kAudioUnitScope_Output, 0);
format.IdentifyCommonPCMFormat(mCommonPCMFormat, NULL);
mBytesPerFrame = format.mBytesPerFrame;
-
+
return noErr;
}
@@ -171,7 +171,7 @@ OSStatus AUEffectBase::Reset( AudioUnitScope inScope,
if (kernel != NULL)
kernel->Reset();
}
-
+
return AUBase::Reset(inScope, inElement);
}
@@ -228,10 +228,10 @@ OSStatus AUEffectBase::SetProperty( AudioUnitPropertyID inID,
{
if (inDataSize < sizeof(UInt32))
return kAudioUnitErr_InvalidPropertyValue;
-
+
bool tempNewSetting = *((UInt32*)inData) != 0;
// we're changing the state of bypass
- if (tempNewSetting != IsBypassEffect())
+ if (tempNewSetting != IsBypassEffect())
{
if (!tempNewSetting && IsBypassEffect() && IsInitialized()) // turning bypass off and we're initialized
Reset(0, 0);
@@ -246,16 +246,16 @@ OSStatus AUEffectBase::SetProperty( AudioUnitPropertyID inID,
}
return AUBase::SetProperty (inID, inScope, inElement, inData, inDataSize);
}
-
+
void AUEffectBase::MaintainKernels()
{
#if TARGET_OS_IPHONE
UInt32 nKernels = mOnlyOneKernel ? 1 : GetNumberOfChannels();
-#else
+#else
UInt32 nKernels = GetNumberOfChannels();
#endif
-
+
if (mKernelList.size() < nKernels) {
mKernelList.reserve(nKernels);
for (UInt32 i = (UInt32)mKernelList.size(); i < nKernels; ++i)
@@ -267,7 +267,7 @@ void AUEffectBase::MaintainKernels()
mKernelList.pop_back();
}
}
-
+
for(unsigned int i = 0; i < nKernels; i++ )
{
if(mKernelList[i]) {
@@ -289,7 +289,7 @@ OSStatus AUEffectBase::ChangeStreamFormat( AudioUnitScope inScope,
{
OSStatus result = AUBase::ChangeStreamFormat(inScope, inElement, inPrevFormat, inNewFormat);
if (result == noErr)
- {
+ {
// for the moment this only dependency we know about
// where a parameter's range may change is with the sample rate
// and effects are only publishing parameters in the global scope!
@@ -314,11 +314,11 @@ OSStatus AUEffectBase::ProcessScheduledSlice( void *inUserData,
UInt32 inTotalBufferFrames )
{
ScheduledProcessParams &sliceParams = *((ScheduledProcessParams*)inUserData);
-
+
AudioUnitRenderActionFlags &actionFlags = *sliceParams.actionFlags;
AudioBufferList &inputBufferList = *sliceParams.inputBufferList;
AudioBufferList &outputBufferList = *sliceParams.outputBufferList;
-
+
UInt32 channelSize = inSliceFramesToProcess * mBytesPerFrame;
// fix the size of the buffer we're operating on before we render this slice of time
for(unsigned int i = 0; i < inputBufferList.mNumberBuffers; i++ ) {
@@ -333,15 +333,15 @@ OSStatus AUEffectBase::ProcessScheduledSlice( void *inUserData,
// we just partially processed the buffers, so increment the data pointers to the next part of the buffer to process
for(unsigned int i = 0; i < inputBufferList.mNumberBuffers; i++ ) {
- inputBufferList.mBuffers[i].mData =
+ inputBufferList.mBuffers[i].mData =
(char *)inputBufferList.mBuffers[i].mData + inputBufferList.mBuffers[i].mNumberChannels * channelSize;
}
-
+
for(unsigned int i = 0; i < outputBufferList.mNumberBuffers; i++ ) {
- outputBufferList.mBuffers[i].mData =
+ outputBufferList.mBuffers[i].mData =
(char *)outputBufferList.mBuffers[i].mData + outputBufferList.mBuffers[i].mNumberChannels * channelSize;
}
-
+
return result;
}
@@ -358,7 +358,7 @@ OSStatus AUEffectBase::Render( AudioUnitRenderActionFlags &ioActionFlags,
OSStatus result = noErr;
result = mMainInput->PullInput(ioActionFlags, inTimeStamp, 0 /* element */, nFrames);
-
+
if (result == noErr)
{
if(ProcessesInPlace() && mMainOutput->WillAllocateBuffer())
@@ -369,7 +369,7 @@ OSStatus AUEffectBase::Render( AudioUnitRenderActionFlags &ioActionFlags,
if (ShouldBypassEffect())
{
// leave silence bit alone
-
+
if(!ProcessesInPlace() )
{
mMainInput->CopyBufferContentsTo (mMainOutput->GetBufferList());
@@ -385,22 +385,22 @@ OSStatus AUEffectBase::Render( AudioUnitRenderActionFlags &ioActionFlags,
else
{
// deal with scheduled parameters...
-
+
AudioBufferList &inputBufferList = mMainInput->GetBufferList();
AudioBufferList &outputBufferList = mMainOutput->GetBufferList();
-
+
ScheduledProcessParams processParams;
processParams.actionFlags = &ioActionFlags;
processParams.inputBufferList = &inputBufferList;
processParams.outputBufferList = &outputBufferList;
-
+
// divide up the buffer into slices according to scheduled params then
// do the DSP for each slice (ProcessScheduledSlice() called for each slice)
result = ProcessForScheduledParams( mParamList,
nFrames,
&processParams );
-
-
+
+
// fixup the buffer pointers to how they were before we started
UInt32 channelSize = nFrames * mBytesPerFrame;
for(unsigned int i = 0; i < inputBufferList.mNumberBuffers; i++ ) {
@@ -408,7 +408,7 @@ OSStatus AUEffectBase::Render( AudioUnitRenderActionFlags &ioActionFlags,
inputBufferList.mBuffers[i].mData = (char *)inputBufferList.mBuffers[i].mData - size;
inputBufferList.mBuffers[i].mDataByteSize = size;
}
-
+
for(unsigned int i = 0; i < outputBufferList.mNumberBuffers; i++ ) {
UInt32 size = outputBufferList.mBuffers[i].mNumberChannels * channelSize;
outputBufferList.mBuffers[i].mData = (char *)outputBufferList.mBuffers[i].mData - size;
@@ -416,13 +416,13 @@ OSStatus AUEffectBase::Render( AudioUnitRenderActionFlags &ioActionFlags,
}
}
}
-
+
if ( (ioActionFlags & kAudioUnitRenderAction_OutputIsSilence) && !ProcessesInPlace() )
{
AUBufferList::ZeroBuffer(mMainOutput->GetBufferList() );
}
}
-
+
return result;
}
@@ -435,7 +435,7 @@ OSStatus AUEffectBase::ProcessBufferLists(
{
if (ShouldBypassEffect())
return noErr;
-
+
// interleaved (or mono)
switch (mCommonPCMFormat) {
case CAStreamBasicDescription::kPCMFormatFloat32 :
@@ -450,7 +450,7 @@ OSStatus AUEffectBase::ProcessBufferLists(
default :
throw CAException(kAudio_UnimplementedError);
}
-
+
return noErr;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.h
index 13ba96b393..a7c62c2098 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.h
@@ -2,14 +2,14 @@
File: AUEffectBase.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 __AUEffectBase_h__
#define __AUEffectBase_h__
@@ -63,7 +63,7 @@ public:
bool inProcessesInPlace = true );
/*! @dtor ~AUEffectBase */
~AUEffectBase();
-
+
/*! @method Initialize */
virtual OSStatus Initialize();
@@ -112,7 +112,7 @@ public:
UInt32 inNumberFrames);
// our virtual methods
-
+
// If your unit processes N to N channels, and there are no interactions between channels,
// it can override NewKernel to create a mono processing object per channel. Otherwise,
// don't override NewKernel, and instead, override ProcessBufferLists.
@@ -129,7 +129,7 @@ public:
// convenience format accessors (use output 0's format)
/*! @method GetSampleRate */
Float64 GetSampleRate();
-
+
/*! @method GetNumberOfChannels */
UInt32 GetNumberOfChannels();
@@ -141,7 +141,7 @@ public:
{
Globals()->SetParameter(paramID, value);
}
-
+
/*! @method GetParameter */
using AUBase::GetParameter;
AudioUnitParameterValue GetParameter( AudioUnitParameterID paramID )
@@ -151,13 +151,13 @@ public:
/*! @method CanScheduleParameters */
virtual bool CanScheduleParameters() const { return true; }
-
+
/*! @method IsBypassEffect */
// This is used for the property value - to reflect to the UI if an effect is bypassed
bool IsBypassEffect () { return mBypassEffect; }
-
+
protected:
-
+
/*! @method MaintainKernels */
void MaintainKernels();
@@ -165,17 +165,17 @@ protected:
// This is used in the render call to see if an effect is bypassed
// It can return a different status than IsBypassEffect (though it MUST take that into account)
virtual bool ShouldBypassEffect () { return IsBypassEffect(); }
-
+
public:
/*! @method SetBypassEffect */
virtual void SetBypassEffect (bool inFlag) { mBypassEffect = inFlag; }
-
+
/*! @method SetParamHasSampleRateDependency */
- void SetParamHasSampleRateDependency (bool inFlag)
- {
- mParamSRDep = inFlag;
+ void SetParamHasSampleRateDependency (bool inFlag)
+ {
+ mParamSRDep = inFlag;
}
-
+
/*! @method GetParamHasSampleRateDependency */
bool GetParamHasSampleRateDependency () const { return mParamSRDep; }
@@ -194,12 +194,12 @@ public:
bool ProcessesInPlace() const {return mProcessesInPlace;};
void SetProcessesInPlace(bool inProcessesInPlace) {mProcessesInPlace = inProcessesInPlace;};
-
+
typedef std::vector<AUKernelBase *> KernelList;
-
-
-protected:
+
+
+protected:
/*! @var mKernelList */
KernelList mKernelList;
@@ -209,13 +209,13 @@ protected:
bool IsInputSilent (AudioUnitRenderActionFlags inActionFlags, UInt32 inFramesToProcess)
{
bool inputSilent = (inActionFlags & kAudioUnitRenderAction_OutputIsSilence) != 0;
-
+
// take latency and tail time into account when propagating the silent bit
UInt32 silentTimeoutFrames = UInt32(GetSampleRate() * (GetLatency() + GetTailTime()));
mSilentTimeout.Process (inFramesToProcess, silentTimeoutFrames, inputSilent);
return inputSilent;
}
-
+
#if TARGET_OS_IPHONE
void SetOnlyOneKernel(bool inUseOnlyOneKernel) { mOnlyOneKernel = inUseOnlyOneKernel; } // set in ctor of subclass that wants it.
#endif
@@ -228,26 +228,26 @@ protected:
UInt32 inFramesToProcess );
CAStreamBasicDescription::CommonPCMFormat GetCommonPCMFormat() const { return mCommonPCMFormat; }
-
+
private:
/*! @var mBypassEffect */
bool mBypassEffect;
/*! @var mParamSRDep */
bool mParamSRDep;
-
+
/*! @var mProcessesInplace */
bool mProcessesInPlace;
-
+
/*! @var mSilentTimeout */
AUSilentTimeout mSilentTimeout;
/*! @var mMainOutput */
AUOutputElement * mMainOutput;
-
+
/*! @var mMainInput */
AUInputElement * mMainInput;
-
+
#if TARGET_OS_IPHONE
/*! @var mOnlyOneKernel */
bool mOnlyOneKernel;
@@ -299,16 +299,16 @@ public:
{
return mAudioUnit->GetSampleRate();
}
-
+
/*! @method GetParameter */
- AudioUnitParameterValue GetParameter (AudioUnitParameterID paramID)
+ AudioUnitParameterValue GetParameter (AudioUnitParameterID paramID)
{
return mAudioUnit->GetParameter(paramID);
}
-
+
void SetChannelNum (UInt32 inChan) { mChannelNum = inChan; }
UInt32 GetChannelNum () { return mChannelNum; }
-
+
protected:
/*! @var mAudioUnit */
AUEffectBase * mAudioUnit;
@@ -332,41 +332,41 @@ void AUEffectBase::ProcessBufferListsT(
if (inBuffer.mNumberBuffers == 1) {
if (inBuffer.mBuffers[0].mNumberChannels == 0)
throw CAException(kAudio_ParamError);
-
+
for (UInt32 channel = 0; channel < mKernelList.size(); ++channel) {
AUKernelBase *kernel = mKernelList[channel];
-
+
if (kernel == NULL) continue;
ioSilence = silentInput;
-
+
// process each interleaved channel individually
kernel->Process(
- (const T *)inBuffer.mBuffers[0].mData + channel,
+ (const T *)inBuffer.mBuffers[0].mData + channel,
(T *)outBuffer.mBuffers[0].mData + channel,
inFramesToProcess,
inBuffer.mBuffers[0].mNumberChannels,
ioSilence);
-
+
if (!ioSilence)
ioActionFlags &= ~kAudioUnitRenderAction_OutputIsSilence;
}
} else {
for (UInt32 channel = 0; channel < mKernelList.size(); ++channel) {
AUKernelBase *kernel = mKernelList[channel];
-
+
if (kernel == NULL) continue;
-
+
ioSilence = silentInput;
const AudioBuffer *srcBuffer = &inBuffer.mBuffers[channel];
AudioBuffer *destBuffer = &outBuffer.mBuffers[channel];
-
+
kernel->Process(
- (const T *)srcBuffer->mData,
- (T *)destBuffer->mData,
+ (const T *)srcBuffer->mData,
+ (T *)destBuffer->mData,
inFramesToProcess,
1,
ioSilence);
-
+
if (!ioSilence)
ioActionFlags &= ~kAudioUnitRenderAction_OutputIsSilence;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp
index e5e358d685..520d76ab8d 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp
@@ -2,14 +2,14 @@
File: AUMIDIBase.cpp
Abstract: AUMIDIBase.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 "AUMIDIBase.h"
#include <CoreMIDI/CoreMIDI.h>
@@ -64,18 +64,18 @@ enum
kMidiController_AllNotesOff = 123
};
-AUMIDIBase::AUMIDIBase(AUBase* inBase)
- : mAUBaseInstance (*inBase)
+AUMIDIBase::AUMIDIBase(AUBase* inBase)
+ : mAUBaseInstance (*inBase)
{
#if CA_AUTO_MIDI_MAP
mMapManager = new CAAUMIDIMapManager();
#endif
}
-AUMIDIBase::~AUMIDIBase()
+AUMIDIBase::~AUMIDIBase()
{
#if CA_AUTO_MIDI_MAP
- if (mMapManager)
+ if (mMapManager)
delete mMapManager;
#endif
}
@@ -88,7 +88,7 @@ OSStatus AUMIDIBase::DelegateGetPropertyInfo(AudioUnitPropertyID inID,
Boolean & outWritable)
{
OSStatus result = noErr;
-
+
switch (inID) {
#if !TARGET_OS_IPHONE
case kMusicDeviceProperty_MIDIXMLNames:
@@ -100,8 +100,8 @@ OSStatus AUMIDIBase::DelegateGetPropertyInfo(AudioUnitPropertyID inID,
} else
result = kAudioUnitErr_InvalidProperty;
break;
-#endif
-#if CA_AUTO_MIDI_MAP
+#endif
+#if CA_AUTO_MIDI_MAP
case kAudioUnitProperty_AllParameterMIDIMappings:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
ca_require(inElement == 0, InvalidElement);
@@ -109,15 +109,15 @@ OSStatus AUMIDIBase::DelegateGetPropertyInfo(AudioUnitPropertyID inID,
outDataSize = sizeof (AUParameterMIDIMapping)*mMapManager->NumMaps();
result = noErr;
break;
-
+
case kAudioUnitProperty_HotMapParameterMIDIMapping:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
ca_require(inElement == 0, InvalidElement);
outWritable = true;
- outDataSize = sizeof (AUParameterMIDIMapping);
+ outDataSize = sizeof (AUParameterMIDIMapping);
result = noErr;
break;
-
+
case kAudioUnitProperty_AddParameterMIDIMapping:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
ca_require(inElement == 0, InvalidElement);
@@ -125,12 +125,12 @@ OSStatus AUMIDIBase::DelegateGetPropertyInfo(AudioUnitPropertyID inID,
outDataSize = sizeof (AUParameterMIDIMapping);
result = noErr;
break;
-
+
case kAudioUnitProperty_RemoveParameterMIDIMapping:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
ca_require(inElement == 0, InvalidElement);
outWritable = true;
- outDataSize = sizeof (AUParameterMIDIMapping);
+ outDataSize = sizeof (AUParameterMIDIMapping);
result = noErr;
break;
#endif
@@ -155,7 +155,7 @@ OSStatus AUMIDIBase::DelegateGetProperty( AudioUnitPropertyID inID,
void * outData)
{
OSStatus result;
-
+
switch (inID) {
#if !TARGET_OS_IPHONE
case kMusicDeviceProperty_MIDIXMLNames:
@@ -163,7 +163,7 @@ OSStatus AUMIDIBase::DelegateGetProperty( AudioUnitPropertyID inID,
ca_require(inElement == 0, InvalidElement);
result = GetXMLNames((CFURLRef *)outData);
break;
-#endif
+#endif
#if CA_AUTO_MIDI_MAP
case kAudioUnitProperty_AllParameterMIDIMappings:{
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
@@ -175,7 +175,7 @@ OSStatus AUMIDIBase::DelegateGetProperty( AudioUnitPropertyID inID,
result = noErr;
break;
}
-
+
case kAudioUnitProperty_HotMapParameterMIDIMapping:{
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
ca_require(inElement == 0, InvalidElement);
@@ -185,7 +185,7 @@ OSStatus AUMIDIBase::DelegateGetProperty( AudioUnitPropertyID inID,
break;
}
#endif
-
+
default:
result = kAudioUnitErr_InvalidProperty;
break;
@@ -207,7 +207,7 @@ OSStatus AUMIDIBase::DelegateSetProperty( AudioUnitPropertyID inID,
UInt32 inDataSize)
{
OSStatus result;
-
+
switch (inID) {
#if CA_AUTO_MIDI_MAP
case kAudioUnitProperty_AddParameterMIDIMapping:{
@@ -215,11 +215,11 @@ OSStatus AUMIDIBase::DelegateSetProperty( AudioUnitPropertyID inID,
ca_require(inElement == 0, InvalidElement);
AUParameterMIDIMapping * maps = (AUParameterMIDIMapping*)inData;
mMapManager->SortedInsertToParamaterMaps (maps, (inDataSize / sizeof(AUParameterMIDIMapping)), mAUBaseInstance);
- mAUBaseInstance.PropertyChanged (kAudioUnitProperty_AllParameterMIDIMappings, kAudioUnitScope_Global, 0);
+ mAUBaseInstance.PropertyChanged (kAudioUnitProperty_AllParameterMIDIMappings, kAudioUnitScope_Global, 0);
result = noErr;
break;
}
-
+
case kAudioUnitProperty_RemoveParameterMIDIMapping:{
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
ca_require(inElement == 0, InvalidElement);
@@ -227,16 +227,16 @@ OSStatus AUMIDIBase::DelegateSetProperty( AudioUnitPropertyID inID,
bool didChange;
mMapManager->SortedRemoveFromParameterMaps(maps, (inDataSize / sizeof(AUParameterMIDIMapping)), didChange);
if (didChange)
- mAUBaseInstance.PropertyChanged (kAudioUnitProperty_AllParameterMIDIMappings, kAudioUnitScope_Global, 0);
+ mAUBaseInstance.PropertyChanged (kAudioUnitProperty_AllParameterMIDIMappings, kAudioUnitScope_Global, 0);
result = noErr;
break;
}
-
+
case kAudioUnitProperty_HotMapParameterMIDIMapping:{
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
ca_require(inElement == 0, InvalidElement);
AUParameterMIDIMapping & map = *((AUParameterMIDIMapping*)inData);
- mMapManager->SetHotMapping (map);
+ mMapManager->SetHotMapping (map);
result = noErr;
break;
}
@@ -249,7 +249,7 @@ OSStatus AUMIDIBase::DelegateSetProperty( AudioUnitPropertyID inID,
break;
}
#endif
-
+
default:
result = kAudioUnitErr_InvalidProperty;
break;
@@ -319,10 +319,10 @@ inline const Byte * NextMIDIEvent(const Byte *event, const Byte *end)
OSStatus AUMIDIBase::HandleMIDIPacketList(const MIDIPacketList *pktlist)
{
if (!mAUBaseInstance.IsInitialized()) return kAudioUnitErr_Uninitialized;
-
+
int nPackets = pktlist->numPackets;
const MIDIPacket *pkt = pktlist->packet;
-
+
while (nPackets-- > 0) {
const Byte *event = pkt->data, *packetEnd = event + pkt->length;
long startFrame = (long)pkt->timeStamp;
@@ -347,20 +347,20 @@ OSStatus AUMIDIBase::HandleMIDIPacketList(const MIDIPacketList *pktlist)
OSStatus AUMIDIBase::HandleMidiEvent(UInt8 status, UInt8 channel, UInt8 data1, UInt8 data2, UInt32 inStartFrame)
{
if (!mAUBaseInstance.IsInitialized()) return kAudioUnitErr_Uninitialized;
-
-#if CA_AUTO_MIDI_MAP
-// you potentially have a choice to make here - if a param mapping matches, do you still want to process the
+
+#if CA_AUTO_MIDI_MAP
+// you potentially have a choice to make here - if a param mapping matches, do you still want to process the
// MIDI event or not. The default behaviour is to continue on with the MIDI event.
if (mMapManager->HandleHotMapping (status, channel, data1, mAUBaseInstance)) {
mAUBaseInstance.PropertyChanged (kAudioUnitProperty_HotMapParameterMIDIMapping, kAudioUnitScope_Global, 0);
}
else {
mMapManager->FindParameterMapEventMatch(status, channel, data1, data2, inStartFrame, mAUBaseInstance);
- }
-#endif
-
+ }
+#endif
+
OSStatus result = noErr;
-
+
switch(status)
{
case kMidiMessage_NoteOn:
@@ -374,16 +374,16 @@ OSStatus AUMIDIBase::HandleMidiEvent(UInt8 status, UInt8 channel, UInt8 data1,
result = HandleNoteOff(channel, data1, data2, inStartFrame);
}
break;
-
+
case kMidiMessage_NoteOff:
result = HandleNoteOff(channel, data1, data2, inStartFrame);
break;
-
+
default:
result = HandleNonNoteEvent (status, channel, data1, data2, inStartFrame);
break;
}
-
+
return result;
}
@@ -396,15 +396,15 @@ OSStatus AUMIDIBase::HandleNonNoteEvent (UInt8 status, UInt8 channel, UInt8 data
case kMidiMessage_PitchWheel:
result = HandlePitchWheel(channel, data1, data2, inStartFrame);
break;
-
+
case kMidiMessage_ProgramChange:
result = HandleProgramChange(channel, data1);
break;
-
+
case kMidiMessage_ChannelPressure:
result = HandleChannelPressure(channel, data1, inStartFrame);
break;
-
+
case kMidiMessage_ControlChange:
{
switch (data1) {
@@ -419,7 +419,7 @@ OSStatus AUMIDIBase::HandleNonNoteEvent (UInt8 status, UInt8 channel, UInt8 data
case kMidiController_AllSoundOff:
result = HandleAllSoundOff(channel);
break;
-
+
default:
result = HandleControlChange(channel, data1, data2, inStartFrame);
break;
@@ -433,7 +433,7 @@ OSStatus AUMIDIBase::HandleNonNoteEvent (UInt8 status, UInt8 channel, UInt8 data
return result;
}
-OSStatus AUMIDIBase::SysEx (const UInt8 * inData,
+OSStatus AUMIDIBase::SysEx (const UInt8 * inData,
UInt32 inLength)
{
if (!mAUBaseInstance.IsInitialized()) return kAudioUnitErr_Uninitialized;
@@ -466,7 +466,7 @@ OSStatus AUMIDIBase::ComponentEntryDispatch( ComponentParameters * params,
if (This == NULL) return kAudio_ParamError;
OSStatus result;
-
+
switch (params->what) {
case kMusicDeviceMIDIEventSelect:
{
@@ -489,7 +489,7 @@ OSStatus AUMIDIBase::ComponentEntryDispatch( ComponentParameters * params,
result = badComponentSelector;
break;
}
-
+
return result;
}
#endif
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h
index 40c6a77695..223f50e406 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h
@@ -2,14 +2,14 @@
File: AUMIDIBase.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 __AUMIDIBase_h__
#define __AUMIDIBase_h__
@@ -66,24 +66,24 @@ public:
AUMIDIBase(AUBase* inBase);
/*! @dtor ~AUMIDIBase */
virtual ~AUMIDIBase();
-
+
/*! @method MIDIEvent */
- virtual OSStatus MIDIEvent( UInt32 inStatus,
- UInt32 inData1,
- UInt32 inData2,
+ virtual OSStatus MIDIEvent( UInt32 inStatus,
+ UInt32 inData1,
+ UInt32 inData2,
UInt32 inOffsetSampleFrame)
{
UInt32 strippedStatus = inStatus & 0xf0;
UInt32 channel = inStatus & 0x0f;
-
+
return HandleMidiEvent(strippedStatus, channel, inData1, inData2, inOffsetSampleFrame);
}
-
+
/*! @method HandleMIDIPacketList */
OSStatus HandleMIDIPacketList(const MIDIPacketList *pktlist);
-
+
/*! @method SysEx */
- virtual OSStatus SysEx( const UInt8 * inData,
+ virtual OSStatus SysEx( const UInt8 * inData,
UInt32 inLength);
#if TARGET_API_MAC_OSX
@@ -99,7 +99,7 @@ public:
AudioUnitScope inScope,
AudioUnitElement inElement,
void * outData);
-
+
/*! @method DelegateSetProperty */
virtual OSStatus DelegateSetProperty( AudioUnitPropertyID inID,
AudioUnitScope inScope,
@@ -118,15 +118,15 @@ protected:
UInt32 inStartFrame);
/*! @method HandleNonNoteEvent */
- virtual OSStatus HandleNonNoteEvent ( UInt8 status,
- UInt8 channel,
- UInt8 data1,
- UInt8 data2,
+ virtual OSStatus HandleNonNoteEvent ( UInt8 status,
+ UInt8 channel,
+ UInt8 data1,
+ UInt8 data2,
UInt32 inStartFrame);
#if TARGET_API_MAC_OSX
/*! @method GetXMLNames */
- virtual OSStatus GetXMLNames(CFURLRef *outNameDocument)
+ virtual OSStatus GetXMLNames(CFURLRef *outNameDocument)
{ return kAudioUnitErr_InvalidProperty; } // if not overridden, it's unsupported
#endif
@@ -136,25 +136,25 @@ protected:
UInt8 inNoteNumber,
UInt8 inVelocity,
UInt32 inStartFrame) { return noErr; }
-
+
/*! @method HandleNoteOff */
virtual OSStatus HandleNoteOff( UInt8 inChannel,
UInt8 inNoteNumber,
UInt8 inVelocity,
UInt32 inStartFrame) { return noErr; }
-
+
/*! @method HandleControlChange */
virtual OSStatus HandleControlChange( UInt8 inChannel,
UInt8 inController,
UInt8 inValue,
UInt32 inStartFrame) { return noErr; }
-
+
/*! @method HandlePitchWheel */
virtual OSStatus HandlePitchWheel( UInt8 inChannel,
UInt8 inPitch1,
UInt8 inPitch2,
UInt32 inStartFrame) { return noErr; }
-
+
/*! @method HandleChannelPressure */
virtual OSStatus HandleChannelPressure( UInt8 inChannel,
UInt8 inValue,
@@ -172,15 +172,15 @@ protected:
/*! @method HandleResetAllControllers */
virtual OSStatus HandleResetAllControllers(UInt8 inChannel) { return noErr; }
-
+
/*! @method HandleAllNotesOff */
virtual OSStatus HandleAllNotesOff( UInt8 inChannel) { return noErr; }
-
+
/*! @method HandleAllSoundOff */
virtual OSStatus HandleAllSoundOff( UInt8 inChannel) { return noErr; }
-//System messages
+//System messages
/*! @method HandleSysEx */
virtual OSStatus HandleSysEx( const UInt8 * inData,
UInt32 inLength ) { return noErr; }
@@ -188,19 +188,19 @@ protected:
#if CA_AUTO_MIDI_MAP
/* map manager */
CAAUMIDIMapManager *GetMIDIMapManager() {return mMapManager;};
-
+
#endif
-
+
private:
/*! @var mAUBaseInstance */
AUBase & mAUBaseInstance;
-
+
#if CA_AUTO_MIDI_MAP
/* map manager */
CAAUMIDIMapManager * mMapManager;
#endif
-
+
public:
#if !CA_USE_AUDIO_PLUGIN_ONLY
// component dispatcher
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp
index dfe307c9eb..c60aa407ec 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp
@@ -2,14 +2,14 @@
File: AUMIDIEffectBase.cpp
Abstract: AUMIDIEffectBase.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 "AUMIDIEffectBase.h"
@@ -61,7 +61,7 @@ static OSStatus AUMIDIEffectBaseMIDIEvent(void * inComponentStorage,
UInt32 inOffsetSampleFrame);
AUMIDIEffectBase::AUMIDIEffectBase( AudioComponentInstance inInstance,
- bool inProcessesInPlace )
+ bool inProcessesInPlace )
: AUEffectBase(inInstance, inProcessesInPlace),
AUMIDIBase(this)
{
@@ -74,12 +74,12 @@ OSStatus AUMIDIEffectBase::GetPropertyInfo(AudioUnitPropertyID inID,
Boolean & outWritable)
{
OSStatus result;
-
+
result = AUEffectBase::GetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable);
-
+
if (result == kAudioUnitErr_InvalidProperty)
result = AUMIDIBase::DelegateGetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable);
-
+
return result;
}
@@ -99,12 +99,12 @@ OSStatus AUMIDIEffectBase::GetProperty( AudioUnitPropertyID inID,
return kAudioUnitErr_InvalidElement;
}
#endif
-
+
result = AUEffectBase::GetProperty (inID, inScope, inElement, outData);
-
+
if (result == kAudioUnitErr_InvalidProperty)
result = AUMIDIBase::DelegateGetProperty (inID, inScope, inElement, outData);
-
+
return result;
}
@@ -116,10 +116,10 @@ OSStatus AUMIDIEffectBase::SetProperty( AudioUnitPropertyID inID,
{
OSStatus result = AUEffectBase::SetProperty (inID, inScope, inElement, inData, inDataSize);
-
+
if (result == kAudioUnitErr_InvalidProperty)
result = AUMIDIBase::DelegateSetProperty (inID, inScope, inElement, inData, inDataSize);
-
+
return result;
}
@@ -131,7 +131,7 @@ OSStatus AUMIDIEffectBase::ComponentEntryDispatch(ComponentParameters * para
if (This == NULL) return paramErr;
OSStatus result;
-
+
switch (params->what) {
case kMusicDeviceMIDIEventSelect:
case kMusicDeviceSysExSelect:
@@ -141,7 +141,7 @@ OSStatus AUMIDIEffectBase::ComponentEntryDispatch(ComponentParameters * para
result = AUEffectBase::ComponentEntryDispatch(params, This);
break;
}
-
+
return result;
}
#endif
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.h
index b38f506d6c..744abd6fd8 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.h
@@ -2,14 +2,14 @@
File: AUMIDIEffectBase.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 __AUMIDIEffectBase_h__
#define __AUMIDIEffectBase_h__
@@ -67,7 +67,7 @@ public:
{
return AUMIDIBase::MIDIEvent (inStatus, inData1, inData2, inOffsetSampleFrame);
}
-
+
/*! @method SysEx */
virtual OSStatus SysEx(const UInt8 * inData,
UInt32 inLength)
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.cpp
index 591c43ab8c..c2ed4cc925 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.cpp
@@ -2,14 +2,14 @@
File: AUOutputBase.cpp
Abstract: AUOutputBase.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.
-
+
*/
#if !CA_USE_AUDIO_PLUGIN_ONLY
#include "AUOutputBase.h"
@@ -52,7 +52,7 @@ OSStatus AUOutputBase::ComponentEntryDispatch(ComponentParameters *params, AUOu
if (This == NULL) return paramErr;
OSStatus result;
-
+
switch (params->what) {
case kAudioOutputUnitStartSelect:
{
@@ -70,7 +70,7 @@ OSStatus AUOutputBase::ComponentEntryDispatch(ComponentParameters *params, AUOu
result = badComponentSelector;
break;
}
-
+
return result;
}
#endif
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.h
index 8e5399b911..f1a3c157a7 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.h
@@ -2,14 +2,14 @@
File: AUOutputBase.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 __AUOutputBase_h__
#define __AUOutputBase_h__
@@ -63,7 +63,7 @@ public:
// additional component entry points
/*! @method Start */
virtual OSStatus Start() = 0;
-
+
/*! @method Stop */
virtual OSStatus Stop() = 0;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.cpp
index f1e2f248ab..91e7d9cc7e 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.cpp
@@ -2,14 +2,14 @@
File: AUPannerBase.cpp
Abstract: AUPannerBase.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 "AUPannerBase.h"
#include "CABundleLocker.h"
@@ -51,13 +51,13 @@
static bool sLocalized = false;
-static CFStringRef kPanner_Azimuth_Name = CFSTR("azimuth");
-static CFStringRef kPanner_Elevation_Name = CFSTR("elevation");
+static CFStringRef kPanner_Azimuth_Name = CFSTR("azimuth");
+static CFStringRef kPanner_Elevation_Name = CFSTR("elevation");
static CFStringRef kPanner_Distance_Name = CFSTR("distance");
-static CFStringRef kPanner_CoordScale_Name = CFSTR("coordinate scale");
-static CFStringRef kPanner_RefDistance_Name = CFSTR("reference distance");
-static CFStringRef kPanner_Gain_Name = CFSTR("gain");
+static CFStringRef kPanner_CoordScale_Name = CFSTR("coordinate scale");
+static CFStringRef kPanner_RefDistance_Name = CFSTR("reference distance");
+static CFStringRef kPanner_Gain_Name = CFSTR("gain");
static Float32 kPannerParamDefault_Azimuth = 0.;
static Float32 kPannerParamDefault_Elevation = 0.;
@@ -75,30 +75,30 @@ AUPannerBase::AUPannerBase(AudioComponentInstance inAudioUnit)
{
CABundleLocker lock;
if (!sLocalized)
- {
+ {
CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.audio.units.Components") );
if (bundle != NULL)
{
kPanner_Azimuth_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Azimuth_Name, CFSTR("AudioUnits"), bundle, CFSTR(""));
kPanner_Elevation_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Elevation_Name, CFSTR("AudioUnits"), bundle, CFSTR(""));
kPanner_Distance_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Distance_Name, CFSTR("AudioUnits"), bundle, CFSTR(""));
-
+
kPanner_CoordScale_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_CoordScale_Name, CFSTR("AudioUnits"), bundle, CFSTR(""));
kPanner_RefDistance_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_RefDistance_Name, CFSTR("AudioUnits"), bundle, CFSTR(""));
kPanner_Gain_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Gain_Name, CFSTR("AudioUnits"), bundle, CFSTR(""));
}
-
+
sLocalized = true;
}
}
-
+
CreateElements();
-
+
SetParameter(kPannerParam_Azimuth, kPannerParamDefault_Azimuth);
SetParameter(kPannerParam_Elevation, kPannerParamDefault_Elevation);
SetParameter(kPannerParam_Distance, kPannerParamDefault_Distance);
-
+
SetParameter(kPannerParam_CoordScale, kPannerParamDefault_CoordScale);
SetParameter(kPannerParam_RefDistance, kPannerParamDefault_RefDistance);
SetParameter(kPannerParam_Gain, kPannerParamDefault_Gain);
@@ -135,13 +135,13 @@ void AUPannerBase::AllocBypassMatrix()
static AudioChannelLayoutTag DefaultTagForNumberOfChannels(UInt32 inNumberChannels)
{
switch (inNumberChannels) {
- case 1: return kAudioChannelLayoutTag_Mono;
- case 2: return kAudioChannelLayoutTag_Stereo;
- case 4: return kAudioChannelLayoutTag_Quadraphonic;
- case 5: return kAudioChannelLayoutTag_AudioUnit_5_0;
- case 6: return kAudioChannelLayoutTag_AudioUnit_6_0;
- case 7: return kAudioChannelLayoutTag_AudioUnit_7_0;
- case 8: return kAudioChannelLayoutTag_AudioUnit_8;
+ case 1: return kAudioChannelLayoutTag_Mono;
+ case 2: return kAudioChannelLayoutTag_Stereo;
+ case 4: return kAudioChannelLayoutTag_Quadraphonic;
+ case 5: return kAudioChannelLayoutTag_AudioUnit_5_0;
+ case 6: return kAudioChannelLayoutTag_AudioUnit_6_0;
+ case 7: return kAudioChannelLayoutTag_AudioUnit_7_0;
+ case 8: return kAudioChannelLayoutTag_AudioUnit_8;
default: return 0xFFFF0000 | inNumberChannels;
}
@@ -153,7 +153,7 @@ static AudioChannelLayoutTag DefaultTagForNumberOfChannels(UInt32 inNumberChanne
OSStatus AUPannerBase::SetDefaultChannelLayoutsIfNone()
{
OSStatus err = noErr;
-
+
// if layout has not been set, then guess layout from number of channels
UInt32 inChannels = GetNumberOfInputChannels();
AudioChannelLayout inputLayoutSubstitute;
@@ -168,7 +168,7 @@ OSStatus AUPannerBase::SetDefaultChannelLayoutsIfNone()
err = SetAudioChannelLayout(kAudioUnitScope_Input, 0, &GetInputLayout());
if (err) return err;
}
-
+
// if layout has not been set, then guess layout from number of channels
UInt32 outChannels = GetNumberOfOutputChannels();
AudioChannelLayout outputLayoutSubstitute;
@@ -183,29 +183,29 @@ OSStatus AUPannerBase::SetDefaultChannelLayoutsIfNone()
err = SetAudioChannelLayout(kAudioUnitScope_Output, 0, &GetOutputLayout());
if (err) return err;
}
-
+
return err;
}
-
+
OSStatus AUPannerBase::UpdateBypassMatrix()
{
OSStatus err = SetDefaultChannelLayoutsIfNone();
if (err) return err;
-
+
UInt32 inChannels = GetNumberOfInputChannels();
- UInt32 outChannels = GetNumberOfOutputChannels();
-
+ UInt32 outChannels = GetNumberOfOutputChannels();
+
const AudioChannelLayout* inoutACL[2];
-
+
inoutACL[0] = &GetInputLayout();
inoutACL[1] = &GetOutputLayout();
mBypassMatrix.alloc(inChannels * outChannels, true);
-
+
UInt32 propSize = inChannels * outChannels * sizeof(Float32);
-
+
err = AudioFormatGetProperty(kAudioFormatProperty_MatrixMixMap, sizeof(inoutACL), inoutACL, &propSize, mBypassMatrix());
if (err) {
// if there is an error, use a diagonal matrix.
@@ -225,7 +225,7 @@ OSStatus AUPannerBase::UpdateBypassMatrix()
/*! @method Cleanup */
void AUPannerBase::Cleanup()
{
-
+
}
@@ -249,9 +249,9 @@ OSStatus AUPannerBase::GetParameterInfo( AudioUnitScope inScope,
outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable
+ kAudioUnitParameterFlag_IsReadable;
-
+
if (inScope == kAudioUnitScope_Global) {
-
+
switch(inParameterID)
{
case kPannerParam_Azimuth:
@@ -279,7 +279,7 @@ OSStatus AUPannerBase::GetParameterInfo( AudioUnitScope inScope,
outParameterInfo.flags += kAudioUnitParameterFlag_IsHighResolution;
//outParameterInfo.flags += kAudioUnitParameterFlag_DisplayLogarithmic;
break;
-
+
case kPannerParam_CoordScale:
AUBase::FillInParameterName (outParameterInfo, kPanner_CoordScale_Name, false);
outParameterInfo.unit = kAudioUnitParameterUnit_Meters;
@@ -313,9 +313,9 @@ OSStatus AUPannerBase::GetParameterInfo( AudioUnitScope inScope,
} else {
result = kAudioUnitErr_InvalidParameter;
}
-
+
return result;
-}
+}
//_____________________________________________________________________________
//
@@ -324,15 +324,15 @@ OSStatus AUPannerBase::GetParameter( AudioUnitParameterID inParamID,
AudioUnitElement inElement,
Float32 & outValue)
{
- if (inScope != kAudioUnitScope_Global)
+ if (inScope != kAudioUnitScope_Global)
return kAudioUnitErr_InvalidScope;
-
+
outValue = Globals()->GetParameter(inParamID);
return noErr;
}
-
+
//_____________________________________________________________________________
//
OSStatus AUPannerBase::SetParameter( AudioUnitParameterID inParamID,
@@ -341,11 +341,11 @@ OSStatus AUPannerBase::SetParameter( AudioUnitParameterID inParamID,
Float32 inValue,
UInt32 inBufferOffsetInFrames)
{
- if (inScope != kAudioUnitScope_Global)
+ if (inScope != kAudioUnitScope_Global)
return kAudioUnitErr_InvalidScope;
Globals()->SetParameter(inParamID, inValue);
-
+
return noErr;
}
@@ -365,7 +365,7 @@ OSStatus AUPannerBase::GetPropertyInfo (AudioUnitPropertyID inID,
case kAudioUnitProperty_BypassEffect:
if (inScope != kAudioUnitScope_Global)
return kAudioUnitErr_InvalidScope;
-
+
outWritable = true;
outDataSize = sizeof (UInt32);
break;
@@ -384,7 +384,7 @@ OSStatus AUPannerBase::GetProperty (AudioUnitPropertyID inID,
void * outData)
{
OSStatus err = noErr;
- switch (inID)
+ switch (inID)
{
case kAudioUnitProperty_BypassEffect:
if (inScope != kAudioUnitScope_Global)
@@ -407,14 +407,14 @@ OSStatus AUPannerBase::SetProperty(AudioUnitPropertyID inID,
const void * inData,
UInt32 inDataSize)
{
- switch (inID)
+ switch (inID)
{
case kAudioUnitProperty_BypassEffect:
if (inDataSize < sizeof(UInt32))
return kAudioUnitErr_InvalidPropertyValue;
bool tempNewSetting = *((UInt32*)inData) != 0;
// we're changing the state of bypass
- if (tempNewSetting != IsBypassEffect())
+ if (tempNewSetting != IsBypassEffect())
{
if (!tempNewSetting && IsBypassEffect() && IsInitialized()) // turning bypass off and we're initialized
Reset(0, 0);
@@ -444,15 +444,15 @@ OSStatus AUPannerBase::ChangeStreamFormat (
const CAStreamBasicDescription & inPrevFormat,
const CAStreamBasicDescription & inNewFormat)
{
- if (inScope == kAudioUnitScope_Input && !InputChannelConfigIsSupported(inNewFormat.NumberChannels()))
+ if (inScope == kAudioUnitScope_Input && !InputChannelConfigIsSupported(inNewFormat.NumberChannels()))
return kAudioUnitErr_FormatNotSupported;
-
- if (inScope == kAudioUnitScope_Output && !OutputChannelConfigIsSupported(inNewFormat.NumberChannels()))
+
+ if (inScope == kAudioUnitScope_Output && !OutputChannelConfigIsSupported(inNewFormat.NumberChannels()))
return kAudioUnitErr_FormatNotSupported;
-
+
if (inNewFormat.NumberChannels() != inPrevFormat.NumberChannels())
RemoveAudioChannelLayout(inScope, inElement);
-
+
return AUBase::ChangeStreamFormat(inScope, inElement, inPrevFormat, inNewFormat);
}
@@ -463,9 +463,9 @@ OSStatus AUPannerBase::Render(AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
UInt32 inNumberFrames)
{
- if (IsBypassEffect())
+ if (IsBypassEffect())
return BypassRender(ioActionFlags, inTimeStamp, inNumberFrames);
- else
+ else
return PannerRender(ioActionFlags, inTimeStamp, inNumberFrames);
}
@@ -483,16 +483,16 @@ OSStatus AUPannerBase::BypassRender(AudioUnitRenderActionFlags & ioActionFlags
AudioBufferList& outputBufferList = GetOutput(0)->GetBufferList();
AUBufferList::ZeroBuffer(outputBufferList);
-
- if (!isSilent)
+
+ if (!isSilent)
{
UInt32 inChannels = GetNumberOfInputChannels();
UInt32 outChannels = GetNumberOfOutputChannels();
Float32* bypass = mBypassMatrix();
for (UInt32 outChan = 0; outChan < outChannels; ++outChan)
{
- float* outData = GetOutput(0)->GetChannelData(outChan);
-
+ float* outData = GetOutput(0)->GetChannelData(outChan);
+
for (UInt32 inChan = 0; inChan < inChannels; ++inChan)
{
float* inData = GetInput(0)->GetChannelData(inChan);
@@ -510,13 +510,13 @@ UInt32 AUPannerBase::GetAudioChannelLayout( AudioUnitScope inScope,
AudioUnitElement inElement,
AudioChannelLayout * outLayoutPtr,
Boolean & outWritable)
-{
+{
SetDefaultChannelLayoutsIfNone();
-
+
outWritable = true;
-
+
CAAudioChannelLayout* caacl = NULL;
- switch (inScope)
+ switch (inScope)
{
case kAudioUnitScope_Input:
caacl = &mInputLayout;
@@ -527,14 +527,14 @@ UInt32 AUPannerBase::GetAudioChannelLayout( AudioUnitScope inScope,
default:
COMPONENT_THROW(kAudioUnitErr_InvalidScope);
}
-
+
if (inElement != 0)
COMPONENT_THROW(kAudioUnitErr_InvalidElement);
-
+
UInt32 size = caacl->IsValid() ? caacl->Size() : 0;
if (size > 0 && outLayoutPtr)
memcpy(outLayoutPtr, &caacl->Layout(), size);
-
+
return size;
}
@@ -544,7 +544,7 @@ OSStatus AUPannerBase::RemoveAudioChannelLayout( AudioUnitScope inScope,
AudioUnitElement inElement)
{
CAAudioChannelLayout* caacl = NULL;
- switch (inScope)
+ switch (inScope)
{
case kAudioUnitScope_Input:
caacl = &mInputLayout;
@@ -555,17 +555,17 @@ OSStatus AUPannerBase::RemoveAudioChannelLayout( AudioUnitScope inScope,
default:
return kAudioUnitErr_InvalidScope;
}
-
+
if (inElement != 0)
return kAudioUnitErr_InvalidElement;
-
+
*caacl = NULL;
return noErr;
}
//_____________________________________________________________________________
//
-OSStatus AUPannerBase::SetAudioChannelLayout( AudioUnitScope inScope,
+OSStatus AUPannerBase::SetAudioChannelLayout( AudioUnitScope inScope,
AudioUnitElement inElement,
const AudioChannelLayout * inLayout)
{
@@ -574,10 +574,10 @@ OSStatus AUPannerBase::SetAudioChannelLayout( AudioUnitScope inScope,
if (!ChannelLayoutTagIsSupported(inScope, inElement, inLayout->mChannelLayoutTag))
return kAudioUnitErr_FormatNotSupported;
-
+
CAAudioChannelLayout* caacl = NULL;
UInt32 currentChannels;
- switch (inScope)
+ switch (inScope)
{
case kAudioUnitScope_Input:
caacl = &mInputLayout;
@@ -590,28 +590,28 @@ OSStatus AUPannerBase::SetAudioChannelLayout( AudioUnitScope inScope,
default:
return kAudioUnitErr_InvalidScope;
}
-
+
if (inElement != 0)
return kAudioUnitErr_InvalidElement;
UInt32 numChannelsInLayout = CAAudioChannelLayout::NumberChannels(*inLayout);
if (currentChannels != numChannelsInLayout)
return kAudioUnitErr_InvalidPropertyValue;
-
+
*caacl = inLayout;
if (IsInitialized())
UpdateBypassMatrix();
-
+
return noErr;
}
//_____________________________________________________________________________
//
UInt32 AUPannerBase::GetChannelLayoutTags( AudioUnitScope inScope,
- AudioUnitElement inElement,
+ AudioUnitElement inElement,
AudioChannelLayoutTag* outTags)
{
- switch (inScope)
+ switch (inScope)
{
case kAudioUnitScope_Input:
if (outTags) {
@@ -687,20 +687,20 @@ bool AUPannerBase::OutputChannelConfigIsSupported(UInt32 inNumberChannels)
//_____________________________________________________________________________
//
-bool AUPannerBase::ChannelLayoutTagIsSupported( AudioUnitScope inScope,
- AudioUnitElement inElement,
+bool AUPannerBase::ChannelLayoutTagIsSupported( AudioUnitScope inScope,
+ AudioUnitElement inElement,
AudioChannelLayoutTag inTag)
{
UInt32 numTags = GetChannelLayoutTags(inScope, inElement, NULL);
CAAutoFree<AudioChannelLayoutTag> tags(numTags);
GetChannelLayoutTags(inScope, inElement, tags());
-
+
for (UInt32 i = 0; i < numTags; ++i)
{
if (tags[i] == inTag)
return true;
}
-
+
return false;
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.h
index 3184830523..8804255e24 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/AUPannerBase.h
@@ -2,14 +2,14 @@
File: AUPannerBase.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 __AUPannerBase_h__
#define __AUPannerBase_h__
@@ -61,7 +61,7 @@ public:
AUPannerBase(AudioComponentInstance inAudioUnit);
/*! @dtor ~AUPannerBase */
virtual ~AUPannerBase();
-
+
/*! @method Initialize */
virtual OSStatus Initialize();
@@ -114,14 +114,14 @@ public:
const CAStreamBasicDescription & inPrevFormat,
const CAStreamBasicDescription & inNewFormat);
-
+
/*! @method IsBypassEffect */
// This is used for the property value - to reflect to the UI if an effect is bypassed
bool IsBypassEffect () { return mBypassEffect; }
-
+
/*! @method SetBypassEffect */
virtual void SetBypassEffect (bool inFlag) { mBypassEffect = inFlag; }
-
+
/*! @method Render */
virtual OSStatus Render(AudioUnitRenderActionFlags & ioActionFlags,
@@ -146,17 +146,17 @@ public:
Boolean & outWritable);
/*! @method SetAudioChannelLayout */
- virtual OSStatus SetAudioChannelLayout( AudioUnitScope inScope,
+ virtual OSStatus SetAudioChannelLayout( AudioUnitScope inScope,
AudioUnitElement inElement,
const AudioChannelLayout * inLayout);
/*! @method RemoveAudioChannelLayout */
- virtual OSStatus RemoveAudioChannelLayout( AudioUnitScope inScope,
+ virtual OSStatus RemoveAudioChannelLayout( AudioUnitScope inScope,
AudioUnitElement inElement);
/*! @method GetChannelLayoutTags */
virtual UInt32 GetChannelLayoutTags( AudioUnitScope inScope,
- AudioUnitElement inElement,
+ AudioUnitElement inElement,
AudioChannelLayoutTag* outTags);
/*! @method GetNumberOfInputChannels */
@@ -169,7 +169,7 @@ public:
AudioUnitScope inScope,
AudioUnitElement inElement,
Float32 & outValue);
-
+
/*! @method SetParameter */
virtual OSStatus SetParameter( AudioUnitParameterID inParamID,
AudioUnitScope inScope,
@@ -185,7 +185,7 @@ public:
OSStatus err = SetParameter(inParamID, kAudioUnitScope_Global, 0, inValue, 0);
if (err) throw err;
}
-
+
/*! @method GetParameter */
Float32 GetParameter( UInt32 inParamID )
{
@@ -219,8 +219,8 @@ public:
/*! @method GetCoordScale */
Float32 GetCoordScale() { return GetParameter(kPannerParam_CoordScale); }
/*! @method GetRefDistance */
- Float32 GetRefDistance() { return GetParameter(kPannerParam_RefDistance); }
-
+ Float32 GetRefDistance() { return GetParameter(kPannerParam_RefDistance); }
+
/*! @method SetGain */
void SetGain(Float32 inValue) { SetParameter(kPannerParam_Gain, inValue); }
/*! @method SetAzimuth */
@@ -233,7 +233,7 @@ public:
void SetCoordScale(Float32 inValue) { SetParameter(kPannerParam_CoordScale, inValue); }
/*! @method SetRefDistance */
void SetRefDistance(Float32 inValue) { SetParameter(kPannerParam_RefDistance, inValue); }
-
+
protected:
/*! @method ShouldBypassEffect */
// This is used in the render call to see if an effect is bypassed
@@ -248,17 +248,17 @@ protected:
/*! @method SetDefaultChannelLayoutsIfNone */
OSStatus SetDefaultChannelLayoutsIfNone();
-
+
/*! @method ChannelLayoutTagIsSupported */
- bool ChannelLayoutTagIsSupported( AudioUnitScope inScope,
- AudioUnitElement inElement,
+ bool ChannelLayoutTagIsSupported( AudioUnitScope inScope,
+ AudioUnitElement inElement,
AudioChannelLayoutTag inTag);
-
+
const AudioChannelLayout& GetInputLayout() const { return mInputLayout.Layout(); }
const AudioChannelLayout& GetOutputLayout() const { return mOutputLayout.Layout(); }
-
+
private:
-
+
/*! @var UpdateBypassMatrix */
bool mBypassEffect;
/*! @var mBypassMatrix */
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp
index 28e4d366bc..15e13e8d38 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp
@@ -2,14 +2,14 @@
File: MusicDeviceBase.cpp
Abstract: MusicDeviceBase.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 "MusicDeviceBase.h"
@@ -90,10 +90,10 @@ static OSStatus MusicDeviceBaseStopNote(void * inComponentStorage,
#endif
-MusicDeviceBase::MusicDeviceBase(AudioComponentInstance inInstance,
+MusicDeviceBase::MusicDeviceBase(AudioComponentInstance inInstance,
UInt32 numInputs,
UInt32 numOutputs,
- UInt32 numGroups)
+ UInt32 numGroups)
: AUBase(inInstance, numInputs, numOutputs, numGroups),
AUMIDIBase(this)
{
@@ -106,8 +106,8 @@ OSStatus MusicDeviceBase::GetPropertyInfo(AudioUnitPropertyID inID,
Boolean & outWritable)
{
OSStatus result;
-
- switch (inID)
+
+ switch (inID)
{
#if !TARGET_OS_IPHONE
case kMusicDeviceProperty_InstrumentCount:
@@ -119,7 +119,7 @@ OSStatus MusicDeviceBase::GetPropertyInfo(AudioUnitPropertyID inID,
#endif
default:
result = AUBase::GetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable);
-
+
if (result == kAudioUnitErr_InvalidProperty)
result = AUMIDIBase::DelegateGetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable);
break;
@@ -134,7 +134,7 @@ OSStatus MusicDeviceBase::GetProperty( AudioUnitPropertyID inID,
{
OSStatus result;
- switch (inID)
+ switch (inID)
{
#if !CA_USE_AUDIO_PLUGIN_ONLY
case kAudioUnitProperty_FastDispatch:
@@ -146,7 +146,7 @@ OSStatus MusicDeviceBase::GetProperty( AudioUnitPropertyID inID,
else if (inElement == kMusicDeviceStartNoteSelect) {
*(TEMP_MusicDeviceStartNoteProc *)outData = MusicDeviceBaseStartNote;
return noErr;
- }
+ }
else if (inElement == kMusicDeviceStopNoteSelect) {
*(TEMP_MusicDeviceStopNoteProc *)outData = MusicDeviceBaseStopNote;
return noErr;
@@ -161,11 +161,11 @@ OSStatus MusicDeviceBase::GetProperty( AudioUnitPropertyID inID,
#endif
default:
result = AUBase::GetProperty (inID, inScope, inElement, outData);
-
+
if (result == kAudioUnitErr_InvalidProperty)
result = AUMIDIBase::DelegateGetProperty (inID, inScope, inElement, outData);
}
-
+
return result;
}
@@ -179,10 +179,10 @@ OSStatus MusicDeviceBase::SetProperty( AudioUnitPropertyID inID,
{
OSStatus result = AUBase::SetProperty (inID, inScope, inElement, inData, inDataSize);
-
+
if (result == kAudioUnitErr_InvalidProperty)
result = AUMIDIBase::DelegateSetProperty (inID, inScope, inElement, inData, inDataSize);
-
+
return result;
}
@@ -205,7 +205,7 @@ OSStatus MusicDeviceBase::HandleNoteOn( UInt8 inChannel,
params.mVelocity = inVelocity;
return StartNote (kMusicNoteEvent_UseGroupInstrument, inChannel, NULL, inStartFrame, params);
}
-
+
OSStatus MusicDeviceBase::HandleNoteOff( UInt8 inChannel,
UInt8 inNoteNumber,
UInt8 inVelocity,
@@ -214,17 +214,17 @@ OSStatus MusicDeviceBase::HandleNoteOff( UInt8 inChannel,
return StopNote (inChannel, inNoteNumber, inStartFrame);
}
-OSStatus
-MusicDeviceBase::HandleStartNoteMessage (MusicDeviceInstrumentID inInstrument,
- MusicDeviceGroupID inGroupID,
- NoteInstanceID * outNoteInstanceID,
- UInt32 inOffsetSampleFrame,
+OSStatus
+MusicDeviceBase::HandleStartNoteMessage (MusicDeviceInstrumentID inInstrument,
+ MusicDeviceGroupID inGroupID,
+ NoteInstanceID * outNoteInstanceID,
+ UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams * inParams)
{
if (inParams == NULL || outNoteInstanceID == NULL) return kAudio_ParamError;
if (!IsInitialized()) return kAudioUnitErr_Uninitialized;
-
+
return StartNote (inInstrument, inGroupID, outNoteInstanceID, inOffsetSampleFrame, *inParams);
}
@@ -251,7 +251,7 @@ OSStatus MusicDeviceBase::ComponentEntryDispatch( ComponentParameters * param
if (This == NULL) return kAudio_ParamError;
OSStatus result;
-
+
switch (params->what) {
case kMusicDeviceMIDIEventSelect:
case kMusicDeviceSysExSelect:
@@ -294,7 +294,7 @@ OSStatus MusicDeviceBase::ComponentEntryDispatch( ComponentParameters * param
result = AUBase::ComponentEntryDispatch(params, This);
break;
}
-
+
return result;
}
#endif
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h
index 4850b8f0cb..f7304a8eaa 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h
@@ -2,14 +2,14 @@
File: MusicDeviceBase.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 __MusicDeviceBase_h__
#define __MusicDeviceBase_h__
@@ -57,23 +57,23 @@
class MusicDeviceBase : public AUBase, public AUMIDIBase {
public:
/*! @ctor MusicDeviceBase */
- MusicDeviceBase( AudioComponentInstance inInstance,
+ MusicDeviceBase( AudioComponentInstance inInstance,
UInt32 numInputs,
UInt32 numOutputs,
UInt32 numGroups = 0);
- virtual OSStatus MIDIEvent( UInt32 inStatus,
- UInt32 inData1,
- UInt32 inData2,
+ virtual OSStatus MIDIEvent( UInt32 inStatus,
+ UInt32 inData1,
+ UInt32 inData2,
UInt32 inOffsetSampleFrame)
{
return AUMIDIBase::MIDIEvent (inStatus, inData1, inData2, inOffsetSampleFrame);
}
/*! @method SysEx */
- virtual OSStatus SysEx( const UInt8 * inData,
- UInt32 inLength)
+ virtual OSStatus SysEx( const UInt8 * inData,
+ UInt32 inLength)
{
return AUMIDIBase::SysEx (inData, inLength);
}
@@ -90,7 +90,7 @@ public:
AudioUnitScope inScope,
AudioUnitElement inElement,
void * outData);
-
+
/*! @method SetProperty */
virtual OSStatus SetProperty( AudioUnitPropertyID inID,
AudioUnitScope inScope,
@@ -103,7 +103,7 @@ public:
UInt8 inNoteNumber,
UInt8 inVelocity,
UInt32 inStartFrame);
-
+
/*! @method HandleNoteOff */
virtual OSStatus HandleNoteOff( UInt8 inChannel,
UInt8 inNoteNumber,
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp
index 2316807138..65c6de8340 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp
@@ -2,14 +2,14 @@
File: AUBaseHelper.cpp
Abstract: AUBaseHelper.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 "AUBaseHelper.h"
@@ -53,18 +53,18 @@
#endif
OSStatus GetFileRefPath (CFDictionaryRef parent, CFStringRef frKey, CFStringRef * fPath)
-{
+{
static CFStringRef kFRString = CFSTR (kAUPresetExternalFileRefs);
-
+
const void* frVal = CFDictionaryGetValue(parent, kFRString);
if (!frVal) return kAudioUnitErr_InvalidPropertyValue;
const void* frString = CFDictionaryGetValue ((CFDictionaryRef)frVal, frKey);
if (!frString) return kAudioUnitErr_InvalidPropertyValue;
-
+
if (fPath)
*fPath = (CFStringRef)frString;
-
+
return noErr;
}
@@ -74,7 +74,7 @@ CFMutableDictionaryRef CreateFileRefDict (CFStringRef fKey, CFStringRef fPath, C
fileRefDict = CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue (fileRefDict, fKey, fPath);
-
+
return fileRefDict;
}
@@ -113,11 +113,11 @@ void PrintAUParamEvent (AudioUnitParameterEvent& event, FILE* f)
fprintf (f, "\tEvent Type:%s,", (isRamp ? "ramp" : "immediate"));
if (isRamp)
fprintf (f, "start=%ld,dur=%ld,startValue=%f,endValue=%f\n",
- (long)event.eventValues.ramp.startBufferOffset, (long)event.eventValues.ramp.durationInFrames,
+ (long)event.eventValues.ramp.startBufferOffset, (long)event.eventValues.ramp.durationInFrames,
event.eventValues.ramp.startValue, event.eventValues.ramp.endValue);
else
- fprintf (f, "start=%ld,value=%f\n",
- (long)event.eventValues.immediate.bufferOffset,
+ fprintf (f, "start=%ld,value=%f\n",
+ (long)event.eventValues.immediate.bufferOffset,
event.eventValues.immediate.value);
fprintf (f, "- - - - - - - - - - - - - - - -\n");
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h
index 310a8df620..ad4cda627e 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h
@@ -2,14 +2,14 @@
File: AUBaseHelper.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 __AUBaseHelper_h__
#define __AUBaseHelper_h__
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.cpp
index 36bb41fa58..6164ae164e 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.cpp
@@ -2,14 +2,14 @@
File: AUBuffer.cpp
Abstract: AUBuffer.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 "AUBuffer.h"
#include <stdlib.h>
@@ -58,10 +58,10 @@ AUBufferList::~AUBufferList()
static UInt32 SafeMultiplyAddUInt32(UInt32 a, UInt32 b, UInt32 c)
{
if (a == 0 || b == 0) return c; // prevent zero divide
-
+
if (a > (0xFFFFFFFF - c) / b)
throw std::bad_alloc();
-
+
return a * b + c;
}
@@ -132,7 +132,7 @@ AudioBufferList & AUBufferList::PrepareBuffer(const CAStreamBasicDescription &fo
if (nStreams > mAllocatedStreams)
COMPONENT_THROW(kAudioUnitErr_FormatNotSupported);
}
-
+
AudioBufferList *abl = mPtrs;
abl->mNumberBuffers = nStreams;
AudioBuffer *buf = abl->mBuffers;
@@ -187,7 +187,7 @@ void AUBufferList::UseExternalBuffer(const CAStreamBasicDescription &format, co
Byte *oldMemory = mMemory;
mMemory = buf.buffer;
mAllocatedBytes = alignedSize;
- // from Allocate(): nBytes = nStreams * nFrames * format.mBytesPerFrame;
+ // from Allocate(): nBytes = nStreams * nFrames * format.mBytesPerFrame;
// thus: nFrames = nBytes / (nStreams * format.mBytesPerFrame)
mAllocatedFrames = mAllocatedBytes / (format.NumberChannelStreams() * format.mBytesPerFrame);
mExternalMemory = true;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.h
index 64ea4c3971..0bdea2300f 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.h
@@ -2,14 +2,14 @@
File: AUBuffer.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 __AUBuffer_h__
#define __AUBuffer_h__
@@ -75,7 +75,7 @@ class AUBufferList {
};
public:
/*! @ctor AUBufferList */
- AUBufferList() : mPtrState(kPtrsInvalid), mExternalMemory(false), mPtrs(NULL), mMemory(NULL),
+ AUBufferList() : mPtrState(kPtrsInvalid), mExternalMemory(false), mPtrs(NULL), mMemory(NULL),
mAllocatedStreams(0), mAllocatedFrames(0), mAllocatedBytes(0) { }
/*! @dtor ~AUBufferList */
~AUBufferList();
@@ -93,7 +93,7 @@ public:
memcpy(mPtrs, &abl, (char *)&abl.mBuffers[abl.mNumberBuffers] - (char *)&abl);
return *mPtrs;
}
-
+
/*! @method SetBuffer */
void SetBuffer(UInt32 index, const AudioBuffer &ab) {
if (mPtrState == kPtrsInvalid || index >= mPtrs->mNumberBuffers)
@@ -118,7 +118,7 @@ public:
COMPONENT_THROW(-1);
memcpy(&abl, mPtrs, (char *)&abl.mBuffers[abl.mNumberBuffers] - (char *)&abl);
}
-
+
/*! @method CopyBufferContentsTo */
void CopyBufferContentsTo(AudioBufferList &abl) const {
if (mPtrState == kPtrsInvalid)
@@ -134,12 +134,12 @@ public:
destbuf->mDataByteSize = srcbuf->mDataByteSize;
}
}
-
+
/*! @method Allocate */
void Allocate(const CAStreamBasicDescription &format, UInt32 nFrames);
/*! @method Deallocate */
void Deallocate();
-
+
/*! @method UseExternalBuffer */
void UseExternalBuffer(const CAStreamBasicDescription &format, const AudioUnitExternalBuffer &buf);
@@ -157,7 +157,7 @@ public:
/*! @method GetAllocatedFrames */
UInt32 GetAllocatedFrames() const { return mAllocatedFrames; }
-
+
private:
/*! @ctor AUBufferList */
AUBufferList(AUBufferList &) { } // prohibit copy constructor
@@ -184,34 +184,34 @@ private:
template <class T>
class TAUBuffer {
public:
- enum {
+ enum {
kAlignInterval = 0x10,
kAlignMask = kAlignInterval - 1
};
-
+
/*! @ctor TAUBuffer.0 */
TAUBuffer() : mMemObject(NULL), mAlignedBuffer(NULL), mBufferSizeBytes(0)
{
}
-
+
/*! @ctor TAUBuffer.1 */
TAUBuffer(UInt32 numElems, UInt32 numChannels) : mMemObject(NULL), mAlignedBuffer(NULL),
mBufferSizeBytes(0)
{
Allocate(numElems, numChannels);
}
-
+
/*! @dtor ~TAUBuffer */
~TAUBuffer()
{
Deallocate();
}
-
+
/*! @method Allocate */
void Allocate(UInt32 numElems) // can also re-allocate
{
UInt32 reqSize = numElems * sizeof(T);
-
+
if (mMemObject != NULL && reqSize == mBufferSizeBytes)
return; // already allocated
@@ -230,28 +230,28 @@ public:
{
if (mMemObject == NULL) return; // so this method has no effect if we're using
// an external buffer
-
+
free(mMemObject);
mMemObject = NULL;
mAlignedBuffer = NULL;
mBufferSizeBytes = 0;
}
-
+
/*! @method AllocateClear */
void AllocateClear(UInt32 numElems) // can also re-allocate
{
Allocate(numElems);
Clear();
}
-
+
/*! @method Clear */
void Clear()
{
memset(mAlignedBuffer, 0, mBufferSizeBytes);
}
-
+
// accessors
-
+
/*! @method operator T *()@ */
operator T *() { return mAlignedBuffer; }
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUInputFormatConverter.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUInputFormatConverter.h
index f628a915e1..bc82c7f67a 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUInputFormatConverter.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUInputFormatConverter.h
@@ -2,14 +2,14 @@
File: AUInputFormatConverter.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 __AUInputFormatConverter_h__
#define __AUInputFormatConverter_h__
@@ -69,14 +69,14 @@ public:
strcpy(mTimestampGenerator.mDebugName, "AUConverter");
#endif
}
-
+
// need to subsequently call Initialize, with the desired formats
-
+
/*! @dtor ~AUInputFormatConverter */
~AUInputFormatConverter()
{
}
-
+
virtual OSStatus Initialize(const AudioStreamBasicDescription &src, const AudioStreamBasicDescription &dest)
{
OSStatus err = FormatConverterClient::Initialize(src, dest);
@@ -92,7 +92,7 @@ public:
mTimestampGenerator.Reset();
return FormatConverterClient::Reset();
}
-
+
void SetStartInputTimeAtZero(bool b)
{
mTimestampGenerator.SetStartInputAtZero(b);
@@ -119,13 +119,13 @@ public:
}
/*! @method FormatConverterInputProc */
- virtual OSStatus FormatConverterInputProc(
+ virtual OSStatus FormatConverterInputProc(
UInt32 & ioNumberDataPackets,
AudioBufferList & ioData,
AudioStreamPacketDescription** outDataPacketDescription)
{
OSStatus err = ca_noErr;
-
+
AudioUnitRenderActionFlags actionFlags = 0;
AUInputElement *input = mHost->GetInput(mHostBus);
*ioNumberDataPackets = std::min(*ioNumberDataPackets, This->mHost->GetMaxFramesPerSlice());
@@ -144,7 +144,7 @@ protected:
AUBase * mHost;
/*! @var mHostBus */
int mHostBus;
-
+
AUTimestampGenerator mTimestampGenerator;
bool mIsPCMToPCM;
bool mHasSRC;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUMIDIDefs.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUMIDIDefs.h
index e83c0e7e8d..4fa7a6259e 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUMIDIDefs.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUMIDIDefs.h
@@ -2,14 +2,14 @@
File: AUMIDIDefs.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 __AUMIDIDefs_h__
#define __AUMIDIDefs_h__
@@ -75,7 +75,7 @@ enum
kMidiController_Balance = 8,
kMidiController_Pan = 10,
kMidiController_Expression = 11,
-
+
// these controls have a (0-63) == off, (64-127) == on
kMidiController_Sustain = 64, //hold1
kMidiController_Portamento = 65,
@@ -91,7 +91,7 @@ enum
kMidiController_VibratoRate = 76,
kMidiController_VibratoDepth = 77,
kMidiController_VibratoDelay = 78,
-
+
// these controls have a 0-127 range and in MIDI they have no LSB (so fractional values are lost in MIDI)
kMidiController_ReverbLevel = 91,
kMidiController_ChorusLevel = 93,
@@ -109,7 +109,7 @@ enum
};
// RPN values
-enum
+enum
{
kMidiControllerValue_RPNPitchBendSensitivity = 0,
kMidiControllerValue_RPNChannelFineTuning = 1,
@@ -119,7 +119,7 @@ enum
};
// GM2 Sound Bank Constants
-enum
+enum
{
kGM2MelodicBank = 0x7900,
kGM2PercussionBank = 0x7800,
@@ -129,7 +129,7 @@ enum
kBankMSBMask = 0xff00
};
-enum
+enum
{
kMSBController_MidPoint = 0x40
};
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUSilentTimeout.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUSilentTimeout.h
index 9fbd3e1f23..ad38819184 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUSilentTimeout.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUSilentTimeout.h
@@ -2,14 +2,14 @@
File: AUSilentTimeout.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 __AUSilentTimeout
#define __AUSilentTimeout
@@ -64,7 +64,7 @@ public:
mTimeoutCounter = inTimeoutLimit;
mResetTimer = false;
}
-
+
if(mTimeoutCounter > 0 )
{
mTimeoutCounter -= inFramesToProcess;
@@ -74,7 +74,7 @@ public:
else
{
// signal to reset the next time we receive silence
- mResetTimer = true;
+ mResetTimer = true;
}
}
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.cpp
index 7c57a81ede..85dad84914 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.cpp
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.cpp
@@ -2,14 +2,14 @@
File: AUTimestampGenerator.cpp
Abstract: AUTimestampGenerator.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 "AUTimestampGenerator.h"
#include "CAMath.h"
@@ -68,12 +68,12 @@ void AUTimestampGenerator::AddOutputTime(const AudioTimeStamp &inTimeStamp, Floa
if (mState.mBypassed)
return;
-
+
if (mState.mHostTimeDiscontinuityCorrection && !(mState.mCurrentOutputTime.mFlags & kAudioTimeStampHostTimeValid) && (mState.mLastOutputTime.mFlags & kAudioTimeStampHostTimeValid)) {
// no host time here but we had one last time, interpolate one
double rateScalar = (mState.mCurrentOutputTime.mFlags & kAudioTimeStampRateScalarValid) ? mState.mCurrentOutputTime.mRateScalar : 1.0;
Float64 deltaSamples = mState.mCurrentOutputTime.mSampleTime - mState.mLastOutputTime.mSampleTime;
- mState.mCurrentOutputTime.mHostTime = mState.mLastOutputTime.mHostTime +
+ mState.mCurrentOutputTime.mHostTime = mState.mLastOutputTime.mHostTime +
UInt64(CAHostTimeBase::GetFrequency() * deltaSamples * rateScalar / outputSampleRate);
mState.mCurrentOutputTime.mFlags |= kAudioTimeStampHostTimeValid;
#if DEBUG
@@ -90,7 +90,7 @@ void AUTimestampGenerator::AddOutputTime(const AudioTimeStamp &inTimeStamp, Floa
mState.mCurrentOutputTime.mFlags |= kAudioTimeStampRateScalarValid;
}
}
-
+
if (mFirstTime) {
mFirstTime = false;
mState.mDiscontinuous = false;
@@ -120,16 +120,16 @@ const AudioTimeStamp & AUTimestampGenerator::GenerateInputTime(Float64 framesToA
return mState.mCurrentOutputTime;
double inputSampleTime;
-
+
mState.mCurrentInputTime.mFlags = kAudioTimeStampSampleTimeValid;
double rateScalar = 1.0;
-
+
// propagate rate scalar
if (mState.mCurrentOutputTime.mFlags & kAudioTimeStampRateScalarValid) {
mState.mCurrentInputTime.mFlags |= kAudioTimeStampRateScalarValid;
mState.mCurrentInputTime.mRateScalar = rateScalar = mState.mCurrentOutputTime.mRateScalar;
}
-
+
// propagate host time and sample time
if (mState.mCurrentOutputTime.mFlags & kAudioTimeStampHostTimeValid) {
mState.mCurrentInputTime.mFlags |= kAudioTimeStampHostTimeValid;
@@ -142,7 +142,7 @@ const AudioTimeStamp & AUTimestampGenerator::GenerateInputTime(Float64 framesToA
mState.mCurrentInputTime.mHostTime = mState.mCurrentOutputTime.mHostTime;
}
if (mState.mHostTimeDiscontinuityCorrection && mState.mDiscontinuous && (mState.mLastOutputTime.mFlags & kAudioTimeStampHostTimeValid)) {
- // we had a discontinuous output time, need to resync by interpolating
+ // we had a discontinuous output time, need to resync by interpolating
// a sample time that is appropriate to the host time
UInt64 deltaHostTime = mState.mCurrentOutputTime.mHostTime - mState.mLastOutputTime.mHostTime;
double deltaSeconds = double(deltaHostTime) * CAHostTimeBase::GetInverseFrequency();
@@ -168,28 +168,28 @@ const AudioTimeStamp & AUTimestampGenerator::GenerateInputTime(Float64 framesToA
// we had a discontinuous output time, need to resync by propagating the
// detected discontinuity, taking the rate scalar adjustment into account
inputSampleTime += floor(mState.mDiscontinuityDeltaSamples / mState.mRateScalarAdj + 0.5);
-
+
#if DEBUG
if (mVerbosity > 1)
printf("%-20.20s: adjusted input time: %.0f -> %.0f (SR=%.3f, rs=%.3f, delta=%.0f)\n", mDebugName, mState.mNextInputSampleTime, inputSampleTime, inputSampleRate, mState.mRateScalarAdj, mState.mDiscontinuityDeltaSamples);
#endif
-
+
mState.mDiscontinuityDeltaSamples = 0.;
}
-
-
+
+
// propagate word clock
if (mState.mCurrentOutputTime.mFlags & kAudioTimeStampWordClockTimeValid) {
mState.mCurrentInputTime.mFlags |= kAudioTimeStampWordClockTimeValid;
mState.mCurrentInputTime.mWordClockTime = mState.mCurrentOutputTime.mWordClockTime;
}
-
+
// propagate SMPTE time
if (mState.mCurrentOutputTime.mFlags & kAudioTimeStampSMPTETimeValid) {
mState.mCurrentInputTime.mFlags |= kAudioTimeStampSMPTETimeValid;
mState.mCurrentInputTime.mSMPTETime = mState.mCurrentOutputTime.mSMPTETime;
}
-
+
// store the input sample time and expected next input time
mState.mCurrentInputTime.mSampleTime = inputSampleTime;
mState.mNextInputSampleTime = inputSampleTime + framesToAdvance;
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h
index cfd8456dfb..333dc195f0 100644
--- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h
+++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h
@@ -2,14 +2,14 @@
File: AUTimestampGenerator.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 __AUTimestampGenerator_h__
#define __AUTimestampGenerator_h__
@@ -76,14 +76,14 @@ public:
CAHostTimeBase::GetFrequency();
Reset();
}
-
+
void SetStartInputAtZero(bool b) { mState.mStartInputAtZero = b; }
bool GetStartInputAtZero() const { return mState.mStartInputAtZero; }
-
+
// bypassing is intended for a narrow special case. the upstream sample time will always be the same as the downstream time.
void SetBypassed(bool b) { mState.mBypassed = b; }
bool GetBypassed() const { return mState.mBypassed; }
-
+
// Call this to reset the timeline.
void Reset()
{
@@ -93,26 +93,26 @@ public:
mState.mNextOutputSampleTime = 0.;
mState.mLastOutputTime.mFlags = 0;
mState.mRateScalarAdj = 1.;
-
+
mFirstTime = true;
#if DEBUG
if (mVerbosity)
printf("%-20.20s: Reset\n", mDebugName);
#endif
}
-
+
// Call this once per render cycle with the downstream timestamp.
- // expectedDeltaFrames is the expected difference between the current and NEXT
+ // expectedDeltaFrames is the expected difference between the current and NEXT
// downstream timestamps.
// sampleRate is the OUTPUT sample rate.
void AddOutputTime(const AudioTimeStamp &inTimeStamp, Float64 expectedDeltaFrames, double outputSampleRate, double rateScalarAdj=1.0);
-
+
// Call this once per render cycle to obtain the upstream timestamp.
// framesToAdvance is the number of frames the input timeline is to be
// advanced during this render cycle.
// sampleRate is the INPUT sample rate.
const AudioTimeStamp & GenerateInputTime(Float64 framesToAdvance, double inputSampleRate, bool advanceHostTime = false);
-
+
// this can be called to override the setting of the next input sample time in GenerateInputTime
void Advance(Float64 framesToAdvance)
{
@@ -128,7 +128,7 @@ public:
Float64 mNextInputSampleTime;
Float64 mNextOutputSampleTime;
Float64 mInputSampleTimeForOutputPull;
-
+
AudioTimeStamp mLastOutputTime;
AudioTimeStamp mCurrentOutputTime;
@@ -137,21 +137,21 @@ public:
bool mDiscontinuous;
bool mBypassed;
Float64 mDiscontinuityDeltaSamples;
-
+
double mRateScalarAdj;
-
+
bool mHostTimeDiscontinuityCorrection; // If true, propagate timestamp discontinuities using host time.
};
-
+
void GetState(State& outState) const { outState = mState; }
void SetState(State const& inState) { mState = inState; mFirstTime = false; }
-
+
private:
-
+
struct State mState;
- bool mFirstTime;
-
+ bool mFirstTime;
+
#if DEBUG
public:
int mVerbosity;