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
bc095ab3
Commit
bc095ab3
authored
5 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Added clear queue and queue playlist.
parent
155d8b56
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/communication/liquidsoap/communicator.py
+67
-0
67 additions, 0 deletions
modules/communication/liquidsoap/communicator.py
with
67 additions
and
0 deletions
modules/communication/liquidsoap/communicator.py
+
67
−
0
View file @
bc095ab3
...
...
@@ -323,6 +323,62 @@ class LiquidSoapCommunicator(ExceptionLogger):
pass
def
activate_playlist
(
self
,
playlist
,
cue_in
=
0.0
):
"""
Activates a new Playlist.
Args:
new_entry (Playlist): The playlist to be played
Raises:
(LQConnectionError): In case connecting to LiquidSoap isn
'
t possible
"""
# Grab the actual active entry
active_entry
=
self
.
scheduler
.
get_active_entry
()
# Set default channel, if no previous track is available
current_channel
=
ScheduleEntryType
.
FILESYSTEM
if
active_entry
:
current_channel
=
active_entry
.
type
try
:
# FIXME clearing creates some serious timing issues
# To activate this feature we'd need some more sophisticated
# Liquidsoap logic, such as >= 2 filesystem channels and
# possiblities to pause pre-queued channels or cleaning them
# after each completed schedule.
# self.enable_transaction()
# #if active_entry:
# #self.fade_out(active_entry)
# res = self.clear_queue()
# self.logger.info("Clear Queue Response: "+res)
# self.disable_transaction()
self
.
enable_transaction
()
self
.
reload_channels
()
# self.fade_in(playlist.entries[0])
for
new_entry
in
playlist
.
entries
:
if
current_channel
==
new_entry
.
type
:
self
.
activate_same_channel
(
new_entry
,
cue_in
)
else
:
self
.
activate_different_channel
(
new_entry
,
cue_in
,
current_channel
)
current_channel
=
new_entry
.
type
self
.
disable_transaction
()
# FIXME Implement TrackService bi-directionally, log fallbacks too.
self
.
logger
.
critical
(
"
FIXME: Implement TrackService
"
)
# self.insert_track_service_entry(new_entry)
except
LQConnectionError
:
# we already caught and handled this error in __send_lqc_command__,
# but we do not want to execute this function further and pass the exception
pass
def
activate_same_channel
(
self
,
entry
,
cue_in
=
0.0
,
activate_different_channel
=
False
):
"""
Activates a playlist entry for the current channel.
...
...
@@ -380,6 +436,17 @@ class LiquidSoapCommunicator(ExceptionLogger):
# Set active channel to wanted volume
self
.
channel_volume
(
entry
.
type
.
value
,
entry
.
volume
)
def
clear_queue
(
self
):
"""
Removes all tracks currently queued.
"""
self
.
logger
.
info
(
TerminalColors
.
PINK
.
value
+
"
LiquidSoapCommunicator is clearing the filesystem queue!
"
+
TerminalColors
.
ENDC
.
value
)
return
self
.
__send_lqc_command__
(
self
.
client
,
"
fs
"
,
"
clear
"
,
)
# ------------------------------------------------------------------------------------------ #
def
insert_track_service_entry
(
self
,
schedule_entry
):
# create trackservice 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