summaryrefslogtreecommitdiff
path: root/libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases
diff options
context:
space:
mode:
Diffstat (limited to 'libs/appleutility/CoreAudio/AudioUnits/AUPublic/OtherBases')
-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
12 files changed, 349 insertions, 349 deletions
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,