mirror of
https://github.com/wled/WLED.git
synced 2025-07-16 15:26:31 +00:00
Merge pull request #3946 from freakintoddles2/0_15
Adds an API parameter to allow the user to skip to the next preset in a playlist at any time
This commit is contained in:
commit
5ab1b14d6b
@ -487,6 +487,8 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doAdvancePlaylist = root[F("np")] | doAdvancePlaylist; //advances to next preset in playlist when true
|
||||||
|
|
||||||
JsonObject wifi = root[F("wifi")];
|
JsonObject wifi = root[F("wifi")];
|
||||||
if (!wifi.isNull()) {
|
if (!wifi.isNull()) {
|
||||||
bool apMode = getBoolVal(wifi[F("ap")], apActive);
|
bool apMode = getBoolVal(wifi[F("ap")], apActive);
|
||||||
|
@ -127,7 +127,7 @@ void handlePlaylist() {
|
|||||||
static unsigned long presetCycledTime = 0;
|
static unsigned long presetCycledTime = 0;
|
||||||
if (currentPlaylist < 0 || playlistEntries == nullptr) return;
|
if (currentPlaylist < 0 || playlistEntries == nullptr) return;
|
||||||
|
|
||||||
if (millis() - presetCycledTime > (100*playlistEntryDur)) {
|
if (millis() - presetCycledTime > (100 * playlistEntryDur) || doAdvancePlaylist) {
|
||||||
presetCycledTime = millis();
|
presetCycledTime = millis();
|
||||||
if (bri == 0 || nightlightActive) return;
|
if (bri == 0 || nightlightActive) return;
|
||||||
|
|
||||||
@ -149,6 +149,7 @@ void handlePlaylist() {
|
|||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -903,6 +903,9 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
|
|||||||
applyPreset(presetCycCurr);
|
applyPreset(presetCycCurr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pos = req.indexOf(F("NP")); //advances to next preset in a playlist
|
||||||
|
if (pos > 0) doAdvancePlaylist = true;
|
||||||
|
|
||||||
//set brightness
|
//set brightness
|
||||||
updateVal(req.c_str(), "&A=", &bri);
|
updateVal(req.c_str(), "&A=", &bri);
|
||||||
|
|
||||||
|
@ -645,6 +645,7 @@ WLED_GLOBAL byte timerWeekday[] _INIT_N(({ 255, 255, 255, 255, 255, 255, 255,
|
|||||||
WLED_GLOBAL byte timerMonth[] _INIT_N(({28,28,28,28,28,28,28,28}));
|
WLED_GLOBAL byte timerMonth[] _INIT_N(({28,28,28,28,28,28,28,28}));
|
||||||
WLED_GLOBAL byte timerDay[] _INIT_N(({1,1,1,1,1,1,1,1}));
|
WLED_GLOBAL byte timerDay[] _INIT_N(({1,1,1,1,1,1,1,1}));
|
||||||
WLED_GLOBAL byte timerDayEnd[] _INIT_N(({31,31,31,31,31,31,31,31}));
|
WLED_GLOBAL byte timerDayEnd[] _INIT_N(({31,31,31,31,31,31,31,31}));
|
||||||
|
WLED_GLOBAL bool doAdvancePlaylist _INIT(false);
|
||||||
|
|
||||||
//improv
|
//improv
|
||||||
WLED_GLOBAL byte improvActive _INIT(0); //0: no improv packet received, 1: improv active, 2: provisioning
|
WLED_GLOBAL byte improvActive _INIT(0); //0: no improv packet received, 1: improv active, 2: provisioning
|
||||||
|
Loading…
x
Reference in New Issue
Block a user