Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
12954393
Commit
12954393
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Functionality for Live Input Channels.
parent
a6f372ad
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
modules/base/enum.py
+5
-5
5 additions, 5 deletions
modules/base/enum.py
modules/base/utils.py
+1
-3
1 addition, 3 deletions
modules/base/utils.py
modules/core/engine.py
+8
-10
8 additions, 10 deletions
modules/core/engine.py
modules/scheduling/scheduler.py
+6
-5
6 additions, 5 deletions
modules/scheduling/scheduler.py
with
20 additions
and
23 deletions
modules/base/enum.py
+
5
−
5
View file @
12954393
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
modules/base/utils.py
+
1
−
3
View file @
12954393
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
modules/core/engine.py
+
8
−
10
View file @
12954393
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
modules/scheduling/scheduler.py
+
6
−
5
View file @
12954393
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment