Skip to content
Snippets Groups Projects
Commit 12954393 authored by David Trattnig's avatar David Trattnig
Browse files

Functionality for Live Input Channels.

parent a6f372ad
No related branches found
No related tags found
No related merge requests found
...@@ -54,11 +54,11 @@ class Channel(Enum): ...@@ -54,11 +54,11 @@ class Channel(Enum):
HTTP_B = "in_http_1" HTTP_B = "in_http_1"
HTTPS_A = "in_https_0" HTTPS_A = "in_https_0"
HTTPS_B = "in_https_1" HTTPS_B = "in_https_1"
LIVE_0 = "aura_linein_0" LIVE_0 = "linein_0"
LIVE_1 = "aura_linein_1" LIVE_1 = "linein_1"
LIVE_2 = "aura_linein_2" LIVE_2 = "linein_2"
LIVE_3 = "aura_linein_3" LIVE_3 = "linein_3"
LIVE_4 = "aura_linein_4" LIVE_4 = "linein_4"
def __str__(self): def __str__(self):
return str(self.value) return str(self.value)
......
...@@ -44,8 +44,6 @@ class EngineUtil: ...@@ -44,8 +44,6 @@ class EngineUtil:
Args: Args:
uri (String): The URI of the source uri (String): The URI of the source
""" """
if uri.startswith("https"): if uri.startswith("https"):
return ChannelType.HTTPS return ChannelType.HTTPS
...@@ -53,7 +51,7 @@ class EngineUtil: ...@@ -53,7 +51,7 @@ class EngineUtil:
return ChannelType.HTTP return ChannelType.HTTP
if uri.startswith("pool") or uri.startswith("playlist") or uri.startswith("file"): if uri.startswith("pool") or uri.startswith("playlist") or uri.startswith("file"):
return ChannelType.FILESYSTEM return ChannelType.FILESYSTEM
if uri.startswith("live") or uri.startswith("line://"): if uri.startswith("line://"):
return ChannelType.LIVE return ChannelType.LIVE
......
...@@ -225,10 +225,14 @@ class SoundSystem(): ...@@ -225,10 +225,14 @@ class SoundSystem():
entry.status = EntryPlayState.LOADING entry.status = EntryPlayState.LOADING
self.logger.info("Loading entry '%s'" % entry) self.logger.info("Loading entry '%s'" % entry)
self.enable_transaction() # Choose and save the input channel
self.player_state.set_active_entry(entry) if entry.type == ChannelType.LIVE:
entry.channel = self.channel_swap(entry.type) entry.channel = "linein_" + entry.source.split("line://")[1]
self.disable_transaction() else:
self.enable_transaction()
self.player_state.set_active_entry(entry)
entry.channel = self.channel_swap(entry.type)
self.disable_transaction()
# PLAYLIST # PLAYLIST
if entry.type == ChannelType.FILESYSTEM: if entry.type == ChannelType.FILESYSTEM:
...@@ -238,12 +242,6 @@ class SoundSystem(): ...@@ -238,12 +242,6 @@ class SoundSystem():
elif entry.type == ChannelType.HTTP or entry.type == ChannelType.HTTPS: elif entry.type == ChannelType.HTTP or entry.type == ChannelType.HTTPS:
self.stream_load_entry(entry) self.stream_load_entry(entry)
# LIVE
else:
# TODO Select correct LINE-OUT channels as per entry
pass
def play(self, entry, transition): def play(self, entry, transition):
......
...@@ -38,7 +38,7 @@ from modules.database.model import AuraDatabaseModel, Schedule, Playlist, Playli ...@@ -38,7 +38,7 @@ from modules.database.model import AuraDatabaseModel, Schedule, Playlist, Playli
from modules.base.exceptions import NoActiveScheduleException, NoActiveEntryException, LoadSourceException from modules.base.exceptions import NoActiveScheduleException, NoActiveEntryException, LoadSourceException
from modules.base.enum import Channel, ChannelType, TimerType, TransitionType, EntryQueueState, EntryPlayState from modules.base.enum import Channel, ChannelType, TimerType, TransitionType, EntryQueueState, EntryPlayState
from modules.base.utils import SimpleUtil, TerminalColors from modules.base.utils import SimpleUtil, TerminalColors, EngineUtil
from modules.communication.redis.messenger import RedisMessenger from modules.communication.redis.messenger import RedisMessenger
from modules.scheduling.calendar import AuraCalendarService from modules.scheduling.calendar import AuraCalendarService
from modules.scheduling.fallback_manager import FallbackManager from modules.scheduling.fallback_manager import FallbackManager
...@@ -215,15 +215,16 @@ class AuraScheduler(threading.Thread): ...@@ -215,15 +215,16 @@ class AuraScheduler(threading.Thread):
self.soundsystem.disable_transaction() self.soundsystem.disable_transaction()
self.logger.info("LiquidSoap seek response: " + response) self.logger.info("LiquidSoap seek response: " + response)
elif active_entry.type == ChannelType.HTTP or active_entry.type == ChannelType.HTTPS: elif active_entry.type == ChannelType.HTTP \
or active_entry.type == ChannelType.HTTPS \
or active_entry.type == ChannelType.LIVE:
# Load and play active entry # Load and play active entry
self.soundsystem.load(active_entry) self.soundsystem.load(active_entry)
self.soundsystem.play(active_entry, TransitionType.FADE) self.soundsystem.play(active_entry, TransitionType.FADE)
self.queue_end_of_schedule(active_entry, True) self.queue_end_of_schedule(active_entry, True)
elif active_entry.type == ChannelType.LIVE:
self.logger.warn("LIVE ENTRIES ARE NOT YET IMPLEMENTED!")
else: else:
self.logger.critical("Unknown Entry Type: %s" % active_entry) self.logger.critical("Unknown Entry Type: %s" % active_entry)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment