Reverted currentPlaylist.

This commit is contained in:
Blaz Kristan 2021-10-07 15:41:30 +02:00
parent bddd22cfab
commit e682fd07cb
4 changed files with 6 additions and 7 deletions

View File

@ -416,7 +416,7 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
if (errorFlag) {root[F("error")] = errorFlag; errorFlag = ERR_NONE;}
root[F("ps")] = currentPreset>0 ? currentPreset : -1;
root[F("pl")] = currentPlaylist>0 ? currentPlaylist : -1;
root[F("pl")] = currentPlaylist;
usermods.addToJsonState(root);

View File

@ -47,8 +47,7 @@ void unloadPlaylist() {
delete[] playlistEntries;
playlistEntries = nullptr;
}
currentPlaylist = 0;
playlistIndex = -1;
currentPlaylist = playlistIndex = -1;
playlistLen = playlistEntryDur = playlistOptions = 0;
DEBUG_PRINTLN(F("Playlist unloaded."));
}
@ -120,7 +119,7 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
void handlePlaylist() {
static unsigned long presetCycledTime = 0;
if (!currentPlaylist || playlistEntries == nullptr) return;
if (currentPlaylist<0 || playlistEntries == nullptr) return;
if (millis() - presetCycledTime > (100*playlistEntryDur)) {
presetCycledTime = millis();

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2110070
#define VERSION 2110071
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG
@ -513,7 +513,7 @@ WLED_GLOBAL byte timerWeekday[] _INIT_N(({ 255, 255, 255, 255, 255, 255, 255, 25
WLED_GLOBAL bool blynkEnabled _INIT(false);
//playlists
WLED_GLOBAL byte currentPlaylist _INIT(0);
WLED_GLOBAL int16_t currentPlaylist _INIT(-1);
//still used for "PL=~" HTTP API command
WLED_GLOBAL byte presetCycCurr _INIT(0);

View File

@ -62,7 +62,7 @@ void XML_response(AsyncWebServerRequest *request, char* dest)
oappend(SET_F("</ws><ps>"));
oappendi(currentPreset);
oappend(SET_F("</ps><cy>"));
oappendi(currentPlaylist > 0);
oappendi(currentPlaylist >= 0);
oappend(SET_F("</cy><ds>"));
oappend(serverDescription);
if (realtimeMode)