Resizing plugin not working properly.

SDK for VST 3 audio plug-in and host development.
Post Reply
jared
Posts: 6
Joined: Tue Mar 19, 2019 9:42 pm

Resizing plugin not working properly.

Post by jared » Thu Jun 27, 2019 6:53 am

I'm stuck trying to get my plugin to resize properly. I'm using my own gui library, and Reaper x64 for testing.

I have a custom View class that inherits from CPluginView, and i have overridden the canResize() and checkSizeConstraint() functions to return true.
When the plugin first starts, Reaper's window border adjusts to the size of the plugin correctly.
When I attempt to resize the window (from the plugin) using the IPlugFrame's resizeView(), the plugin scales fine but Reaper's FX window stays the same size (leaving a white border or clipping the plugin).
I'm able to resize Reaper's FX window manually, however I have not been able to change it at all from the plugin.

Does anybody have any thoughts on what I might be missing? Thanks for reading!

rhansen
Posts: 25
Joined: Mon Jun 20, 2016 7:43 am
Location: Hamburg

Re: Resizing plugin not working properly.

Post by rhansen » Thu Jun 27, 2019 8:28 am

jared wrote:
Thu Jun 27, 2019 6:53 am
I'm stuck trying to get my plugin to resize properly. I'm using my own gui library, and Reaper x64 for testing.

I have a custom View class that inherits from CPluginView, and i have overridden the canResize() and checkSizeConstraint() functions to return true.
When the plugin first starts, Reaper's window border adjusts to the size of the plugin correctly.
When I attempt to resize the window (from the plugin) using the IPlugFrame's resizeView(), the plugin scales fine but Reaper's FX window stays the same size (leaving a white border or clipping the plugin).
I'm able to resize Reaper's FX window manually, however I have not been able to change it at all from the plugin.

Does anybody have any thoughts on what I might be missing? Thanks for reading!
Hey,

my synthesizer plug-in (http://www.hansen-audio.de) can resize from 100% to 150% and 200%. I think that this is what you want to achieve as well, right?

I am using Reaper regularly and it seems to work fine here. The Reaper frame adapts to editor size correctly after resizing was initiated from the plug-in side.

The GUI of my plug-in is done with VSTGUI and I used this example as a base: https://github.com/steinbergmedia/vstgu ... omtest.cpp

Maybe this helps a bit to see which sequences need to be done.

René

jared
Posts: 6
Joined: Tue Mar 19, 2019 9:42 pm

Re: Resizing plugin not working properly.

Post by jared » Thu Jun 27, 2019 12:44 pm

Thanks for the info!

I suspect that there is some critical step that VSTGUI handles which I am missing. In the mean time I can just resize via the fx window. I'm afraid I may have to go digging through the VSTGUI source to get to the bottom of this.

rhansen
Posts: 25
Joined: Mon Jun 20, 2016 7:43 am
Location: Hamburg

Re: Resizing plugin not working properly.

Post by rhansen » Thu Jun 27, 2019 12:58 pm

Just in case you did not see this yet, here are some sequence diagrams from the SDK: https://steinbergmedia.github.io/vst3_d ... kflow.html - "Resize View Call Sequences" section.

René

jared
Posts: 6
Joined: Tue Mar 19, 2019 9:42 pm

Re: Resizing plugin not working properly.

Post by jared » Thu Jun 27, 2019 1:46 pm

Now I am finding that modifying the rect that gets passed to checkSizeConstraint() has no effect on the size of the fx window (for example if I try to lock the aspect ratio when dragging to resize). Which is really quite inconvenient. There appears to be a intermediate window that is being resized appropriately (which is the size of my plugin, and on top of reaper's FX window). However this still leaves the FX window incorrect. (I can provide screenshots) I'm stumped.

jared
Posts: 6
Joined: Tue Mar 19, 2019 9:42 pm

Re: Resizing plugin not working properly.

Post by jared » Thu Jun 27, 2019 3:50 pm

I've figured it out:

I was calling resizeView() from my (separate) draw thread instead of the window (plugin view) thread. If I call it from the correct thread everything works great!

Arne Scheffler
Posts: 276
Joined: Mon Jun 20, 2016 7:53 am

Re: Resizing plugin not working properly.

Post by Arne Scheffler » Fri Jun 28, 2019 7:01 am

Remember that everything in the edit controller domain must happen on the main thread also calls to the IComponentHandler instance of the host. So don't call beginEdit, endEdit or performEdit on a secondary thread.

Cheers,
Arne

Post Reply