iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IPlugVST2.h
Go to the documentation of this file.
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// Only load one API class!
14
20#include "aeffectx.h"
21#include "IPlugAPIBase.h"
22#include "IPlugProcessor.h"
23
24BEGIN_IPLUG_NAMESPACE
25
27struct InstanceInfo
28{
29 audioMasterCallback mVSTHostCallback;
30};
31
34class IPlugVST2 : public IPlugAPIBase
35 , public IPlugProcessor
36{
37public:
38 IPlugVST2(const InstanceInfo& info, const Config& config);
39
40 //IPlugAPIBase
41 void BeginInformHostOfParamChange(int idx) override;
42 void InformHostOfParamChange(int idx, double normalizedValue) override;
43 void EndInformHostOfParamChange(int idx) override;
44 void InformHostOfPresetChange() override;
45 void HostSpecificInit() override;
46 bool EditorResize(int viewWidth, int viewHeight) override;
47
48 //IPlugProcessor
49 void SetLatency(int samples) override;
50 bool SendMidiMsg(const IMidiMsg& msg) override;
51 bool SendSysEx(const ISysEx& msg) override;
52
53 //IPlugVST
54 audioMasterCallback& GetHostCallback() { return mHostCallback; }
55 AEffect& GetAEffect() { return mAEffect; }
56 void OutputSysexFromEditor();
57
58private:
59 virtual VstIntPtr VSTVendorSpecific(VstInt32 idx, VstIntPtr value, void* ptr, float opt) { return 0; }
60 virtual VstIntPtr VSTCanDo(const char* hostString) { return 0; }
61
69 template <class SAMPLETYPE>
70 void VSTPreProcess(SAMPLETYPE** inputs, SAMPLETYPE** outputs, VstInt32 nFrames);
71
72 static VstIntPtr VSTCALLBACK VSTDispatcher(AEffect *pEffect, VstInt32 opCode, VstInt32 idx, VstIntPtr value, void *ptr, float opt);
73 static void VSTCALLBACK VSTProcess(AEffect *pEffect, float **inputs, float **outputs, VstInt32 nFrames); // Deprecated.
74 static void VSTCALLBACK VSTProcessReplacing(AEffect *pEffect, float **inputs, float **outputs, VstInt32 nFrames);
75 static void VSTCALLBACK VSTProcessDoubleReplacing(AEffect *pEffect, double **inputs, double **outputs, VstInt32 nFrames);
76 static float VSTCALLBACK VSTGetParameter(AEffect *pEffect, VstInt32 idx);
77 static void VSTCALLBACK VSTSetParameter(AEffect *pEffect, VstInt32 idx, float value);
78
79 bool SendVSTEvent(VstEvent& event);
80 bool SendVSTEvents(WDL_TypedBuf<VstEvent>* pEvents);
81
82 void UpdateEditRect();
83
84 ERect mEditRect;
85 VstSpeakerArrangement mInputSpkrArr, mOutputSpkrArr;
86
87 enum { VSTEXT_NONE=0, VSTEXT_COCKOS, VSTEXT_COCOA }; // list of VST extensions supported by host
88 int mHasVSTExtensions;
89
90 IByteChunk mState; // Persistent storage if the host asks for plugin state.
91 IByteChunk mBankState; // Persistent storage if the host asks for bank state.
92protected:
93 AEffect mAEffect;
94 audioMasterCallback mHostCallback;
95};
96
97#ifndef REAPER_PLUGIN
98IPlugVST2* MakePlug(const InstanceInfo& info);
99#endif
100
101END_IPLUG_NAMESPACE
102
103#endif
Manages a block of memory, for plug-in settings store/recall.
Definition: IPlugStructs.h:112
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
Definition: IPlugAPIBase.h:43
The base class for IPlug Audio Processing.
VST2.4 API base class for an IPlug plug-in.
Definition: IPlugVST2.h:36
void InformHostOfParamChange(int idx, double normalizedValue) override
Implemented by the API class, called by the UI via SetParameterValue() with the value of a parameter ...
Definition: IPlugVST2.cpp:184
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: IPlugVST2.cpp:243
void EndInformHostOfParamChange(int idx) override
Implemented by the API class, called by the UI (or by a delegate) at the end of a parameter change ge...
Definition: IPlugVST2.cpp:189
void SetLatency(int samples) override
Call this if the latency of your plug-in changes after initialization (perhaps from OnReset() ) This ...
Definition: IPlugVST2.cpp:224
bool EditorResize(int viewWidth, int viewHeight) override
Implementations call into the APIs resize hooks returns a bool to indicate whether the DAW or plugin ...
Definition: IPlugVST2.cpp:199
void HostSpecificInit() override
This method is implemented in some API classes, in order to do specific initialisation for particular...
Definition: IPlugVST2.cpp:272
bool SendSysEx(const ISysEx &msg) override
Send a single MIDI System Exclusive (SysEx) message // TODO: info about what thread should this be ca...
Definition: IPlugVST2.cpp:258
void BeginInformHostOfParamChange(int idx) override
Implemented by the API class, called by the UI (or by a delegate) at the beginning of a parameter cha...
Definition: IPlugVST2.cpp:179
void InformHostOfPresetChange() override
Implemented by the API class, called by the UI (etc) when the plug-in initiates a program/preset chan...
Definition: IPlugVST2.cpp:194
Encapsulates a MIDI message and provides helper functions.
Definition: IPlugMidi.h:31
A struct for dealing with SysEx messages.
Definition: IPlugMidi.h:539