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:
2019-11-14 20:42:02 +01:00
parent 0d64366241
commit 0cddfaf0d9
11 changed files with 412 additions and 344 deletions

View File

@ -3,14 +3,19 @@
#include <Arduino.h>
#include "config.h"
#include "player.h"
#include "playlist.h"
#include "playlist_manager.h"
#include "mqtt_client.h"
#include <MFRC522.h>
enum ControllerState { NORMAL, LOCKING, LOCKED };
class Controller {
private:
MFRC522* _rfid;
SPIMaster* _spi;
MQTTClient* _mqtt_client;
PlaylistManager* _pm;
ControllerState _state = NORMAL;
bool _rfid_enabled = true;
void _check_rfid();
void _check_serial();
@ -33,7 +38,7 @@ private:
unsigned long _last_mqtt_report_at = 0;
void _send_mqtt_report();
public:
Controller(Player* p, SPIMaster* s);
Controller(Player* p, PlaylistManager* pm);
void set_mqtt_client(MQTTClient* m);
String get_status_json();
void loop();