VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

Loading...
Searching...
No Matches
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
{
UIDesc::Config config;
config.uiDescFileName = "Window.uidesc";
config.viewName = "Window";
config.windowConfig.title = "Sample App";
config.windowConfig.autoSaveFrameName = "SampleAppWindow";
config.windowConfig.style.border ().close ().size ().centered ();
if (auto window = UIDesc::makeWindow (config))
{
window->show ();
window->registerWindowListener (this);
}
else
{
IApplication::instance ().quit ();
}
}
void onClosed (const IWindow& window) override
{
IApplication::instance ().quit ();
}
};
static Init gAppDelegate (std::make_unique<MyApplication> ());
VSTGUI::Standalone::Application::DelegateAdapter
Application delegate adapter
Definition appdelegate.h:20
VSTGUI::Standalone::WindowListenerAdapter
Window listener adapter
Definition windowlistener.h:20
VSTGUI::Standalone::Application
Definition appinit.h:12
VSTGUI::Standalone
Standalone Library
Definition appinit.h:11
VSTGUI::Standalone::Application::Init
Init application.
Definition appinit.h:90
VSTGUI::Standalone::UIDesc::Config::uiDescFileName
UTF8String uiDescFileName
Filename of the UIDescription xml file.
Definition iuidescwindow.h:72
VSTGUI::Standalone::UIDesc::Config::viewName
UTF8String viewName
Template name of the view in the uidesc file to show in the window.
Definition iuidescwindow.h:75
VSTGUI::Standalone::UIDesc::Config::windowConfig
WindowConfiguration windowConfig
Window configuration.
Definition iuidescwindow.h:78
VSTGUI::Standalone::WindowConfiguration::title
UTF8String title
Window title.
Definition iwindow.h:145
VSTGUI::Standalone::WindowConfiguration::autoSaveFrameName
UTF8String autoSaveFrameName
Window save frame name.
Definition iwindow.h:147
VSTGUI::Standalone::WindowConfiguration::style
WindowStyle style
Window style.
Definition iwindow.h:141
VSTGUI::Standalone::WindowStyle::border
WindowStyle & border()
Definition iwindow.h:89
VSTGUI::Standalone::WindowStyle::centered
WindowStyle & centered()
Definition iwindow.h:114
VSTGUI::Standalone::WindowStyle::close
WindowStyle & close()
Definition iwindow.h:94
VSTGUI::Standalone::WindowStyle::size
WindowStyle & size()
Definition iwindow.h:99

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;
VSTGUI::Standalone::IValue
Value interface.
Definition ivalue.h:21
VSTGUI::Standalone::UIDesc::ModelBindingCallbacks::make
static ModelBindingCallbacksPtr make()
Definition modelbinding.h:60
VSTGUI::Standalone::Value::make
ValuePtr make(const UTF8String &id, IValue::Type initialValue=0., const ValueConverterPtr &valueConverter=nullptr)
make a value in the normalized range [0..1]
VSTGUI::Standalone::UIDesc::Config::modelBinding
ModelBindingPtr modelBinding
Model binding.
Definition iuidescwindow.h:86
VSTGUI::Standalone::UIDesc::ValueCalls::onAction
static ValueCalls onAction(Call &&call)
Definition modelbinding.h:41

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