Switch View Containers | Advanced GUI API Programming in RackAFX v6.6 | Forum


Please consider registering

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 Topic RSS sp_TopicIcon
Switch View Containers
October 31, 2015 - 9:03 am
Member Since: September 7, 2015
Forum Posts: 45
sp_UserOfflineSmall Offline

Hi Will,
I'm looking for a way to exchange containers in my GUI, much like the tab-controller works, but without a tab.
I've had success layering the different containers on top of one another and then using the show/hide techniques from module 4. But things get messy in RAFX when doing so. Is there a way to create the view container in the offscreen view and then load it in when needed?
Thanks, Fred

November 8, 2015 - 11:46 pm
Member Since: January 29, 2017
Forum Posts: 689
sp_UserOfflineSmall Offline

EDIT: I have deleted several posts here which were incorrect and/or now lead to broken links. Here is the final answer:

Hi Fred

We have a bad-news/good-news situation here. The bad news is that you can't programmatically control a UIViewSwitchContainer by issuing commands to a Tab Controller object, whether it is hidden or not. In the sample project from the old post (which I have removed) the GUI works fine in RackAFX and AU because in both cases I use a custom UIViewSwitchContainer that I coded from scratch to work better with the RAFX XML parsing paradigm.

But, for VST3 I use the built-in parser and object creation mechanism. There is no outward difference in the way the two objects behave, with the exception of using a remote Tab Controller. When issuing commands that start the view switching remotely, the timer that runs the animation does not deliver timer notifications to the animation object. So, the animation never occurs and this is what caused the problem with the behavior in VST3 clients. I believe this is because the valueChanged( ) command is issued from the plugin thread rather than the GUI thread, but I have not proven this.

The good news is that there was a mis-communication/mis-understanding about the Tab Controller ID tag values from my Video. When I looked at your synth code, I realized that you were trying to use an Option Menu linked to your oscillator-type variable to trigger the remote control of the hidden Option Menu on the main view. The reality is that you are free to use RackAFX-variable-linked controls as tab controllers too. There is nothing preventing you from using the Oscillator Type enum as the Tab Controller. I added those built-in tags TAB_CTRL_0, TAB_CTRL_1, etc... so that the user would not need to create dummy RackAFX variables as a control link. But in your case, you *want* to use the RackAFX control variable as the Tab Control. So, all you need to do is:

- In the UIViewSwitchContainers, set the Tab Controller IDs to your RackAFX variables, Osc1TypeEnum, etc...

- you still need to create those Custom View Option Menus on the main view, and you also set their ID values to the match the UIViewSwitchContainers, i.e. Osc1TypeEnum, etc... You still need these because the option menus in your UI VC's are on the off-screen views.

- in the Custom View implementation, you only need to hide the control by setting the visibility flag - that's it.

- there is nothing to do in your update() function -- the option menu connection takes care of that for you, automatically.

So, for example, your first hidden tab controller Custom View instantiation looks like this:

// --- decode the customViewName variable
if (strcmp(info->customViewName, "Osc1TabController") == 0)
// --- get the needed attributes with the helper
const CRect rect = m_GUIHelper.getRectWithVSTGUIRECT(info->customViewRect);

// --- create the tab controller
m_pTabController = new COptionMenu(rect, (CControlListener*)info->listener, info->customViewTag);

// --- hide it

// --- return control cloaked as a void*
return (void*)m_pTabController;

I emailed you the only two files that needed modification, the .uidesc XML file and the .cpp file which is now simpler.

So, that is how you can control your UIViewSwitchContainers directly via RackAFX-variable-controls.

BTW: your synth GUI looks FANTASTIC! I really like using the UIViewSwitchControllers for the Oscillator interface -- very slick, indeed. When you are finished, I would like to feature it in the GUI Gallery Page, so be sure to send some screen shots.


- Will

November 11, 2015 - 7:15 pm
Member Since: September 7, 2015
Forum Posts: 45
sp_UserOfflineSmall Offline

Hi Will,
Everything works perfectly in RAFX as well as Ableton, thank you! Yeah, I missed that you could use the COptionMenu, as it was sitting insinde the VCs themselves. The filters are now inside VCs as well and most of the GUI functionality is now complete! Laugh
I'm still working on background designs for the GUI with a friend of mine and the modmatrix needs to be done properly, I will send you screenshots once it's complete. Smile
Thank you for everything!

November 11, 2015 - 8:47 pm
Member Since: January 29, 2017
Forum Posts: 689
sp_UserOfflineSmall Offline

Cool - glad everything is up and running for you!

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 1

Members: 768

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 842

Posts: 3347

Moderators: W Pirkle: 689