From 4e39daf1cf95f4163b4f7d35a8dec9aab0ac20cd Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:54:22 +0100 Subject: [PATCH 01/12] Update plugin.json --- plugin.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.json b/plugin.json index 0f4e2e6..cdc03dd 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "slug": "Loco", "name": "LocoMods", - "version": "1.1.1", + "version": "2.1.1", "license": "Creative Commons - Reuse and modify with attribution", "brand": "Loco", "author": "Luke Perkin", @@ -28,4 +28,4 @@ ] } ] -} \ No newline at end of file +} From 7776690db0ab036af21c321d47745956bdc065b6 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:56:10 +0100 Subject: [PATCH 02/12] Update Tex.cpp --- src/Tex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index 875a199..ed46270 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -326,7 +326,7 @@ struct TexModuleWidget : ModuleWidget { TexModule *module; void onAction(const event::Action &e) override { MenuItem::onAction(e); - std::string dir = module->lastImagePath.empty() ? asset::user("") : rack::string::directory(module->lastImagePath); + std::string dir = module->lastImagePath.empty() ? asset::user("") : system::getDirectory(module->lastImagePath); char *path = osdialog_file(OSDIALOG_OPEN, dir.c_str(), NULL, NULL); if (path) { module->loadImage(path); @@ -344,4 +344,4 @@ struct TexModuleWidget : ModuleWidget { }; -Model* modelTex = createModel("Tex"); \ No newline at end of file +Model* modelTex = createModel("Tex"); From 2af383f076ee27f05676a8da21ba3ace510f4359 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 09:38:32 +0100 Subject: [PATCH 03/12] Update Tex.cpp --- src/Tex.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index ed46270..180f621 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -55,9 +55,18 @@ struct TexModule : Module { TexModule() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); - configParam(X_OFFSET, 0.f, VOLT_MAX, 0.f, "x offset", "volts"); - configParam(Y_OFFSET, 0.f, VOLT_MAX, 0.f, "y offset", "volts"); - configParam(AUTO, 0.f, 1.f, 0.f); + configParam(X_OFFSET, 0.f, VOLT_MAX, 0.f, "X offset", " volts"); + configParam(Y_OFFSET, 0.f, VOLT_MAX, 0.f, "Y offset", " volts"); + configSwitch(AUTO, 0.f, 1.f, 0.f, "Auto"); + configInput(X_INPUT, "X"); + configInput(Y_INPUT, "Y"); + configInput(TRIG_INPUT, "Trigger"); + configOutput(RED_OUTPUT, "Red"); + configOutput(GREEN_OUTPUT, "Green"); + configOutput(BLUE_OUTPUT, "Blue"); + configOutput(HUE_OUTPUT, "Hue"); + configOutput(SATURATION_OUTPUT, "Saturation"); + configOutput(LEVEL_OUTPUT, "Level"); } json_t *dataToJson() override { From 94230a8d05d9184538814f519b8a1929fc8daf60 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 11:26:40 +0100 Subject: [PATCH 04/12] Update Tex.cpp --- src/Tex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index 180f621..3e7ff89 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -278,7 +278,7 @@ struct TexModuleCrosshair : OpaqueWidget { struct TexModuleWidget : ModuleWidget { TexModuleWidget(TexModule* module) { setModule(module); - setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Tex.svg"))); + setPanel(createPanel(asset::plugin(pluginInstance, "res/Tex.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); From b653f5bcc10dc237589941bd5cdf116933d18c4f Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 11:33:55 +0100 Subject: [PATCH 05/12] Update Chaos.cpp --- src/Chaos.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Chaos.cpp b/src/Chaos.cpp index ded2629..bf749bc 100644 --- a/src/Chaos.cpp +++ b/src/Chaos.cpp @@ -87,10 +87,15 @@ struct ChaosModule : Module { ChaosModule() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); - configParam(GRAVITY_PARAM, 0.01f, 6.f, 1.0f, "timewarp", "x"); - configParam(LENGTH_RATIO_PARAM, 0.1f, 1.0f - 0.1f, 0.5f, "ratio", ""); - configParam(DAMPING_PARAM, 0.0f, 1.f, 0.0f, "dampen", ""); + configParam(GRAVITY_PARAM, 0.01f, 6.f, 1.0f, "Timewarp", "x"); + configParam(LENGTH_RATIO_PARAM, 0.1f, 1.0f - 0.1f, 0.5f, "Ratio", ""); + configParam(DAMPING_PARAM, 0.0f, 1.f, 0.0f, "Dampen", ""); configParam(KICK_PARAM, 0.f, 1.f, 0.f); + configInput(GRAVITY_IN, "Timewarp CV"); + configInput(RATIO_IN, "Ratio CV"); + configInput(DAMPING_IN, "Damping CV"); + configInput(KICK_TRIG_IN, "Kick trigger"); + configOutput(POLY_CHAOS_OUTPUT, "Poly chaos"); integrationMode = IntegrationMode::RK4; kickMode = KickMode::ClearVelocity; } @@ -287,7 +292,7 @@ struct PendulumWidget : OpaqueWidget { struct ChaosWidget : ModuleWidget { ChaosWidget(ChaosModule* module) { setModule(module); - setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Chaos.svg"))); + setPanel(createPanel(asset::plugin(pluginInstance, "res/Chaos.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); @@ -394,4 +399,4 @@ struct ChaosWidget : ModuleWidget { }; -Model* modelChaos = createModel("Chaos"); \ No newline at end of file +Model* modelChaos = createModel("Chaos"); From 99f627baf076830d387fc579fd711263f3a46eaf Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 11:49:49 +0100 Subject: [PATCH 06/12] Update Tex.cpp --- src/Tex.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index 3e7ff89..1a1af10 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -97,7 +97,6 @@ struct TexModule : Module { uint uncroppedImageHeight; uint error = lodepng::decode(uncroppedImage, uncroppedImageWidth, uncroppedImageHeight, path, LCT_RGB); if (error != 0) { - std::cout << "error " << error << ": " << lodepng_error_text(error) << std::endl; lastImagePath = ""; bImageLoaded = false; } else { From f70f4ef1e9c9a8027e42963f83d2db1d637b959b Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 12:01:11 +0100 Subject: [PATCH 07/12] Tex darkmode --- src/Tex.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index 1a1af10..2c8d758 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -231,9 +231,8 @@ struct TexModuleImageDisplay : OpaqueWidget { bool bLoadedImage = false; - void draw(const DrawArgs &args) override { - OpaqueWidget::draw(args); - if (module) { + void drawLayer(const DrawArgs& args, int layer) override { + if (module || layer == 1) { if (module->bImageLoaded && (imagePath != module->lastImagePath)) { imageHandle = nvgCreateImage(args.vg, module->lastImagePath.c_str(), 0); imagePath = module->lastImagePath; @@ -249,6 +248,7 @@ struct TexModuleImageDisplay : OpaqueWidget { nvgFill(args.vg); nvgClosePath(args.vg); } + Widget::drawLayer(args, layer); } }; From e39f851f29bdb7b61770d4df2c64f8720dfcd4ae Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 12:08:37 +0100 Subject: [PATCH 08/12] Tex darkmode II --- src/Tex.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index 2c8d758..e941cba 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -255,9 +255,8 @@ struct TexModuleImageDisplay : OpaqueWidget { struct TexModuleCrosshair : OpaqueWidget { TexModule* module; - void draw(const DrawArgs &args) override { - OpaqueWidget::draw(args); - if (module) { + void drawLayer(const DrawArgs& args, int layer) override { + if (module || layer == 1) { const float size = IMG_WIDTH; nvgBeginPath(args.vg); nvgStrokeWidth(args.vg, 1); @@ -271,6 +270,7 @@ struct TexModuleCrosshair : OpaqueWidget { nvgClosePath(args.vg); nvgStroke(args.vg); } + Widget::drawLayer(args, layer); } }; From dbb7408e46912fd771d26c09481213345915e9fc Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Sun, 2 Oct 2022 12:10:17 +0100 Subject: [PATCH 09/12] Chaos darkmode --- src/Chaos.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Chaos.cpp b/src/Chaos.cpp index bf749bc..d47f3b0 100644 --- a/src/Chaos.cpp +++ b/src/Chaos.cpp @@ -258,9 +258,8 @@ struct ChaosModule : Module { struct PendulumWidget : OpaqueWidget { ChaosModule* module; - void draw(const DrawArgs &args) override { - OpaqueWidget::draw(args); - if (module) { + void drawLayer(const DrawArgs& args, int layer) override { + if (module || layer == 1) { const float maxLen = 80.0f; const float center = 105.f; float p0_x = (module->p0.x * maxLen) + center; @@ -286,6 +285,7 @@ struct PendulumWidget : OpaqueWidget { nvgClosePath(args.vg); nvgStroke(args.vg); } + Widget::drawLayer(args, layer); } }; From ec0e97afeb52ebda2f9620193236a080e45931c1 Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Thu, 20 Oct 2022 14:13:53 +0100 Subject: [PATCH 10/12] Browser crash fix 1 --- src/Chaos.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Chaos.cpp b/src/Chaos.cpp index d47f3b0..6407aa3 100644 --- a/src/Chaos.cpp +++ b/src/Chaos.cpp @@ -259,7 +259,7 @@ struct PendulumWidget : OpaqueWidget { ChaosModule* module; void drawLayer(const DrawArgs& args, int layer) override { - if (module || layer == 1) { + if (module && layer == 1) { const float maxLen = 80.0f; const float center = 105.f; float p0_x = (module->p0.x * maxLen) + center; From 82a9c11614fbe66e573e19b1c6ff2935378f76ed Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Thu, 20 Oct 2022 14:15:11 +0100 Subject: [PATCH 11/12] Browser crash fix 2 --- src/Tex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index e941cba..bcb24c3 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -232,7 +232,7 @@ struct TexModuleImageDisplay : OpaqueWidget { void drawLayer(const DrawArgs& args, int layer) override { - if (module || layer == 1) { + if (module && layer == 1) { if (module->bImageLoaded && (imagePath != module->lastImagePath)) { imageHandle = nvgCreateImage(args.vg, module->lastImagePath.c_str(), 0); imagePath = module->lastImagePath; @@ -256,7 +256,7 @@ struct TexModuleCrosshair : OpaqueWidget { TexModule* module; void drawLayer(const DrawArgs& args, int layer) override { - if (module || layer == 1) { + if (module && layer == 1) { const float size = IMG_WIDTH; nvgBeginPath(args.vg); nvgStrokeWidth(args.vg, 1); From 44a1be6251795abec1531c72192e401888f1181a Mon Sep 17 00:00:00 2001 From: Steve Russell <41975381+SteveRussell33@users.noreply.github.com> Date: Thu, 20 Oct 2022 15:38:31 +0100 Subject: [PATCH 12/12] Image load crash fix --- src/Tex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tex.cpp b/src/Tex.cpp index bcb24c3..05d5d1e 100644 --- a/src/Tex.cpp +++ b/src/Tex.cpp @@ -256,7 +256,7 @@ struct TexModuleCrosshair : OpaqueWidget { TexModule* module; void drawLayer(const DrawArgs& args, int layer) override { - if (module && layer == 1) { + if (layer == 1) { const float size = IMG_WIDTH; nvgBeginPath(args.vg); nvgStrokeWidth(args.vg, 1);