xfjx / TonUINO

Die DIY Musikbox (nicht nur) für Kinder
https://www.voss.earth/tonuino/
GNU General Public License v3.0
449 stars 404 forks source link

Added new "single track" modifier, fixed bug in dealing with duplicate OnPlayFinished events #58

Open joachimeichborn opened 4 years ago

joachimeichborn commented 4 years ago

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.

joachimeichborn commented 4 years ago

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.

hvdh2 commented 4 years ago

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.