starting software configuration

This commit is contained in:
2019-02-09 09:41:21 +01:00
parent 3e60e872bf
commit 0d9723d784
5 changed files with 95 additions and 3 deletions
+40
View File
@@ -0,0 +1,40 @@
from socketIO_client import SocketIO, LoggingNamespace
import threading
import time
is_playing = False # for toggling play/pause (stores the current status from the pushState events)
socketIO = SocketIO('localhost', 3000)
def play_callback(channel):
global is_playing
if is_playing:
logging.info("PAUSE")
socketIO.emit('pause')
else:
logging.info("PLAY")
socketIO.emit('play')
def events_thread():
socketIO.wait()
try:
socketIO.on('pushState', on_pushState)
socketIO.emit('replaceAndPlay', {'service':'mpd','uri':'mnt/INTERNAL/qudio/sounds/armstrong.mp3'})
time.sleep(3.5)
t1 = threading.Thread(target=play_callback)
t1.start()
t1.join()
time.sleep(3)
t1 = threading.Thread(target=play_callback)
t1.start()
t1.join()
# Exit when Ctrl-C is pressed
except KeyboardInterrupt:
logging.info('Shutdown')