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

@ -8,10 +8,12 @@
#include "spi_master.h"
#include "http_server.h"
#include "mqtt_client.h"
#include "playlist_manager.h"
#include <ESP8266FtpServer.h>
Controller* controller;
Player* player;
PlaylistManager* pm;
//HTTPServer* http_server;
FtpServer* ftp_server;
MQTTClient* mqtt_client;
@ -33,6 +35,7 @@ void setup() {
DEBUG("Setting up SPI...\n");
SPI.begin();
SPI.setHwCs(false);
SPIMaster::init();
SPIMaster* spi = new SPIMaster();
INFO("SPI initialized.\n");
@ -45,9 +48,13 @@ void setup() {
}
spi->select_sd(false);
DEBUG("Initializing PlaylistManager...\n");
pm = new PlaylistManager();
DEBUG("done.\n");
DEBUG("Initializing Player and Controller...\n");
player = new Player(spi);
controller = new Controller(player, spi);
controller = new Controller(player, pm);
INFO("Player and controller initialized.\n");
DEBUG("Connecting to wifi \"%s\"...\n", WIFI_SSID);