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
Using sendUpdateGUI()
No permission to create posts
January 9, 2015
12:22 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

EDIT: as of v6.8, this function has been removed and replaced with a thread safe and simpler implementation documented in the pinned forum topic above. -- Will

SEE: http://www.willpirkle.com/foru.....d-in-v6-8/

RackAFX has always had a built-in function that tells the GUI to update its controls, but it is only semi-documented. When the user moves a GUI control, RackAFX alters the underlying variable that it is linked with. If you want to control a GUI element from your plug-in - that is, work things in reverse - then you do the following 2-step process:

1. alter the underlying GUI linked variable to the new value
2. call sendUpdateGUI( );

The GUI will update itself based on the new value that you set. Make sure you stay within your own defined upper and lower limits!

This operation ports out to the VST2/3 and AU projects as well, so GUIs on these platforms will behave identically to the RackAFX GUI. Thanks to my student Alex Audritsh for pointing out that this operation needs to be platform-independent and was subsequently added to v6.5.

One restriction with sendUpdateGUI( ) is that it can not be called from the Constructor because the window handle/pointer is not valid until after plugin construction. If you need to force a GUI update at startup time, place the code in the function:

initialize( )

which is called after construction and after the window handle/pointer becomes valid.

November 21, 2015
7:11 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

More notes on sendUpdateGUI:

1) Do not call sendUpdateGUI( ) from any audio process( ) method -- it will lock up the GUI trying to repeatedly refresh it.

2) Do not call sendUpdateGUI( ) as a result of moving a continuous GUI control such as a knob or slider via userInterfaceChange( ) -- the resulting continuous set of updates will also make the GUI very sluggish.

It is fine to call sendUpdateGUI( ) as a result of interacting with non-continuous GUI objects like buttons or switches.

July 22, 2016
9:48 pm
Avatar
clau_ste
Member
Members
Forum Posts: 39
Member Since:
April 5, 2016
sp_UserOfflineSmall Offline

I have a mmmh, let's say, problem, while studying the books and reviewing c++, i tried also to get familiar with GUI, i've created three controls
1) First Row - int from 1 to 3
2) Second Row - int from 4 to 6
3) Rows - int from 1 to 6

The first row control is linked to an horizontal switch with 3 buttons, the second row to another horizontal switch
What i would do, is to make possible to switch to 6 views using 2 horizontal switch, what i write in the userInterfaceChange function is this

case 1:
{
sendStatusWndText("1 -> FirstRow is changing");
char* row1Value = intToString(chainsFirstRows);
sendStatusWndText(row1Value);
chainsRows = chainsFirstRows;
userInterfaceChange(3);
break;
}
case 2:
{
sendStatusWndText("2-> SecondRow is changing");
char* row2Value = intToString(chainsSecondRows);
sendStatusWndText(row2Value);
chainsRows = chainsSecondRows;
userInterfaceChange(3);
break;
}
case3:
{
sendStatusWndText("3-> Rows are changing");
char* rowValue = intToString(chainsRows);
CUICtrl *chains_Pointer = getUICtrlByControlID(5);
if (chains_Pointer) {
chains_Pointer->fInitUserIntValue = chainsRows;
sendStatusWndText(rowValue);
}
sendUpdateGUI();
break;
}

What i would to do is to update the Rows integer control, which is the one that manage the Switch view container, in the debug windows i see that if i switch from the first horizontal switch, also the rows are changed, and the same for the second horizontal switch happen, the fact is that nothing happens, and if i link the switch view container to first row, or second rows, the switch works

Maybe (I'm pratically sure) I'm using sendUpdateGUI in the wrong way, as it's explained by Will in the preview answer to this post, but in the case of horizontal switch, that's not a button or switch, but it's something different, where could I call the sendUpdateGUI method?
Should i make an external function or what ever?
Does the horizontal switch intended to be like a knob or a slider?

Thanks

July 23, 2016
1:26 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Do not use sendUpdateGUI( )

I am currently in the process of overhauling RackAFX and the derivative projects for thread safety between GUI and processing threads. For the most part, derivative projects (VST, AU, AAX) are already thread-safe by design. However, sendUpdateGUI( ) has the remote possibility of creating a race condition. Therefore, I have modified the way that this works at the API level.

I will post a very big update in the next few weeks describing how to properly implement updating the GUI from within the plugin for linking controls, etc... The new paradigm is actually easier to understand and you do not directly modify any of your plugin values.

You can work on something else until the new update/beta version is ready, hopefully before August 15, 2016.

- Will

July 23, 2016
1:34 am
Avatar
clau_ste
Member
Members
Forum Posts: 39
Member Since:
April 5, 2016
sp_UserOfflineSmall Offline

Thanks for the explaination, by the way it could be also cool if the Horizontal Switch could have a "non state" value, like if you've not selected a value, this could be cool for example, if like me, somebody would "link" two horizontal switches 🙂

Or also even cooler, mix horizontal switch graphics (all the buttons with one selected that switch) whit the text of a CSegmentButton, this could be cool in my opinion, you should open a "New Ideas" topic hahaha 🙂

These are cool news by the way because I'm coming home from holidays in the middle of august, I hope to have a big surprise 🙂 I've readed in a post that also new books are coming out, does them will come out in the same time or later the release?

July 23, 2016
6:10 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

The horizontal switch is a VSTUGI4 object. If you want to change its default behavior then you need to use the Advanced GUI API and create your own custom control(s) and take control of non-default behavior on your own.

Currently, there are no new books coming out anytime soon. I have plans for 2nd Editions of both books, but nothing has been set with the publisher; depending on inventory it could be quite some time before that happens.

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143