![]() |
VCV Rack API v2
|
Root namespace for the Rack API. More...
Namespaces | |
| namespace | app |
| Rack's custom UI widgets that control the Rack state and engine. | |
| namespace | plugin |
| Loads and manages Rack plugins. | |
| namespace | engine |
| High-performance classes handling modules and voltage signals between them. | |
| namespace | asset |
| Handles common path locations. | |
| namespace | audio |
| Abstraction for all audio drivers in Rack. | |
| namespace | color |
| Utilities for NVGcolor. | |
| namespace | componentlibrary |
| Library of Rack components: knobs, ports, lights, switches, buttons, etc. | |
| namespace | history |
| Action history for UI undo/redo. | |
| namespace | window |
| Handles OS windowing, OpenGL, and NanoVG. | |
| namespace | patch |
| Handles the Rack patch file state. | |
| namespace | widget |
| Base UI widget types. | |
| namespace | midiloopback |
| namespace | dsp |
| Digital signal processing routines and classes. | |
| namespace | gamepad |
| Gamepad/joystick/controller MIDI driver. | |
| namespace | keyboard |
| Computer keyboard MIDI driver. | |
| namespace | library |
| Synchronizes plugins with the VCV Library and handles VCV accounts with the vcvrack.com API. | |
| namespace | logger |
| Logs messages to a file or the terminal. | |
| namespace | math |
| Extends <cmath> with extra functions and types. | |
| namespace | midi |
| Abstraction for all MIDI drivers in Rack. | |
| namespace | network |
| Networking functions for HTTP requests, downloads, and URLs. | |
| namespace | ui |
| Common graphical user interface widgets. | |
| namespace | random |
| Random number generation. | |
| namespace | settings |
| Process-scope globals, most of which are persisted across launches. | |
| namespace | simd |
| Abstraction of aligned types for SIMD computation. | |
| namespace | string |
| Supplemental std::string functions. | |
| namespace | system |
| Cross-platform functions for OS, file path, and filesystem routines. | |
| namespace | tag |
| Tags describing the function(s) of modules. | |
| namespace | event |
| Deprecated Rack v1 event namespace. | |
Classes | |
| struct | DeferWrapper |
| Defers running code until the scope is destructed. More... | |
| struct | Exception |
| An exception explicitly thrown by Rack or a Rack plugin. More... | |
| struct | Context |
| Rack instance state. More... | |
| struct | SharedMutex |
| Allows multiple "reader" threads to obtain a lock simultaneously, but only one "writer" thread. More... | |
| struct | SharedLock |
| struct | Quantity |
| A controller for manipulating a float value (which subclasses must store somehow) with limits and labels. More... | |
| struct | WeakHandle |
| struct | WeakBase |
| Base class for classes that allow WeakPtrs to be used. More... | |
| struct | WeakPtr |
| A weak pointer to a subclass of WeakBase. More... | |
| struct | Plugin |
| struct | Model |
| Type information for a module. More... | |
Functions | |
| template<typename To, typename From> | |
| To | bitCast (From from) |
| Casts a primitive, preserving its bits instead of converting. | |
| template<typename T> | |
| T * | construct () |
| C#-style property constructor Example: | |
| template<typename T, typename F, typename V, typename... Args> | |
| T * | construct (F f, V v, Args... args) |
| template<typename F> | |
| DeferWrapper< F > | deferWrapper (F f) |
| template<typename C> | |
| const C::mapped_type & | get (const C &c, const typename C::key_type &key, const typename C::mapped_type &def=typename C::mapped_type()) |
| Given a std::map c, returns the value of the given key, or returns def if the key doesn't exist. | |
| template<typename C> | |
| const C::value_type & | get (const C &c, typename C::size_type i, const typename C::value_type &def=typename C::value_type()) |
| Given a std::vector c, returns the value of the given index i, or returns def if the index is out of bounds. | |
| Context * | contextGet () |
| Returns the global Context pointer. | |
| void | contextSet (Context *context) |
| Sets the context for this thread. | |
| DEPRECATED Context * | appGet () |
| Deprecated. | |
| template<class TModule, class TModuleWidget> | |
| plugin::Model * | createModel (std::string slug) |
| Returns a Model that constructs a Module and ModuleWidget subclass. | |
| template<class TWidget> | |
| TWidget * | createWidget (math::Vec pos) |
| Creates a Widget subclass with its top-left at a position. | |
| template<class TWidget> | |
| TWidget * | createWidgetCentered (math::Vec pos) |
| Creates a Widget subclass with its center at a position. | |
| template<class TPanel = app::SvgPanel> | |
| TPanel * | createPanel (std::string svgPath) |
| Creates an SvgPanel and loads the SVG from the given path. | |
| template<class TPanel = app::ThemedSvgPanel> | |
| TPanel * | createPanel (std::string lightSvgPath, std::string darkSvgPath) |
| Creates a ThemedSvgPanel and loads the light/dark SVGs from the given paths. | |
| template<class TParamWidget> | |
| TParamWidget * | createParam (math::Vec pos, engine::Module *module, int paramId) |
| template<class TParamWidget> | |
| TParamWidget * | createParamCentered (math::Vec pos, engine::Module *module, int paramId) |
| template<class TPortWidget> | |
| TPortWidget * | createInput (math::Vec pos, engine::Module *module, int inputId) |
| template<class TPortWidget> | |
| TPortWidget * | createInputCentered (math::Vec pos, engine::Module *module, int inputId) |
| template<class TPortWidget> | |
| TPortWidget * | createOutput (math::Vec pos, engine::Module *module, int outputId) |
| template<class TPortWidget> | |
| TPortWidget * | createOutputCentered (math::Vec pos, engine::Module *module, int outputId) |
| template<class TModuleLightWidget> | |
| TModuleLightWidget * | createLight (math::Vec pos, engine::Module *module, int firstLightId) |
| template<class TModuleLightWidget> | |
| TModuleLightWidget * | createLightCentered (math::Vec pos, engine::Module *module, int firstLightId) |
| template<class TParamWidget> | |
| TParamWidget * | createLightParam (math::Vec pos, engine::Module *module, int paramId, int firstLightId) |
| Creates a param with a light and calls setFirstLightId() on it. | |
| template<class TParamWidget> | |
| TParamWidget * | createLightParamCentered (math::Vec pos, engine::Module *module, int paramId, int firstLightId) |
| template<class TMenu = ui::Menu> | |
| TMenu * | createMenu () |
| template<class TMenuLabel = ui::MenuLabel> | |
| TMenuLabel * | createMenuLabel (std::string text) |
| template<class TMenuItem = ui::MenuItem> | |
| TMenuItem * | createMenuItem (std::string text, std::string rightText="") |
| template<class TMenuItem = ui::MenuItem> | |
| TMenuItem * | createMenuItem (std::string text, std::string rightText, std::function< void()> action, bool disabled=false, bool alwaysConsume=false) |
| Creates a MenuItem with an action that calls a lambda function. | |
| template<class TMenuItem = ui::MenuItem> | |
| TMenuItem * | createCheckMenuItem (std::string text, std::string rightText, std::function< bool()> checked, std::function< void()> action, bool disabled=false, bool alwaysConsume=false) |
| Creates a MenuItem with a check mark set by a lambda function. | |
| template<class TMenuItem = ui::MenuItem> | |
| TMenuItem * | createBoolMenuItem (std::string text, std::string rightText, std::function< bool()> getter, std::function< void(bool state)> setter, bool disabled=false, bool alwaysConsume=false) |
| Creates a MenuItem that controls a boolean value with a check mark. | |
| template<typename T> | |
| ui::MenuItem * | createBoolPtrMenuItem (std::string text, std::string rightText, T *ptr) |
| Easy wrapper for createBoolMenuItem() to modify a bool pointer. | |
| template<class TMenuItem = ui::MenuItem> | |
| TMenuItem * | createSubmenuItem (std::string text, std::string rightText, std::function< void(ui::Menu *menu)> createMenu, bool disabled=false) |
| Creates a MenuItem that opens a submenu. | |
| template<class TMenuItem = ui::MenuItem> | |
| TMenuItem * | createIndexSubmenuItem (std::string text, std::vector< std::string > labels, std::function< size_t()> getter, std::function< void(size_t val)> setter, bool disabled=false, bool alwaysConsume=false) |
| Creates a MenuItem that when hovered, opens a submenu with several MenuItems indexed by an integer. | |
| template<typename T> | |
| ui::MenuItem * | createIndexPtrSubmenuItem (std::string text, std::vector< std::string > labels, T *ptr) |
| Easy wrapper for createIndexSubmenuItem() that controls an integer index at a pointer address. | |
| PRIVATE void | rtaudioInit () |
| PRIVATE void | rtmidiInit () |
Variables | |
| const std::string | APP_NAME |
| const std::string | APP_EDITION |
| const std::string | APP_EDITION_NAME |
| const std::string | APP_VERSION_MAJOR |
| const std::string | APP_VERSION |
| const std::string | APP_OS |
| const std::string | APP_OS_NAME |
| const std::string | APP_CPU |
| const std::string | APP_CPU_NAME |
| const std::string | API_URL |
Root namespace for the Rack API.
| To rack::bitCast | ( | From | from | ) |
Casts a primitive, preserving its bits instead of converting.
| T * rack::construct | ( | ) |
C#-style property constructor Example:
Foo *foo = construct<Foo>(&Foo::greeting, "Hello world", &Foo::legs, 2);
| T * rack::construct | ( | F | f, |
| V | v, | ||
| Args... | args ) |
| DeferWrapper< F > rack::deferWrapper | ( | F | f | ) |
| const C::mapped_type & rack::get | ( | const C & | c, |
| const typename C::key_type & | key, | ||
| const typename C::mapped_type & | def = typename C::mapped_type() ) |
Given a std::map c, returns the value of the given key, or returns def if the key doesn't exist.
Does not add the default value to the map.
Posted to https://stackoverflow.com/a/63683271/272642. Example:
std::map<std::string, int> m; int v = get(m, "a", 3);
v is 3 because the key "a" does not exist
int w = get(m, "a");
w is 0 because no default value is given, so it assumes the default int.
| const C::value_type & rack::get | ( | const C & | c, |
| typename C::size_type | i, | ||
| const typename C::value_type & | def = typename C::value_type() ) |
Given a std::vector c, returns the value of the given index i, or returns def if the index is out of bounds.
| void rack::contextSet | ( | Context * | context | ) |
Sets the context for this thread.
You must set the context when preparing each thread if the code uses the APP macro in that thread.
|
inline |
Deprecated.
Use contextGet() or the APP macro to get the current Context.
| plugin::Model * rack::createModel | ( | std::string | slug | ) |
Returns a Model that constructs a Module and ModuleWidget subclass.
| TWidget * rack::createWidget | ( | math::Vec | pos | ) |
Creates a Widget subclass with its top-left at a position.
| TWidget * rack::createWidgetCentered | ( | math::Vec | pos | ) |
Creates a Widget subclass with its center at a position.
| TPanel * rack::createPanel | ( | std::string | svgPath | ) |
Creates an SvgPanel and loads the SVG from the given path.
| TPanel * rack::createPanel | ( | std::string | lightSvgPath, |
| std::string | darkSvgPath ) |
Creates a ThemedSvgPanel and loads the light/dark SVGs from the given paths.
| TParamWidget * rack::createParam | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | paramId ) |
| TParamWidget * rack::createParamCentered | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | paramId ) |
| TPortWidget * rack::createInput | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | inputId ) |
| TPortWidget * rack::createInputCentered | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | inputId ) |
| TPortWidget * rack::createOutput | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | outputId ) |
| TPortWidget * rack::createOutputCentered | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | outputId ) |
| TModuleLightWidget * rack::createLight | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | firstLightId ) |
| TModuleLightWidget * rack::createLightCentered | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | firstLightId ) |
| TParamWidget * rack::createLightParam | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | paramId, | ||
| int | firstLightId ) |
Creates a param with a light and calls setFirstLightId() on it.
Requires ParamWidget to have a light member.
| TParamWidget * rack::createLightParamCentered | ( | math::Vec | pos, |
| engine::Module * | module, | ||
| int | paramId, | ||
| int | firstLightId ) |
| TMenu * rack::createMenu | ( | ) |
| TMenuLabel * rack::createMenuLabel | ( | std::string | text | ) |
| TMenuItem * rack::createMenuItem | ( | std::string | text, |
| std::string | rightText = "" ) |
| TMenuItem * rack::createMenuItem | ( | std::string | text, |
| std::string | rightText, | ||
| std::function< void()> | action, | ||
| bool | disabled = false, | ||
| bool | alwaysConsume = false ) |
Creates a MenuItem with an action that calls a lambda function.
Example:
menu->addChild(createMenuItem("Load sample", "kick.wav",
[=]() {
module->loadSample();
}
));
| TMenuItem * rack::createCheckMenuItem | ( | std::string | text, |
| std::string | rightText, | ||
| std::function< bool()> | checked, | ||
| std::function< void()> | action, | ||
| bool | disabled = false, | ||
| bool | alwaysConsume = false ) |
Creates a MenuItem with a check mark set by a lambda function.
Example:
menu->addChild(createCheckMenuItem("Loop", "",
[=]() {
return module->isLoop();
},
[=]() {
module->toggleLoop();
}
));
| TMenuItem * rack::createBoolMenuItem | ( | std::string | text, |
| std::string | rightText, | ||
| std::function< bool()> | getter, | ||
| std::function< void(bool state)> | setter, | ||
| bool | disabled = false, | ||
| bool | alwaysConsume = false ) |
Creates a MenuItem that controls a boolean value with a check mark.
Example:
menu->addChild(createBoolMenuItem("Loop", "",
[=]() {
return module->isLoop();
},
[=](bool loop) {
module->setLoop(loop);
}
));
| ui::MenuItem * rack::createBoolPtrMenuItem | ( | std::string | text, |
| std::string | rightText, | ||
| T * | ptr ) |
Easy wrapper for createBoolMenuItem() to modify a bool pointer.
Example:
menu->addChild(createBoolPtrMenuItem("Loop", "", &module->loop));
| TMenuItem * rack::createSubmenuItem | ( | std::string | text, |
| std::string | rightText, | ||
| std::function< void(ui::Menu *menu)> | createMenu, | ||
| bool | disabled = false ) |
Creates a MenuItem that opens a submenu.
Example:
menu->addChild(createSubmenuItem("Edit", "",
[=](Menu* menu) {
menu->addChild(createMenuItem("Copy", "", [=]() {copy();}));
menu->addChild(createMenuItem("Paste", "", [=]() {paste();}));
}
));
| TMenuItem * rack::createIndexSubmenuItem | ( | std::string | text, |
| std::vector< std::string > | labels, | ||
| std::function< size_t()> | getter, | ||
| std::function< void(size_t val)> | setter, | ||
| bool | disabled = false, | ||
| bool | alwaysConsume = false ) |
Creates a MenuItem that when hovered, opens a submenu with several MenuItems indexed by an integer.
Example:
menu->addChild(createIndexSubmenuItem("Mode",
{"Hi-fi", "Mid-fi", "Lo-fi"},
[=]() {
return module->getMode();
},
[=](int mode) {
module->setMode(mode);
}
));
| ui::MenuItem * rack::createIndexPtrSubmenuItem | ( | std::string | text, |
| std::vector< std::string > | labels, | ||
| T * | ptr ) |
Easy wrapper for createIndexSubmenuItem() that controls an integer index at a pointer address.
Example:
menu->addChild(createIndexPtrSubmenuItem("Mode",
{"Hi-fi", "Mid-fi", "Lo-fi"},
&module->mode
));
| PRIVATE void rack::rtaudioInit | ( | ) |
| PRIVATE void rack::rtmidiInit | ( | ) |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |