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.

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?