Resizable Plugin - how to?

I am trying to have my plugin resizable. My requirements seem modest:

  1. Give the user the possibility to resize my plugin by dragging
  2. impose a fixed ratio, mininmal and maximal dimensions
  3. work reliable with win10 & mac as VST3 and AU on the usual hosts

My question is not about how to handle the layout and drawing, my question is on setting it up such that my plugin editor receives the information about resize and allows constraining it, without ugly black borders between my plugin and the window containing it.

I thought this is simple problem … however, it turned out to be tough. I also found dozens of posts in the forum where people reported similar problems again and again. Also the AudioPluginDemo suffers from all kind of resize issues, eg with VST3 on WIN10 in Ableton: you can resize the outer frame such that you get ugly black border, or you shrink the outer window and “cut” the plugin area short, because it does not get the resize events.

Obviously I am doing something wrong, and obviously there must be a solution for this … so can anyone help me?

Many thanks in advance!
Peter

Are you using the very latest version of JUCE from the develop branch? Some changes were made in this area in the last few days, so if you haven’t updated for a while it’s worth checking out the newest version.

Here, the AudioPluginDemo resizes correctly when loaded as a VST3 in Live 11 on Windows 10. Resizing using the border of the host window resizes the plugin completely smoothly. Resizing using the plugin’s internal corner resizer is slightly less smooth, with the plugin view being trimmed or bordered briefly. However, the host window always quickly catches up with the editor’s new size.

1 Like

Is there ever a way to resize from the border in AU (especially Logic) as well?
Seems not possible to me.

(Sorry for hijacking)

I’m not aware of any AUv2s which implement this, no. For AUv2, it seems that client-initiated resize via a corner resizer or similar is necessary.

Annoyingly, the opposite seems to be true for AUv3, where only host-initiated resize seems to have any effect.

1 Like

Yes, the only AUv2 that allow to drag the border are the Apple built in ones.
Funnily Logic keeps showing the resizer cursors over the border regardless if the plugin is resizable or not.
I suspect they have a private/undocumented API to receive the dragging events from the border…

Ok, cool. Tried out on latest dev and its fixed there - thank you @reuk!
Will these fixes be available on the main branch anywhere soon?

No fixed date yet, but these changes will be part of the next version release.

Here is what I got in the beginning of my PluginEditor.cpp’s constructor;

    setResizable (true, true);
	setResizeLimits (1278, 700, 1918, 1050);

	const float ratio = 1.83f;
	getConstrainer ()->setFixedAspectRatio (ratio);

	appWidth = 1918;
	appHeight = 1050;
    setSize (appWidth, appHeight);