I want to create a spectrum analyzer with VSTGUI. I know how to create my own custom view and register it so it can use it with the inline ui editor. However when creating a custom view it only allows me to link the view to a single parameter (a double). A spectrum consists of a list of numbers so i won’t be able to display the spectrum this way. What is the way to go for this? Are there any tutorials/documentation about this?
Not really. But here’s the recipe:
- Create a custom view class which inherits from CView not CControl
- Create a subcontroller class which inherits from DelegationController.
- Overwrite the VST3EditorDelegate method createSubController. And return your subcontroller.
In the ui-editor you drag your custom view into your view template and set the sub-controller attribute to the one you have created above.
Now you can implement verifyView in your controller to get your custom view by checking the view class with dynamic_class.
And finally you can now implement the spectrum data access. When you have new spectrum data in your edit controller, you can move that data thru the sub controller to the view.
I hope this helps.
Thanks! I’ll look into this.
I am trying to implement your method but am having some trouble with setting the sub-controller attribute in the ui-editor. Whenever i enter the sub-controllers name in the box and hit enter, the name disappears. It is also not saved in the uidesc file. When i manually add it into the uidesc file the ui fails to load when loading the plugin in my host.
Am i supposed to add additional code for my custom view to have a sub-controller attribute?
Ah my mistake, you need to set the sub-controller of the parent of your custom view. Otherwise it doesn’t work.