MiczFlor/RPi-Jukebox-RFID

๐Ÿš€ | Robust forward/backward seeking

votti opened this issue ยท 0 comments

Feature

I would love to have a forward/backward action that works nicely for single long files (audiobooks) as well as short files (songs).
For long audiobooks the behaviour should be that the forward action jumps a reasonable (configurable?) amount forward (eg 2 minutes) or backwards.
For short songs, the forward/backward action should jump to next/previous file.

User perspective

As a kid I have both cards containing lots of short songs but also cards with single large files (eg digitized casettes where daddy was to lazy to split them into many small files).
I want to have a forward/backward button on my musicbox that works conveniently for both cases.
For large audios I want to navigate through them by repeatedly smashing the forward back button. I would expect this to seek within the file, i.e. each button press two minutes forward/backward.

When listening to shorter music files, I would want that the same forward/backward buttons just jump between the files.

If I press forward while a song is about to end (i.e. last 10 seconds in the file), I would prefer it to start at the beginning of the next song.
If I press backwards I would like: If the song is long, go back some minutes. If I just started the song and press the back button, it should go to the previous song.

Further information

This is based on a real world need by my kids.
Also this has been mentioned here by @plimptm as a need: #1945

I already have implemented this for myself: votti@c746000

For forward seeking I just added the existing seek function as an RPC command. This already behaves nicely.

For backward seeking, I implemented a bit a more complicated logic:
a) song already running longer than time_delta: the song position is
reverted back a time delta -> enables to seek within long audiobooks

b) song running shorter than time_delta: Go to the previous song. It his is longer than time_delta, go to the position one time-delta from the end.
Otherwise go to the beginning.
-> enables to seek back to the previous song

The forward/backward buttons on my box now map to seeking forward/backwards.