/Users/airy/Sources/augui/AUGUIFramework/SampleCode/CAUGuiSDK (AUGUI)/projectfiles/CAUGuiDemoAU.h

Go to the documentation of this file.
00001 /*      Copyright:      © Copyright 2002 Urs Heckmann. All rights reserved.
00002 
00003         CAUGuiDemoAU.h
00004         
00005 =============================================================================*/
00006 
00007 #ifndef __CAUGuiDemoAU_h__
00008 #define __CAUGuiDemoAU_h__
00009 
00010 #ifndef PI
00011 #define PI (3.1415926535897932384626433832795)
00012 #endif
00013 
00014 #define kProperty_MIDILearn 100000
00015 
00016 #include <AudioUnit/AudioUnitCarbonView.h>
00017 #include "AUMIDIEffectBase.h"
00018 
00019 #include "CAUGuiDemoCsts.h"
00020 #include "CAUGuiConfig.h"
00021 
00022 //#include "EZ_AU_preset.h"
00023 
00024 enum
00025 {
00026         kParam_Knob_1 = 0,
00027         kParam_Knob_2,
00028         kParam_Buttons_1,
00029         kParam_Buttons_2,
00030         kParam_Slider_1,
00031         kParam_Slider_2,
00032         kParam_Slider_3,
00033         kParam_Display_1,
00034         
00035         // You can use non-standard parameters after the standard ones
00036         
00037         kNumParameters,
00038         
00039         
00040         kNumAUParameters = kNumParameters,// here it's the same number...
00041         
00042         kNumPresets = 10
00043         
00044 };
00045 
00046 typedef struct EZ_preset
00047 {
00048         char                    name[ 32 ];
00049         float                   values[ kNumParameters ];
00050         
00051         // put whatever you like here
00052         // i.e. Audiofile References
00053         
00054         // Don't use pointers here, just plain data!!!
00055 
00056 } EZ_preset;
00057 
00058 class CAUGuiDemoAU : public AUMIDIEffectBase
00059 {
00060 
00061         public:
00062                 
00063                 CAUGuiDemoAU(AudioUnit);
00064                 
00065                 ~CAUGuiDemoAU();
00066                 
00067                 ComponentResult         Initialize(void);
00068         
00069                 ComponentResult         Reset   (AudioUnitScope, AudioUnitElement);
00070         
00071                 ComponentResult         GetParameterList (AudioUnitScope, AudioUnitParameterID*, UInt32&);
00072         
00073                 UInt32                          SupportedNumChannels (const AUChannelInfo**);
00074                 
00075                 ComponentResult GetParameterInfo(       AudioUnitScope inScope,
00076                                                                                         AudioUnitParameterID inParameterID,
00077                                                                                         AudioUnitParameterInfo &outParameterInfo );
00078                 
00079                 ComponentResult         SaveState( CFPropertyListRef * outData);
00080                 
00081                 ComponentResult         RestoreState( CFPropertyListRef inData);
00082                 
00083                 ComponentResult GetParameterValueStrings(       AudioUnitScope inScope, 
00084                                                                                                         AudioUnitParameterID inID,
00085                                                                                                         CFArrayRef* tArrayRef);
00086 
00087                 
00088                 ComponentResult         GetPresets ( CFArrayRef * outData) const;
00089 
00090                 OSStatus NewFactoryPresetSet (const AUPreset & inNewFactoryPreset);
00091 
00092 
00093                 ComponentResult GetPropertyInfo( AudioUnitPropertyID inID, AudioUnitScope inScope,
00094                                                 AudioUnitElement inElement, UInt32 & outDataSize,
00095                                                 Boolean & outWritable);
00096                                                                                                 
00097                 ComponentResult GetProperty( AudioUnitPropertyID inID,
00098                                             AudioUnitScope inScope,
00099                                             AudioUnitElement inElement,
00100                                             void * outData);
00101                                                                                         
00102                 ComponentResult SetProperty( AudioUnitPropertyID inID,
00103                                                            AudioUnitScope inScope,
00104                                                            AudioUnitElement inElement,
00105                                                            const void *inData,
00106                                              UInt32 inDataSize);
00107                 void    HandleControlChange(    int     inChannel,
00108                                                                 UInt8   inController,
00109                                                                 UInt8   inValue,
00110                                                                 long    inStartFrame);
00111 
00112                     // NEW in Dec 02 Dev Tools
00113                 int     GetNumCustomUIComponents ();
00114                 void    GetUIComponentDescs (ComponentDescription* inDescArray);
00115 
00116 
00117                 ComponentResult         GetParameter (AudioUnitParameterID, AudioUnitScope,     AudioUnitElement, Float32&);
00118 
00119                 ComponentResult         SetParameter (AudioUnitParameterID,     AudioUnitScope, AudioUnitElement, Float32, UInt32);
00120 
00121                 OSStatus                        ProcessBufferLists (AudioUnitRenderActionFlags&, const AudioBufferList&, AudioBufferList&, UInt32);
00122                 
00123                 ComponentResult Version()
00124                 {
00125                     return DEMO_VERSION;
00126                 }
00127                 
00128 
00129 private:
00130         
00131                 
00132                 void                            clearBuffers(); // Unused :-)
00133         
00134 
00135                 // Variables for plugin maintainance
00136                 
00137                 const AudioUnitParameterInfo*   m_asParInfo;            // array of parameter infos
00138                 const AUChannelInfo*                    m_asChannelInfo;        // array of i/o configurations
00139                 float*                                                  m_arPar;                        // parameter value latches
00140                 
00141                 // Internal Parameters to be exchanged between AU and View but are not common parameters
00142                 
00143                 // These are read out via timer, suitable for VUmeters...
00144                 
00145                 float                                                   internalParameters[ kNumInternalParameters ];
00146                 
00147                 // The "dirty" Parameters when editing a Preset
00148                 
00149                 EZ_preset                                               editPreset;
00150                 
00151                 // The default presets
00152                 
00153                 EZ_preset                                               Presets[ kNumPresets ];
00154                 
00155                 // The Apple-way Prest name + number
00156                 
00157                 AUPreset                                                AU_Presets[ kNumPresets ];
00158                 
00159                 // The Preset that's currently edited
00160                 
00161                 int                                                             currentPreset;
00162 
00163                 // For MIDI Learn
00164                 short                   mMIDICC[128];   // mMIDICC[CC] is the param to change when receiving a CC. -1 is not bound
00165                 short                   mCurrentLearning; // The parameter ID for the current MIDI learning. (-1 is none)        
00166 };
00167 
00168 #endif // __CAUGuiDemoAU_h__
00169 





Generated on Sat Jul 8 13:02:22 2006 for AUGUI Framework by doxygen1.4.6

hosted on SourceForge.net Logo