From cbfeb2ef5fd1826fbd56d7c8f73fb44b676174a4 Mon Sep 17 00:00:00 2001 From: eggix <9631813+eggix@users.noreply.github.com> Date: Fri, 4 Oct 2019 21:54:10 +0200 Subject: [PATCH 1/4] created plugin.json and removed slugs --- Makefile | 3 --- plugin.json | 25 +++++++++++++++++++++++++ src/Stochasm.cpp | 2 -- src/Stochasm.hpp | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 plugin.json diff --git a/Makefile b/Makefile index 5f13c1d..7bfda67 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -SLUG = com-soundchasing-stochasm -VERSION = 0.6.0 - # FLAGS will be passed to both the C and C++ compiler FLAGS += CFLAGS += diff --git a/plugin.json b/plugin.json new file mode 100644 index 0000000..9e2faf5 --- /dev/null +++ b/plugin.json @@ -0,0 +1,25 @@ +{ + "slug": "com-soundchasing-stochasm", + "name": "Stochasm", + "version": "1.0.0", + "license": "MIT", + "brand": "Stochasm", + "author": "teletypist", + "authorEmail": "", + "authorUrl": "https://soundchasing.com", + "pluginUrl": "https://github.com/teletypist/stochasm", + "manualUrl": "https://github.com/teletypist/stochasm", + "sourceUrl": "https://github.com/teletypist/stochasm", + "donateUrl": "", + "changelogUrl": "", + "modules": [ + { + "slug": "Resonator", + "name": "Resonator", + "description": "Bitstream Resonator", + "tags": [ + "Oscillator" + ] + } + ] +} diff --git a/src/Stochasm.cpp b/src/Stochasm.cpp index c0912c1..cb60ad4 100644 --- a/src/Stochasm.cpp +++ b/src/Stochasm.cpp @@ -10,8 +10,6 @@ void init(rack::Plugin *p) { // It must only contain letters, numbers, and characters "-" and "_". No spaces. // To guarantee uniqueness, it is a good idea to prefix the slug by your name, alias, or company name if available, e.g. "MyCompany-MyPlugin". // The ZIP package must only contain one folder, with the name equal to the plugin's slug. - p->slug = TOSTRING(SLUG); - p->version = TOSTRING(VERSION); p->website = "https://soundchasing.com/uncertainty"; p->manual = "https://soundchasing.com/stochasm"; diff --git a/src/Stochasm.hpp b/src/Stochasm.hpp index fcabfe3..7c79e31 100644 --- a/src/Stochasm.hpp +++ b/src/Stochasm.hpp @@ -1,4 +1,4 @@ -#include "rack.hpp" +#include "rack0.hpp" using namespace rack; From 13cd7739bb57cb1beab10d9c60867ff482a6fa74 Mon Sep 17 00:00:00 2001 From: eggix <9631813+eggix@users.noreply.github.com> Date: Fri, 4 Oct 2019 22:29:36 +0200 Subject: [PATCH 2/4] completed phase 1 of migration --- Makefile | 2 +- src/Resonator.cpp | 52 ++++++++++++++++++++++++----------------------- src/Stochasm.cpp | 14 ++++++------- src/Stochasm.hpp | 24 ++++++++++++---------- 4 files changed, 47 insertions(+), 45 deletions(-) diff --git a/Makefile b/Makefile index 7bfda67..d7e38ff 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # FLAGS will be passed to both the C and C++ compiler -FLAGS += +FLAGS += -w CFLAGS += CXXFLAGS += diff --git a/src/Resonator.cpp b/src/Resonator.cpp index 241701e..715438c 100644 --- a/src/Resonator.cpp +++ b/src/Resonator.cpp @@ -67,11 +67,12 @@ struct Resonator : Module { float lPre = 0.f; - Resonator() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {} + Resonator() { + config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);} void step() override; // For more advanced Module features, read Rack's engine.hpp header file - // - toJson, fromJson: serialization of internal data + // - dataToJson, dataFromJson: serialization of internal data // - onSampleRateChange: event triggered by a change of sample rate // - onReset, onRandomize, onCreate, onDelete: implements special behavior when user clicks these from the context menu }; @@ -196,7 +197,8 @@ struct ResonatorWidget : ModuleWidget { }; -ResonatorWidget::ResonatorWidget(Resonator *module) : ModuleWidget(module) { +ResonatorWidget::ResonatorWidget(Resonator *module) { + setModule(module); //Resonator *module = new Resonator(); //setModule(module); @@ -206,38 +208,38 @@ ResonatorWidget::ResonatorWidget(Resonator *module) : ModuleWidget(module) { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(plugin, "res/Resonator.svg"))); + panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Resonator.svg"))); addChild(panel); } - addChild(Widget::create(Vec(RACK_GRID_WIDTH, 0))); - addChild(Widget::create(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(Widget::create(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(Widget::create(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); //Upper - addParam(ParamWidget::create(Vec(52, 30), module, Resonator::UPPER_CHAMBER, 0.0, 10.0, 5.0)); - addParam(ParamWidget::create(Vec(48, 104), module, Resonator::UPPER_FILTER1, 0.0, 10.0, 5.0)); - addParam(ParamWidget::create(Vec(85, 104), module, Resonator::UPPER_FILTER2, 0.0, 10.0, 5.0)); - addParam(ParamWidget::create(Vec(11, 81), module, Resonator::UPPER_MANUAL, 0.0, 1.0, 0.0)); + addParam(createParam(Vec(52, 30), module, Resonator::UPPER_CHAMBER, 0.0, 10.0, 5.0)); + addParam(createParam(Vec(48, 104), module, Resonator::UPPER_FILTER1, 0.0, 10.0, 5.0)); + addParam(createParam(Vec(85, 104), module, Resonator::UPPER_FILTER2, 0.0, 10.0, 5.0)); + addParam(createParam(Vec(11, 81), module, Resonator::UPPER_MANUAL, 0.0, 1.0, 0.0)); - addInput(Port::create(Vec(12, 43), Port::INPUT, module, Resonator::UPPER_VOCT)); - addInput(Port::create(Vec(12, 120), Port::INPUT, module, Resonator::UPPER_GATE)); + addInput(createPort(Vec(12, 43), PortWidget::INPUT, module, Resonator::UPPER_VOCT)); + addInput(createPort(Vec(12, 120), PortWidget::INPUT, module, Resonator::UPPER_GATE)); - addOutput(Port::create(Vec(12, 159), Port::OUTPUT, module, Resonator::UPPER_OUT)); - addOutput(Port::create(Vec(86, 159), Port::OUTPUT, module, Resonator::UPPER_BITS)); + addOutput(createPort(Vec(12, 159), PortWidget::OUTPUT, module, Resonator::UPPER_OUT)); + addOutput(createPort(Vec(86, 159), PortWidget::OUTPUT, module, Resonator::UPPER_BITS)); //Lower - addParam(ParamWidget::create(Vec(52, 218), module, Resonator::LOWER_CHAMBER, 0.0, 10.0, 5.0)); - addParam(ParamWidget::create(Vec(48, 292), module, Resonator::LOWER_FILTER1, 0.0, 10.0, 5.0)); - addParam(ParamWidget::create(Vec(85, 292), module, Resonator::LOWER_FILTER2, 0.0, 10.0, 5.0)); - addParam(ParamWidget::create(Vec(11, 269), module, Resonator::LOWER_MANUAL, 0.0, 1.0, 0.0)); + addParam(createParam(Vec(52, 218), module, Resonator::LOWER_CHAMBER, 0.0, 10.0, 5.0)); + addParam(createParam(Vec(48, 292), module, Resonator::LOWER_FILTER1, 0.0, 10.0, 5.0)); + addParam(createParam(Vec(85, 292), module, Resonator::LOWER_FILTER2, 0.0, 10.0, 5.0)); + addParam(createParam(Vec(11, 269), module, Resonator::LOWER_MANUAL, 0.0, 1.0, 0.0)); - addInput(Port::create(Vec(12, 230), Port::INPUT, module, Resonator::LOWER_VOCT)); - addInput(Port::create(Vec(12, 308), Port::INPUT, module, Resonator::LOWER_GATE)); + addInput(createPort(Vec(12, 230), PortWidget::INPUT, module, Resonator::LOWER_VOCT)); + addInput(createPort(Vec(12, 308), PortWidget::INPUT, module, Resonator::LOWER_GATE)); - addOutput(Port::create(Vec(12, 346), Port::OUTPUT, module, Resonator::LOWER_OUT)); - addOutput(Port::create(Vec(86, 346), Port::OUTPUT, module, Resonator::LOWER_BITS)); + addOutput(createPort(Vec(12, 346), PortWidget::OUTPUT, module, Resonator::LOWER_OUT)); + addOutput(createPort(Vec(86, 346), PortWidget::OUTPUT, module, Resonator::LOWER_BITS)); //addInput(createInput(Vec(33, 186), module, Resonator::PITCH_INPUT)); @@ -268,4 +270,4 @@ Out, PJ301M -> (12, 346) Bits, PJ301M -> (86, 346) */ -Model *modelResonator = Model::create("Stochasm", "Resonator", "Bitstream Resonator", OSCILLATOR_TAG); \ No newline at end of file +Model *modelResonator = createModel("Resonator"); diff --git a/src/Stochasm.cpp b/src/Stochasm.cpp index cb60ad4..921b46c 100644 --- a/src/Stochasm.cpp +++ b/src/Stochasm.cpp @@ -1,21 +1,19 @@ #include "Stochasm.hpp" -// The plugin-wide instance of the Plugin class -Plugin *plugin; +// The pluginInstance-wide instance of the Plugin class +Plugin *pluginInstance; void init(rack::Plugin *p) { - plugin = p; - // The "slug" is the unique identifier for your plugin and must never change after release, so choose wisely. + pluginInstance = p; + // The "slug" is the unique identifier for your pluginInstance and must never change after release, so choose wisely. // It must only contain letters, numbers, and characters "-" and "_". No spaces. // To guarantee uniqueness, it is a good idea to prefix the slug by your name, alias, or company name if available, e.g. "MyCompany-MyPlugin". - // The ZIP package must only contain one folder, with the name equal to the plugin's slug. - p->website = "https://soundchasing.com/uncertainty"; - p->manual = "https://soundchasing.com/stochasm"; + // The ZIP package must only contain one folder, with the name equal to the pluginInstance's slug. // For each module, specify the ModuleWidget subclass, manufacturer slug (for saving in patches), manufacturer human-readable name, module slug, and module name p->addModel(modelResonator); - // Any other plugin initialization may go here. + // Any other pluginInstance initialization may go here. // As an alternative, consider lazy-loading assets and lookup tables when your module is created to reduce startup times of Rack. } diff --git a/src/Stochasm.hpp b/src/Stochasm.hpp index 7c79e31..4c252d2 100644 --- a/src/Stochasm.hpp +++ b/src/Stochasm.hpp @@ -4,7 +4,9 @@ using namespace rack; -extern Plugin *plugin; +extern Plugin *pluginInstance; + +extern Model *modelResonator; //////////////////// // module widgets @@ -21,40 +23,40 @@ struct StochasmKnob : SVGKnob { struct StochasmMintKnob : StochasmKnob { StochasmMintKnob() { - setSVG(SVG::load(assetPlugin(plugin, "res/MintKnob.svg"))); + setSVG(SVG::load(assetPlugin(pluginInstance, "res/MintKnob.svg"))); } }; struct StochasmTangerineKnob : StochasmKnob { StochasmTangerineKnob() { - setSVG(SVG::load(assetPlugin(plugin, "res/TangerineKnob.svg"))); + setSVG(SVG::load(assetPlugin(pluginInstance, "res/TangerineKnob.svg"))); } }; struct StochasmMintLargeKnob : StochasmKnob { StochasmMintLargeKnob() { - setSVG(SVG::load(assetPlugin(plugin, "res/MintKnobLarge.svg"))); + setSVG(SVG::load(assetPlugin(pluginInstance, "res/MintKnobLarge.svg"))); } }; struct StochasmTangerineLargeKnob : StochasmKnob { StochasmTangerineLargeKnob() { - setSVG(SVG::load(assetPlugin(plugin, "res/TangerineKnobLarge.svg"))); + setSVG(SVG::load(assetPlugin(pluginInstance, "res/TangerineKnobLarge.svg"))); } }; -struct MintMomentarySwitch : SVGSwitch, MomentarySwitch { +struct MintMomentarySwitch : SVGSwitch { MintMomentarySwitch() { - addFrame(SVG::load(assetPlugin(plugin, "res/MintMomentary0.svg"))); - addFrame(SVG::load(assetPlugin(plugin, "res/MintMomentary1.svg"))); + addFrame(SVG::load(assetPlugin(pluginInstance, "res/MintMomentary0.svg"))); + addFrame(SVG::load(assetPlugin(pluginInstance, "res/MintMomentary1.svg"))); } }; -struct TangerineMomentarySwitch : SVGSwitch, MomentarySwitch { +struct TangerineMomentarySwitch : SVGSwitch { TangerineMomentarySwitch() { - addFrame(SVG::load(assetPlugin(plugin, "res/TangerineMomentary0.svg"))); - addFrame(SVG::load(assetPlugin(plugin, "res/TangerineMomentary1.svg"))); + addFrame(SVG::load(assetPlugin(pluginInstance, "res/TangerineMomentary0.svg"))); + addFrame(SVG::load(assetPlugin(pluginInstance, "res/TangerineMomentary1.svg"))); } }; From c19fc8e64e8be23a9dfa47bf8b6ef71e14ceada9 Mon Sep 17 00:00:00 2001 From: eggix <9631813+eggix@users.noreply.github.com> Date: Fri, 4 Oct 2019 22:54:13 +0200 Subject: [PATCH 3/4] completed phase 2 of migration --- Makefile | 2 +- src/Resonator.cpp | 70 +++++++++++++++++++++++++++-------------------- src/Stochasm.hpp | 20 +++++++------- 3 files changed, 51 insertions(+), 41 deletions(-) diff --git a/Makefile b/Makefile index d7e38ff..7bfda67 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # FLAGS will be passed to both the C and C++ compiler -FLAGS += -w +FLAGS += CFLAGS += CXXFLAGS += diff --git a/src/Resonator.cpp b/src/Resonator.cpp index 715438c..f304f05 100644 --- a/src/Resonator.cpp +++ b/src/Resonator.cpp @@ -68,8 +68,18 @@ struct Resonator : Module { Resonator() { - config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);} - void step() override; + config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); + configParam(Resonator::UPPER_CHAMBER, 0.0, 10.0, 5.0, ""); + configParam(Resonator::UPPER_FILTER1, 0.0, 10.0, 5.0, ""); + configParam(Resonator::UPPER_FILTER2, 0.0, 10.0, 5.0, ""); + configParam(Resonator::UPPER_MANUAL, 0.0, 1.0, 0.0, ""); + configParam(Resonator::LOWER_CHAMBER, 0.0, 10.0, 5.0, ""); + configParam(Resonator::LOWER_FILTER1, 0.0, 10.0, 5.0, ""); + configParam(Resonator::LOWER_FILTER2, 0.0, 10.0, 5.0, ""); + configParam(Resonator::LOWER_MANUAL, 0.0, 1.0, 0.0, ""); + } + + void process(const ProcessArgs& args) override; // For more advanced Module features, read Rack's engine.hpp header file // - dataToJson, dataFromJson: serialization of internal data @@ -78,38 +88,38 @@ struct Resonator : Module { }; -void Resonator::step() { +void Resonator::process(const ProcessArgs& args) { int i; - uDelaySize = pow(2, clamp(params[UPPER_CHAMBER].value + inputs[UPPER_VOCT].value, 0.f, 10.f) +6); - lDelaySize = pow(2, clamp(params[LOWER_CHAMBER].value + inputs[LOWER_VOCT].value, 0.f, 10.f) +6); + uDelaySize = pow(2, clamp(params[UPPER_CHAMBER].getValue() + inputs[UPPER_VOCT].getVoltage(), 0.f, 10.f) +6); + lDelaySize = pow(2, clamp(params[LOWER_CHAMBER].getValue() + inputs[LOWER_VOCT].getVoltage(), 0.f, 10.f) +6); uDelayIndex %= uDelaySize; lDelayIndex %= lDelaySize; int size; - size = (int)params[UPPER_FILTER1].value; + size = (int)params[UPPER_FILTER1].getValue(); if (size - uFilter1Size > 0) uFilter1Size << (size - uFilter1Size); else if (uFilter1Size - size > 0) uFilter1Size >> (uFilter1Size - size); uFilter1Size = size; - size = (int)params[UPPER_FILTER2].value; + size = (int)params[UPPER_FILTER2].getValue(); if (size - uFilter2Size > 0) uFilter2Size << (size - uFilter2Size); else if (uFilter2Size - size > 0) uFilter2Size >> (uFilter2Size - size); uFilter2Size = size; - size = (int)params[LOWER_FILTER1].value; + size = (int)params[LOWER_FILTER1].getValue(); if (size - lFilter1Size > 0) lFilter1Size << (size - lFilter1Size); else if (lFilter1Size - size > 0) lFilter1Size >> (lFilter1Size - size); lFilter1Size = size; - size = (int)params[LOWER_FILTER2].value; + size = (int)params[LOWER_FILTER2].getValue(); if (size - lFilter2Size > 0) lFilter2Size << (size - lFilter2Size); else if (lFilter2Size - size > 0) @@ -136,7 +146,7 @@ void Resonator::step() { lFilter2LFSR >>= 1; lFilter2LFSR ^= (-lsb) & LFSR_TAPS_MAX_32; - if (params[UPPER_MANUAL].value > 0.f || inputs[UPPER_GATE].value > 1.7f) + if (params[UPPER_MANUAL].getValue() > 0.f || inputs[UPPER_GATE].getVoltage() > 1.7f) { //Determine out values uDelayOut = (bool) uDelay[uDelayIndex]; @@ -159,7 +169,7 @@ void Resonator::step() { uCurrent = uCurrent + IIR_FILTER_DECAY * (-uCurrent); } - if (params[LOWER_MANUAL].value > 0.f || inputs[LOWER_GATE].value > 1.7f) + if (params[LOWER_MANUAL].getValue() > 0.f || inputs[LOWER_GATE].getVoltage() > 1.7f) { //Determine out values lDelayOut = (bool) lDelay[lDelayIndex]; @@ -187,8 +197,8 @@ void Resonator::step() { } - outputs[UPPER_OUT].value = uCurrent; - outputs[LOWER_OUT].value = lCurrent; + outputs[UPPER_OUT].setVoltage(uCurrent); + outputs[LOWER_OUT].setVoltage(lCurrent); } @@ -208,7 +218,7 @@ ResonatorWidget::ResonatorWidget(Resonator *module) { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Resonator.svg"))); + panel->setBackground(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Resonator.svg"))); addChild(panel); } @@ -218,28 +228,28 @@ ResonatorWidget::ResonatorWidget(Resonator *module) { addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); //Upper - addParam(createParam(Vec(52, 30), module, Resonator::UPPER_CHAMBER, 0.0, 10.0, 5.0)); - addParam(createParam(Vec(48, 104), module, Resonator::UPPER_FILTER1, 0.0, 10.0, 5.0)); - addParam(createParam(Vec(85, 104), module, Resonator::UPPER_FILTER2, 0.0, 10.0, 5.0)); - addParam(createParam(Vec(11, 81), module, Resonator::UPPER_MANUAL, 0.0, 1.0, 0.0)); + addParam(createParam(Vec(52, 30), module, Resonator::UPPER_CHAMBER)); + addParam(createParam(Vec(48, 104), module, Resonator::UPPER_FILTER1)); + addParam(createParam(Vec(85, 104), module, Resonator::UPPER_FILTER2)); + addParam(createParam(Vec(11, 81), module, Resonator::UPPER_MANUAL)); - addInput(createPort(Vec(12, 43), PortWidget::INPUT, module, Resonator::UPPER_VOCT)); - addInput(createPort(Vec(12, 120), PortWidget::INPUT, module, Resonator::UPPER_GATE)); + addInput(createInput(Vec(12, 43), module, Resonator::UPPER_VOCT)); + addInput(createInput(Vec(12, 120), module, Resonator::UPPER_GATE)); - addOutput(createPort(Vec(12, 159), PortWidget::OUTPUT, module, Resonator::UPPER_OUT)); - addOutput(createPort(Vec(86, 159), PortWidget::OUTPUT, module, Resonator::UPPER_BITS)); + addOutput(createOutput(Vec(12, 159), module, Resonator::UPPER_OUT)); + addOutput(createOutput(Vec(86, 159), module, Resonator::UPPER_BITS)); //Lower - addParam(createParam(Vec(52, 218), module, Resonator::LOWER_CHAMBER, 0.0, 10.0, 5.0)); - addParam(createParam(Vec(48, 292), module, Resonator::LOWER_FILTER1, 0.0, 10.0, 5.0)); - addParam(createParam(Vec(85, 292), module, Resonator::LOWER_FILTER2, 0.0, 10.0, 5.0)); - addParam(createParam(Vec(11, 269), module, Resonator::LOWER_MANUAL, 0.0, 1.0, 0.0)); + addParam(createParam(Vec(52, 218), module, Resonator::LOWER_CHAMBER)); + addParam(createParam(Vec(48, 292), module, Resonator::LOWER_FILTER1)); + addParam(createParam(Vec(85, 292), module, Resonator::LOWER_FILTER2)); + addParam(createParam(Vec(11, 269), module, Resonator::LOWER_MANUAL)); - addInput(createPort(Vec(12, 230), PortWidget::INPUT, module, Resonator::LOWER_VOCT)); - addInput(createPort(Vec(12, 308), PortWidget::INPUT, module, Resonator::LOWER_GATE)); + addInput(createInput(Vec(12, 230), module, Resonator::LOWER_VOCT)); + addInput(createInput(Vec(12, 308), module, Resonator::LOWER_GATE)); - addOutput(createPort(Vec(12, 346), PortWidget::OUTPUT, module, Resonator::LOWER_OUT)); - addOutput(createPort(Vec(86, 346), PortWidget::OUTPUT, module, Resonator::LOWER_BITS)); + addOutput(createOutput(Vec(12, 346), module, Resonator::LOWER_OUT)); + addOutput(createOutput(Vec(86, 346), module, Resonator::LOWER_BITS)); //addInput(createInput(Vec(33, 186), module, Resonator::PITCH_INPUT)); diff --git a/src/Stochasm.hpp b/src/Stochasm.hpp index 4c252d2..92d45e6 100644 --- a/src/Stochasm.hpp +++ b/src/Stochasm.hpp @@ -1,4 +1,4 @@ -#include "rack0.hpp" +#include "rack.hpp" using namespace rack; @@ -23,40 +23,40 @@ struct StochasmKnob : SVGKnob { struct StochasmMintKnob : StochasmKnob { StochasmMintKnob() { - setSVG(SVG::load(assetPlugin(pluginInstance, "res/MintKnob.svg"))); + setSVG(APP->window->loadSvg(asset::plugin(pluginInstance, "res/MintKnob.svg"))); } }; struct StochasmTangerineKnob : StochasmKnob { StochasmTangerineKnob() { - setSVG(SVG::load(assetPlugin(pluginInstance, "res/TangerineKnob.svg"))); + setSVG(APP->window->loadSvg(asset::plugin(pluginInstance, "res/TangerineKnob.svg"))); } }; struct StochasmMintLargeKnob : StochasmKnob { StochasmMintLargeKnob() { - setSVG(SVG::load(assetPlugin(pluginInstance, "res/MintKnobLarge.svg"))); + setSVG(APP->window->loadSvg(asset::plugin(pluginInstance, "res/MintKnobLarge.svg"))); } }; struct StochasmTangerineLargeKnob : StochasmKnob { StochasmTangerineLargeKnob() { - setSVG(SVG::load(assetPlugin(pluginInstance, "res/TangerineKnobLarge.svg"))); + setSVG(APP->window->loadSvg(asset::plugin(pluginInstance, "res/TangerineKnobLarge.svg"))); } }; struct MintMomentarySwitch : SVGSwitch { MintMomentarySwitch() { - addFrame(SVG::load(assetPlugin(pluginInstance, "res/MintMomentary0.svg"))); - addFrame(SVG::load(assetPlugin(pluginInstance, "res/MintMomentary1.svg"))); + addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/MintMomentary0.svg"))); + addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/MintMomentary1.svg"))); } }; struct TangerineMomentarySwitch : SVGSwitch { TangerineMomentarySwitch() { - addFrame(SVG::load(assetPlugin(pluginInstance, "res/TangerineMomentary0.svg"))); - addFrame(SVG::load(assetPlugin(pluginInstance, "res/TangerineMomentary1.svg"))); + addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/TangerineMomentary0.svg"))); + addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/TangerineMomentary1.svg"))); } }; @@ -65,4 +65,4 @@ struct TangerineMomentarySwitch : SVGSwitch { struct ResonatorWidget : ModuleWidget { ResonatorWidget(); }; -*/ \ No newline at end of file +*/ From 35694a60ce6aaab600012ca282b37dc266ff4676 Mon Sep 17 00:00:00 2001 From: eggix <9631813+eggix@users.noreply.github.com> Date: Tue, 8 Oct 2019 21:18:54 +0200 Subject: [PATCH 4/4] fixes switches to be momentary again --- src/Stochasm.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Stochasm.hpp b/src/Stochasm.hpp index 92d45e6..2cd57e8 100644 --- a/src/Stochasm.hpp +++ b/src/Stochasm.hpp @@ -48,6 +48,7 @@ struct StochasmTangerineLargeKnob : StochasmKnob { struct MintMomentarySwitch : SVGSwitch { MintMomentarySwitch() { + momentary = true; addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/MintMomentary0.svg"))); addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/MintMomentary1.svg"))); } @@ -55,6 +56,7 @@ struct MintMomentarySwitch : SVGSwitch { struct TangerineMomentarySwitch : SVGSwitch { TangerineMomentarySwitch() { + momentary = true; addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/TangerineMomentary0.svg"))); addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/TangerineMomentary1.svg"))); }