Added new "single track" modifier, fixed bug in dealing with duplicate OnPlayFinished events#58
Open
joachimeichborn wants to merge 10 commits intoxfjx:DEVfrom
joachimeichborn:DEV
Open
Added new "single track" modifier, fixed bug in dealing with duplicate OnPlayFinished events#58joachimeichborn wants to merge 10 commits intoxfjx:DEVfrom joachimeichborn:DEV
joachimeichborn wants to merge 10 commits intoxfjx:DEVfrom
joachimeichborn:DEV
Conversation
Added context information to every Serial.print call where it was missing. Previously sometimes plain numbers were logged without any hint what they could mean.
Introduced enums to be used instead of magic ints to increase the comprehensibility of the code
Replaced if statements with switch, removed redundancies
Added a new modifier that TonUINO stops playing after the current track
The test was done after the call to the active modifier, so this was called twice. This can lead to unexpected behaviour of the modifiers. In fact the check can be moved to the Mp3Notify class. That way we also don't have to create random track numbers if the next button is pressed.
Added preprocessor directives that allow to simply activate a power led
Author
|
I forgot to mention that I have not added the required new mp3-file 0977_modifier_single_track.mp3 as I don't have access to a mac. So this would have to be added while merging the changes. |
If buttons four and five are pressed long while nothing is played, the system behaves as if the non-modifier card that was used the last time was used again. So it's possible to continue a card after the system went into sleep without having to use the card.
Set five button mode, changed button five pin, removed mp3.sleep
Contributor
|
I already made a pull request to introduce enums for playback modes over a year ago. The code is very poorly readable without. Sadly, it still isn't merged yet. |
hvdh2
reviewed
Apr 25, 2020
| }; | ||
|
|
||
| enum Mode { | ||
| // Hörspielmodus: eine zufällige Datei aus dem Ordner |
Contributor
There was a problem hiding this comment.
I prefer to have the comments right of the enums.
hvdh2
reviewed
Apr 25, 2020
| mfrc522.PCD_StopCrypto1(); | ||
| adminMenu(true); | ||
| break; | ||
| case SLEEP_TIMER: |
Contributor
There was a problem hiding this comment.
I prefer the old single line code here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new modifier stops playing after the current track has ended, no matter what mode is configured and how many tracks may be left in the folder.
The bug in handling duplicate OnPlayFinished events caused that handleNext methods from modifiers were called multiple times.
Apart from that, I improved logging and introduced mode and modifiers enums to make the code easier to understand for new developers - and to get a grasp of what is going on myself. With the plain integer numbers that were used previously I found itsometimes confusing because it's not directly visible if the number encodes a mode or a modifier.