Jamoma API  0.6.0.a19
PlugtasticAUEffect.h
1 #include "AUEffectBase.h"
2 #include "PlugtasticAUEffectVersion.h"
3 #include "PlugtasticAUEffectGraph.h"
4 
5 #if AU_DEBUG_DISPATCHER
6 #include "AUDebugDispatcher.h"
7 #endif
8 
9 
10 #ifndef __PlugtasticAUEffect_h__
11 #define __PlugtasticAUEffect_h__
12 
13 class PlugtasticAUParameters;
14 
15 class PlugtasticAUEffect : public AUEffectBase
16 {
17  PlugtasticAUEffectGraph* mGraph;
18  PlugtasticAUParameters* mParameters;
19 
20 public:
21 
22  PlugtasticAUEffect(AudioUnit component);
23 
24  virtual ~PlugtasticAUEffect()
25  {
26  delete mGraph;
27  delete mParameters;
28 
29 #if AU_DEBUG_DISPATCHER
30  delete mDebugDispatcher;
31 #endif
32  }
33 
34  virtual OSStatus GetParameterValueStrings(AudioUnitScope inScope, AudioUnitParameterID inParameterID, CFArrayRef* outStrings);
35 
36  virtual OSStatus GetParameterInfo(AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo &outParameterInfo);
37 
38  virtual OSStatus GetPropertyInfo(AudioUnitPropertyID inID,
39  AudioUnitScope inScope,
40  AudioUnitElement inElement,
41  UInt32& outDataSize,
42  Boolean& outWritable);
43 
44  virtual ComponentResult SetParameter(AudioUnitParameterID inID,
45  AudioUnitScope inScope,
46  AudioUnitElement inElement,
47  Float32 inValue,
48  UInt32 inBufferOffsetInFrames);
49 
50  virtual void SetParameter(AudioUnitParameterID inID, Float32 inValue);
51 
52  virtual OSStatus GetProperty(AudioUnitPropertyID inID,
53  AudioUnitScope inScope,
54  AudioUnitElement inElement,
55  void* outData);
56 
57  virtual bool SupportsTail()
58  {
59  return false;
60  }
61 
62  virtual OSStatus Version()
63  {
64  return kPlugtasticAUEffectVersion;
65  }
66 
67 
68 #pragma mark -
69 #pragma mark audio
70 
71  struct PlugtasticScheduledProcessParams {
72  ScheduledProcessParams au; // official AU way of doing this
73  AudioBufferList* sidechainInputBufferList; // our extension of the struct to pass sidechains
74  AudioBufferList* sidechainOutputBufferList;
75  };
76 
77 
78  // Our own custom prototype signature so we can do sidechains
79  OSStatus ProcessBufferLists(AudioUnitRenderActionFlags& ioActionFlags,
80  const AudioBufferList& inBufferList,
81  AudioBufferList& outBufferList,
82  UInt32 nFrames,
83  const AudioBufferList* inSidechainBufferList,
84  AudioBufferList* outSidechainBufferList);
85 
86  // Standard AU Override
87  virtual OSStatus ProcessBufferLists(AudioUnitRenderActionFlags& iFlags,
88  const AudioBufferList& inBufferList,
89  AudioBufferList& outBufferList,
90  UInt32 iFrames);
91 
92  virtual OSStatus ProcessScheduledSlice(void* inUserData,
93  UInt32 inStartFrameInBuffer,
94  UInt32 inSliceFramesToProcess,
95  UInt32 inTotalBufferFrames );
96 
97  virtual OSStatus Render(AudioUnitRenderActionFlags& ioActionFlags,
98  const AudioTimeStamp& inTimeStamp,
99  UInt32 nFrames);
100 };
101 
102 
103 #endif // __PlugtasticAUEffect_h__