forked from osoumen/C700
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC700.h
128 lines (96 loc) · 3.98 KB
/
C700.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#pragma once
#include "AUInstrumentBase.h"
#include "C700Version.h"
#include "C700Generator.h"
#ifdef USE_CARBON_UI
#include "AUCarbonViewBase.h"
#endif
#if AU_DEBUG_DISPATCHER
#include "AUDebugDispatcher.h"
#endif
#include "C700defines.h"
#include "C700Kernel.h"
#pragma mark ____C700
class C700 : public AUInstrumentBase
{
public:
C700(AudioUnit component);
virtual ~C700();
virtual OSStatus Initialize();
virtual void Cleanup();
virtual OSStatus Reset( AudioUnitScope inScope,
AudioUnitElement inElement);
virtual OSStatus SetParameter( AudioUnitParameterID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
Float32 inValue,
UInt32 inBufferOffsetInFrames);
virtual OSStatus GetParameterInfo(AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
AudioUnitParameterInfo &outParameterInfo);
virtual OSStatus GetPropertyInfo(AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
UInt32 & outDataSize,
Boolean & outWritable );
virtual OSStatus GetProperty(AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
void * outData);
virtual OSStatus SetProperty(AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
const void * inData,
UInt32 inDataSize);
virtual ComponentResult GetPresets(CFArrayRef *outData) const;
virtual OSStatus NewFactoryPresetSet (const AUPreset & inNewFactoryPreset);
virtual OSStatus SaveState(CFPropertyListRef *outData);
virtual OSStatus RestoreState(CFPropertyListRef plist);
virtual bool SupportsTail() {return true;}
virtual Float64 GetLatency() {return mEfx->GetProcessDelayTime();}
virtual OSStatus RealTimeStartNote( SynthGroupElement *inGroup,
NoteInstanceID inNoteInstanceID,
UInt32 inOffsetSampleFrame,
const MusicDeviceNoteParams &inParams);
virtual OSStatus RealTimeStopNote( MusicDeviceGroupID inGroup,
NoteInstanceID inNoteInstanceID,
UInt32 inOffsetSampleFrame);
virtual OSStatus HandlePitchWheel( UInt8 inChannel,
UInt8 inPitch1,
UInt8 inPitch2,
UInt32 inStartFrame);
virtual OSStatus HandleControlChange(UInt8 inChannel,
UInt8 inController,
UInt8 inValue,
UInt32 inStartFrame);
virtual OSStatus HandleProgramChange(UInt8 inChannel,
UInt8 inValue,
UInt32 inStartFrame);
virtual OSStatus HandleResetAllControllers( UInt8 inChannel);
virtual OSStatus HandleAllNotesOff( UInt8 inChannel);
virtual OSStatus HandleAllSoundOff( UInt8 inChannel);
virtual OSStatus Render( AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
UInt32 inNumberFrames);
/*! @method Version */
virtual OSStatus Version() { return kC700Version; }
#ifdef USE_CARBON_UI
int GetNumCustomUIComponents () { return 1; }
void GetUIComponentDescs (ComponentDescription* inDescArray) {
inDescArray[0].componentType = kAudioUnitCarbonViewComponentType;
inDescArray[0].componentSubType = C700_COMP_SUBTYPE;
inDescArray[0].componentManufacturer = C700_COMP_MANF;
inDescArray[0].componentFlags = 0;
inDescArray[0].componentFlagsMask = 0;
}
#endif
private:
static void PropertyNotifyFunc(int propID, void* userData);
static void ParameterSetFunc(int paramID, float value, void* userData);
double mTempo;
C700Kernel *mEfx;
AUPreset *mPresets;
bool mParameterHasChanged[kNumberOfParameters];
int CreatePGDataDic(CFDictionaryRef *data, int pgnum);
void RestorePGDataDic(CFPropertyListRef data, int pgnum);
};