[IPLUG/EXAMPLES] fix IPlugChunks example
[wdl/wdl-ol.git] / IPlugExamples / IPlugPolySynth / IPlugPolySynth.h
blob77e90fc8cdd4647d290945c585bd558c6f067cf1
1 #ifndef __IPLUGPOLYSYNTH__
2 #define __IPLUGPOLYSYNTH__
4 #include "IPlug_include_in_plug_hdr.h"
5 #include "IMidiQueue.h"
6 #include "IPlugPolySynthDSP.h"
8 #define MAX_VOICES 16
9 #define ATTACK_DEFAULT 5.
10 #define DECAY_DEFAULT 20.
11 #define RELEASE_DEFAULT 500.
12 #define TIME_MIN 2.
13 #define TIME_MAX 5000.
15 class IPlugPolySynth : public IPlug
17 public:
19 IPlugPolySynth(IPlugInstanceInfo instanceInfo);
20 ~IPlugPolySynth();
22 void Reset();
23 void OnParamChange(int paramIdx);
25 void ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames);
26 bool HostRequestingAboutBox();
28 int GetNumKeys();
29 bool GetKeyStatus(int key);
30 void ProcessMidiMsg(IMidiMsg* pMsg);
31 void NoteOnOff(IMidiMsg* pMsg);
33 private:
35 void NoteOnOffPoly(IMidiMsg* pMsg);
36 int FindFreeVoice();
38 IBitmapOverlayControl* mAboutBox;
39 IControl* mKeyboard;
41 IMidiQueue mMidiQueue;
43 int mActiveVoices;
44 int mKey;
45 int mNumHeldKeys;
46 bool mKeyStatus[128]; // array of on/off for each key
48 double mSampleRate;
50 CVoiceState mVS[MAX_VOICES];
51 CWTOsc* mOsc;
52 CADSREnvL* mEnv;
53 double* mTable;
56 enum ELayout
58 kWidth = GUI_WIDTH, // width of plugin window
59 kHeight = GUI_HEIGHT, // height of plugin window
61 kKeybX = 1,
62 kKeybY = 233,
64 kGainX = 100,
65 kGainY = 100,
66 kKnobFrames = 60
69 #endif //__IPLUGPOLYSYNTH__