2019-11-14 19:42:02 +00:00
|
|
|
#pragma once
|
2019-11-29 16:41:16 +00:00
|
|
|
|
2022-08-19 08:37:03 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <Arduino.h>
|
2019-11-14 19:42:02 +00:00
|
|
|
|
|
|
|
class Playlist {
|
2022-08-19 08:37:03 +00:00
|
|
|
private:
|
|
|
|
std::vector<String> files;
|
|
|
|
uint8_t current_file = 0;
|
2022-08-21 09:37:42 +00:00
|
|
|
uint32_t current_time = 0;
|
|
|
|
void set_current_position(uint8_t file, uint32_t position=0);
|
|
|
|
String rfid_id;
|
2022-08-19 08:37:03 +00:00
|
|
|
|
|
|
|
public:
|
2022-08-21 09:37:42 +00:00
|
|
|
Playlist(String rfid_id="");
|
2022-08-19 08:37:03 +00:00
|
|
|
void add_file(String filename);
|
|
|
|
void sort();
|
2022-08-21 09:37:42 +00:00
|
|
|
String get_rfid_id();
|
|
|
|
String get_current_file_name();
|
|
|
|
bool next_track();
|
|
|
|
bool prev_track();
|
|
|
|
void restart();
|
|
|
|
void set_current_time(uint32_t time);
|
|
|
|
uint32_t get_current_time();
|
2019-11-14 19:42:02 +00:00
|
|
|
};
|