13#include "pluginterfaces/base/ustring.h"
14#include "pluginterfaces/base/ibstream.h"
15#include "pluginterfaces/vst/ivstparameterchanges.h"
16#include "pluginterfaces/vst/ivstevents.h"
17#include "pluginterfaces/vst/ivstmidicontrollers.h"
22using namespace Steinberg;
25#include "IPlugVST3_Parameter.h"
27#pragma mark - IPlugVST3 Constructor/Destructor
29IPlugVST3::IPlugVST3(
const InstanceInfo& info,
const Config& config)
38IPlugVST3::~IPlugVST3() {}
40#pragma mark AudioEffect overrides
42Steinberg::uint32 PLUGIN_API IPlugVST3::getTailSamples()
47tresult PLUGIN_API IPlugVST3::initialize(FUnknown* context)
51 if (SingleComponentEffect::initialize(context) == kResultOk)
53 IPlugVST3ProcessorBase::Initialize(
this);
56 IPlugVST3GetHost(
this, context);
66tresult PLUGIN_API IPlugVST3::terminate()
70 return SingleComponentEffect::terminate();
73tresult PLUGIN_API IPlugVST3::setBusArrangements(SpeakerArrangement* pInputBusArrangements, int32 numInBuses, SpeakerArrangement* pOutputBusArrangements, int32 numOutBuses)
77 return IPlugVST3ProcessorBase::SetBusArrangements(
this, pInputBusArrangements, numInBuses, pOutputBusArrangements, numOutBuses) ? kResultTrue : kResultFalse;
80tresult PLUGIN_API IPlugVST3::setActive(TBool state)
85 return SingleComponentEffect::setActive(state);
88tresult PLUGIN_API IPlugVST3::setupProcessing(ProcessSetup& newSetup)
92 return SetupProcessing(newSetup, processSetup) ? kResultOk : kResultFalse;
95tresult PLUGIN_API IPlugVST3::setProcessing(TBool state)
97 Trace(TRACELOC,
" state: %i", state);
99 return SetProcessing((
bool) state) ? kResultOk : kResultFalse;
102tresult PLUGIN_API IPlugVST3::process(ProcessData& data)
106 Process(data, processSetup, audioInputs, audioOutputs, mMidiMsgsFromEditor, mMidiMsgsFromProcessor, mSysExDataFromEditor, mSysexBuf);
110tresult PLUGIN_API IPlugVST3::canProcessSampleSize(int32 symbolicSampleSize)
112 return CanProcessSampleSize(symbolicSampleSize) ? kResultTrue : kResultFalse;
115tresult PLUGIN_API IPlugVST3::setState(IBStream* pState)
119 return IPlugVST3State::SetState(
this, pState) ? kResultOk :kResultFalse;
122tresult PLUGIN_API IPlugVST3::getState(IBStream* pState)
126 return IPlugVST3State::GetState(
this, pState) ? kResultOk :kResultFalse;
129#pragma mark IEditController overrides
130ParamValue PLUGIN_API IPlugVST3::getParamNormalized(ParamID tag)
132 return IPlugVST3ControllerBase::GetParamNormalized(tag);
135tresult PLUGIN_API IPlugVST3::setParamNormalized(ParamID tag, ParamValue value)
137 if (IPlugVST3ControllerBase::SetParamNormalized(
this, tag, value))
143IPlugView* PLUGIN_API IPlugVST3::createView(
const char* name)
145 if (
HasUI() && name && strcmp(name,
"editor") == 0)
147 mView =
new ViewType(*
this);
154tresult PLUGIN_API IPlugVST3::setEditorState(IBStream* pState)
160tresult PLUGIN_API IPlugVST3::getEditorState(IBStream* pState)
166tresult PLUGIN_API IPlugVST3::setComponentState(IBStream* pState)
172#pragma mark IMidiMapping overrides
174tresult PLUGIN_API IPlugVST3::getMidiControllerAssignment(int32 busIndex, int16 midiChannel, CtrlNumber midiCCNumber, ParamID& tag)
176 if (busIndex == 0 && midiChannel < VST3_NUM_CC_CHANS)
178 tag = kMIDICCParamStartIdx + (midiChannel * kCountCtrlNumber) + midiCCNumber;
185#pragma mark IInfoListener overrides
187Steinberg::tresult PLUGIN_API IPlugVST3::setChannelContextInfos(Steinberg::Vst::IAttributeList* pList)
189 return IPlugVST3ControllerBase::SetChannelContextInfos(pList) ? kResultTrue : kResultFalse;
192#pragma mark IPlugAPIBase overrides
196 Trace(TRACELOC,
"%d", idx);
202 Trace(TRACELOC,
"%d:%f", idx, normalizedValue);
203 performEdit(idx, normalizedValue);
208 Trace(TRACELOC,
"%d", idx);
214 FUnknownPtr<IComponentHandler> handler(componentHandler);
215 handler->restartComponent(kParamTitlesChanged);
222 if (viewWidth != GetEditorWidth() || viewHeight != GetEditorHeight())
223 mView->Resize(viewWidth, viewHeight);
225 SetEditorSize(viewWidth, viewHeight);
231#pragma mark IEditorDelegate overrides
235 for (
int i = 0; i < NParams(); i++)
236 IPlugVST3ControllerBase::SetVST3ParamNormalized(i, GetParam(i)->GetNormalized());
243void IPlugVST3::SendParameterValueFromUI(
int paramIdx,
double normalisedValue)
245 IPlugVST3ControllerBase::SetVST3ParamNormalized(paramIdx, normalisedValue);
246 IPlugAPIBase::SendParameterValueFromUI(paramIdx, normalisedValue);
255 if (componentHandler)
257 FUnknownPtr<IComponentHandler> handler(componentHandler);
261 handler->restartComponent(kLatencyChanged);
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
virtual void DirtyParametersFromUI() override
In a distributed VST3 or WAM plugin, if you modify the parameters on the UI side (e....
virtual void OnHostIdentified()
Implement this to do something specific when IPlug becomes aware of the particular host that is hosti...
bool GetTailIsInfinite() const
virtual void SetLatency(int latency)
Call this if the latency of your plug-in changes after initialization (perhaps from OnReset() ) This ...
bool IsInstrument() const
virtual void OnActivate(bool active)
Override OnActivate() which should be called by the API class when a plug-in is "switched on" by the ...
Shared VST3 controller code.
void InformHostOfParameterDetailsChange() override
Implemented by the API class, call this if you update parameter labels and hopefully the host should ...
void SetLatency(int samples) override
Call this if the latency of your plug-in changes after initialization (perhaps from OnReset() ) This ...
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...
void InformHostOfParamChange(int idx, double normalizedValue) override
Implemented by the API class, called by the UI via SetParameterValue() with the value of a parameter ...
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...
bool EditorResize(int viewWidth, int viewHeight) override
Implementations call into the APIs resize hooks returns a bool to indicate whether the DAW or plugin ...
void DirtyParametersFromUI() override
In a distributed VST3 or WAM plugin, if you modify the parameters on the UI side (e....
Shared VST3 processor code.