VST3ClientExtensions - Issue with audioProcessor being null

Hi Guys,

Im not fully sure how VST3ClientExtensions can fully work, maybe I am missing something.

The call to queryAdditionalInterfaces() will only work if the audioProcessor member variable has been set.

Even though the AudioProcessor has been created this is not set until tresult PLUGIN_API connect (IConnectionPoint* other) is called, so any queryInterfaces that happen before this will not be handled by the VST3ClientExtensions.

I’m seeing this here in Ableton, so all the queryInterfaces from before this point go missing.

Is there a trick to get this working?

Cheers

Andy

Unfortunately I don’t think this can work, but there’s also not a straightforward workaround, at least with the current design.

The problem is that the EditController instance doesn’t know anything about the particular AudioProcessor instance that it’s wrapping until connect is called, but the host may query the edit controller’s interfaces before calling connect. Given this, there’s no way to call through to the VST3ClientExtensions of the AudioProcessor to check for additional interfaces.

We’ve had at least one previous request to implement the IContextInfoProvider extension directly in JUCE. If a sufficient quantity of users would find it useful, we could investigate and find out whether this work is actually feasible. You could try opening a “built-in support for IContextInfoProvider” feature request to gauge support.

Thanks for the reply.

I already have the IContextInfoProvider code in juice_VST3_Wrapper.cpp but was looking to move it into VST3ClientExtensions to keep things tidier and easier to keep up to date.

I have been looking for a way to shoehorn it in using VST3ClientExtensions and as you say it is not straightforward with the existing design.

I have found another problem, this time with the call to setIComponentHandler which is done in void installAudioProcessor (const VSTComSmartPtr<JuceAudioProcessor>& newAudioProcessor)

This relies on the fact that tresult PLUGIN_API EditController::setComponentHandler (IComponentHandler* newHandler) have been called previously, for Studio One this is not the case.

This one is quite easy to fix with an addition to JuceVST3EditController:

tresult PLUGIN_API setComponentHandler (Steinberg::Vst::IComponentHandler* newHandler) override
    {
        tresult result = Vst::EditController::setComponentHandler (newHandler);
      
        if(audioProcessor)
        {
          if (auto* extensions = dynamic_cast<VST3ClientExtensions*> (audioProcessor->get()))
          {
              extensions->setIComponentHandler (componentHandler);
          }
        }
        return result;
    }
  
2 Likes