computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit 98776d0e81172e948ac27ea9af82c8e741e74cc4
parent 238f2a98c79adb9462816682e8f80a7c7047662c
Author: Adam M <[email protected]>
Date:   Sat, 16 Jan 2021 11:41:31 -0600

tooltips for blank expander clock modes

Diffstat:
Msrc/ComputerscareBlankExpander.cpp | 19++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/ComputerscareBlankExpander.cpp b/src/ComputerscareBlankExpander.cpp @@ -3,6 +3,8 @@ struct ComputerscareBlankExpander; +const std::string clockModeDescriptions[3] = {"Sync\nAnimation will synchronize to a steady clock signal", "Scan\nAnimation will linearly follow a 0-10v CV. 0v => frame 1, 10v => last frame", "Frame Advance\nClock signal will advance the animation by 1 frame" }; + struct FrameOffsetParam : ParamQuantity { ComputerscareBlankExpander* module; @@ -16,6 +18,15 @@ struct FrameOffsetParam : ParamQuantity { }; +//template <const std::string& options> +struct ClockModeParamQuantity : ParamQuantity { + std::string getDisplayValueString() override { + int val = getValue(); + return clockModeDescriptions[val]; + } +}; + + struct ComputerscareBlankExpander : Module { float rightMessages[2][10] = {}; @@ -57,23 +68,17 @@ struct ComputerscareBlankExpander : Module { dsp::Timer syncTimer; - std::vector<std::string> clockModeDescriptions; - FrameOffsetParam* frameOffsetQuantity; ComputerscareBlankExpander() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); - configParam(CLOCK_MODE, 0.f, 2.f, 0.f, "Clock Mode"); + configParam<ClockModeParamQuantity>(CLOCK_MODE, 0.f, 2.f, 0.f, "Clock Mode"); configParam(MANUAL_RESET_BUTTON, 0.f, 1.f, 0.f, "Manual Reset"); configParam<FrameOffsetParam>(ZERO_OFFSET, 0.f, 0.999f, 0.f, "EOC / Reset Frame #"); frameOffsetQuantity = dynamic_cast<FrameOffsetParam*>(paramQuantities[ZERO_OFFSET]); - clockModeDescriptions.push_back("Sync"); - clockModeDescriptions.push_back("Scan"); - clockModeDescriptions.push_back("Frame Advance"); - rightExpander.producerMessage = rightMessages[0]; rightExpander.consumerMessage = rightMessages[1]; }