update xcodeprojects and xcshemes for Xcode 7.2
[wdl/wdl-ol.git] / IPlugExamples / IPlugMultiTargets / IPlugMultiTargets.h
blob2ea7b4eb30b7d5da990155a289709591b320f0dd
1 #ifndef __IPLUGMULTITARGETS__
2 #define __IPLUGMULTITARGETS__
4 #include "IPlug_include_in_plug_hdr.h"
5 #include "IMidiQueue.h"
7 #ifndef OS_IOS
8 #include "IControl.h"
9 #endif
11 // http://www.musicdsp.org/archive.php?classid=3#257
13 class CParamSmooth
15 public:
16 CParamSmooth() { a = 0.99; b = 1. - a; z = 0.; };
17 ~CParamSmooth() {};
18 inline double Process(double in) { z = (in * b) + (z * a); return z; }
19 private:
20 double a, b, z;
23 class IPlugMultiTargets : public IPlug
25 public:
27 IPlugMultiTargets(IPlugInstanceInfo instanceInfo);
28 ~IPlugMultiTargets();
30 void Reset();
31 void OnParamChange(int paramIdx);
33 #ifdef OS_IOS
34 void ProcessSingleReplacing(float** inputs, float** outputs, int nFrames);
35 #else
36 void ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames);
37 bool HostRequestingAboutBox();
38 #endif
40 int GetNumKeys();
41 bool GetKeyStatus(int key);
42 void ProcessMidiMsg(IMidiMsg* pMsg);
44 private:
45 #ifndef OS_IOS
46 IBitmapOverlayControl* mAboutBox;
47 IControl* mKeyboard;
48 int mMeterIdx_L, mMeterIdx_R;
49 #endif
51 IMidiQueue mMidiQueue;
53 int mNumKeys; // how many keys are being played (via midi)
54 bool mKeyStatus[128]; // array of on/off for each key
56 int mPhase;
57 int mNote;
58 int mKey;
60 double mGainL, mGainR;
61 double mSampleRate;
62 double mFreq;
63 double mNoteGain;
64 double mPrevL, mPrevR;
66 ITimeInfo mTimeInfo;
68 CParamSmooth mGainLSmoother, mGainRSmoother;
71 #ifndef OS_IOS
72 enum ELayout
74 kWidth = GUI_WIDTH, // width of plugin window
75 kHeight = GUI_HEIGHT, // height of plugin window
77 kKeybX = 1,
78 kKeybY = 233,
80 kGainX = 100,
81 kGainY = 100,
82 kKnobFrames = 60
84 #endif
85 #endif //__IPLUGMULTITARGETS__