Power off playlist unload.
This commit is contained in:
parent
a1c2c04510
commit
90808ac67e
@ -166,6 +166,7 @@ class PinManagerClass {
|
||||
};
|
||||
|
||||
//playlist.cpp
|
||||
void unloadPlaylist();
|
||||
void loadPlaylist(JsonObject playlistObject);
|
||||
void handlePlaylist();
|
||||
|
||||
|
@ -30,6 +30,7 @@ void toggleOnOff()
|
||||
{
|
||||
briLast = bri;
|
||||
bri = 0;
|
||||
unloadPlaylist();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,9 +74,19 @@ void serializePlaylist() {
|
||||
}
|
||||
*/
|
||||
|
||||
void unloadPlaylist() {
|
||||
if (playlistEntries != nullptr) {
|
||||
delete[] playlistEntries;
|
||||
playlistEntries = nullptr;
|
||||
}
|
||||
currentPlaylist = playlistIndex = -1;
|
||||
playlistLen = playlistEntryDur = 0;
|
||||
}
|
||||
|
||||
void loadPlaylist(JsonObject playlistObj) {
|
||||
if (playlistEntries != nullptr) {delete[] playlistEntries; playlistEntries = nullptr;}
|
||||
currentPlaylist = playlistIndex = -1; playlistEntryDur = 0;
|
||||
|
||||
unloadPlaylist();
|
||||
|
||||
JsonArray presets = playlistObj["ps"];
|
||||
playlistLen = presets.size();
|
||||
if (playlistLen == 0) return;
|
||||
|
Loading…
Reference in New Issue
Block a user