Commit a5c756fe authored by David Trattnig's avatar David Trattnig
Browse files

State management for file entries.

parent da0cbfb8
......@@ -224,10 +224,12 @@ class SoundSystem():
"""
entry.status = EntryPlayState.LOADING
self.logger.info("Loading entry '%s'" % entry)
is_ready = False
# Choose and save the input channel
if entry.type == ChannelType.LIVE:
entry.channel = "linein_" + entry.source.split("line://")[1]
is_ready = True
else:
self.enable_transaction()
self.player_state.set_active_entry(entry)
......@@ -236,12 +238,14 @@ class SoundSystem():
# PLAYLIST
if entry.type == ChannelType.FILESYSTEM:
self.playlist_push(entry.channel, entry.source)
is_ready = self.playlist_push(entry.channel, entry.source)
# STREAM
elif entry.type == ChannelType.HTTP or entry.type == ChannelType.HTTPS:
self.stream_load_entry(entry)
is_ready = self.stream_load_entry(entry)
if is_ready == True:
entry.status = EntryPlayState.READY
def play(self, entry, transition):
......@@ -494,7 +498,7 @@ class SoundSystem():
time.sleep(retry_delay)
retries += 1
entry.status = EntryPlayState.READY
return True
......@@ -640,7 +644,7 @@ class SoundSystem():
self.logger.info("%s.playlist_push result: %s" % (channel, result))
self.disable_transaction()
return result
return result == "1"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment