September 7, 2015
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?
January 29, 2017
EDIT: I have deleted several posts here which were incorrect and/or now lead to broken links. Here is the final answer:
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*
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.
September 7, 2015
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!
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.
Thank you for everything!
Most Users Ever Online: 55
Currently Browsing this Page:
Guest Posters: 1
Newest Members:Third Audio, LRT, TomJ, Giscard, Alejandro Florez, Tomaso, Jonas, Ralph, Wayne, Steve Duell
Moderators: W Pirkle: 267
Administrators: Tom: 67, JD Young: 80, Will Pirkle: 0, W Pirkle: 267