Systeminfos werden via mp3-Dateien in /system abgespielt.
This commit is contained in:
@@ -134,6 +134,9 @@ void Controller::play(String rfid_id, bool shuffle) {
|
||||
play();
|
||||
} else {
|
||||
Serial.printf("There is no playlist for rfid_id %s\n", rfid_id.c_str());
|
||||
// This is working more or less, but downloading files is really, REALLY slow. (About 4 minutes for 10 MBytes).
|
||||
//download_album(rfid_id);
|
||||
audio.connecttoFS(SD, "/system/sys_unknown_card.mp3");
|
||||
}
|
||||
} else {
|
||||
if (!audio.isRunning()) {
|
||||
@@ -150,6 +153,11 @@ void Controller::play() {
|
||||
audio.connecttoFS(SD, file.c_str(), current_playlist.get_current_time());
|
||||
} else if (file.startsWith("http")) {
|
||||
log_i("Playing URL %s via connecttohost", file.c_str());
|
||||
audio.connecttoFS(SD, "/system/sys_connecting.mp3");
|
||||
while (audio.isRunning()) {
|
||||
yield();
|
||||
audio.loop();
|
||||
}
|
||||
audio.connecttohost(file.c_str());
|
||||
}
|
||||
}
|
||||
@@ -202,8 +210,12 @@ bool Controller::is_button_pressed(uint8_t pin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Controller::eof_mp3() {
|
||||
void Controller::eof_mp3(String info) {
|
||||
log_d("Handling eof. Keep playing until the file is finished.");
|
||||
while(audio.isRunning()) { audio.loop(); yield; }
|
||||
next_track();
|
||||
if (info.startsWith("sys_")) {
|
||||
log_d("File ending was a system audio file. Not running next_track.");
|
||||
} else {
|
||||
next_track();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user