commit eb09f565458257e639de5511fbc4321a03239dbf
parent a9a9a2670d61b88bffd6a67d141616c230d9d683
Author: Matt Demanett <matt@demanett.net>
Date: Mon, 27 Sep 2021 22:17:27 -0400
Rack2: delete commented-out ParamWidget reset()/randomize(), after checking that things more or less work without a replacement. On MIX4/8, randomizing can now solo channels, unlike before.
Diffstat:
4 files changed, 0 insertions(+), 56 deletions(-)
diff --git a/src/mixer.cpp b/src/mixer.cpp
@@ -99,13 +99,6 @@ void DimmableMixerWidget::contextMenu(Menu* menu) {
}
-// FIXME: this callback removed in rack2.
-// void MuteButton::randomize() {
-// if (_randomize) {
-// ToggleButton::randomize();
-// }
-// }
-
void MuteButton::onButton(const event::Button& e) {
if (!(e.action == GLFW_PRESS && (e.mods & RACK_MOD_MASK) == 0)) {
return;
@@ -140,19 +133,6 @@ SoloMuteButton::SoloMuteButton() {
shadow->box.pos = Vec(0.0, 1.0);
}
-// FIXME: these callbacks removed in rack2.
-// void SoloMuteButton::reset() {
-// if (paramQuantity) {
-// getParamQuantity()->setValue(0.0f);
-// }
-// }
-//
-// void SoloMuteButton::randomize() {
-// if (paramQuantity) {
-// getParamQuantity()->setValue(random::uniform() > 0.5f ? 1.0f : 0.0f);
-// }
-// }
-
void SoloMuteButton::onButton(const event::Button& e) {
if (!getParamQuantity() || !(e.action == GLFW_PRESS && (e.mods & RACK_MOD_MASK) == 0)) {
ParamWidget::onButton(e);
diff --git a/src/mixer.hpp b/src/mixer.hpp
@@ -80,7 +80,6 @@ struct MuteButton : ToggleButton {
}
inline void setRandomize(bool randomize) { _randomize = randomize; }
- // void randomize() override;
void onButton(const event::Button& e) override;
};
@@ -90,8 +89,6 @@ struct SoloMuteButton : ParamWidget {
CircularShadow* shadow = NULL;
SoloMuteButton();
- // void reset() override;
- // void randomize() override;
void onButton(const event::Button& e) override;
void onChange(const event::Change& e) override;
};
diff --git a/src/widgets.cpp b/src/widgets.cpp
@@ -301,22 +301,6 @@ StatefulButton::StatefulButton(const char* offSvgPath, const char* onSvgPath) {
shadow->box.pos = Vec(0.0, 1.0);
}
-// FIXME: these callbacks removed in rack2.
-// void StatefulButton::reset() {
-// if (getParamQuantity()) {
-// getParamQuantity()->reset();
-// }
-// }
-//
-// void StatefulButton::randomize() {
-// if (getParamQuantity()) {
-// float min = getParamQuantity()->getMinValue();
-// float max = getParamQuantity()->getMaxValue();
-// float value = roundf(min + (max - min) * random::uniform());
-// getParamQuantity()->setValue(value);
-// }
-// }
-
void StatefulButton::onDragStart(const event::DragStart& e) {
if (getParamQuantity()) {
_svgWidget->setSvg(_frames[1]);
@@ -449,19 +433,6 @@ InvertingIndicatorButton::InvertingIndicatorButton(int dim) {
fb->addChild(w);
}
-// FIXME: these callbacks removed in rack2.
-// void InvertingIndicatorButton::reset() {
-// if (getParamQuantity()) {
-// getParamQuantity()->reset();
-// }
-// }
-//
-// void InvertingIndicatorButton::randomize() {
-// if (getParamQuantity()) {
-// getParamQuantity()->setValue(roundf(2.0f * random::uniform()) - 1.0f);
-// }
-// }
-
void InvertingIndicatorButton::onHover(const event::Hover& e) {
math::Vec c = box.size.div(2);
float dist = e.pos.minus(c).norm();
diff --git a/src/widgets.hpp b/src/widgets.hpp
@@ -118,8 +118,6 @@ struct StatefulButton : ParamWidget {
CircularShadow* shadow = NULL;
StatefulButton(const char* offSvgPath, const char* onSvgPath);
- // void reset() override;
- // void randomize() override;
void onDragStart(const event::DragStart& e) override;
void onDragEnd(const event::DragEnd& e) override;
void onDoubleClick(const event::DoubleClick& e) override {}
@@ -165,8 +163,6 @@ struct InvertingIndicatorButton : ParamWidget {
inline void setClickToInvertCallback(std::function<bool()> fn) { clickToInvertCB = fn; }
inline void setOnChangeCallback(std::function<void(int, float)> fn) { onChangeCB = fn; }
- // void reset() override;
- // void randomize() override;
void onHover(const event::Hover& e) override;
void onDoubleClick(const event::DoubleClick& e) override {}
void onButton(const event::Button& e) override;