Scaling UI of hosted plugin

I’m building a sequencer plugin that is able to host other plugins and have hit a snag with UI scaling.

I cant seem to find a way to scale the UI of hosted plugins that works. I have tried:

  • Applying a transform directly to the hosted plugin’s AudioProcessorEditor
  • Applying a transform to a parent component of the hosted plugin’s AudioProcessorEditor
  • Setting the scale with setScaleFactor on the hosted plugin’s AudioProcessorEditor
  • Calling Desktop::setGlobalScaleFactor()

In all cases the hosted plugin’s editor quickly flashes (unscaled) on screen and then disappears.

I have tested with a few of DAWs and the behaviour is the same.

Update:

After some further testing I have figured out that only AU plugins flash and disappear when scaled. VST plugins will render unscaled.

1 Like

Bump. Perhaps someone from the JUCE team could weigh in on this?

Have you looked at the HostPluginDemo in the JUCE repo? Does that work properly for you?

I’m not sure you can scale the plugin as the host. I think it’s up to the plugin to scale itself, and for the host to adapt if its size changes.

This is from my experience working on a plugin host. I’ve also never seen a DAW that scales plugin editors. I could be wrong though…

1 Like

not all plugins are made with JUCE, not all plugins support being rescaled at all.
But most of all, it’s the end-user who decides on a system-wide basis what DPI they are comfortable with. It’s would not be best practice (regarding accessibility etc) for a DAW to ignore the user’s preferences regarding DPI.

Thanks for the feedback.

I’m aware that not all plugins are built with JUCE, but the AudioProcessorEditor object created by a AudioPluginInstance does allow you to set a scale transform … it just doesn’t work.

I wonder if this is by design or not?

Hi @rbuskov

Did you ever get to the bottom of this?

Cheers

Andy

I’m 99% sure there is no way to apply an arbitrary scale to another window. On Windows, you can mark the HWND as DPI aware or not, I think that’s the only option.

Thanks @RolandMR

I think you are right, we are trying to embed the plugin editor component in another component, the only way seems to be to create a heavyweight window and set it to be DPI unaware. Embedding in a juce component and trying to scale just doesn’t work.