diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.h index b0d49566..55fe0169 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.h @@ -664,7 +664,7 @@ class AudioReactive : public Usermod { void removeAudioPalettes(void); void createAudioPalettes(void); CRGB getCRGBForBand(int x, int pal); - void fillAudioPalette(int pal); + void fillAudioPalettes(void); //////////////////// // Debug support // @@ -1371,7 +1371,7 @@ class AudioReactive : public Usermod { lastTime = millis(); } - for (int i=0; i0) { strip.customPalettes.pop_back(); DEBUG_PRINTLN(palettes); palettes--; @@ -1869,6 +1869,7 @@ void AudioReactive::removeAudioPalettes(void) { void AudioReactive::createAudioPalettes(void) { DEBUG_PRINT(F("Total # of palettes: ")); DEBUG_PRINTLN(strip.customPalettes.size()); + if (palettes) return; DEBUG_PRINTLN(F("Adding audio palettes.")); for (int i=0; i=palettes) return; // palette does not exist +void AudioReactive::fillAudioPalettes() { + if (!palettes) return; + size_t lastCustPalette = strip.customPalettes.size(); + if (lastCustPalette >= palettes) lastCustPalette -= palettes; + for (size_t pal=0; pal %p\n", &orig, this); memcpy((void*)this, (void*)&orig, sizeof(Segment)); _t = nullptr; // copied segment cannot be in transition - if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); } else { name = nullptr; } - if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); } else { data = nullptr; _dataLen = 0; } + name = nullptr; + data = nullptr; + _dataLen = 0; + if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); } + if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); } } // move constructor Segment::Segment(Segment &&orig) noexcept { //DEBUG_PRINTF("-- Move segment constructor: %p -> %p\n", &orig, this); memcpy((void*)this, (void*)&orig, sizeof(Segment)); + orig._t = nullptr; // old segment cannot be in transition any more orig.name = nullptr; orig.data = nullptr; orig._dataLen = 0; - orig._t = nullptr; // old segment cannot be in transition any more } // copy assignment @@ -110,14 +113,7 @@ Segment& Segment::operator= (const Segment &orig) { if (this != &orig) { // clean destination if (name) { delete[] name; name = nullptr; } - if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); } - if (_t) { - #ifndef WLED_DISABLE_MODE_BLEND - if (_t->_segT._dataT) free(_t->_segT._dataT); - #endif - delete _t; - _t = nullptr; // copied segment cannot be in transition - } + stopTransition(); deallocateData(); // copy source memcpy((void*)this, (void*)&orig, sizeof(Segment)); @@ -125,6 +121,7 @@ Segment& Segment::operator= (const Segment &orig) { data = nullptr; _dataLen = 0; // copy source data + if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); } if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); } } return *this; @@ -135,13 +132,7 @@ Segment& Segment::operator= (Segment &&orig) noexcept { //DEBUG_PRINTF("-- Moving segment: %p -> %p\n", &orig, this); if (this != &orig) { if (name) { delete[] name; name = nullptr; } // free old name - if (_t) { - #ifndef WLED_DISABLE_MODE_BLEND - if (_t->_segT._dataT) free(_t->_segT._dataT); - #endif - delete _t; - _t = nullptr; - } + stopTransition(); deallocateData(); // free old runtime data memcpy((void*)this, (void*)&orig, sizeof(Segment)); orig.name = nullptr; @@ -312,7 +303,7 @@ void Segment::startTransition(uint16_t dur) { if (_dataLen > 0 && data) { _t->_segT._dataT = (byte *)malloc(_dataLen); if (_t->_segT._dataT) { - //DEBUG_PRINTF("-- Allocated duplicate data (%d): %p\n", _dataLen, _t->_segT._dataT); + //DEBUG_PRINTF("-- Allocated duplicate data (%d) for %p: %p\n", _dataLen, this, _t->_segT._dataT); memcpy(_t->_segT._dataT, data, _dataLen); _t->_segT._dataLenT = _dataLen; } @@ -330,7 +321,7 @@ void Segment::stopTransition() { if (isInTransition()) { #ifndef WLED_DISABLE_MODE_BLEND if (_t->_segT._dataT && _t->_segT._dataLenT > 0) { - //DEBUG_PRINTF("-- Released duplicate data (%d): %p\n", _t->_segT._dataLenT, _t->_segT._dataT); + //DEBUG_PRINTF("-- Released duplicate data (%d) for %p: %p\n", _t->_segT._dataLenT, this, _t->_segT._dataT); free(_t->_segT._dataT); _t->_segT._dataT = nullptr; _t->_segT._dataLenT = 0; @@ -588,7 +579,7 @@ void Segment::setMode(uint8_t fx, bool loadDefaults) { sOpt = extractModeDefaults(fx, "o2"); check2 = (sOpt >= 0) ? (bool)sOpt : false; sOpt = extractModeDefaults(fx, "o3"); check3 = (sOpt >= 0) ? (bool)sOpt : false; sOpt = extractModeDefaults(fx, "m12"); if (sOpt >= 0) map1D2D = constrain(sOpt, 0, 7); - sOpt = extractModeDefaults(fx, "si"); if (sOpt >= 0) soundSim = constrain(sOpt, 0, 1); + sOpt = extractModeDefaults(fx, "si"); if (sOpt >= 0) soundSim = constrain(sOpt, 0, 3); sOpt = extractModeDefaults(fx, "rev"); if (sOpt >= 0) reverse = (bool)sOpt; sOpt = extractModeDefaults(fx, "mi"); if (sOpt >= 0) mirror = (bool)sOpt; // NOTE: setting this option is a risky business sOpt = extractModeDefaults(fx, "rY"); if (sOpt >= 0) reverse_y = (bool)sOpt; diff --git a/wled00/data/index.css b/wled00/data/index.css index c960b9ce..a8092c76 100644 --- a/wled00/data/index.css +++ b/wled00/data/index.css @@ -34,6 +34,7 @@ --bhd: none; --sgp: "block"; --bmt: 0; + --sti: 42px; } html { @@ -219,7 +220,7 @@ button { .pop-c span { padding: 2px 6px; } - + .search-icon { position: absolute; top: 8px; @@ -457,12 +458,17 @@ button { padding: 4px 2px; position: relative; opacity: 1; - transition: opacity .5s linear, height .5s, transform .5s; + transition: opacity .5s linear, height .25s, transform .25s; } .filter { z-index: 1; /*overflow: visible;*/ + border-radius: 0 0 16px 16px; + max-width: 220px; + height: 54px; + line-height: 1.5; + padding-bottom: 8px; } /* New tooltip */ @@ -470,7 +476,7 @@ button { position: absolute; opacity: 0; visibility: hidden; - transition: opacity .4s ease, visibility .4s ease; + transition: opacity .25s ease, visibility .25s ease; background-color: var(--c-5); box-shadow: 4px 4px 10px 4px var(--c-1); color: var(--c-f); @@ -478,13 +484,13 @@ button { padding: 8px 16px; border-radius: 6px; z-index: 1; + pointer-events: none; } - + .tooltip::after { content: ""; position: absolute; - border: 8px; - border-style: solid; + border: 8px solid; border-color: var(--c-5) transparent transparent transparent; top: 100%; left: calc(50% - 8px); @@ -1231,6 +1237,10 @@ TD .checkmark, TD .radiomark { -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */ filter: grayscale(100%); } +.filter .fchkl { + margin: 0 4px; + min-width: 20px; +} .lbl-l { font-size: 13px; @@ -1307,20 +1317,14 @@ TD .checkmark, TD .radiomark { top: 42px; } -#fxlist .lstI.selected { - top: 84px; -} - -#fxlist .lstI.sticky { - top: 42px; -} - +#fxlist .lstI.selected, #pallist .lstI.selected { - top: 84px; + top: calc(var(--sti) + 42px); } +#fxlist .lstI.sticky, #pallist .lstI.sticky { - top: 42px; + top: var(--sti); } /* list item content */ diff --git a/wled00/data/index.htm b/wled00/data/index.htm index ce427ac5..8221822e 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -182,7 +182,7 @@
-