mirror of
https://github.com/xfjx/TonUINO.git
synced 2025-08-30 15:00:07 +02:00
Fix für Repeat Modifier
This commit is contained in:
16
Tonuino.ino
16
Tonuino.ino
@@ -68,6 +68,7 @@ adminSettings mySettings;
|
|||||||
nfcTagObject myCard;
|
nfcTagObject myCard;
|
||||||
folderSettings *myFolder;
|
folderSettings *myFolder;
|
||||||
unsigned long sleepAtMillis = 0;
|
unsigned long sleepAtMillis = 0;
|
||||||
|
static uint16_t _lastTrackFinished;
|
||||||
|
|
||||||
static void nextTrack(uint16_t track);
|
static void nextTrack(uint16_t track);
|
||||||
uint8_t voiceMenu(int numberOfOptions, int startMessage, int messageOffset,
|
uint8_t voiceMenu(int numberOfOptions, int startMessage, int messageOffset,
|
||||||
@@ -458,14 +459,17 @@ class RepeatSingleModifier: public Modifier {
|
|||||||
public:
|
public:
|
||||||
virtual bool handleNext() {
|
virtual bool handleNext() {
|
||||||
Serial.println(F("== RepeatSingleModifier::handleNext() -> REPEAT CURRENT TRACK"));
|
Serial.println(F("== RepeatSingleModifier::handleNext() -> REPEAT CURRENT TRACK"));
|
||||||
|
delay(50);
|
||||||
|
if (isPlaying()) return true;
|
||||||
mp3.playFolderTrack(myFolder->folder, currentTrack);
|
mp3.playFolderTrack(myFolder->folder, currentTrack);
|
||||||
|
_lastTrackFinished = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
RepeatSingleModifier() {
|
RepeatSingleModifier() {
|
||||||
Serial.println(F("=== RepeatSingleModifier()"));
|
Serial.println(F("=== RepeatSingleModifier()"));
|
||||||
}
|
}
|
||||||
uint8_t getActive() {
|
uint8_t getActive() {
|
||||||
Serial.println(F("== KindergardenMode::getActive()"));
|
Serial.println(F("== RepeatSingleModifier::getActive()"));
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -505,8 +509,12 @@ class FeedbackModifier: public Modifier {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Leider kann das Modul selbst keine Queue abspielen, daher müssen wir selbst die Queue verwalten
|
// Leider kann das Modul selbst keine Queue abspielen, daher müssen wir selbst die Queue verwalten
|
||||||
static uint16_t _lastTrackFinished;
|
|
||||||
static void nextTrack(uint16_t track) {
|
static void nextTrack(uint16_t track) {
|
||||||
|
Serial.println(track);
|
||||||
|
if (activeModifier != NULL)
|
||||||
|
if (activeModifier->handleNext() == true)
|
||||||
|
return;
|
||||||
|
|
||||||
if (track == _lastTrackFinished) {
|
if (track == _lastTrackFinished) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -519,10 +527,6 @@ static void nextTrack(uint16_t track) {
|
|||||||
|
|
||||||
Serial.println(F("=== nextTrack()"));
|
Serial.println(F("=== nextTrack()"));
|
||||||
|
|
||||||
if (activeModifier != NULL)
|
|
||||||
if (activeModifier->handleNext() == true)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (myFolder->mode == 1 || myFolder->mode == 7) {
|
if (myFolder->mode == 1 || myFolder->mode == 7) {
|
||||||
Serial.println(F("Hörspielmodus ist aktiv -> keinen neuen Track spielen"));
|
Serial.println(F("Hörspielmodus ist aktiv -> keinen neuen Track spielen"));
|
||||||
setstandbyTimer();
|
setstandbyTimer();
|
||||||
|
Reference in New Issue
Block a user