VCV Rack API v2
Loading...
Searching...
No Matches
plugin.hpp
Go to the documentation of this file.
1#pragma once
2#include <vector>
3
4#include <common.hpp>
5#include <plugin/Plugin.hpp>
6#include <plugin/Model.hpp>
7
8
9namespace rack {
11namespace plugin {
12
13
16PRIVATE void settingsMergeJson(json_t* rootJ);
17
19Plugin* getPlugin(const std::string& pluginSlug);
21Plugin* getPluginFallback(const std::string& pluginSlug);
23Model* getModel(const std::string& pluginSlug, const std::string& modelSlug);
25Model* getModelFallback(const std::string& pluginSlug, const std::string& modelSlug);
26
30Model* modelFromJson(json_t* moduleJ);
32bool isSlugValid(const std::string& slug);
34std::string normalizeSlug(const std::string& slug);
35
36
38extern std::string pluginsPath;
39extern std::vector<Plugin*> plugins;
40
41
42} // namespace plugin
43} // namespace rack
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:30
std::string plugin(plugin::Plugin *plugin, std::string filename="")
Returns the path of an asset in the plugin's dir.
Model * getModel(const std::string &pluginSlug, const std::string &modelSlug)
Finds a loaded Model by plugin and model slug.
std::vector< Plugin * > plugins
std::string normalizeSlug(const std::string &slug)
Returns a string containing only the valid slug characters.
bool isSlugValid(const std::string &slug)
Checks that the slug contains only alphanumeric characters, "-", and "_".
Model * getModelFallback(const std::string &pluginSlug, const std::string &modelSlug)
Finds a loaded Model by plugin and model slug, or a fallback model if exists.
PRIVATE void settingsMergeJson(json_t *rootJ)
PRIVATE void init()
Plugin * getPlugin(const std::string &pluginSlug)
Finds a loaded Plugin by slug.
std::string pluginsPath
Path to plugins installation dir.
Plugin * getPluginFallback(const std::string &pluginSlug)
Finds a loaded Plugin by slug, or a fallback plugin if exists.
Model * modelFromJson(json_t *moduleJ)
Creates a Model from a JSON module object.
PRIVATE void destroy()
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Type information for a module.
Definition Model.hpp:34
Definition Plugin.hpp:17