Skip to content

Fix missing VST3ClientExtensions.setComponentHandler call in Studio One #1526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,24 @@ class JuceVST3EditController final : public Vst::EditController,
return kResultOk;
}


//==============================================================================
tresult PLUGIN_API setComponentHandler (Steinberg::Vst::IComponentHandler* newHandler) override
{
auto result = Vst::EditController::setComponentHandler (newHandler);
// The following is needed because Studio One calls this method after our installAudioProcessor method,
// so installAudioProcessor is not able to set a non-null IComponentHandler on VST3ClientExtensions.
// Other DAWs call this method before our installAudioProcessor (when audioProcessor is still nullptr).
if(audioProcessor != nullptr)
{
if (auto* extensions = audioProcessor->get()->getVST3ClientExtensions())
{
extensions->setIComponentHandler (componentHandler);
}
}
return result;
}

void setAudioProcessor (JuceAudioProcessor* audioProc)
{
if (audioProcessor.get() != audioProc)
Expand Down Expand Up @@ -1706,7 +1724,10 @@ class JuceVST3EditController final : public Vst::EditController,

if (auto* extensions = audioProcessor->get()->getVST3ClientExtensions())
{
extensions->setIComponentHandler (componentHandler);
if (componentHandler != nullptr)
{
extensions->setIComponentHandler (componentHandler);
}
extensions->setIHostApplication (hostContext.get());
}

Expand Down