Play position in stuff like podcasts can now be permanently persisted.
This commit is contained in:
@ -4,9 +4,16 @@
|
||||
#include <ArduinoJson.h>
|
||||
#include "http_client_wrapper.h"
|
||||
|
||||
enum PlaylistPersistence {
|
||||
PERSIST_NONE,
|
||||
PERSIST_TEMPORARY,
|
||||
PERSIST_PERMANENTLY
|
||||
};
|
||||
|
||||
struct PlaylistEntry {
|
||||
String filename;
|
||||
String title;
|
||||
String id;
|
||||
|
||||
bool operator<(PlaylistEntry p) { return title < p.title; }
|
||||
};
|
||||
@ -19,12 +26,14 @@ private:
|
||||
bool _shuffled = false;
|
||||
std::vector<PlaylistEntry> _files;
|
||||
String _title = "";
|
||||
String _path;
|
||||
void _add_path(String path);
|
||||
void _examine_http_url(String url);
|
||||
void _parse_rss(HTTPClientWrapper* http);
|
||||
void _parse_m3u(HTTPClientWrapper* http);
|
||||
void _parse_pls(HTTPClientWrapper* http);
|
||||
public:
|
||||
PlaylistPersistence persistence = PERSIST_TEMPORARY;
|
||||
Playlist(String path);
|
||||
void start();
|
||||
uint16_t get_file_count();
|
||||
@ -34,9 +43,12 @@ public:
|
||||
bool track_prev();
|
||||
void track_restart();
|
||||
bool set_track(uint8_t track);
|
||||
void set_track_by_id(String id);
|
||||
void reset();
|
||||
String path();
|
||||
bool is_empty();
|
||||
bool get_current_file(String* dst);
|
||||
String get_current_track_id();
|
||||
uint32_t get_position();
|
||||
void set_position(uint32_t p);
|
||||
void shuffle(uint8_t random_offset=0);
|
||||
|
@ -20,4 +20,5 @@ public:
|
||||
String json();
|
||||
bool add_mapping(String id, String folder);
|
||||
String create_mapping_txt();
|
||||
void persist(Playlist* p);
|
||||
};
|
||||
|
Reference in New Issue
Block a user