VCV Rack API v2
Loading...
Searching...
No Matches
Plugin.hpp
Go to the documentation of this file.
1#pragma once
2#include <common.hpp>
3
4#include <jansson.h>
5
6#include <list>
7
8
9namespace rack {
10namespace plugin {
11
12
13struct Model;
14
15
16// Subclass this and return a pointer to a new one when init() is called
17struct Plugin {
21 std::list<Model*> models;
24 std::string path;
27 void* handle = NULL;
28
32 std::string slug;
36 std::string version;
39 std::string license;
42 std::string name;
46 std::string brand;
50 std::string description;
53 std::string author;
56 std::string authorEmail;
59 std::string authorUrl;
62 std::string pluginUrl;
65 std::string manualUrl;
68 std::string sourceUrl;
71 std::string donateUrl;
74 std::string changelogUrl;
77 double modifiedTimestamp = -INFINITY;
78
80 void addModel(Model* model);
81 Model* getModel(const std::string& slug);
82 void fromJson(json_t* rootJ);
83 void modulesFromJson(json_t* rootJ);
84 std::string getBrand();
85};
86
87
88} // namespace plugin
89} // namespace rack
std::string plugin(plugin::Plugin *plugin, std::string filename="")
Returns the path of an asset in the plugin's dir.
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Type information for a module.
Definition Model.hpp:34
Definition Plugin.hpp:17
std::string slug
Must be unique.
Definition Plugin.hpp:32
std::string version
Your plugin's latest version.
Definition Plugin.hpp:36
void addModel(Model *model)
void * handle
OS-dependent library handle.
Definition Plugin.hpp:27
std::string name
Human-readable display name for your plugin.
Definition Plugin.hpp:42
std::list< Model * > models
List of models contained in this plugin.
Definition Plugin.hpp:21
std::string authorUrl
Homepage of the author.
Definition Plugin.hpp:59
std::string description
A one-line summary of the plugin's purpose.
Definition Plugin.hpp:50
std::string path
The file path to the plugin's directory.
Definition Plugin.hpp:24
std::string manualUrl
The manual of your plugin.
Definition Plugin.hpp:65
std::string changelogUrl
Link to the changelog of the plugin.
Definition Plugin.hpp:74
std::string pluginUrl
Homepage featuring the plugin itself.
Definition Plugin.hpp:62
Model * getModel(const std::string &slug)
double modifiedTimestamp
Last modified timestamp of the plugin directory.
Definition Plugin.hpp:77
std::string sourceUrl
The source code homepage.
Definition Plugin.hpp:68
std::string getBrand()
std::string license
The license type of your plugin.
Definition Plugin.hpp:39
void modulesFromJson(json_t *rootJ)
std::string authorEmail
Your email address for support inquiries.
Definition Plugin.hpp:56
void fromJson(json_t *rootJ)
std::string donateUrl
Link to donation page for users who wish to donate.
Definition Plugin.hpp:71
std::string brand
Prefix of each module name in the Module Browser.
Definition Plugin.hpp:46
std::string author
Your name, company, alias, or GitHub username.
Definition Plugin.hpp:53