COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 05-04-2018, 09:37 AM   #1
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default Resizing weirdness

I tried applying the resizing example to my plugin but it made the controls act crazy (not updating, showing wrong values) and sometimes even crashed reaper when getting smaller.

The only difference in my code from the example is that instead of resize being triggered by a mouse click on a button, it was triggered by an enum parameter change in OnParameterChange. Some modes of this parameter require more space, some less.

Is it possible to resize the UI in OnParameterChange safely?
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 05-04-2018, 10:36 AM   #2
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

OnParamChange() could be called at high priority (on the audio thread), so I wouldn't recommend resizing the GUI that way in the current implementation

seems slightly strange that you would resize the GUI with a parameter anyway
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-04-2018, 10:40 AM   #3
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by olilarkin View Post
OnParamChange() could be called at high priority (on the audio thread), so I wouldn't recommend resizing the GUI that way in the current implementation

seems slightly strange that you would resize the GUI with a parameter anyway
Is there anyway to defer it to the UI thread? Some kind of doLater(mytask) kind of thing that a lot of frameworks have to avoid thread issues.

In this situation doing it from a parameter makes a lot of sense. It is a mode parameter. Some modes need double the space as have more controls.
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 05-04-2018, 11:10 AM   #4
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

not easy in the current version
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-04-2018, 11:14 AM   #5
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

in iPlug2, there is a deferred OnParamChangeGUI().

high priority parameter changes are pushed onto a queue and popped in a main thread timer

https://github.com/olilarkin/wdl-ol/...g/IPlugTimer.h
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-04-2018, 11:27 AM   #6
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

How about I set a flag and do the resize in a draw method?

I might have to force a redraw for that to work. How?
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 05-05-2018, 07:00 AM   #7
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Is this mode something that you would want to automate? If not then I don’t think it should be a parameter. You can still store it in state. Then your user interface control that changes the mood can trigger the resize
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-05-2018, 07:11 AM   #8
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by olilarkin View Post
Is this mode something that you would want to automate? If not then I don’t think it should be a parameter. You can still store it in state. Then your user interface control that changes the mood can trigger the resize
It is not automatable but should be 'translateable' between hosts. I thought that would be easier as non automatable parameters (although I might be wrong).

I know with state in reaper that reaper mangles FX state data to add in it's own things. So I can't decode it easily from another app. I wanted to swap FX state between different hosts in another situation and couldn't because of this. In that particular case I wanted to take AU state chunks from FCPX XMLs and put them in an RPP. Justin said that was impossible because of the way reaper mangles the state data before storing/retrieving it.

The idea with my FX is that it can be used in two DAWs and another tool can be used to translate between them.
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.