mirror of
https://github.com/Pecusx/piradio-mini.git
synced 2026-05-20 22:33:44 +02:00
Streaming control added.
This commit is contained in:
@@ -326,6 +326,18 @@ class Radio:
|
||||
self.loadStations()
|
||||
self.setInterrupt()
|
||||
|
||||
elif key == 'STREAMING_TOGGLE':
|
||||
self.toggleStreaming()
|
||||
self.setInterrupt()
|
||||
|
||||
elif key == 'STREAMING_ON':
|
||||
self.streamingOn()
|
||||
self.setInterrupt()
|
||||
|
||||
elif key == 'STREAMING_OFF':
|
||||
self.streamingOff()
|
||||
self.setInterrupt()
|
||||
|
||||
elif key == 'KEY_MEDIA': # and remote dedicated button (Pecus)
|
||||
if self.display_mode != self.MODE_SLEEP: # no in sleep mode! (Pecus)
|
||||
self.setPlayerSource() # (Pecus)
|
||||
@@ -1388,6 +1400,7 @@ class Radio:
|
||||
|
||||
# Switch on Icecast2 streaming
|
||||
def streamingOn(self):
|
||||
if not self.streaming:
|
||||
output_id = 2
|
||||
self.streaming = True
|
||||
self.execCommand("service icecast2 start")
|
||||
@@ -1399,6 +1412,7 @@ class Radio:
|
||||
|
||||
# Switch off Icecast2 streaming
|
||||
def streamingOff(self):
|
||||
if self.streaming:
|
||||
output_id = 2
|
||||
self.streaming = False
|
||||
self.execMpcCommand("disable " + str(output_id))
|
||||
|
||||
Reference in New Issue
Block a user