commit 5a1ddf72d9a758701040413ee5065f78539a85de
parent 5203ce04c944fa52fb5d22065cc6a3072227b129
Author: Adam M <aemalone@gmail.com>
Date: Sun, 3 May 2020 09:45:05 -0500
Show "auto" in tooltip when poly channels knob set to 0
Diffstat:
7 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/ComputerscareBolyPuttons.cpp b/src/ComputerscareBolyPuttons.cpp
@@ -44,7 +44,7 @@ struct ComputerscareBolyPuttons : ComputerscarePolyModule {
//configParam(KNOB + i, 0.0f, 10.0f, 0.0f);
configParam(TOGGLE + i, 0.f, 1.f, 0.f, "Channel " + std::to_string(i + 1));
}
- configParam(POLY_CHANNELS, 0.f, 16.f, 16.f, "Poly Channels");
+ configParam<AutoParamQuantity>(POLY_CHANNELS, 0.f, 16.f, 16.f, "Poly Channels");
outputRanges[0][0] = 0.f;
outputRanges[0][1] = 10.f;
diff --git a/src/ComputerscareGolyPenerator.cpp b/src/ComputerscareGolyPenerator.cpp
@@ -51,7 +51,7 @@ struct ComputerscareGolyPenerator : ComputerscarePolyModule {
configParam(OUT_SCALE, -20.f, 20.f, 10.f, "Output Scale");
configParam(OUT_OFFSET, -10.f, 10.f, 0.f, "Output Offset");
- configParam(POLY_CHANNELS, 1.f, 16.f, 16.f, "Poly Channels");
+ configParam<AutoParamQuantity>(POLY_CHANNELS, 1.f, 16.f, 16.f, "Poly Channels");
goly = Goly();
diff --git a/src/ComputerscareHorseADoodleDoo.cpp b/src/ComputerscareHorseADoodleDoo.cpp
@@ -197,7 +197,7 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule {
configParam(STEPS_TRIM, -1.f, 1.f, 0.f, "Steps CV Trim");
configParam(DENSITY_TRIM, -1.f, 1.f, 0.f, "Density CV Trim");
- configParam(POLY_KNOB, 0.f, 16.f, 0.f, "Polyphony");
+ configParam<AutoParamQuantity>(POLY_KNOB, 0.f, 16.f, 0.f, "Polyphony");
configParam(MODE_KNOB,1.f,16.f,1.f,"Mode");
diff --git a/src/ComputerscareMolyPatrix.cpp b/src/ComputerscareMolyPatrix.cpp
@@ -46,7 +46,7 @@ struct ComputerscareMolyPatrix : ComputerscarePolyModule {
configParam(KNOB + i * 16 + j, -2.f, 2.f, i == j ? 1.f : 0.f, "i:" + std::to_string(i) + ",j:" + std::to_string(j));
}
configParam(OUTPUT_TRIM,-2.f,2.f,1.f,"Output Attenuation");
- configParam(POLY_CHANNELS,0.f,16.f,0.f,"Poly Channels");
+ configParam<AutoParamQuantity>(POLY_CHANNELS,0.f,16.f,0.f,"Poly Channels");
}
}
diff --git a/src/ComputerscarePolyModule.hpp b/src/ComputerscarePolyModule.hpp
@@ -2,6 +2,13 @@
using namespace rack;
+struct AutoParamQuantity : ParamQuantity {
+ std::string getDisplayValueString() override {
+ std::string disp = Quantity::getDisplayValueString();
+ return disp == "0" ? "Auto" : disp;
+ }
+};
+
struct ComputerscarePolyModule : Module {
int polyChannels = 16;
int polyChannelsKnobSetting=0;
diff --git a/src/ComputerscareRolyPouter.cpp b/src/ComputerscareRolyPouter.cpp
@@ -39,7 +39,7 @@ struct ComputerscareRolyPouter : ComputerscarePolyModule {
configParam(KNOB + i, 1.f, 16.f, (i + 1), "output ch" + std::to_string(i + 1) + " = input ch");
routing[i] = i;
}
- configParam(POLY_CHANNELS, 0.f, 16.f, 16.f, "Poly Channels");
+ configParam<AutoParamQuantity>(POLY_CHANNELS, 0.f, 16.f, 16.f, "Poly Channels");
configParam(RANDOMIZE_ONE_TO_ONE, 0.f, 1.f, 0.f);
}
diff --git a/src/ComputerscareSolyPequencer.cpp b/src/ComputerscareSolyPequencer.cpp
@@ -49,7 +49,7 @@ struct ComputerscareSolyPequencer : ComputerscarePolyModule {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(MANUAL_CLOCK_BUTTON, 0.f, 1.f, 0.f);
configParam(MANUAL_RESET_BUTTON, 0.f, 1.f, 0.f);
- configParam(POLY_CHANNELS, 0.f, 16.f, 16.f, "Poly Channels");
+ configParam<AutoParamQuantity>(POLY_CHANNELS, 0.f, 16.f, 16.f, "Poly Channels");
}
void resetAll() {
for (int i = 0; i < 16; i++) {