Binary effect parameters.
This commit is contained in:
parent
52e5f467b0
commit
32fc6d4b7f
@ -4533,14 +4533,14 @@ uint16_t mode_wavesins(void) {
|
||||
|
||||
for (int i = 0; i < SEGLEN; i++) {
|
||||
uint8_t bri = sin8(millis()/4 + i * SEGMENT.intensity);
|
||||
uint8_t index = beatsin8(SEGMENT.speed, SEGMENT.custom1, SEGMENT.custom1+SEGMENT.custom2, 0, i * SEGMENT.custom3);
|
||||
uint8_t index = beatsin8(SEGMENT.speed, SEGMENT.custom1, SEGMENT.custom1+SEGMENT.custom2, 0, i * (SEGMENT.custom3<<3)); // custom3 is reduced resolution slider
|
||||
//SEGMENT.setPixelColor(i, ColorFromPalette(SEGPALETTE, index, bri, LINEARBLEND));
|
||||
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(index, false, PALETTE_SOLID_WRAP, 0, bri));
|
||||
}
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_waveins()
|
||||
static const char _data_FX_MODE_WAVESINS[] PROGMEM = "Wavesins@Speed,Brightness variation,Starting Color,Range of Colors,Color variation;!;!;1d";
|
||||
static const char _data_FX_MODE_WAVESINS[] PROGMEM = "Wavesins@!,Brightness variation,Starting color,Range of colors,Color variation;!;!;1d";
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
@ -4597,7 +4597,7 @@ uint16_t mode_2DBlackHole(void) { // By: Stepko https://editor.soulma
|
||||
// inner stars
|
||||
for (size_t i = 0; i < 4; i++) {
|
||||
x = beatsin8(SEGMENT.custom2>>3, cols/4, cols - 1 - cols/4, 0, ((i % 2) ? 128 : 0) + t * i);
|
||||
y = beatsin8(SEGMENT.custom3>>3, rows/4, rows - 1 - rows/4, 0, ((i % 2) ? 192 : 64) + t * i);
|
||||
y = beatsin8(SEGMENT.custom3 , rows/4, rows - 1 - rows/4, 0, ((i % 2) ? 192 : 64) + t * i);
|
||||
SEGMENT.addPixelColorXY(x, y, CHSV(i*32, 255, 255));
|
||||
}
|
||||
// central white dot
|
||||
@ -4983,15 +4983,15 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
|
||||
|
||||
SEGMENT.custom1 = 128; // Make sure the location widgets are centered to start.
|
||||
SEGMENT.custom2 = 128;
|
||||
SEGMENT.custom3 = 128;
|
||||
SEGMENT.custom3 = 16;
|
||||
SEGMENT.intensity = 24;
|
||||
}
|
||||
|
||||
julias->xcen = julias->xcen + (float)(SEGMENT.custom1 - 128)/100000.;
|
||||
julias->ycen = julias->ycen + (float)(SEGMENT.custom2 - 128)/100000.;
|
||||
julias->xymag = julias->xymag + (float)(SEGMENT.custom3-128)/100000.;
|
||||
if (julias->xymag < 0.01) julias->xymag = 0.01;
|
||||
if (julias->xymag > 1.0) julias->xymag = 1.0;
|
||||
julias->xcen = julias->xcen + (float)(SEGMENT.custom1 - 128)/100000.f;
|
||||
julias->ycen = julias->ycen + (float)(SEGMENT.custom2 - 128)/100000.f;
|
||||
julias->xymag = julias->xymag + (float)((SEGMENT.custom3 - 16)<<3)/100000.f; // reduced resolution slider
|
||||
if (julias->xymag < 0.01f) julias->xymag = 0.01f;
|
||||
if (julias->xymag > 1.0f) julias->xymag = 1.0f;
|
||||
|
||||
float xmin = julias->xcen - julias->xymag;
|
||||
float xmax = julias->xcen + julias->xymag;
|
||||
@ -4999,10 +4999,10 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
|
||||
float ymax = julias->ycen + julias->xymag;
|
||||
|
||||
// Whole set should be within -1.2,1.2 to -.8 to 1.
|
||||
xmin = constrain(xmin,-1.2,1.2);
|
||||
xmax = constrain(xmax,-1.2,1.2);
|
||||
ymin = constrain(ymin,-.8,1.0);
|
||||
ymax = constrain(ymax,-.8,1.0);
|
||||
xmin = constrain(xmin, -1.2f, 1.2f);
|
||||
xmax = constrain(xmax, -1.2f, 1.2f);
|
||||
ymin = constrain(ymin, -0.8f, 1.0f);
|
||||
ymax = constrain(ymax, -0.8f, 1.0f);
|
||||
|
||||
float dx; // Delta x is mapped to the matrix size.
|
||||
float dy; // Delta y is mapped to the matrix size.
|
||||
@ -5014,11 +5014,11 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
|
||||
|
||||
|
||||
// Resize section on the fly for some animaton.
|
||||
reAl = -0.94299; // PixelBlaze example
|
||||
imAg = 0.3162;
|
||||
reAl = -0.94299f; // PixelBlaze example
|
||||
imAg = 0.3162f;
|
||||
|
||||
reAl += sin((float)millis()/305.)/20.;
|
||||
imAg += sin((float)millis()/405.)/20.;
|
||||
reAl += sin_t((float)millis()/305.f)/20.f;
|
||||
imAg += sin_t((float)millis()/405.f)/20.f;
|
||||
|
||||
dx = (xmax - xmin) / (cols); // Scale the delta x and y values to our matrix size.
|
||||
dy = (ymax - ymin) / (rows);
|
||||
@ -5064,7 +5064,7 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_2DJulia()
|
||||
static const char _data_FX_MODE_2DJULIA[] PROGMEM = "Julia@,Max iterations per pixel,X center,Y center,Area size;;!;2d";
|
||||
static const char _data_FX_MODE_2DJULIA[] PROGMEM = "Julia@,Max iterations per pixel,X center,Y center,Area size;;!;ix=24,c1=128,c2=128,c3=16,2d";
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
@ -5113,7 +5113,7 @@ uint16_t mode_2Dmatrix(void) { // Matrix2D. By Jeremy Williams.
|
||||
|
||||
CRGB spawnColor;
|
||||
CRGB trailColor;
|
||||
if (SEGMENT.custom2 > 128) {
|
||||
if (SEGMENT.check1) {
|
||||
spawnColor = SEGCOLOR(0);
|
||||
trailColor = SEGCOLOR(1);
|
||||
} else {
|
||||
@ -5154,7 +5154,7 @@ uint16_t mode_2Dmatrix(void) { // Matrix2D. By Jeremy Williams.
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_2Dmatrix()
|
||||
static const char _data_FX_MODE_2DMATRIX[] PROGMEM = "Matrix@Falling speed,Spawning rate,Trail,Custom color;Spawn,Trail;;pal=0,2d";
|
||||
static const char _data_FX_MODE_2DMATRIX[] PROGMEM = "Matrix@Falling speed,Spawning rate,Trail,,,Custom color,,;Spawn,Trail;;pal=0,2d";
|
||||
|
||||
|
||||
/////////////////////////
|
||||
@ -5415,7 +5415,7 @@ uint16_t mode_2Dsquaredswirl(void) { // By: Mark Kriegsman. https://g
|
||||
|
||||
SEGMENT.fadeToBlackBy(24);
|
||||
|
||||
uint8_t blurAmount = SEGMENT.custom3>>4;
|
||||
uint8_t blurAmount = SEGMENT.custom3>>1; // reduced resolution slider
|
||||
SEGMENT.blur(blurAmount);
|
||||
|
||||
// Use two out-of-sync sine waves
|
||||
@ -5983,12 +5983,12 @@ uint16_t mode_ripplepeak(void) { // * Ripple peak. By Andrew Tuli
|
||||
|
||||
if (SEGENV.call == 0) {
|
||||
SEGENV.aux0 = 255;
|
||||
SEGMENT.custom2 = *binNum;
|
||||
SEGMENT.custom3 = *maxVol * 2;
|
||||
SEGMENT.custom1 = *binNum;
|
||||
SEGMENT.custom2 = *maxVol * 2;
|
||||
}
|
||||
|
||||
*binNum = SEGMENT.custom2; // Select a bin.
|
||||
*maxVol = SEGMENT.custom3/2; // Our volume comparator.
|
||||
*binNum = SEGMENT.custom1; // Select a bin.
|
||||
*maxVol = SEGMENT.custom2 / 2; // Our volume comparator.
|
||||
|
||||
SEGMENT.fade_out(240); // Lower frame rate means less effective fading than FastLED
|
||||
SEGMENT.fade_out(240);
|
||||
@ -6029,7 +6029,7 @@ uint16_t mode_ripplepeak(void) { // * Ripple peak. By Andrew Tuli
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_ripplepeak()
|
||||
static const char _data_FX_MODE_RIPPLEPEAK[] PROGMEM = "Ripple Peak@Fade rate,Max # of ripples,,Select bin,Volume (minimum);!,!;!;c3=0,mp12=0,ssim=0,1d,vo"; // Pixel, Beatsin
|
||||
static const char _data_FX_MODE_RIPPLEPEAK[] PROGMEM = "Ripple Peak@Fade rate,Max # of ripples,Select bin,Volume (minimum);!,!;!;c2=0,mp12=0,ssim=0,1d,vo"; // Pixel, Beatsin
|
||||
|
||||
|
||||
#ifndef WLED_DISABLE_2D
|
||||
@ -6532,17 +6532,17 @@ uint16_t mode_puddlepeak(void) { // Puddlepeak. By Andrew Tuline.
|
||||
float volumeSmth = *(float*) um_data->u_data[0];
|
||||
|
||||
if (SEGENV.call == 0) {
|
||||
SEGMENT.custom2 = *binNum;
|
||||
SEGMENT.custom3 = *maxVol * 2;
|
||||
SEGMENT.custom1 = *binNum;
|
||||
SEGMENT.custom2 = *maxVol * 2;
|
||||
}
|
||||
|
||||
*binNum = SEGMENT.custom2; // Select a bin.
|
||||
*maxVol = SEGMENT.custom3/4; // Our volume comparator.
|
||||
*binNum = SEGMENT.custom1; // Select a bin.
|
||||
*maxVol = SEGMENT.custom2 / 2; // Our volume comparator.
|
||||
|
||||
SEGMENT.fade_out(fadeVal);
|
||||
|
||||
if (samplePeak == 1) {
|
||||
size = volumeSmth * SEGMENT.intensity /256 /4 + 1; // Determine size of the flash based on the volume.
|
||||
size = volumeSmth * SEGMENT.intensity /256 /4 + 1; // Determine size of the flash based on the volume.
|
||||
if (pos+size>= SEGLEN) size = SEGLEN - pos;
|
||||
}
|
||||
|
||||
@ -6552,7 +6552,7 @@ uint16_t mode_puddlepeak(void) { // Puddlepeak. By Andrew Tuline.
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_puddlepeak()
|
||||
static const char _data_FX_MODE_PUDDLEPEAK[] PROGMEM = "Puddlepeak@Fade rate,Puddle size,,Select bin,Volume (minimum);!,!;!;c3=0,mp12=0,ssim=0,1d,vo"; // Pixels, Beatsin
|
||||
static const char _data_FX_MODE_PUDDLEPEAK[] PROGMEM = "Puddlepeak@Fade rate,Puddle size,Select bin,Volume (minimum);!,!;!;c2=0,mp12=0,ssim=0,1d,vo"; // Pixels, Beatsin
|
||||
|
||||
|
||||
//////////////////////
|
||||
@ -6745,7 +6745,7 @@ uint16_t mode_freqmatrix(void) { // Freqmatrix. By Andreas Plesch
|
||||
if(SEGENV.aux0 != secondHand) {
|
||||
SEGENV.aux0 = secondHand;
|
||||
|
||||
uint8_t sensitivity = map(SEGMENT.custom3, 0, 255, 1, 10);
|
||||
uint8_t sensitivity = map(SEGMENT.custom3, 0, 31, 1, 10); // reduced resolution slider
|
||||
int pixVal = (volumeSmth * SEGMENT.intensity * sensitivity) / 256.0f;
|
||||
if (pixVal > 255) pixVal = 255;
|
||||
|
||||
@ -6842,10 +6842,7 @@ uint16_t mode_freqwave(void) { // Freqwave. By Andreas Pleschun
|
||||
if(SEGENV.aux0 != secondHand) {
|
||||
SEGENV.aux0 = secondHand;
|
||||
|
||||
//uint8_t fade = SEGMENT.custom3;
|
||||
//uint8_t fadeval;
|
||||
|
||||
float sensitivity = mapf(SEGMENT.custom3, 1, 255, 1, 10);
|
||||
float sensitivity = mapf(SEGMENT.custom3, 1, 31, 1, 10); // reduced resolution slider
|
||||
float pixVal = volumeSmth * (float)SEGMENT.intensity / 256.0f * sensitivity;
|
||||
if (pixVal > 255) pixVal = 255;
|
||||
|
||||
@ -7014,12 +7011,12 @@ uint16_t mode_waterfall(void) { // Waterfall. By: Andrew Tulin
|
||||
SEGMENT.setUpLeds();
|
||||
SEGMENT.fill(BLACK);
|
||||
SEGENV.aux0 = 255;
|
||||
SEGMENT.custom2 = *binNum;
|
||||
SEGMENT.custom3 = *maxVol * 2;
|
||||
SEGMENT.custom1 = *binNum;
|
||||
SEGMENT.custom2 = *maxVol * 2;
|
||||
}
|
||||
|
||||
*binNum = SEGMENT.custom2; // Select a bin.
|
||||
*maxVol = SEGMENT.custom3/2; // Our volume comparator.
|
||||
*binNum = SEGMENT.custom1; // Select a bin.
|
||||
*maxVol = SEGMENT.custom2 / 2; // Our volume comparator.
|
||||
|
||||
uint8_t secondHand = micros() / (256-SEGMENT.speed)/500 + 1 % 16;
|
||||
if (SEGENV.aux0 != secondHand) { // Triggered millis timing.
|
||||
@ -7037,7 +7034,7 @@ uint16_t mode_waterfall(void) { // Waterfall. By: Andrew Tulin
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_waterfall()
|
||||
static const char _data_FX_MODE_WATERFALL[] PROGMEM = "Waterfall@!,Adjust color,,Select bin, Volume (minimum);!,!;!;c3=0,mp12=2,ssim=0,1d,fr"; // Circles, Beatsin
|
||||
static const char _data_FX_MODE_WATERFALL[] PROGMEM = "Waterfall@!,Adjust color,Select bin,Volume (minimum);!,!;!;c2=0,mp12=2,ssim=0,1d,fr"; // Circles, Beatsin
|
||||
|
||||
|
||||
#ifndef WLED_DISABLE_2D
|
||||
@ -7079,7 +7076,7 @@ uint16_t mode_2DGEQ(void) { // By Will Tatam. Code reduction by Ewoud Wijma.
|
||||
|
||||
uint32_t ledColor = BLACK;
|
||||
for (int y=0; y < barHeight; y++) {
|
||||
if (SEGMENT.custom2 > 128) //color_vertical / color bars toggle
|
||||
if (SEGMENT.check1) //color_vertical / color bars toggle
|
||||
colorIndex = map(y, 0, rows-1, 0, 255);
|
||||
|
||||
ledColor = SEGMENT.color_from_palette(colorIndex, false, PALETTE_SOLID_WRAP, 0);
|
||||
@ -7093,7 +7090,7 @@ uint16_t mode_2DGEQ(void) { // By Will Tatam. Code reduction by Ewoud Wijma.
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_2DGEQ()
|
||||
static const char _data_FX_MODE_2DGEQ[] PROGMEM = "GEQ@Fade speed,Ripple decay,# of bands,Color bars;!,,Peak Color;!;c1=255,c2=64,pal=11,ssim=0,2d,fr"; // Beatsin
|
||||
static const char _data_FX_MODE_2DGEQ[] PROGMEM = "GEQ@Fade speed,Ripple decay,# of bands,,,Color bars,,;!,,Peak Color;!;c1=255,c2=64,pal=11,ssim=0,2d,fr"; // Beatsin
|
||||
|
||||
|
||||
/////////////////////////
|
||||
|
13
wled00/FX.h
13
wled00/FX.h
@ -42,7 +42,7 @@
|
||||
#define DEFAULT_COLOR (uint32_t)0xFFAA00
|
||||
#define DEFAULT_C1 (uint8_t)128
|
||||
#define DEFAULT_C2 (uint8_t)128
|
||||
#define DEFAULT_C3 (uint8_t)128
|
||||
#define DEFAULT_C3 (uint8_t)16
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a)<(b)?(a):(b))
|
||||
@ -376,7 +376,13 @@ typedef struct Segment {
|
||||
uint8_t opacity;
|
||||
uint32_t colors[NUM_COLORS];
|
||||
uint8_t cct; //0==1900K, 255==10091K
|
||||
uint8_t custom1, custom2, custom3; // custom FX parameters
|
||||
uint8_t custom1, custom2; // custom FX parameters/sliders
|
||||
struct {
|
||||
uint8_t custom3 : 5; // reduced range slider (0-31)
|
||||
bool check1 : 1; // checkmark 1
|
||||
bool check2 : 1; // checkmark 2
|
||||
bool check3 : 1; // checkmark 3
|
||||
};
|
||||
uint16_t startY; // start Y coodrinate 2D (top)
|
||||
uint16_t stopY; // stop Y coordinate 2D (bottom)
|
||||
char *name;
|
||||
@ -439,6 +445,9 @@ typedef struct Segment {
|
||||
custom1(DEFAULT_C1),
|
||||
custom2(DEFAULT_C2),
|
||||
custom3(DEFAULT_C3),
|
||||
check1(false),
|
||||
check2(false),
|
||||
check3(false),
|
||||
startY(0),
|
||||
stopY(1),
|
||||
name(nullptr),
|
||||
|
@ -399,22 +399,25 @@ button {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.filter {
|
||||
.filter, .option {
|
||||
background-color: var(--c-4);
|
||||
/*box-shadow: 0px 0px 6px 6px var(--c-1);*/
|
||||
border-radius: 26px;
|
||||
height: 26px;
|
||||
margin: 0 auto; /* add 4-8px if you want space at the bottom */
|
||||
padding: 8px 2px;
|
||||
padding: 4px 2px;
|
||||
position: relative;
|
||||
/*width: 260px;*/
|
||||
/*transition: opacity 1s;*/
|
||||
/*opacity: 1;*/
|
||||
z-index: 1;
|
||||
opacity: 1;
|
||||
transition: opacity 0.5s linear, height 0.5s, transform 0.5s;
|
||||
transform: scaleY(1);
|
||||
}
|
||||
|
||||
.option {
|
||||
z-index: unset;
|
||||
}
|
||||
|
||||
/* Tooltip text */
|
||||
.slider .tooltiptext {
|
||||
.slider .tooltiptext, .option .tooltiptext {
|
||||
visibility: hidden;
|
||||
background-color: var(--c-5);
|
||||
/*border: 2px solid var(--c-2);*/
|
||||
@ -436,14 +439,11 @@ button {
|
||||
opacity: 0;
|
||||
transition: opacity 0.75s;
|
||||
}
|
||||
/*
|
||||
.slider.top .tooltiptext {
|
||||
top: 100%;
|
||||
bottom: unset;
|
||||
.option .tooltiptext {
|
||||
bottom: 120%;
|
||||
}
|
||||
*/
|
||||
/* Tooltip arrow */
|
||||
.slider .tooltiptext::after {
|
||||
.slider .tooltiptext::after, .option .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
@ -453,16 +453,8 @@ button {
|
||||
border-style: solid;
|
||||
border-color: var(--c-5) transparent transparent transparent;
|
||||
}
|
||||
/*
|
||||
.slider.top .tooltiptext::after {
|
||||
bottom: 100%;
|
||||
left: 50%;
|
||||
top: unset;
|
||||
border-color: transparent transparent var(--c-5) transparent;
|
||||
}
|
||||
*/
|
||||
/* Show the tooltip text when you mouse over the tooltip container */
|
||||
.slider:hover .tooltiptext {
|
||||
.slider:hover .tooltiptext, .option .check:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
@ -475,8 +467,11 @@ button {
|
||||
display: none !important;
|
||||
}
|
||||
.fade {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
visibility: hidden; /* hide it */
|
||||
opacity: 0; /* make it transparent */
|
||||
transform: scaleY(0); /* shrink content */
|
||||
height: 0px; /* force other elements to move */
|
||||
padding: 0; /* remove empty space */
|
||||
}
|
||||
|
||||
.first {
|
||||
@ -1206,18 +1201,14 @@ TD .checkmark, TD .radiomark {
|
||||
top: auto !important; /* prevent sticky */
|
||||
bottom: auto !important;
|
||||
}
|
||||
/*
|
||||
.seg:last-child {
|
||||
margin: 0;
|
||||
}
|
||||
*/
|
||||
/* checkmark labels */
|
||||
.seg .schkl {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 9px;
|
||||
}
|
||||
|
||||
.filter .fchkl {
|
||||
/* checkmark labels */
|
||||
.filter .fchkl, .option .ochkl {
|
||||
display: inline-block;
|
||||
min-width: 0.7em;
|
||||
padding: 1px 4px 4px 32px;
|
||||
|
@ -200,7 +200,7 @@
|
||||
<div id="fx">
|
||||
<p class="labels hd" id="modeLabel">Effect mode</p>
|
||||
<div class="staytop fnd" id="fxFind">
|
||||
<input type="text" placeholder="Search" oninput="search(this,'fxlist')" onfocus="search(this,'fxlist')" />
|
||||
<input type="text" placeholder="Search" oninput="search(this,'fxlist')" onfocus="search(this,'fxlist');gId('filters').classList.add('fade');" onblur="gId('filters').classList.remove('fade')"/>
|
||||
<i class="icons clear-icon" onclick="clean(this);"></i>
|
||||
<i class="icons search-icon" onclick="gId('filters').classList.toggle('hide');" style="cursor:pointer;"></i>
|
||||
</div>
|
||||
@ -260,7 +260,7 @@
|
||||
<div id="slider2" class="slider hide">
|
||||
<i class="icons slider-icon"></i>
|
||||
<div class="sliderwrap il">
|
||||
<input id="sliderC1" class="noslide" onchange="setCustom(1)" oninput="updateTrail(this)" max="255" min="0" type="range" value="6" />
|
||||
<input id="sliderC1" class="noslide" onchange="setCustom(1)" oninput="updateTrail(this)" max="255" min="0" type="range" value="0" />
|
||||
<div class="sliderdisplay"></div>
|
||||
</div>
|
||||
<output class="sliderbubble"></output>
|
||||
@ -269,7 +269,7 @@
|
||||
<div id="slider3" class="slider hide">
|
||||
<i class="icons slider-icon"></i>
|
||||
<div class="sliderwrap il">
|
||||
<input id="sliderC2" class="noslide" onchange="setCustom(2)" oninput="updateTrail(this)" max="255" min="0" type="range" value="6" />
|
||||
<input id="sliderC2" class="noslide" onchange="setCustom(2)" oninput="updateTrail(this)" max="255" min="0" type="range" value="0" />
|
||||
<div class="sliderdisplay"></div>
|
||||
</div>
|
||||
<output class="sliderbubble"></output>
|
||||
@ -278,12 +278,26 @@
|
||||
<div id="slider4" class="slider hide">
|
||||
<i class="icons slider-icon"></i>
|
||||
<div class="sliderwrap il">
|
||||
<input id="sliderC3" class="noslide" onchange="setCustom(3)" oninput="updateTrail(this)" max="255" min="0" type="range" value="6" />
|
||||
<input id="sliderC3" class="noslide" onchange="setCustom(3)" oninput="updateTrail(this)" max="31" min="0" type="range" value="0" />
|
||||
<div class="sliderdisplay"></div>
|
||||
</div>
|
||||
<output class="sliderbubble"></output>
|
||||
<span class="tooltiptext" id="sliderLabel4">Custom 3</span>
|
||||
</div>
|
||||
<div id="fxopt" class="option fade">
|
||||
<label id="opt0" class="check ochkl hide"><i class="icons"></i><span class="tooltiptext" id="optLabel0">Check 1</span>
|
||||
<input type="checkbox" onchange="setOption(1, this.checked)">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<label id="opt1" class="check ochkl hide"><i class="icons"></i><span class="tooltiptext" id="optLabel1">Check 2</span>
|
||||
<input type="checkbox" onchange="setOption(2, this.checked)">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<label id="opt2" class="check ochkl hide"><i class="icons"></i><span class="tooltiptext" id="optLabel2">Check 3</span>
|
||||
<input type="checkbox" onchange="setOption(3, this.checked)">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1341,18 +1341,19 @@ function setEffectParameters(idx)
|
||||
var paOnOff = (effectPars.length<3 || effectPars[2]=='')?[]:effectPars[2].split(",");
|
||||
|
||||
// set html slider items on/off
|
||||
var nSliders = Math.min(5,Math.floor(gId("sliders").children.length)); // div for each slider
|
||||
//var nSliders = Math.min(7,Math.floor(gId("sliders").children.length)); // div for each slider + filter + options
|
||||
let nSliders = 5;
|
||||
var sldCnt = 0;
|
||||
for (let i=0; i<nSliders; i++) {
|
||||
var slider = gId("slider" + i);
|
||||
var label = gId("sliderLabel" + i);
|
||||
// if (not controlDefined and for AC speed or intensity and for SR alle sliders) or slider has a value
|
||||
if ((!controlDefined && i < ((idx<128)?2:nSliders)) || (slOnOff.length>i && slOnOff[i] != "")) {
|
||||
if (slOnOff.length>i && slOnOff[i].indexOf("=")>0) {
|
||||
// embeded default values
|
||||
var dPos = slOnOff[i].indexOf("=");
|
||||
slOnOff[i] = slOnOff[i].substring(0,dPos);
|
||||
}
|
||||
//if (slOnOff.length>i && slOnOff[i].indexOf("=")>0) {
|
||||
// // embeded default values
|
||||
// var dPos = slOnOff[i].indexOf("=");
|
||||
// slOnOff[i] = slOnOff[i].substring(0,dPos);
|
||||
//}
|
||||
if (slOnOff.length>i && slOnOff[i]!="!") label.innerHTML = slOnOff[i];
|
||||
else if (i==0) label.innerHTML = "Effect speed";
|
||||
else if (i==1) label.innerHTML = "Effect intensity";
|
||||
@ -1363,13 +1364,26 @@ function setEffectParameters(idx)
|
||||
slider.classList.add("hide");
|
||||
}
|
||||
}
|
||||
if (slOnOff.length>5) {
|
||||
gId('fxopt').classList.remove('fade');
|
||||
for (let i = 0; i<3; i++) {
|
||||
if (slOnOff[5+i]!=='') {
|
||||
gId('opt'+i).classList.remove('hide');
|
||||
gId('optLabel'+i).innerHTML = slOnOff[5+i]=="!" ? 'Option' : slOnOff[5+i].substr(0,16);
|
||||
} else
|
||||
gId('opt'+i).classList.add('hide');
|
||||
}
|
||||
} else {
|
||||
gId('fxopt').classList.add('fade');
|
||||
}
|
||||
|
||||
// set the bottom position of selected effect (sticky) as the top of sliders div
|
||||
let top = parseInt(getComputedStyle(gId("sliders")).height);
|
||||
//top += 5; // size of tooltip
|
||||
let sel = d.querySelector('#fxlist .selected');
|
||||
if (sel) sel.style.bottom = top + "px"; // we will need to remove this when unselected (in setX())
|
||||
|
||||
setInterval(()=>{
|
||||
let top = parseInt(getComputedStyle(gId("sliders")).height);
|
||||
top += 5;
|
||||
let sel = d.querySelector('#fxlist .selected');
|
||||
if (sel) sel.style.bottom = top + "px"; // we will need to remove this when unselected (in setX())
|
||||
},750);
|
||||
// set html color items on/off
|
||||
var cslLabel = '';
|
||||
var sep = '';
|
||||
@ -2117,6 +2131,16 @@ function setCustom(i=1)
|
||||
requestJson(obj);
|
||||
}
|
||||
|
||||
function setOption(i=1, v=false)
|
||||
{
|
||||
if (i<1 || i>3) return;
|
||||
var obj = {"seg": {}};
|
||||
if (i===3) obj.seg.o3 = !(!v); //make sure it is bool
|
||||
else if (i===2) obj.seg.o2 = !(!v); //make sure it is bool
|
||||
else obj.seg.o1 = !(!v); //make sure it is bool
|
||||
requestJson(obj);
|
||||
}
|
||||
|
||||
function setLor(i)
|
||||
{
|
||||
var obj = {"lor": i};
|
||||
|
3707
wled00/html_ui.h
3707
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
@ -222,7 +222,13 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
||||
}
|
||||
getVal(elem[F("c1")], &seg.custom1);
|
||||
getVal(elem[F("c2")], &seg.custom2);
|
||||
getVal(elem[F("c3")], &seg.custom3);
|
||||
uint8_t cust3 = seg.custom3;
|
||||
getVal(elem[F("c3")], &cust3); // we can't pass reference to bifield
|
||||
seg.custom3 = cust3;
|
||||
|
||||
seg.check1 = elem[F("o1")] | seg.check1;
|
||||
seg.check2 = elem[F("o2")] | seg.check2;
|
||||
seg.check3 = elem[F("o3")] | seg.check3;
|
||||
|
||||
JsonArray iarr = elem[F("i")]; //set individual LEDs
|
||||
if (!iarr.isNull()) {
|
||||
@ -510,6 +516,9 @@ void serializeSegment(JsonObject& root, Segment& seg, byte id, bool forPreset, b
|
||||
root[F("mY")] = seg.getOption(SEG_OPTION_MIRROR_Y);
|
||||
root[F("tp")] = seg.getOption(SEG_OPTION_TRANSPOSED);
|
||||
}
|
||||
root[F("o1")] = seg.check1;
|
||||
root[F("o2")] = seg.check2;
|
||||
root[F("o3")] = seg.check3;
|
||||
root[F("ssim")] = seg.soundSim;
|
||||
root[F("mp12")] = seg.map1D2D;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user