summaryrefslogtreecommitdiff
path: root/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h')
-rw-r--r--libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUInstrumentBase/SynthElement.h62
1 files changed, 31 insertions, 31 deletions
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