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
42tresult PLUGIN_API IPlugVST3::initialize(FUnknown* context)
46 if (SingleComponentEffect::initialize(context) == kResultOk)
48 IPlugVST3ProcessorBase::Initialize(
this);
51 IPlugVST3GetHost(
this, context);
61tresult PLUGIN_API IPlugVST3::terminate()
65 return SingleComponentEffect::terminate();
68tresult PLUGIN_API IPlugVST3::setBusArrangements(SpeakerArrangement* pInputBusArrangements, int32 numInBuses, SpeakerArrangement* pOutputBusArrangements, int32 numOutBuses)
72 return IPlugVST3ProcessorBase::SetBusArrangements(
this, pInputBusArrangements, numInBuses, pOutputBusArrangements, numOutBuses) ? kResultTrue : kResultFalse;
75tresult PLUGIN_API IPlugVST3::setActive(TBool state)
80 return SingleComponentEffect::setActive(state);
83tresult PLUGIN_API IPlugVST3::setupProcessing(ProcessSetup& newSetup)
87 return SetupProcessing(newSetup, processSetup) ? kResultOk : kResultFalse;
90tresult PLUGIN_API IPlugVST3::setProcessing(TBool state)
92 Trace(TRACELOC,
" state: %i", state);
94 return SetProcessing((
bool) state) ? kResultOk : kResultFalse;
97tresult PLUGIN_API IPlugVST3::process(ProcessData& data)
101 Process(data, processSetup, audioInputs, audioOutputs, mMidiMsgsFromEditor, mMidiMsgsFromProcessor, mSysExDataFromEditor, mSysexBuf);
105tresult PLUGIN_API IPlugVST3::canProcessSampleSize(int32 symbolicSampleSize)
107 return CanProcessSampleSize(symbolicSampleSize) ? kResultTrue : kResultFalse;
110tresult PLUGIN_API IPlugVST3::setState(IBStream* pState)
114 return IPlugVST3State::SetState(
this, pState) ? kResultOk :kResultFalse;
117tresult PLUGIN_API IPlugVST3::getState(IBStream* pState)
121 return IPlugVST3State::GetState(
this, pState) ? kResultOk :kResultFalse;
124#pragma mark IEditController overrides
125ParamValue PLUGIN_API IPlugVST3::getParamNormalized(ParamID tag)
127 return IPlugVST3ControllerBase::GetParamNormalized(tag);
130tresult PLUGIN_API IPlugVST3::setParamNormalized(ParamID tag, ParamValue value)
132 if (IPlugVST3ControllerBase::SetParamNormalized(
this, tag, value))
138IPlugView* PLUGIN_API IPlugVST3::createView(
const char* name)
140 if (
HasUI() && name && strcmp(name,
"editor") == 0)
142 mView =
new ViewType(*
this);
149tresult PLUGIN_API IPlugVST3::setEditorState(IBStream* pState)
155tresult PLUGIN_API IPlugVST3::getEditorState(IBStream* pState)
161tresult PLUGIN_API IPlugVST3::setComponentState(IBStream* pState)
167#pragma mark IMidiMapping overrides
169tresult PLUGIN_API IPlugVST3::getMidiControllerAssignment(int32 busIndex, int16 midiChannel, CtrlNumber midiCCNumber, ParamID& tag)
171 if (busIndex == 0 && midiChannel < VST3_NUM_CC_CHANS)
173 tag = kMIDICCParamStartIdx + (midiChannel * kCountCtrlNumber) + midiCCNumber;
180#pragma mark IInfoListener overrides
182Steinberg::tresult PLUGIN_API IPlugVST3::setChannelContextInfos(Steinberg::Vst::IAttributeList* pList)
184 return IPlugVST3ControllerBase::SetChannelContextInfos(pList) ? kResultTrue : kResultFalse;
187#pragma mark IPlugAPIBase overrides
191 Trace(TRACELOC,
"%d", idx);
197 Trace(TRACELOC,
"%d:%f", idx, normalizedValue);
198 performEdit(idx, normalizedValue);
203 Trace(TRACELOC,
"%d", idx);
209 FUnknownPtr<IComponentHandler> handler(componentHandler);
210 handler->restartComponent(kParamTitlesChanged);
217 if (viewWidth != GetEditorWidth() || viewHeight != GetEditorHeight())
218 mView->Resize(viewWidth, viewHeight);
220 SetEditorSize(viewWidth, viewHeight);
226#pragma mark IEditorDelegate overrides
230 for (
int i = 0; i < NParams(); i++)
231 IPlugVST3ControllerBase::SetVST3ParamNormalized(i, GetParam(i)->GetNormalized());
238void IPlugVST3::SendParameterValueFromUI(
int paramIdx,
double normalisedValue)
240 IPlugVST3ControllerBase::SetVST3ParamNormalized(paramIdx, normalisedValue);
241 IPlugAPIBase::SendParameterValueFromUI(paramIdx, normalisedValue);
250 if (componentHandler)
252 FUnknownPtr<IComponentHandler> handler(componentHandler);
256 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...
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.