VCV Rack API v2
Loading...
Searching...
No Matches
Model.hpp
Go to the documentation of this file.
1#pragma once
2#include <common.hpp>
3#include <plugin/Plugin.hpp>
4
5#include <jansson.h>
6
7#include <list>
8
9
10namespace rack {
11
12
13namespace ui {
14struct Menu;
15} // namespace app
16
17
18namespace app {
19struct ModuleWidget;
20} // namespace app
21
22
23namespace engine {
24struct Module;
25} // namespace engine
26
27
28namespace plugin {
29
30
34struct Model {
35 Plugin* plugin = NULL;
36
40 std::string slug;
42 std::string name;
46 std::list<int> tagIds;
48 std::string description;
51 std::string manualUrl;
52 std::string modularGridUrl;
53
57 bool hidden = false;
58
59 virtual ~Model() {}
62 return NULL;
63 }
68 return NULL;
69 }
70
71 void fromJson(json_t* rootJ);
73 std::string getFullName();
77 std::string getManualUrl();
78
83 void appendContextMenu(ui::Menu* menu, bool inBrowser = false);
84 bool isFavorite();
85 void setFavorite(bool favorite);
86};
87
88
89} // namespace plugin
90} // 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
Manages an engine::Module in the rack.
Definition ModuleWidget.hpp:17
DSP processor instance for your module.
Definition Module.hpp:29
Type information for a module.
Definition Model.hpp:34
virtual app::ModuleWidget * createModuleWidget(engine::Module *m)
Creates a ModuleWidget with a Module attached.
Definition Model.hpp:67
std::string name
Human readable name for your model, e.g.
Definition Model.hpp:42
virtual ~Model()
Definition Model.hpp:59
std::string manualUrl
The manual of the module.
Definition Model.hpp:51
std::string getManualUrl()
Returns the module or plugin manual URL, whichever exists.
bool hidden
Hides model from the Module Browser but able to be loaded from a patch file.
Definition Model.hpp:57
void setFavorite(bool favorite)
std::string getFactoryPresetDirectory()
std::string modularGridUrl
Definition Model.hpp:52
std::list< int > tagIds
List of tag IDs representing the function(s) of the module.
Definition Model.hpp:46
void appendContextMenu(ui::Menu *menu, bool inBrowser=false)
Appends items to menu with useful Model information.
void fromJson(json_t *rootJ)
std::string slug
Must be unique.
Definition Model.hpp:40
virtual engine::Module * createModule()
Creates a Module.
Definition Model.hpp:61
Plugin * plugin
Definition Model.hpp:35
std::string getFullName()
Returns the branded name of the model, e.g.
std::string description
A one-line summary of the module's purpose.
Definition Model.hpp:48
std::string getUserPresetDirectory()
Definition Plugin.hpp:17
Definition Menu.hpp:11