CC-1469: Crossfading support (non-equal power)
-further implementation..
This commit is contained in:
parent
2b7ebafa94
commit
dd7fc61e23
7 changed files with 83 additions and 49 deletions
|
@ -354,28 +354,32 @@ end
|
|||
# Add a skip function to a source
|
||||
# when it does not have one
|
||||
# by default
|
||||
def add_skip_command(s)
|
||||
# A command to skip
|
||||
def skip(_)
|
||||
# get playing (active) queue and flush it
|
||||
l = list.hd(server.execute("queue.secondary_queue"))
|
||||
l = string.split(separator=" ",l)
|
||||
list.iter(fun (rid) -> ignore(server.execute("queue.remove #{rid}")), l)
|
||||
#def add_skip_command(s)
|
||||
# # A command to skip
|
||||
# def skip(_)
|
||||
# # get playing (active) queue and flush it
|
||||
# l = list.hd(server.execute("queue.secondary_queue"))
|
||||
# l = string.split(separator=" ",l)
|
||||
# list.iter(fun (rid) -> ignore(server.execute("queue.remove #{rid}")), l)
|
||||
#
|
||||
# l = list.hd(server.execute("queue.primary_queue"))
|
||||
# l = string.split(separator=" ", l)
|
||||
# if list.length(l) > 0 then
|
||||
# source.skip(s)
|
||||
# "Skipped"
|
||||
# else
|
||||
# "Not skipped"
|
||||
# end
|
||||
# end
|
||||
# # Register the command:
|
||||
# server.register(namespace="source",
|
||||
# usage="skip",
|
||||
# description="Skip the current song.",
|
||||
# "skip",fun(s) -> begin log("source.skip") skip(s) end)
|
||||
#end
|
||||
|
||||
l = list.hd(server.execute("queue.primary_queue"))
|
||||
l = string.split(separator=" ", l)
|
||||
if list.length(l) > 0 then
|
||||
source.skip(s)
|
||||
"Skipped"
|
||||
else
|
||||
"Not skipped"
|
||||
end
|
||||
end
|
||||
# Register the command:
|
||||
server.register(namespace="source",
|
||||
usage="skip",
|
||||
description="Skip the current song.",
|
||||
"skip",fun(s) -> begin log("source.skip") skip(s) end)
|
||||
def clear_queue(s)
|
||||
source.skip(s)
|
||||
end
|
||||
|
||||
def set_dynamic_source_id(id) =
|
||||
|
|
|
@ -39,7 +39,14 @@ sources = ref []
|
|||
source_id = ref 0
|
||||
|
||||
def create_source()
|
||||
sources := list.append([request.equeue(id="s#{!source_id}", length=0.5)], !sources)
|
||||
l = request.equeue(id="s#{!source_id}", length=0.5)
|
||||
sources := list.append([l], !sources)
|
||||
server.register(namespace="queues",
|
||||
"s#{!source_id}_skip",
|
||||
fun (s) -> begin log("queues.s#{!source_id}_skip")
|
||||
clear_queue(l)
|
||||
"Done"
|
||||
end)
|
||||
source_id := !source_id + 1
|
||||
end
|
||||
|
||||
|
@ -268,7 +275,7 @@ end
|
|||
|
||||
|
||||
# Attach a skip command to the source s:
|
||||
add_skip_command(s)
|
||||
#add_skip_command(s)
|
||||
|
||||
server.register(namespace="streams",
|
||||
description="Stop Master DJ source.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue