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

Functionality for Live Input Channels.

parent a6f372ad
......@@ -54,11 +54,11 @@ class Channel(Enum):
HTTP_B = "in_http_1"
HTTPS_A = "in_https_0"
HTTPS_B = "in_https_1"
LIVE_0 = "aura_linein_0"
LIVE_1 = "aura_linein_1"
LIVE_2 = "aura_linein_2"
LIVE_3 = "aura_linein_3"
LIVE_4 = "aura_linein_4"
LIVE_0 = "linein_0"
LIVE_1 = "linein_1"
LIVE_2 = "linein_2"
LIVE_3 = "linein_3"
LIVE_4 = "linein_4"
def __str__(self):
return str(self.value)
......
......@@ -44,8 +44,6 @@ class EngineUtil:
Args:
uri (String): The URI of the source
"""
if uri.startswith("https"):
return ChannelType.HTTPS
......@@ -53,7 +51,7 @@ class EngineUtil:
return ChannelType.HTTP
if uri.startswith("pool") or uri.startswith("playlist") or uri.startswith("file"):
return ChannelType.FILESYSTEM
if uri.startswith("live") or uri.startswith("line://"):
if uri.startswith("line://"):
return ChannelType.LIVE
......
......@@ -225,10 +225,14 @@ class SoundSystem():
entry.status = EntryPlayState.LOADING
self.logger.info("Loading entry '%s'" % entry)
self.enable_transaction()
self.player_state.set_active_entry(entry)
entry.channel = self.channel_swap(entry.type)
self.disable_transaction()
# Choose and save the input channel
if entry.type == ChannelType.LIVE:
entry.channel = "linein_" + entry.source.split("line://")[1]
else:
self.enable_transaction()
self.player_state.set_active_entry(entry)
entry.channel = self.channel_swap(entry.type)
self.disable_transaction()
# PLAYLIST
if entry.type == ChannelType.FILESYSTEM:
......@@ -238,12 +242,6 @@ class SoundSystem():
elif entry.type == ChannelType.HTTP or entry.type == ChannelType.HTTPS:
self.stream_load_entry(entry)
# LIVE
else:
# TODO Select correct LINE-OUT channels as per entry
pass
def play(self, entry, transition):
......
......@@ -38,7 +38,7 @@ from modules.database.model import AuraDatabaseModel, Schedule, Playlist, Playli
from modules.base.exceptions import NoActiveScheduleException, NoActiveEntryException, LoadSourceException
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.scheduling.calendar import AuraCalendarService
from modules.scheduling.fallback_manager import FallbackManager
......@@ -215,15 +215,16 @@ class AuraScheduler(threading.Thread):
self.soundsystem.disable_transaction()
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
self.soundsystem.load(active_entry)
self.soundsystem.play(active_entry, TransitionType.FADE)
self.queue_end_of_schedule(active_entry, True)
elif active_entry.type == ChannelType.LIVE:
self.logger.warn("LIVE ENTRIES ARE NOT YET IMPLEMENTED!")
else:
self.logger.critical("Unknown Entry Type: %s" % active_entry)
......
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