VSTGUI  4.10
Graphical User Interface Framework not only for VST plugins
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Standalone Library

About

Note
The Standalone Library is a preview. The API may change in the future !

The standalone library adds a minimal set of classes to write simple cross-platform UI applications. See this page for a list of classes.

Here's a minimal sample just showing one window:

#include "vstgui/standalone/include/iapplication.h"
#include "vstgui/standalone/include/iuidescwindow.h"
#include "vstgui/standalone/include/helpers/appdelegate.h"
#include "vstgui/standalone/include/helpers/windowlistener.h"
using namespace VSTGUI::Standalone;
using namespace VSTGUI::Standalone::Application;
class MyApplication : public DelegateAdapter, public WindowListenerAdapter
{
public:
MyApplication ()
: DelegateAdapter ({"simple_standalone", "1.0.0", "com.mycompany.simplestandalone"})
{}
void finishLaunching () override
{
config.uiDescFileName = "Window.uidesc";
config.viewName = "Window";
config.windowConfig.title = "Sample App";
config.windowConfig.autoSaveFrameName = "SampleAppWindow";
if (auto window = UIDesc::makeWindow (config))
{
window->show ();
window->registerWindowListener (this);
}
else
{
}
}
void onClosed (const IWindow& window) override
{
}
};
static Init gAppDelegate (std::make_unique<MyApplication> ());

Adding a real user interface to the window is done via a "What You See Is What You Get" editor at runtime as known from the VST3 inline editor. Bindings are done via the IModelBinding interface.

Bindings

Binding the user interface with your code is done via IValue objects. A list of value objects are exposed via an object that implements the IModelBinding interface.

As an example implementation there is the ModelBindingCallbacks class in the helpers sub directory. For example you want to have a button in the UI which triggers a function, you can implement it like this :

auto binding = UIDesc::ModelBindingCallbacks::make ();
binding->addValue (Value::make ("MyFunction"),
UIDesc::ValueCalls::onAction ([&] (IValue& v) {
executeMyFunction ();
}));
config.modelBinding = binding;

After you have set the binding as the UIDesc::Config::modelBinding parameter when you create the window, you can start your program, enable the inline editor, create a button and bind that button to the "control-tag" of "MyFunction" as written in the above code. When the button is clicked, the function 'executeMyFunction' is called.

Customization

If you need deeper control of the UI you can supply an object implementing the ICustomization interface as the UIDesc::Config::customization parameter. In the UI editor you can set the 'sub-controller' attribute of a view container to create a new IController object out of your ICustomization object. This controller can alter the UI in many ways, it can even create custom views if you don't want to use the way described in IViewCreator to support the view inside the UI editor.

Supported operating systems

  • Microsoft Windows 64bit
    • minimum supported version : 7
  • Apple macOS 64bit
    • minimum supported version : 10.10

Compiler requirements

To compile and use the library you need a compiler supporting most of c++14.

As of this writing the following compilers work (others not tested):

  • Visual Studio 15
  • Xcode 7.3