Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
checkUpdateGUI question (Two clicks required to change to the correct preset)
No permission to create posts
March 25, 2018
12:53 pm
Avatar
JimmyM
Member
Members
Forum Posts: 30
Member Since:
July 21, 2016
sp_UserOfflineSmall Offline

Hi Will.

 

I hope I'm posting in the right spot. I've scoured the forums, but cannot find an answer for this particular type of problem.

I'm looking to implement a dropdown preset menu.

I followed "Updating GUIs from your PlugIn.pdf", and was able to successfully update presets accordingly in checkUpdateGUI, however - from the dropdown, in order to reflect the correct values, each preset must be clicked twice.

 

For example, I have it changing a slider as such:

preset1: slider value = 0

preset2: slider value = 0.3

preset3: slider value = -0.3

 

Inside checkUpdateGUI I have this (maybe it's a silly coding error I've overlooked, I've tried many combinations in this code, starting with how it was coded in the .pdf, all with the same results.):

 

switch(nControlIndex)
{

   case 43:
    {
      bLoadingPreset = true;
      GUI_PARAMETER param3 = { 0 };
      param3.uControlId = 3;

      if (m_uPresetDropdown == preset1)
     {

           param3.fActualValue = 0.0;
           uiParameters.append(param3);

          return true; // if update needed

     }

     if (m_uPresetDropdown == preset2)
    {

          param3.fActualValue = 0.3;
         guiParameters.append(param3);

         return true; // if update needed

    }

     if (m_uPresetDropdown == preset3)
    {

         param3.fActualValue = -0.3;
         guiParameters.append(param3);

         return true; // if update needed

    }
guiParameters.append(param3);
return true;

}

default:
break;
}

return false;

 

So somehow, it seems to have to register a click on the dropdown menu before evaluating its selection. Is there a thread-safe way to handle it so it constantly reads for the values - as if one click on the dropdown menu will then enable reading of the preset choices throughout the time the VST is opened?

March 25, 2018
2:19 pm
Avatar
Eddie
Member
Members
Forum Posts: 14
Member Since:
July 11, 2017
sp_UserOfflineSmall Offline

I had exactly the same problem. In a preset system. Not much use but I gave up and used a knob instead!!

March 25, 2018
4:58 pm
Avatar
JimmyM
Member
Members
Forum Posts: 30
Member Since:
July 21, 2016
sp_UserOfflineSmall Offline

Eddie said
I had exactly the same problem. In a preset system. Not much use but I gave up and used a knob instead!!  

Eddie, I think that the reason it doesn't change on the first click is that it doesn't register a click when you first select the dropdown menu.

 

This is just a theory at this point. The other part of it is probably when the values are actually parsed. Unlike a knob, where they are read immediately, these values seem to be read at specific intervals - upon a change event. If I get any usable results I'll post how I got them.

March 25, 2018
5:54 pm
Avatar
JimmyM
Member
Members
Forum Posts: 30
Member Since:
July 21, 2016
sp_UserOfflineSmall Offline

Yeah, like I thought - it looks like when I make a selection, it then waits for the selection. The act of simply activating the dropdown menu doesn't seem to register as anything.

 

Once a selection is made, that's when case 43 (in my instance as that is the dropdown button) is invoked. It needs one more state to send a signal. When clicked (upon opening the dropdown), it needs to send a signal, and then once a selection is made, another signal needs to be sent.

l'll experiment with adding a little button, and then triggering the dropdown menu with that button (or something along those lines) and see if any joy.

 

UPDATE: using 3 momentary switches instead of the dropdown, the presets update perfectly.

March 25, 2018
8:54 pm
Avatar
JimmyM
Member
Members
Forum Posts: 30
Member Since:
July 21, 2016
sp_UserOfflineSmall Offline

~~~~~FACEPALM~~~~~

 

Okay, I guess I didn't exactly follow the .pdf to the 'T'.

 

Using the code example below I did this (see the bold):

case 43:
{
bLoadingPreset = true;
GUI_PARAMETER param3 = { 0 };
param3.uControlId = 3;

if (m_uPresetDropdown == preset1)
{

param3.fActualValue = 0.0;
uiParameters.append(param3);

return true; // if update needed

}

 

Instead, "fValue" needs to be used. Like referring to "fActualValue", they're actually members of the COptionMenu class.

Case 43 refers to the control ID of the actual dropdown control, so at that point it apparently looks at 43's fValue, and instantly does its thing.

 

So now it totally works.

Forum Timezone: America/New_York

Most Users Ever Online: 55

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 43

Peter: 41

clau_ste: 39

Gwen: 32

JimmyM: 30

TheSmile: 28

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 527

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 31

Topics: 552

Posts: 2168

Newest Members:

Steve Duell, Cal, LamebrainEddy, SteveThackery, rawbirdtoe, Bill, hill william, NAUN_SONAR, sufy, Diane

Moderators: W Pirkle: 261

Administrators: Tom: 67, JD Young: 80, Will Pirkle: 0, W Pirkle: 261