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: 525
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?
__________________
Mac OS X 10.11.x, Motu Ultralite, Reaper, FCP X.
http://vordio.net
http://twitter.com/vordio
mrlimbic is offline   Reply With Quote
Old 05-04-2018, 10:36 AM   #2
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,106
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 | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
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: 525
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.
__________________
Mac OS X 10.11.x, Motu Ultralite, Reaper, FCP X.
http://vordio.net
http://twitter.com/vordio
mrlimbic is offline   Reply With Quote
Old 05-04-2018, 11:10 AM   #4
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,106
Default

not easy in the current version
__________________
VirtualCZ | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 05-04-2018, 11:14 AM   #5
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,106
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 | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
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: 525
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?
__________________
Mac OS X 10.11.x, Motu Ultralite, Reaper, FCP X.
http://vordio.net
http://twitter.com/vordio
mrlimbic is offline   Reply With Quote
Old 05-05-2018, 07:00 AM   #7
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,106
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 | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
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: 525
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.
__________________
Mac OS X 10.11.x, Motu Ultralite, Reaper, FCP X.
http://vordio.net
http://twitter.com/vordio
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 11:38 PM.


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