![]() |
#1 |
Human being with feelings
Join Date: Sep 2018
Location: Oxford, England
Posts: 226
|
![]()
I'm having problems getting Reaper to remember the plugin UI size of CLAP plugins on Windows. Opening / closing the UI or floating / embedding the UI appears to work, however if I save and then reload the session, reaper creates its own (host) plugin window the correct size, but fails to call any of the plugin's getSize, adjustSize setSize etc API functions, so the plugin window appears back to its default size. (All these functions get called when 'live' resizing the plugin so it appears Reaper knows about them)
All these calls work as intended and the UI size is correct on Linux and these are basically a direct port to Windows. Can anyone offer some clarification about how the UI size is supposed to persist across session save / load. Is this part of the CLAP standard, or something more ad-hoc like it was in VST2?
__________________
Plug-in developer - Applied Computer Music Technologies https://www.acmt.co.uk https://www.facebook.com/acmtaudio Last edited by mike@overtonedsp; 12-22-2023 at 07:56 AM. |
![]() |
![]() |
![]() |
#2 |
Human being with feelings
Join Date: Sep 2018
Location: Oxford, England
Posts: 226
|
![]()
Just wanted to bump this - it would be good to know if this is a Reaper issue or not (I don't have any other Windows CLAP hosts or plugins to test with, and it would be good to know what the 'correct' way to ensure a resizable CLAP plug-in UI size persists across session saves currently is)
__________________
Plug-in developer - Applied Computer Music Technologies https://www.acmt.co.uk https://www.facebook.com/acmtaudio |
![]() |
![]() |
![]() |
#3 |
Human being with feelings
Join Date: Sep 2018
Location: Oxford, England
Posts: 226
|
![]()
Anyone?
__________________
Plug-in developer - Applied Computer Music Technologies https://www.acmt.co.uk https://www.facebook.com/acmtaudio |
![]() |
![]() |
![]() |
#4 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,335
|
![]()
hmm do you have the "auto-size to plug-in" options set (prefs/plugins) ? If they are set it should ask the plugin for size and then size up/down to it... if not set, then it uses the last window size.
|
![]() |
![]() |
![]() |
#5 | |
Human being with feelings
Join Date: Sep 2018
Location: Oxford, England
Posts: 226
|
![]() Quote:
On Linux it seems as if Reaper actively tells the plugin to restore its UI to the custom size, using the clap_plugin_gui.set_size and clap_plugin_gui.adjust_size API whereas on Windows none of those calls happen. On VST2 (and VST3) it seems as if we are storing the size as part of the plugin state (for VST2 this is understandable as VST2 was never really 'supposed' to support (live) resizable UIs) but with CLAP it seems as if this is assumed the host application's responsibility. It could be something weird is going on, though this is a direct port and it appears to work as expected on Linux. I guess I'm just looking for clarity about what the 'standard' method is? Should a CLAP plugin expect the host to formally save / restore a custom UI size as part of the session, or should the plugin store its own custom size as part of some local state? Or should the plugin be relying on some OS specific Window resizing hints from the 'parent' Window to informally resize itself? (or all of the above)
__________________
Plug-in developer - Applied Computer Music Technologies https://www.acmt.co.uk https://www.facebook.com/acmtaudio |
|
![]() |
![]() |
![]() |
#6 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,335
|
![]()
Looking at this now. For CLAP plug-ins, you can look in the .rpp file to see if it is saving the size -- in the <CLAP chunk, there should be a "CFG" line, which should be "CFG flags w h preset_name". Are w/h set there?
When displaying the UI, REAPER will: 1) call clap_plugin_ui->create() 2) if the above w/h are set nonzero, and clap_plugin_ui->can_resize() is true, resize the container (HWND or NSView or X11 window) to w/h 3) if not 2 (w/h are 0 or can_resize() returns false) - REAPER will query clap_plugin_ui->get_size() for width/height, and size the container to that 4) call clap_plugin_ui->set_parent / clap_plugin_ui->show |
![]() |
![]() |
![]() |
#7 | |
Human being with feelings
Join Date: Sep 2018
Location: Oxford, England
Posts: 226
|
![]() Quote:
Is the 0 preceding the size significant? (As far as I can tell I have set can_resize true so reaper should know the UI can be resized, and it all behaves as expected while the project is open, just doesn't restore correctly when reloading the project)
__________________
Plug-in developer - Applied Computer Music Technologies https://www.acmt.co.uk https://www.facebook.com/acmtaudio |
|
![]() |
![]() |
![]() |
#8 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,335
|
![]()
Ah yes, we are not calling set_size() on the initial create... the assumption is that the plug-in would size itself to the container window in set_parent(). If this is a problem we can add the manual set_size() call immediately before/after calling set_parent() (which would you prefer?).
|
![]() |
![]() |
![]() |
#9 | |
Human being with feelings
Join Date: Sep 2018
Location: Oxford, England
Posts: 226
|
![]() Quote:
Code:
/// Showing the GUI works as follow: /// 1. clap_plugin_gui->is_api_supported(), check what can work /// 2. clap_plugin_gui->create(), allocates gui resources /// 3. if the plugin window is floating /// 4. -> clap_plugin_gui->set_transient() /// 5. -> clap_plugin_gui->suggest_title() /// 6. else /// 7. -> clap_plugin_gui->set_scale() /// 8. -> clap_plugin_gui->can_resize() /// 9. -> if resizable and has known size from previous session, clap_plugin_gui->set_size() /// 10. -> else clap_plugin_gui->get_size(), gets initial size /// 11. -> clap_plugin_gui->set_parent() /// 12. clap_plugin_gui->show() /// 13. clap_plugin_gui->hide()/show() ... /// 14. clap_plugin_gui->destroy() when done with the gui
__________________
Plug-in developer - Applied Computer Music Technologies https://www.acmt.co.uk https://www.facebook.com/acmtaudio Last edited by mike@overtonedsp; 01-17-2024 at 10:33 AM. |
|
![]() |
![]() |
![]() |
#10 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,335
|
![]()
Thanks for bringing that comment to our attention! The next pre-release build will have this addition, I'll post here when it is available.
|
![]() |
![]() |
![]() |
#11 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,335
|
![]()
7.09+dev0118+ should fix this, thanks!
|
![]() |
![]() |
![]() |
#12 |
Human being with feelings
Join Date: Sep 2018
Location: Oxford, England
Posts: 226
|
![]()
Thanks, yes that seems to be working
__________________
Plug-in developer - Applied Computer Music Technologies https://www.acmt.co.uk https://www.facebook.com/acmtaudio |
![]() |
![]() |
![]() |
Thread Tools | |
|
|