computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit 62494d6d1c8e5b1d0feb65f73a6376d002eecdb8
parent e17fdc4ab588d26c5a2c66bcf5089f42528814f5
Author: Adam M <[email protected]>
Date:   Wed, 20 Oct 2021 15:07:14 -0500

draw knolypobs and rolypouter in browser, and update UI disabled state per knob value in real time

Diffstat:
Msrc/ComputerscareKnolyPobs.cpp | 7++++---
Msrc/ComputerscarePolyModule.hpp | 4++++
Msrc/ComputerscareRolyPouter.cpp | 12++++++++++++
3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/ComputerscareKnolyPobs.cpp b/src/ComputerscareKnolyPobs.cpp @@ -92,18 +92,19 @@ struct DisableableSmoothKnob : RoundKnob { shadow->box.size = math::Vec(0, 0); shadow->opacity = 0.f; } - - void draw(const DrawArgs& args) override { + void step() override { if (module) { bool candidate = channel > module->polyChannels - 1; if (disabled != candidate) { setSvg(candidate ? disabledSvg : enabledSvg); + onChange(*(new event::Change())); + fb->dirty = true; disabled = candidate; } } else { } - RoundKnob::draw(args); + RoundKnob::step(); } }; diff --git a/src/ComputerscarePolyModule.hpp b/src/ComputerscarePolyModule.hpp @@ -48,6 +48,7 @@ struct TinyChannelsSnapKnob: RoundKnob { } } else { + } RoundKnob::draw(args); } @@ -82,6 +83,9 @@ struct PolyChannelsDisplay : SmallLetterDisplay } } + else { + value = std::to_string(16); + } SmallLetterDisplay::draw(args); } }; diff --git a/src/ComputerscareRolyPouter.cpp b/src/ComputerscareRolyPouter.cpp @@ -165,6 +165,10 @@ struct PouterSmallDisplay : SmallLetterDisplay } value = str; } + else { + textColor = okayColor; + value = std::to_string(ch + 1); + } SmallLetterDisplay::draw(args); } }; @@ -185,8 +189,16 @@ struct DisableableSnapKnob : RoundKnob { if (module) { disabled = channel > module->polyChannels - 1; } + else { + disabled = false; + setSvg(enabledSvg); + onChange(*(new event::Change())); + fb->dirty = true; + } if (disabled != lastDisabled) { setSvg(disabled ? disabledSvg : enabledSvg); + onChange(*(new event::Change())); + fb->dirty = true; lastDisabled = disabled; } RoundKnob::step();