Skip to content

Commit

Permalink
Bugfix change [leds] by [&leds] in projection controls
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed Jun 24, 2024
1 parent 8da613e commit 49a9fe3
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/App/LedProjections.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ class MultiplyProjection: public Projection {
}

void controls(Leds &leds, JsonObject parentVar) {
ui->initCoord3D(parentVar, "proMulti", {2,2,1}, 0, 10, false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
ui->initCoord3D(parentVar, "proMulti", {2,2,1}, 0, 10, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onUI:
ui->setLabel(var, "MultiplyX");
return true;
case onChange:
ui->initCheckBox(var, "mirror", false, false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
ui->initCheckBox(var, "mirror", false, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onChange:
if (rowNr < leds.fixture->listOfLeds.size()) {
leds.fixture->listOfLeds[rowNr]->doMap = true;
Expand Down Expand Up @@ -108,29 +108,29 @@ class TiltPanRollProjection: public Projection {
void controls(Leds &leds, JsonObject parentVar) {
//tbd: implement variable by reference for rowNrs
#ifdef STARBASE_USERMOD_MPU6050
ui->initCheckBox(parentVar, "proGyro", false, false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
ui->initCheckBox(parentVar, "proGyro", false, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onChange:
if (rowNr < leds.fixture->listOfLeds.size())
leds.fixture->listOfLeds[rowNr]->proGyro = mdl->getValue(var, rowNr);
return true;
default: return false;
}});
#endif
ui->initSlider(parentVar, "proTilt", 128, 0, 254, false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
ui->initSlider(parentVar, "proTilt", 128, 0, 254, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onChange:
if (rowNr < leds.fixture->listOfLeds.size())
leds.fixture->listOfLeds[rowNr]->proTiltSpeed = mdl->getValue(var, rowNr);
return true;
default: return false;
}});
ui->initSlider(parentVar, "proPan", 128, 0, 254, false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
ui->initSlider(parentVar, "proPan", 128, 0, 254, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onChange:
if (rowNr < leds.fixture->listOfLeds.size())
leds.fixture->listOfLeds[rowNr]->proPanSpeed = mdl->getValue(var, rowNr);
return true;
default: return false;
}});
ui->initSlider(parentVar, "proRoll", 128, 0, 254, false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
ui->initSlider(parentVar, "proRoll", 128, 0, 254, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onUI:
ui->setLabel(var, "Roll speed");
return true;
Expand All @@ -151,7 +151,7 @@ class DistanceFromPointProjection: public Projection {
public: //to use in Preset1Projection

void controls(Leds &leds, JsonObject parentVar) {
ui->initCoord3D(parentVar, "proCenter", {8,8,8}, 0, NUM_LEDS_Max, false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
ui->initCoord3D(parentVar, "proCenter", {8,8,8}, 0, NUM_LEDS_Max, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onUI:
ui->setLabel(var, "Center");
return true;
Expand Down Expand Up @@ -297,7 +297,15 @@ class PinwheelProjection: public Projection {
// UI swirlVal
// UI arms? arms currently 360, reduce for diff effect?
// UI add multiply / mirror / reverse / tilt pan roll
// ui->initCheckBox(parentVar, "pw test", true);
ui->initCheckBox(parentVar, "pw test", true, false, [&leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case onUI:
ui->setLabel(var, "MultiplyX");
return true;
case onChange:
ppf("pw test onChange %s\n", var["value"].as<String>().c_str());
return true;
default: return false;
}});
}
}; //PinwheelProjection

Expand Down

0 comments on commit 49a9fe3

Please sign in to comment.