MCPcopy Create free account
hub / github.com/VCVRack/Rack / BlankModule

Class BlankModule

src/core/Blank.cpp:9–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9struct BlankModule : Module {
10 int width = 10;
11
12 /** Legacy for <=v1 patches */
13 void fromJson(json_t* rootJ) override {
14 Module::fromJson(rootJ);
15 json_t* widthJ = json_object_get(rootJ, "width");
16 if (widthJ)
17 width = std::round(json_number_value(widthJ) / RACK_GRID_WIDTH);
18 }
19
20 json_t* dataToJson() override {
21 json_t* rootJ = json_object();
22 json_object_set_new(rootJ, "width", json_integer(width));
23 return rootJ;
24 }
25
26 void dataFromJson(json_t* rootJ) override {
27 json_t* widthJ = json_object_get(rootJ, "width");
28 if (widthJ)
29 width = json_integer_value(widthJ);
30 }
31};
32
33
34struct BlankPanel : Widget {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected