Clarification about IComponent::setState and IComponent::getState

SDK for VST 3 audio plug-in and host development.
Post Reply
abique
Posts: 39
Joined: Tue Jun 21, 2016 12:43 pm

Clarification about IComponent::setState and IComponent::getState

Post by abique » Wed Apr 10, 2019 2:43 pm

Hi,

From which thread should IComponent::setState() and IComponent::getState() be called?

Can those methods be called from the main thread while the component is processing audio?

Many thanks,
Alex

ygrabit
Posts: 120
Joined: Fri Jun 17, 2016 7:52 am
Location: Hamburg

Re: Clarification about IComponent::setState and IComponent::getState

Post by ygrabit » Thu Apr 11, 2019 7:16 am

setState and getState are called in the UI Thread.
Note that the process call in the Audio Thread is still called during changing state (setState), the plugin has to take care about this.... One possibility is to keep the new state in a struct and apply it to the processor model in the next process call.
YVan Grabit

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

Re: Clarification about IComponent::setState and IComponent::getState

Post by abique » Fri Apr 12, 2019 7:37 am

Thank you for the clarification :-)

User avatar
pongasoft
Posts: 74
Joined: Sun Mar 11, 2018 5:57 pm
Location: Las Vegas, USA
Contact:

Re: Clarification about IComponent::setState and IComponent::getState

Post by pongasoft » Fri Apr 12, 2019 1:06 pm

@abique: you may also want to check this thread viewtopic.php?t=516 in which I ran some experiments and provided a potential solution...

Yan

Post Reply