VSTGUI 4.10
Graphical User Interface Framework not only for VST plugins
|
VSTGUI 4.1 includes a new VST3 inline UI editor which makes UI design easier than before.
It automatically supports the following VST3 features:
Before using the inline UI editor, you must make sure that you use the Steinberg::Vst::EditController class as a base of your own edit controller and that you have used the Steinberg::Vst::Parameter class or any subclass of it for your parameters.
Otherwise the inline UI editor won't work properly.
Next you have to add two files to your project:
After that you have to alter your project settings to add a preprocessor definition to your debug build:
As last step you have to modify your edit controller class to overwrite the createView() method:
And make sure to include the vst3editor.h header.
Now you can build your plug-in and start your preferred VST3 host to start designing your user interface.
If you now open your plug-in editor you will see a blank editor. To enter the UI editor you have to make a right click on it and choose "Open UIDescription Editor".
If you've used the Parameter class provided by the VST3 SDK, you will get automatic parameter bindings between the controls of your editor and the parameters in your VST Edit Controller.
The only thing you need to do is to declare the ids of the parameters as tags in the Tags editor (or use the 'Sync Parameter Tags' command in the Edit Menu of the Toolbar) and set the tags of your controls to these ids. After you've done this your VST Edit Controller will receive the beginEdit(..)/performEdit(..)/endEdit(..) calls when the user changes the controls and if the host automates the parameter the control will also reflect these changes.
As an addition you can modify your VST Edit Controller to return specific parameter objects in the getParameterObject(int32 paramID) method for UI only needs, which are not parameters of your VST audio processor. This way you can store view settings like the tab which is open when the user closes the editor so that you can restore it when the user opens the editor again. You can look at the sources of the included 'uidescription test' project how this works.
The Editor has mainly five sections:
All actions you do here are undoable.
The toolbar currently contains the two menus "File" and "Edit", the editing checkbox and the grid settings.
TODO: describe menu items
The File Menu contains:
The Edit Menu contains:
TODO
The View Attribute Editor shows the attributes of the selected views. If multiple views are selected it only shows those attributes which applies to all selected views. On the left side are the names of the attributes and on the right side their values. The values are editable.
You can enter a search term in the search field so that only those attributes are shown which matches the search string.
The most left list shows all the templates. You can rename a template with a double click on it.
If a template is selected, it is shown in the Template Editor and all sub views are listed in the next list. You can select these sub views and if the selected sub view is a container view, its subviews are listed in the next list, etc.
You can alter the selection of the Template Editor via double click.
You can move the selected view up and down in the hierarchy order via Command-Up and Command-Down.
This section contains five subsections :
This section shows all views which are registered with UIDescription. You can register your own views, see VSTGUI::IViewCreator.
To insert a view, select it and drag it into the template editor. While dragging the view over the template editor, the container view will be highlighted which will be the parent of the view if you drop it there.
Here you define Tags for your controls. The left column describes the name of the Tag and the right column is the numerical value of the tag as used in VSTGUI::CControl.
With the + button you add a new tag and with the - button you remove the selected tag.
TODO: New Screenshot
Here you define custom colors.
With the + button you add a new color and with the - button you remove the selected color.
TODO: New Screenshot
Here you define your bitmaps.
The path is the path to the bitmap.
The Nine Part Tiled checkbox indicates if this is a VSTGUI::CNinePartTiledBitmap. And the l/t/r/b values describes its offsets.
With the + button you add a new bitmap and with the - button you remove the selected bitmap.
Here you describe your custom fonts.
With the + button you add a new font and with the - button you remove the selected font.
If you need to create custom views, you can implement the VSTGUI::VST3EditorDelegate interface in your edit controller class. The createCustomView method will be called if you set the 'custom-view-name' attribute in one of the views.
Another way to use your own views is to register them at runtime with the UIViewFactory. This method requires more work but has the advantage that the view will be listed like the built-in views and changing attributes work on the fly. See VSTGUI::IViewCreator.
Sub-Controllers are useful if you need finer control of your views. You can define sub-controllers for views with the 'sub-controller' attribute. Sub-Controllers will be created via the VSTGUI::VST3EditorDelegate interface. The Sub-Controller object is now owned by the view and will be destroyed when the view is destroyed.
TODO: describe nested subcontrollers
The VSTGUI::DelegationController is a helper class if you don't want to control every aspect of the views by forwarding every call to its parent controller. You only overwrite the methods you need in your inherited class.
If you want to be notified about value changes for controls in your sub-controller but don't want to loose the Parameter Binding you can add your sub-controller as dependent of the control:
Templates are root views where you can group controls in logical entities. You can embed templates into other templates.
Some views like the VSTGUI::UIViewSwitchContainer shows different templates depending on a control value.