mirror of
https://github.com/wled/WLED.git
synced 2025-07-23 10:46:33 +00:00
Updated based on more feedback
This commit is contained in:
parent
db475b6998
commit
5e38039c4d
@ -226,7 +226,7 @@ void _overlayAnalogClock();
|
|||||||
void shufflePlaylist();
|
void shufflePlaylist();
|
||||||
void unloadPlaylist();
|
void unloadPlaylist();
|
||||||
int16_t loadPlaylist(JsonObject playlistObject, byte presetId = 0);
|
int16_t loadPlaylist(JsonObject playlistObject, byte presetId = 0);
|
||||||
void handlePlaylist(bool doAdvancePlaylist = false);
|
void handlePlaylist();
|
||||||
void serializePlaylist(JsonObject obj);
|
void serializePlaylist(JsonObject obj);
|
||||||
|
|
||||||
//presets.cpp
|
//presets.cpp
|
||||||
|
@ -486,9 +486,9 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
|||||||
strip.loadCustomPalettes();
|
strip.loadCustomPalettes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root.containsKey(F("np")) && root[F("np")].as<bool>()) { //skip to next preset in a playlist
|
if (root.containsKey(F("np"))) {
|
||||||
doAdvancePlaylist = true;
|
doAdvancePlaylist = root[F("np")].as<bool>(); //advances to next preset in playlist when true
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonObject wifi = root[F("wifi")];
|
JsonObject wifi = root[F("wifi")];
|
||||||
|
@ -123,7 +123,7 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void handlePlaylist(bool doAdvancePlaylist) {
|
void handlePlaylist() {
|
||||||
static unsigned long presetCycledTime = 0;
|
static unsigned long presetCycledTime = 0;
|
||||||
if (currentPlaylist < 0 || playlistEntries == nullptr) return;
|
if (currentPlaylist < 0 || playlistEntries == nullptr) return;
|
||||||
|
|
||||||
@ -149,6 +149,7 @@ if (millis() - presetCycledTime > (100 * playlistEntryDur) || doAdvancePlaylist)
|
|||||||
strip.setTransition(fadeTransition ? playlistEntries[playlistIndex].tr * 100 : 0);
|
strip.setTransition(fadeTransition ? playlistEntries[playlistIndex].tr * 100 : 0);
|
||||||
playlistEntryDur = playlistEntries[playlistIndex].dur;
|
playlistEntryDur = playlistEntries[playlistIndex].dur;
|
||||||
applyPresetFromPlaylist(playlistEntries[playlistIndex].preset);
|
applyPresetFromPlaylist(playlistEntries[playlistIndex].preset);
|
||||||
|
doAdvancePlaylist = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -901,8 +901,8 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
|
|||||||
applyPreset(presetCycCurr);
|
applyPreset(presetCycCurr);
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = req.indexOf(F("NP")); //skips to next preset in a playlist
|
pos = req.indexOf(F("NP")); //advances to next preset in a playlist
|
||||||
if (pos > 0) doAdvancePlaylist = true;
|
if (pos > 0) doAdvancePlaylist = true;
|
||||||
|
|
||||||
//set brightness
|
//set brightness
|
||||||
updateVal(req.c_str(), "&A=", &bri);
|
updateVal(req.c_str(), "&A=", &bri);
|
||||||
|
@ -209,12 +209,6 @@ void WLED::loop()
|
|||||||
|
|
||||||
toki.resetTick();
|
toki.resetTick();
|
||||||
|
|
||||||
// Advance to next playlist preset if the flag is set to true
|
|
||||||
if (doAdvancePlaylist) {
|
|
||||||
handlePlaylist(true);
|
|
||||||
doAdvancePlaylist = false; // Reset flag to false
|
|
||||||
}
|
|
||||||
|
|
||||||
#if WLED_WATCHDOG_TIMEOUT > 0
|
#if WLED_WATCHDOG_TIMEOUT > 0
|
||||||
// we finished our mainloop, reset the watchdog timer
|
// we finished our mainloop, reset the watchdog timer
|
||||||
static unsigned long lastWDTFeed = 0;
|
static unsigned long lastWDTFeed = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user