diff --git a/wled00/FX.h b/wled00/FX.h index 5520cf7f..dd877d05 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -351,8 +351,8 @@ typedef struct Segment { bool mirror_y : 1; // 8 : mirrored Y (2D) bool transpose : 1; // 9 : transposed (2D, swapped X & Y) uint8_t map1D2D : 3; // 10-12 : mapping for 1D effect on 2D (0-use as strip, 1-expand vertically, 2-circular/arc, 3-rectangular/corner, ...) - uint8_t soundSim : 1; // 13 : 0-1 sound simulation types ("soft" & "hard") - uint8_t group : 2; // 14-15 : 0-3 UI segment groups + uint8_t soundSim : 1; // 13 : 0-1 sound simulation types ("soft" & "hard" or "on"/"off") + uint8_t set : 2; // 14-15 : 0-3 UI segment sets/groups }; }; uint8_t grouping, spacing; @@ -514,7 +514,7 @@ typedef struct Segment { static uint16_t getUsedSegmentData(void) { return _usedSegmentData; } static void addUsedSegmentData(int len) { _usedSegmentData += len; } - void set(uint16_t i1, uint16_t i2, uint8_t grp=1, uint8_t spc=0, uint16_t ofs=UINT16_MAX, uint16_t i1Y=0, uint16_t i2Y=1); + void setUp(uint16_t i1, uint16_t i2, uint8_t grp=1, uint8_t spc=0, uint16_t ofs=UINT16_MAX, uint16_t i1Y=0, uint16_t i2Y=1); bool setColor(uint8_t slot, uint32_t c); //returns true if changed void setCCT(uint16_t k); void setOpacity(uint8_t o); diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 05b02339..b4e7d6da 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -379,7 +379,7 @@ void Segment::handleTransition() { } } -void Segment::set(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, uint16_t ofs, uint16_t i1Y, uint16_t i2Y) { +void Segment::setUp(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, uint16_t ofs, uint16_t i1Y, uint16_t i2Y) { //return if neither bounds nor grouping have changed bool boundsUnchanged = (start == i1 && stop == i2); #ifndef WLED_DISABLE_2D @@ -750,7 +750,7 @@ uint8_t Segment::differs(Segment& b) const { if (startY != b.startY) d |= SEG_DIFFERS_BOUNDS; if (stopY != b.stopY) d |= SEG_DIFFERS_BOUNDS; - //bit pattern: (msb first) sound:3, mapping:3, transposed, mirrorY, reverseY, [transitional, reset,] paused, mirrored, on, reverse, [selected] + //bit pattern: (msb first) set:2, sound:1, mapping:3, transposed, mirrorY, reverseY, [transitional, reset,] paused, mirrored, on, reverse, [selected] if ((options & 0b1111111110011110U) != (b.options & 0b1111111110011110U)) d |= SEG_DIFFERS_OPT; if ((options & 0x0001U) != (b.options & 0x0001U)) d |= SEG_DIFFERS_SEL; for (uint8_t i = 0; i < NUM_COLORS; i++) if (colors[i] != b.colors[i]) d |= SEG_DIFFERS_COL; @@ -1426,7 +1426,7 @@ Segment& WS2812FX::getSegment(uint8_t id) { void WS2812FX::setSegment(uint8_t n, uint16_t i1, uint16_t i2, uint8_t grouping, uint8_t spacing, uint16_t offset, uint16_t startY, uint16_t stopY) { if (n >= _segments.size()) return; - _segments[n].set(i1, i2, grouping, spacing, offset, startY, stopY); + _segments[n].setUp(i1, i2, grouping, spacing, offset, startY, stopY); } void WS2812FX::restartRuntime() { diff --git a/wled00/data/index.js b/wled00/data/index.js index 816b9a13..31f47222 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -703,7 +703,7 @@ function populateSegments(s) let exp = sg ? (sg.classList.contains('expanded') || (i===0 && cfg.comp.segexp)) : false; let cG = "var(--c-f)"; - switch (inst.group) { + switch (inst.set) { case 1: cG = "var(--c-r)"; break; case 2: cG = "var(--c-g)"; break; case 3: cG = "var(--c-b)"; break; @@ -741,7 +741,7 @@ function populateSegments(s) ``+ ``+ ``; - cn += `
`+ + cn += `
`+ `