Incrementing & random effects, palettes via JSON.
This commit is contained in:
parent
b97b6dc144
commit
97b3c3db7b
@ -148,21 +148,21 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
|||||||
|
|
||||||
//temporary, strip object gets updated via colorUpdated()
|
//temporary, strip object gets updated via colorUpdated()
|
||||||
if (id == strip.getMainSegmentId()) {
|
if (id == strip.getMainSegmentId()) {
|
||||||
byte effectPrev = effectCurrent;
|
if (getVal(elem["fx"], &effectCurrent, 1, strip.getModeCount())) { //load effect ('r' random, '~' inc/dec, 1-255 exact value)
|
||||||
effectCurrent = elem["fx"] | effectCurrent;
|
if (!presetId) unloadPlaylist(); //stop playlist if active and FX changed manually
|
||||||
if (!presetId && effectCurrent != effectPrev) unloadPlaylist(); //stop playlist if active and FX changed manually
|
}
|
||||||
effectSpeed = elem[F("sx")] | effectSpeed;
|
effectSpeed = elem[F("sx")] | effectSpeed;
|
||||||
effectIntensity = elem[F("ix")] | effectIntensity;
|
effectIntensity = elem[F("ix")] | effectIntensity;
|
||||||
effectPalette = elem["pal"] | effectPalette;
|
getVal(elem["pal"], &effectPalette, 1, strip.getPaletteCount());
|
||||||
} else { //permanent
|
} else { //permanent
|
||||||
byte fx = elem["fx"] | seg.mode;
|
byte fx = seg.mode;
|
||||||
if (fx != seg.mode && fx < strip.getModeCount()) {
|
if (getVal(elem["fx"], &fx, 1, strip.getModeCount())) { //load effect ('r' random, '~' inc/dec, 1-255 exact value)
|
||||||
strip.setMode(id, fx);
|
strip.setMode(id, fx);
|
||||||
if (!presetId) unloadPlaylist(); //stop playlist if active and FX changed manually
|
if (!presetId) unloadPlaylist(); //stop playlist if active and FX changed manually
|
||||||
}
|
}
|
||||||
seg.speed = elem[F("sx")] | seg.speed;
|
seg.speed = elem[F("sx")] | seg.speed;
|
||||||
seg.intensity = elem[F("ix")] | seg.intensity;
|
seg.intensity = elem[F("ix")] | seg.intensity;
|
||||||
seg.palette = elem["pal"] | seg.palette;
|
getVal(elem["pal"], &seg.palette, 1, strip.getPaletteCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonArray iarr = elem[F("i")]; //set individual LEDs
|
JsonArray iarr = elem[F("i")]; //set individual LEDs
|
||||||
|
Loading…
Reference in New Issue
Block a user