COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 02-16-2018, 08:20 PM   #1
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default IPlug program structures

I've been coding some plugins that have various controls that don't interact with the DAW as standard parameters(ie. paramIdx==-1 when instantiating the control) because I don't want their state restored or automated by the DAW.
This means there's no OnParamterChange called when the control is touched. In one situation I tested a flag variable in ProcessReplacing to detect and respond to an event. The processing at this point was very light and everything works well.
In the current project a button opens a file dialog which suspends the thread which is obviously no good for ProcessReplacing.
So my question is how to detect and service events from non-DAW parameter controls?
Guod3 is offline   Reply With Quote
Old 02-19-2018, 01:12 PM   #2
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 317
Default

I use private parameters for the controls that don't need to be visible to the host in that way. They should work as normal, but they won't appear in the automation list.

The only thing is I'm not sure where you should actually set them to your desired value on load. I'm currently doing it in MyPlug::SetGUILayout, which is ok for me as my plugin's mainly a visualiser, but this won't work right for parameters that affect the sound as this will only be called on load if the interface is open, and it doesn't work when loading presets.
Bobflip is offline   Reply With Quote
Old 02-19-2018, 04:57 PM   #3
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

Parameters that don't get automated or automatically saved/restored but still trigger OnParameterChange() would be ideal.
How is this implemented? (Like this?:https://forum.cockos.com/showpost.ph...8&postcount=15)

Would UnSerializeState() be good for loading initial values?
Guod3 is offline   Reply With Quote
Old 02-19-2018, 05:04 PM   #4
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 317
Default

Which framework are you using?
Bobflip is offline   Reply With Quote
Old 02-19-2018, 05:06 PM   #5
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

WDL-OL
Guod3 is offline   Reply With Quote
Old 02-19-2018, 05:13 PM   #6
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 317
Default

Ok, well, I saw this in the IPlugControls example, I think the last param is an example of a private param. Don't know about how to reset it though. I'm using WDL-Youlean, didn't personally get the reset to work with UnserializeParams.

Code:
enum EParams
{
  kISwitchControl_2,
  kISwitchControl_3,
  kIInvisibleSwitchControl,
  kIRadioButtonsControl_H,
  kIRadioButtonsControl_V,
  kIContactControl,
  kIFaderControl_Horiz,
  kIFaderControl_Vert,
  kIKnobLineControl_def,
  kIKnobLineControl_lo_gear,
  kIKnobRotaterControl_def,
  kIKnobRotaterControl_restrict,
  kIKnobMultiControl_def,
  kIKnobMultiControl_Horiz,
  kIKnobRotatingMaskControl,
  kICaptionControl,
  kNumParams,   // put any controls to be controlled from the plug but not
  kInvisibleSwitchIndicator   // the user after kNumParams so they get a param id
};
Bobflip is offline   Reply With Quote
Old 02-19-2018, 05:56 PM   #7
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

I'm getting a null pointer exception when calling GetParam() the the index after kNumParams.

The posting I linked to was from this thread:https://forum.cockos.com/showthread....348#post788348
It provides a recipe from a while back with someone having used it successfully just recently. Maybe Youlean has implemented support already?
Guod3 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:38 PM.


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