refactor(playout): rename dynamic_source to web_stream
This commit is contained in:
parent
9b9defe935
commit
14cfc4ea97
|
@ -201,12 +201,12 @@ def clear_queue(s)
|
||||||
source.skip(s)
|
source.skip(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_dynamic_source_id(id) =
|
def set_web_stream_id(id) =
|
||||||
web_stream_id := id
|
web_stream_id := id
|
||||||
string_of(!web_stream_id)
|
string_of(!web_stream_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_dynamic_source_id() =
|
def get_web_stream_id() =
|
||||||
string_of(!web_stream_id)
|
string_of(!web_stream_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -61,30 +61,30 @@ stream_queue = map_metadata(update=false, append_title, stream_queue)
|
||||||
|
|
||||||
ignore(output.dummy(stream_queue, fallible=true))
|
ignore(output.dummy(stream_queue, fallible=true))
|
||||||
|
|
||||||
server.register(namespace="dynamic_source",
|
server.register(namespace="web_stream",
|
||||||
description="Enable webstream output",
|
description="Enable webstream output",
|
||||||
usage='start',
|
usage='start',
|
||||||
"output_start",
|
"output_start",
|
||||||
fun (s) -> begin log("dynamic_source.output_start")
|
fun (s) -> begin log("web_stream.output_start")
|
||||||
notify([("schedule_table_id", !web_stream_id)])
|
notify([("schedule_table_id", !web_stream_id)])
|
||||||
web_stream_enabled := true "enabled" end)
|
web_stream_enabled := true "enabled" end)
|
||||||
server.register(namespace="dynamic_source",
|
server.register(namespace="web_stream",
|
||||||
description="Enable webstream output",
|
description="Enable webstream output",
|
||||||
usage='stop',
|
usage='stop',
|
||||||
"output_stop",
|
"output_stop",
|
||||||
fun (s) -> begin log("dynamic_source.output_stop") web_stream_enabled := false "disabled" end)
|
fun (s) -> begin log("web_stream.output_stop") web_stream_enabled := false "disabled" end)
|
||||||
|
|
||||||
server.register(namespace="dynamic_source",
|
server.register(namespace="web_stream",
|
||||||
description="Set the streams cc_schedule row id",
|
description="Set the streams cc_schedule row id",
|
||||||
usage="id <id>",
|
usage="id <id>",
|
||||||
"id",
|
"id",
|
||||||
fun (s) -> begin log("dynamic_source.id") set_dynamic_source_id(s) end)
|
fun (s) -> begin log("web_stream.id") set_web_stream_id(s) end)
|
||||||
|
|
||||||
server.register(namespace="dynamic_source",
|
server.register(namespace="web_stream",
|
||||||
description="Get the streams cc_schedule row id",
|
description="Get the streams cc_schedule row id",
|
||||||
usage="get_id",
|
usage="get_id",
|
||||||
"get_id",
|
"get_id",
|
||||||
fun (s) -> begin log("dynamic_source.get_id") get_dynamic_source_id() end)
|
fun (s) -> begin log("web_stream.get_id") get_web_stream_id() end)
|
||||||
|
|
||||||
default = amplify(id="silence_src", 0.00001, noise())
|
default = amplify(id="silence_src", 0.00001, noise())
|
||||||
|
|
||||||
|
|
|
@ -77,27 +77,27 @@ class LiquidsoapClient:
|
||||||
|
|
||||||
def web_stream_get_id(self) -> str:
|
def web_stream_get_id(self) -> str:
|
||||||
with self.conn:
|
with self.conn:
|
||||||
self.conn.write("dynamic_source.get_id")
|
self.conn.write("web_stream.get_id")
|
||||||
return self.conn.read().splitlines()[0]
|
return self.conn.read().splitlines()[0]
|
||||||
|
|
||||||
def web_stream_start(self) -> None:
|
def web_stream_start(self) -> None:
|
||||||
with self.conn:
|
with self.conn:
|
||||||
self.conn.write("streams.scheduled_play_start")
|
self.conn.write("streams.scheduled_play_start")
|
||||||
self.conn.write("dynamic_source.output_start")
|
self.conn.write("web_stream.output_start")
|
||||||
|
|
||||||
def web_stream_start_buffer(self, schedule_id: int, uri: str) -> None:
|
def web_stream_start_buffer(self, schedule_id: int, uri: str) -> None:
|
||||||
with self.conn:
|
with self.conn:
|
||||||
self.conn.write(f"dynamic_source.id {schedule_id}")
|
self.conn.write(f"web_stream.id {schedule_id}")
|
||||||
self.conn.write(f"http.restart {uri}")
|
self.conn.write(f"http.restart {uri}")
|
||||||
|
|
||||||
def web_stream_stop(self) -> None:
|
def web_stream_stop(self) -> None:
|
||||||
with self.conn:
|
with self.conn:
|
||||||
self.conn.write("dynamic_source.output_stop")
|
self.conn.write("web_stream.output_stop")
|
||||||
|
|
||||||
def web_stream_stop_buffer(self) -> None:
|
def web_stream_stop_buffer(self) -> None:
|
||||||
with self.conn:
|
with self.conn:
|
||||||
self.conn.write("http.stop")
|
self.conn.write("http.stop")
|
||||||
self.conn.write("dynamic_source.id -1")
|
self.conn.write("web_stream.id -1")
|
||||||
|
|
||||||
def source_disconnect(self, name: Literal["master_dj", "live_dj"]) -> None:
|
def source_disconnect(self, name: Literal["master_dj", "live_dj"]) -> None:
|
||||||
command_map = {
|
command_map = {
|
||||||
|
|
Loading…
Reference in New Issue