VCV Rack API v2
rack::plugin Namespace Reference

Loads and manages Rack plugins. More...

Classes

struct  Model
 Type information for a module. More...
 
struct  Plugin
 

Functions

PRIVATE void init ()
 
PRIVATE void destroy ()
 
PlugingetPlugin (const std::string &pluginSlug)
 Finds a loaded Plugin by slug. More...
 
PlugingetExactPlugin (const std::string &pluginSlug)
 Finds a loaded Plugin by slug, ignoring plugin slug aliases. More...
 
ModelgetModel (const std::string &pluginSlug, const std::string &modelSlug)
 Finds a loaded Model by plugin and model slug. More...
 
ModelgetExactModel (const std::string &pluginSlug, const std::string &modelSlug)
 Finds a loaded Model by plugin and model slug, ignoring module slug aliases. More...
 
ModelmodelFromJson (json_t *moduleJ)
 Creates a Model from a JSON module object. More...
 
bool isSlugValid (const std::string &slug)
 Checks that the slug contains only alphanumeric characters, "-", and "_". More...
 
std::string normalizeSlug (const std::string &slug)
 Returns a string containing only the valid slug characters. More...
 

Variables

std::string pluginsPath
 Path to plugins installation dir. More...
 
std::vector< Plugin * > plugins
 

Detailed Description

Loads and manages Rack plugins.

Function Documentation

◆ init()

PRIVATE void rack::plugin::init ( )

◆ destroy()

PRIVATE void rack::plugin::destroy ( )

◆ getPlugin()

Plugin * rack::plugin::getPlugin ( const std::string &  pluginSlug)

Finds a loaded Plugin by slug.

◆ getExactPlugin()

Plugin * rack::plugin::getExactPlugin ( const std::string &  pluginSlug)

Finds a loaded Plugin by slug, ignoring plugin slug aliases.

◆ getModel()

Model * rack::plugin::getModel ( const std::string &  pluginSlug,
const std::string &  modelSlug 
)

Finds a loaded Model by plugin and model slug.

◆ getExactModel()

Model * rack::plugin::getExactModel ( const std::string &  pluginSlug,
const std::string &  modelSlug 
)

Finds a loaded Model by plugin and model slug, ignoring module slug aliases.

◆ modelFromJson()

Model * rack::plugin::modelFromJson ( json_t *  moduleJ)

Creates a Model from a JSON module object.

Throws an Exception if the model is not found.

◆ isSlugValid()

bool rack::plugin::isSlugValid ( const std::string &  slug)

Checks that the slug contains only alphanumeric characters, "-", and "_".

◆ normalizeSlug()

std::string rack::plugin::normalizeSlug ( const std::string &  slug)

Returns a string containing only the valid slug characters.

Variable Documentation

◆ pluginsPath

std::string rack::plugin::pluginsPath
extern

Path to plugins installation dir.

◆ plugins

std::vector<Plugin*> rack::plugin::plugins
extern