working rfid, more player capabilities
This commit is contained in:
@@ -122,6 +122,36 @@ void DirectoryNode::advanceToFirstMP3InThisNode() {
|
||||
}
|
||||
}
|
||||
|
||||
DirectoryNode* DirectoryNode::advanceToMP3(const String* currentGlobal) {
|
||||
for (auto subdir : subdirectories)
|
||||
{
|
||||
if (subdir->getName()==*currentGlobal) {
|
||||
subdir->advanceToFirstMP3InThisNode();
|
||||
return subdir;
|
||||
}
|
||||
|
||||
// Have each subdirectory advance its song
|
||||
for (size_t i = 0; i < subdir->mp3Files.size(); i++)
|
||||
{
|
||||
if (*currentGlobal == subdir->mp3Files[i])
|
||||
{
|
||||
// Found the current MP3 file
|
||||
if (i < subdir->mp3Files.size() - 1)
|
||||
{
|
||||
subdir->currentPlaying = &subdir->mp3Files[i];
|
||||
return subdir;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we get here, there were no MP3 files or subdirectories left to check
|
||||
currentPlaying = nullptr;
|
||||
Serial.println("no more nodes found");
|
||||
return this;
|
||||
}
|
||||
|
||||
DirectoryNode* DirectoryNode::advanceToNextMP3(const String* currentGlobal)
|
||||
{
|
||||
bool useFirst = false;
|
||||
|
||||
Reference in New Issue
Block a user