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" 21 using namespace iplug;
25 #include "IPlugVST3_Parameter.h" 27 #pragma mark - IPlugVST3 Constructor/Destructor 29 IPlugVST3::IPlugVST3(
const InstanceInfo& info,
const Config& config)
38 IPlugVST3::~IPlugVST3() {}
40 #pragma mark AudioEffect overrides 42 tresult PLUGIN_API IPlugVST3::initialize(FUnknown* context)
46 if (SingleComponentEffect::initialize(context) == kResultOk)
48 IPlugVST3ProcessorBase::Initialize(
this);
51 IPlugVST3GetHost(
this, context);
61 tresult PLUGIN_API IPlugVST3::terminate()
65 return SingleComponentEffect::terminate();
68 tresult PLUGIN_API IPlugVST3::setBusArrangements(SpeakerArrangement* pInputBusArrangements, int32 numInBuses, SpeakerArrangement* pOutputBusArrangements, int32 numOutBuses)
72 return IPlugVST3ProcessorBase::SetBusArrangements(
this, pInputBusArrangements, numInBuses, pOutputBusArrangements, numOutBuses) ? kResultTrue : kResultFalse;
75 tresult PLUGIN_API IPlugVST3::setActive(TBool state)
80 return SingleComponentEffect::setActive(state);
83 tresult PLUGIN_API IPlugVST3::setupProcessing(ProcessSetup& newSetup)
87 return SetupProcessing(newSetup, processSetup) ? kResultOk : kResultFalse;
90 tresult PLUGIN_API IPlugVST3::setProcessing(TBool state)
92 Trace(TRACELOC,
" state: %i", state);
94 return SetProcessing((
bool) state) ? kResultOk : kResultFalse;
97 tresult PLUGIN_API IPlugVST3::process(ProcessData& data)
101 Process(data, processSetup, audioInputs, audioOutputs, mMidiMsgsFromEditor, mMidiMsgsFromProcessor, mSysExDataFromEditor, mSysexBuf);
105 tresult PLUGIN_API IPlugVST3::canProcessSampleSize(int32 symbolicSampleSize)
107 return CanProcessSampleSize(symbolicSampleSize) ? kResultTrue : kResultFalse;
110 tresult PLUGIN_API IPlugVST3::setState(IBStream* pState)
114 return IPlugVST3State::SetState(
this, pState) ? kResultOk :kResultFalse;
117 tresult PLUGIN_API IPlugVST3::getState(IBStream* pState)
121 return IPlugVST3State::GetState(
this, pState) ? kResultOk :kResultFalse;
124 #pragma mark IEditController overrides 125 ParamValue PLUGIN_API IPlugVST3::getParamNormalized(ParamID tag)
127 return IPlugVST3ControllerBase::GetParamNormalized(tag);
130 tresult PLUGIN_API IPlugVST3::setParamNormalized(ParamID tag, ParamValue value)
132 if (IPlugVST3ControllerBase::SetParamNormalized(
this, tag, value))
138 IPlugView* PLUGIN_API IPlugVST3::createView(
const char* name)
140 if (name && strcmp(name,
"editor") == 0)
142 mView =
new ViewType(*
this);
149 tresult PLUGIN_API IPlugVST3::setEditorState(IBStream* pState)
155 tresult PLUGIN_API IPlugVST3::getEditorState(IBStream* pState)
161 tresult PLUGIN_API IPlugVST3::setComponentState(IBStream* pState)
167 #pragma mark IMidiMapping overrides 169 tresult 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 182 Steinberg::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());
238 void IPlugVST3::SendParameterValueFromUI(
int paramIdx,
double normalisedValue)
240 IPlugVST3ControllerBase::SetVST3ParamNormalized(paramIdx, normalisedValue);
241 IPlugAPIBase::SendParameterValueFromUI(paramIdx, normalisedValue);
246 if (componentHandler)
248 FUnknownPtr<IComponentHandler> handler(componentHandler);
253 handler->restartComponent(kLatencyChanged);
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
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...
Shared VST3 controller code.
virtual void SetLatency(int latency)
Call this if the latency of your plug-in changes after initialization (perhaps from OnReset() ) This ...
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...
bool IsInstrument() const
void CreateTimer()
Called by the API class to create the timer that pumps the parameter/message queues.
virtual void DirtyParametersFromUI() override
In a distributed VST3 or WAM plugin, if you modify the parameters on the UI side (e.g.
VST3 base class for a non-distributed IPlug VST3 plug-in.
void InformHostOfParamChange(int idx, double normalizedValue) override
Implemented by the API class, called by the UI via SetParameterValue() with the value of a parameter ...
Shared VST3 processor code.
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.g.
virtual void OnActivate(bool active)
Override OnActivate() which should be called by the API class when a plug-in is "switched on" by the ...
virtual void OnHostIdentified()
Implement this to do something specific when IPlug becomes aware of the particular host that is hosti...