[IPLUG] updated Examples.rtf with new Xcode5 info
[wdl/wdl-ol.git] / IPlugExamples / IPlugChunks / IPlugChunks.h
blob8429e615dd476b961ebd0ead9bb1fb8c91f81b61
1 #ifndef __IPLUGEFFECT__
2 #define __IPLUGEFFECT__
4 #include "IPlug_include_in_plug_hdr.h"
5 #include "IPlugChunks_controls.h"
7 /*
9 IPlugChunks - an example of storing data in chunks, and custom IControl classes
11 A step sequenced volume control / tarnce gate
13 Using chunks allows you to store arbitary data (e.g. a hidden, non-automatable parameter, a filepath etc) in the plugin's state,
14 i.e. when you save a preset to a file or when you save the project in your host
16 You need to override SerializeState / UnserializeState and set PLUG_DOES_STATE_CHUNKS 1 in resource.h
18 // WARNING - I'm not happy with how the multislider data is shared with the high priority thread
19 // need to rethink that
24 #define NUM_SLIDERS 16
25 #define BEAT_DIV 4 // semiquavers
27 class IPlugChunks : public IPlug
29 public:
31 IPlugChunks(IPlugInstanceInfo instanceInfo);
32 ~IPlugChunks();
34 void Reset();
35 void OnParamChange(int paramIdx);
37 void ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames);
39 bool SerializeState(ByteChunk* pChunk);
40 int UnserializeState(ByteChunk* pChunk, int startPos);
41 bool CompareState(const unsigned char* incomingState, int startPos);
43 void PresetsChangedByHost();
45 private:
47 double mSteps[NUM_SLIDERS];
49 double mGain;
50 unsigned long mCount, mPrevCount;
52 MultiSliderControlV *mMSlider;
55 #endif