-
Notifications
You must be signed in to change notification settings - Fork 0
/
playList.cpp
29 lines (24 loc) · 857 Bytes
/
playList.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "playList.h"
String& playList_t::toString(String& s) {
s = "playlist\n";
if (list.size()) {
for (const auto& item : list) {
switch (item.type) {
case HTTP_FILE:
s.concat(item.url.substring(item.url.lastIndexOf("/") + 1) + "\n" + typeStr[item.type] + "\n");
break;
case HTTP_PRESET:
s.concat(preset[item.index].name + "\n" + typeStr[item.type] + "\n");
break;
case HTTP_FOUND:
case HTTP_FAVORITE:
s.concat(item.name + "\n" + typeStr[item.type] + "\n");
break;
default:
log_e("ERROR! Playlist 'item.type' has no handler!");
break;
}
}
}
return s;
}