Changed the playing code to use Playlists managed by a PlaylistManager. This allows you to have randomized playlists and stuff. Also, you can now access special functions via the contents of RFID tags. See the README for a list of available modes.
This commit is contained in:
25
include/playlist.h
Normal file
25
include/playlist.h
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include <vector>
|
||||
|
||||
class Playlist {
|
||||
private:
|
||||
uint32_t _position = 0;
|
||||
uint32_t _current_track = 0;
|
||||
bool _shuffled = false;
|
||||
std::vector<String> _files;
|
||||
public:
|
||||
Playlist(String path);
|
||||
bool has_track_next();
|
||||
bool has_track_prev();
|
||||
bool track_next();
|
||||
bool track_prev();
|
||||
void track_restart();
|
||||
void reset();
|
||||
bool is_empty();
|
||||
String get_current_file();
|
||||
uint32_t get_position();
|
||||
void set_position(uint32_t p);
|
||||
void shuffle(uint8_t random_offset=0);
|
||||
bool is_fresh();
|
||||
};
|
Reference in New Issue
Block a user