iPlug2 - C++ Audio Plug-in Framework
IPlugWAM.h
1 /*
2  ==============================================================================
3 
4  This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5 
6  See LICENSE.txt for more info.
7 
8  ==============================================================================
9 */
10 
11 #ifndef _IPLUGAPI_
12 #define _IPLUGAPI_
13 
14 #include "IPlugAPIBase.h"
15 #include "IPlugProcessor.h"
16 #include "processor.h"
17 
18 using namespace WAM;
19 
20 BEGIN_IPLUG_NAMESPACE
21 
23 struct InstanceInfo
24 {};
25 
28 class IPlugWAM : public IPlugAPIBase
29  , public IPlugProcessor
30  , public Processor
31 {
32 public:
33  IPlugWAM(const InstanceInfo& info, const Config& config);
34 
35  //WAM
36  const char* init(uint32_t bufsize, uint32_t sr, void* pDesc) override;
37  void terminate() override { DBGMSG("terminate"); }
38  void resize(uint32_t bufsize) override { DBGMSG("resize"); }
39 
40  void onProcess(WAM::AudioBus* pAudio, void* pData) override;
41  void onMidi(byte status, byte data1, byte data2) override;
42  void onSysex(byte* pData, uint32_t size) override;
43  void onMessage(char* verb, char* res, double data) override;
44  void onMessage(char* verb, char* res, char* data) override;
45  void onMessage(char* verb, char* res, void* data, uint32_t size) override;
46  void onParam(uint32_t idparam, double value) override;
47 
48  //IPlugProcessor
49  void SetLatency(int samples) override {};
50  bool SendMidiMsg(const IMidiMsg& msg) override { return false; }
51  bool SendSysEx(const ISysEx& msg) override { return false; }
52 
53  //IEditorDelegate - these are overwritten because we need to use WAM messaging system
54  void SendControlValueFromDelegate(int ctrlTag, double normalizedValue) override;
55  void SendControlMsgFromDelegate(int ctrlTag, int msgTag, int dataSize, const void* pData) override;
56  void SendParameterValueFromDelegate(int paramIdx, double value, bool normalized) override;
57  void SendArbitraryMsgFromDelegate(int msgTag, int dataSize = 0, const void* pData = nullptr) override;
58 
59 private:
61  void OnEditorIdleTick();
62 };
63 
64 IPlugWAM* MakePlug(const InstanceInfo& info);
65 
66 END_IPLUG_NAMESPACE
67 
68 #endif
The base class for IPlug Audio Processing.
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
Definition: IPlugAPIBase.h:42
Encapsulates a MIDI message and provides helper functions.
Definition: IPlugMidi.h:30
bool SendMidiMsg(const IMidiMsg &msg) override
Send a single MIDI message // TODO: info about what thread should this be called on or not called on!...
Definition: IPlugWAM.h:50
bool SendSysEx(const ISysEx &msg) override
Send a single MIDI System Exclusive (SysEx) message // TODO: info about what thread should this be ca...
Definition: IPlugWAM.h:51
The base class for IPlug Audio Processing.
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
void SetLatency(int samples) override
Call this if the latency of your plug-in changes after initialization (perhaps from OnReset() ) This ...
Definition: IPlugWAM.h:49
A struct for dealing with SysEx messages.
Definition: IPlugMidi.h:538
WebAudioModule (WAM) API base class.
Definition: IPlugWAM.h:28