more input handling work

This commit is contained in:
Sundog Jones 2020-08-02 09:03:26 -07:00
parent 0d4c7430b1
commit 3e46566f4d

View File

@ -3,6 +3,7 @@ import RPi.GPIO as GPIO
from SoundslabDisplay import SoundslabDisplay from SoundslabDisplay import SoundslabDisplay
import time import time
import musicpd import musicpd
from math import floor
# connect to mpd # connect to mpd
player_client = musicpd.MPDClient() player_client = musicpd.MPDClient()
@ -79,11 +80,17 @@ def DN():
def LF(): def LF():
# seek back 10s # seek back 10s
pass global player_client
print("seek -10s")
status = player_client.status()
player_client.seekcur(floor(float(status['elapsed']) - 10.0))
def RT(): def RT():
# seek forward 10s # seek forward 10s
pass global player_client
print("seek +10s")
status = player_client.status()
player_client.seekcur(floor(float(status['elapsed']) + 10.0))
def SELECT(): def SELECT():
# display lock/unlock # display lock/unlock