peqoud / RPi-Jukebox-RFID

A jukebox for the Raspberry Pi, playing local audio files, playlists or even web streams triggered by RFID cards. All plug and play via USB, no soldering iron needed.
MIT License
0 stars 0 forks source link

Buttons shall support fast forward and backword on long press #2

Open peqoud opened 6 years ago

peqoud commented 6 years ago

The buttons for next / prev shall have a second use-case: Pressed for more then x seconds, they shall to a fast forward. Short press shall do the current behaviour of going to next or previous track on the playlist

https://github.com/peqoud/RPi-Jukebox-RFID/blob/1d6dbe0c41ccfb27bd952032d4754d55ffbf596f/scripts/jukebox_control.py#L141

peqoud commented 6 years ago

https://gpiozero.readthedocs.io/en/stable/api_input.html#button

Define hold time until first event hold_time (float) hold_repeat(bool) = true

--> when_held() is done like this first event = Next/Previous Track (dont execute) Second Event = Forwards X seconds (immediate execute) Release of button before second event --> Execute Next/previous track Release of button after second event --> Nothing - Reset system