How to use restartComponent and which flags are the right one, when changing all characteristics parameters except size

SDK for VST 3 audio plug-in and host development.
Arne Scheffler
Posts: 383
Joined: Mon Jun 20, 2016 7:53 am

Re: How to use restartComponent and which flags are the right one, when changing all characteristics parameters except

Post by Arne Scheffler »

Hi Erez,
you don't need to call for every parameter beginEdit, performEdit, endEdit. If you do this, then the parameter values are already known in the host and you don't need to call restartComponent with kParamValuesChanged. If you do this only to tell your processor to use these new values, you can also send your processor a custom message with all the new values and set them yourself in the processor.
You just have to make sure that before you make a call to restartComponent with kParamTitlesChanged|kParamValuesChanged, that your controller will return the correct information afterwards.

ErezEitan007
Posts: 9
Joined: Tue Jun 27, 2017 7:30 am

Re: How to use restartComponent and which flags are the right one, when changing all characteristics parameters except

Post by ErezEitan007 »

Hi Arne,
By saying "custom message" what do you mean ?

Here is a partial code that we do before calling restartComponent with kParamTitlesChanged|kParamValuesChanged
Without this code the automation list remain the same and also the value in the host doesn't change
Is that your meaning (only without the calling of beginEdit, performEdit, endEdit)?

EditController::setParamNormalized(hostIndex, NEW_VALUE);

Steinberg::Vst::Parameter* param = getParameterObject(hostIndex);
Steinberg::Vst::ParameterInfo& info = param->getInfo();

Steinberg::UString(info.title, tStrBufferSize(Steinberg::Vst::String128)).assign(USTRING("NEW_NAME"));
info.stepCount = NEW_NUM_STEP;
info.defaultNormalizedValue = NEW_VALUE;
info.flags = NEW_AUTOMATION_FLAG;

Arne Scheffler
Posts: 383
Joined: Mon Jun 20, 2016 7:53 am

Re: How to use restartComponent and which flags are the right one, when changing all characteristics parameters except

Post by Arne Scheffler »

If you now call restartComponent with kParamTitlesChanged|kParamValuesChanged, the host should have the new parameter names, flags and values. The host will not send the values to your processor in the process call this way.
So if you need them there, but without going thru the beginEdit, performEdit, endEdit methods, you could allocate an IMessage with IHostApplication::createInstance() fill it with the necessary information and send it via IConnectionPoint::notify to your processor.

abique
Posts: 48
Joined: Tue Jun 21, 2016 12:43 pm

Re: How to use restartComponent and which flags are the right one, when changing all characteristics parameters except

Post by abique »

Why shouldn't the host sends the new parameter values to the processor after kParamValuesChanged?

ray
Posts: 101
Joined: Fri Sep 02, 2016 9:37 am

Re: How to use restartComponent and which flags are the right one, when changing all characteristics parameters except

Post by ray »

abique wrote:
Fri Oct 02, 2020 10:24 am
Why shouldn't the host sends the new parameter values to the processor after kParamValuesChanged?
I think the question is: Why should it. As far as I can tell this is by design, restartComponent with kParamValuesChanged is a message from the plugin to the host, notifying the latter that its parameters have changed internally.
Last edited by ray on Sat Oct 03, 2020 7:04 pm, edited 1 time in total.

abique
Posts: 48
Joined: Tue Jun 21, 2016 12:43 pm

Re: How to use restartComponent and which flags are the right one, when changing all characteristics parameters except

Post by abique »

ray wrote:
Fri Oct 02, 2020 11:05 am
abique wrote:
Fri Oct 02, 2020 10:24 am
Why shouldn't the host sends the new parameter values to the processor after kParamValuesChanged?
I think the question is: Why should it. As far as I can tell this is by design, restartComponent with kParamValuesChanged is a message from the plugin to the host, notifying the latter that its parameter have changed internally.
When the GUI changes a parameter it calls performEdit() which then sends the param update to the processor. So the host is responsible for keeping the processor and UI in sync.

Arne Scheffler
Posts: 383
Joined: Mon Jun 20, 2016 7:53 am

Re: How to use restartComponent and which flags are the right one, when changing all characteristics parameters except

Post by Arne Scheffler »

A plug-in calls restartComponent (kParamValuesChanged) to let the host know about an internal change of its parameter values.
If you want to communicate changes from the controller to the processor via the host, then you have to use beginEdit, performEdit, endEdit.
So the host wont transfer changes when restartComponent (kParamValuesChanged) is called.

Cheers,
Arne

Post Reply