From 80970a7292fa75138af6c49e97afc20b3dc20179 Mon Sep 17 00:00:00 2001 From: Paul Dempsey Date: Thu, 5 Oct 2023 10:49:00 -0700 Subject: [PATCH] Strip HC-4 down to HC-One module scaffold --- src/HC-4/HC-4-ui.cpp | 20 +++++--------------- src/HC-4/HC-4.cpp | 12 +++--------- src/HC-4/HC-4.hpp | 4 +--- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/HC-4/HC-4-ui.cpp b/src/HC-4/HC-4-ui.cpp index 4e55bdb..18dabb0 100644 --- a/src/HC-4/HC-4-ui.cpp +++ b/src/HC-4/HC-4-ui.cpp @@ -23,23 +23,13 @@ Hc4ModuleWidget::Hc4ModuleWidget(Hc4Module * module) device_label = createStaticTextLabel( Vec(7.f, 21.f), 180.f, "", TextAlignment::Left, 12.f, false, GetStockColor(StockColor::pachde_blue_medium)); addChild(device_label); - - float x = COL_1; - float y = ROW_1; - auto port_color = GetStockColor(StockColor::pachde_default_port); - addChild(createStaticTextLabel(Vec(7.5f, y -LABEL_VOFFSET), LABEL_WIDTH, "Pedal 1", TextAlignment::Right)); - addChild(createColorOutputCentered(x, y, Hc4O::O_PEDAL1, port_color, module)); - y += ROW_SPREAD; - addChild(createStaticTextLabel(Vec(7.5f, y - LABEL_VOFFSET), LABEL_WIDTH, "Pedal 2", TextAlignment::Right)); - addChild(createColorOutputCentered(x, y, Hc4O::O_PEDAL2, port_color, module)); - } -// Hc1Module* Hc4ModuleWidget::getPartner() -// { -// if (!module) return nullptr; -// return my_module->getPartner(); -// } +Hc1Module* Hc4ModuleWidget::getPartner() +{ + if (!module) return nullptr; + return my_module->getPartner(); +} void Hc4ModuleWidget::onDisconnect(const DisconnectEvent& e) { diff --git a/src/HC-4/HC-4.cpp b/src/HC-4/HC-4.cpp index a1665de..a3dd292 100644 --- a/src/HC-4/HC-4.cpp +++ b/src/HC-4/HC-4.cpp @@ -5,8 +5,6 @@ namespace pachde { Hc4Module::Hc4Module() { config(Params::NUM_PARAMS, Inputs::NUM_INPUTS, Outputs::NUM_OUTPUTS, Lights::NUM_LIGHTS); - configOutput(Outputs::O_PEDAL1, "Pedal 1"); - configOutput(Outputs::O_PEDAL2, "Pedal 2"); } Hc4Module::~Hc4Module() @@ -32,11 +30,7 @@ Hc1Module* Hc4Module::getPartner() void Hc4Module::onPedalChanged(const PedalChangedEvent& e) { - switch (e.pedal.jack) { - case 0 : getOutput(O_PEDAL1).setVoltage(e.pedal.value * 10.f / 127.f); break; - case 1 : getOutput(O_PEDAL2).setVoltage(e.pedal.value * 10.f / 127.f); break; - default: break; - } + } void Hc4Module::onDeviceChanged(const DeviceChangedEvent& e) @@ -69,8 +63,8 @@ void Hc4Module::process(const ProcessArgs& args) check_cv = 0; auto partner = getPartner(); if (partner) { - getOutput(Outputs::O_PEDAL1).setVoltage(10.f * partner->pedal1.value / 127); - getOutput(Outputs::O_PEDAL2).setVoltage(10.f * partner->pedal2.value / 127); + // getOutput(Outputs::O_PEDAL1).setVoltage(10.f * partner->pedal1.value / 127); + // getOutput(Outputs::O_PEDAL2).setVoltage(10.f * partner->pedal2.value / 127); } } } diff --git a/src/HC-4/HC-4.hpp b/src/HC-4/HC-4.hpp index 7b0b4e2..9241c0e 100644 --- a/src/HC-4/HC-4.hpp +++ b/src/HC-4/HC-4.hpp @@ -23,8 +23,6 @@ struct Hc4Module : Module, IHandleHcEvents }; enum Outputs { - O_PEDAL1, - O_PEDAL2, NUM_OUTPUTS }; enum Lights @@ -70,7 +68,7 @@ struct Hc4ModuleWidget : ModuleWidget, IHandleHcEvents } } - // Hc1Module * getPartner(); + Hc1Module * getPartner(); // IHandleHcEvents // void onPresetChanged(const PresetChangedEvent& e) override;