2023-02-20 22:01:24 +01:00
|
|
|
boot_timestamp = interactive.string("boot_timestamp", string_of(gettimeofday()))
|
2011-01-17 16:30:45 +01:00
|
|
|
|
2012-07-17 22:00:13 +02:00
|
|
|
#Dynamic source list
|
2012-11-15 22:43:22 +01:00
|
|
|
#dyn_sources = ref []
|
2012-08-15 22:43:01 +02:00
|
|
|
webstream_enabled = ref false
|
2012-07-17 22:00:13 +02:00
|
|
|
|
2012-10-19 22:29:31 +02:00
|
|
|
current_dyn_id = ref '-1'
|
2012-07-17 22:00:13 +02:00
|
|
|
|
2023-02-20 22:01:24 +01:00
|
|
|
show_name = interactive.string("show_name", "")
|
2011-01-17 16:30:45 +01:00
|
|
|
|
2020-12-24 23:18:15 +01:00
|
|
|
dynamic_metadata_callback = ref fun (~new_track=false, s) -> begin () end
|
2013-06-12 18:43:27 +02:00
|
|
|
|
2011-12-24 16:59:09 +01:00
|
|
|
s1_connected = ref ''
|
|
|
|
s2_connected = ref ''
|
|
|
|
s3_connected = ref ''
|
2015-03-03 22:08:53 +01:00
|
|
|
s4_connected = ref ''
|
2011-12-24 16:59:09 +01:00
|
|
|
s1_namespace = ref ''
|
|
|
|
s2_namespace = ref ''
|
|
|
|
s3_namespace = ref ''
|
2012-04-13 19:25:40 +02:00
|
|
|
just_switched = ref false
|
2011-12-24 16:59:09 +01:00
|
|
|
|
2011-03-07 20:04:47 +01:00
|
|
|
%include "ls_lib.liq"
|
2011-01-17 16:30:45 +01:00
|
|
|
|
2013-03-14 21:50:55 +01:00
|
|
|
sources = ref []
|
|
|
|
source_id = ref 0
|
|
|
|
|
2017-02-18 13:35:13 +01:00
|
|
|
def check_version(~version=liquidsoap.version, major, minor) =
|
|
|
|
v = list.map(int_of_string, string.split(separator="\.", version))
|
2019-12-31 04:07:48 +01:00
|
|
|
list.nth(v,0,default=0) > major or list.nth(v,0,default=0) == major and list.nth(v,1,default=0) >= minor
|
2017-02-18 13:35:13 +01:00
|
|
|
end
|
|
|
|
|
2013-03-14 21:50:55 +01:00
|
|
|
def create_source()
|
2013-03-15 17:50:23 +01:00
|
|
|
l = request.equeue(id="s#{!source_id}", length=0.5)
|
2013-05-23 00:07:12 +02:00
|
|
|
|
|
|
|
l = audio_to_stereo(id="queue_src", l)
|
2013-07-10 16:35:24 +02:00
|
|
|
l = cue_cut(l)
|
2013-05-23 00:07:12 +02:00
|
|
|
l = amplify(1., override="replay_gain", l)
|
|
|
|
|
|
|
|
# the crossfade function controls fade in/out
|
2020-12-24 23:18:15 +01:00
|
|
|
l = crossfade(duration=0., smart=true, l)
|
2013-05-23 00:07:12 +02:00
|
|
|
|
2013-06-12 18:43:27 +02:00
|
|
|
l = on_metadata(notify_queue, l)
|
2013-06-26 07:25:26 +02:00
|
|
|
|
2013-03-15 17:50:23 +01:00
|
|
|
sources := list.append([l], !sources)
|
|
|
|
server.register(namespace="queues",
|
|
|
|
"s#{!source_id}_skip",
|
2020-12-24 23:18:15 +01:00
|
|
|
fun (s) -> begin log("queues.s#{!source_id}_skip")
|
|
|
|
clear_queue(l)
|
|
|
|
"Done"
|
2013-03-15 17:50:23 +01:00
|
|
|
end)
|
2013-03-14 21:50:55 +01:00
|
|
|
source_id := !source_id + 1
|
|
|
|
end
|
|
|
|
|
|
|
|
create_source()
|
|
|
|
create_source()
|
|
|
|
create_source()
|
|
|
|
create_source()
|
|
|
|
|
|
|
|
create_source()
|
|
|
|
create_source()
|
|
|
|
create_source()
|
|
|
|
create_source()
|
|
|
|
|
2013-05-11 05:19:54 +02:00
|
|
|
queue = add(!sources, normalize=false)
|
2013-06-12 20:04:52 +02:00
|
|
|
pair = insert_metadata(queue)
|
2013-06-12 22:04:57 +02:00
|
|
|
dynamic_metadata_callback := fst(pair)
|
2013-06-12 20:04:52 +02:00
|
|
|
queue = snd(pair)
|
2013-03-14 21:50:55 +01:00
|
|
|
|
2012-09-18 21:23:26 +02:00
|
|
|
output.dummy(fallible=true, queue)
|
2012-03-08 23:42:38 +01:00
|
|
|
|
2012-12-03 17:06:56 +01:00
|
|
|
http = input.http_restart(id="http")
|
|
|
|
http = cross_http(http_input_id="http",http)
|
2013-01-10 16:29:57 +01:00
|
|
|
output.dummy(fallible=true, http)
|
|
|
|
stream_queue = http_fallback(http_input_id="http", http=http, default=queue)
|
2013-03-08 22:00:16 +01:00
|
|
|
stream_queue = map_metadata(update=false, append_title, stream_queue)
|
2012-08-17 05:50:32 +02:00
|
|
|
|
|
|
|
ignore(output.dummy(stream_queue, fallible=true))
|
2012-07-17 22:00:13 +02:00
|
|
|
|
2012-09-18 23:22:14 +02:00
|
|
|
server.register(namespace="streams",
|
|
|
|
"connection_status",
|
2015-03-11 00:15:38 +01:00
|
|
|
fun (s) -> begin log("streams.connection_status") "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected},4:#{!s4_connected}" end)
|
2012-08-15 22:43:01 +02:00
|
|
|
|
|
|
|
server.register(namespace="dynamic_source",
|
|
|
|
description="Enable webstream output",
|
|
|
|
usage='start',
|
|
|
|
"output_start",
|
2013-03-01 18:48:32 +01:00
|
|
|
fun (s) -> begin log("dynamic_source.output_start")
|
|
|
|
notify([("schedule_table_id", !current_dyn_id)])
|
2012-12-03 17:06:56 +01:00
|
|
|
webstream_enabled := true "enabled" end)
|
2012-08-15 22:43:01 +02:00
|
|
|
server.register(namespace="dynamic_source",
|
|
|
|
description="Enable webstream output",
|
|
|
|
usage='stop',
|
|
|
|
"output_stop",
|
2012-08-20 20:40:46 +02:00
|
|
|
fun (s) -> begin log("dynamic_source.output_stop") webstream_enabled := false "disabled" end)
|
2012-08-15 22:43:01 +02:00
|
|
|
|
2012-08-01 20:51:56 +02:00
|
|
|
server.register(namespace="dynamic_source",
|
2012-11-15 22:43:22 +01:00
|
|
|
description="Set the streams cc_schedule row id",
|
2012-08-01 20:51:56 +02:00
|
|
|
usage="id <id>",
|
|
|
|
"id",
|
2012-08-20 20:40:46 +02:00
|
|
|
fun (s) -> begin log("dynamic_source.id") set_dynamic_source_id(s) end)
|
2012-10-19 22:29:31 +02:00
|
|
|
|
|
|
|
server.register(namespace="dynamic_source",
|
2012-11-15 22:43:22 +01:00
|
|
|
description="Get the streams cc_schedule row id",
|
2012-10-19 22:29:31 +02:00
|
|
|
usage="get_id",
|
|
|
|
"get_id",
|
|
|
|
fun (s) -> begin log("dynamic_source.get_id") get_dynamic_source_id() end)
|
|
|
|
|
2012-11-15 22:43:22 +01:00
|
|
|
#server.register(namespace="dynamic_source",
|
|
|
|
# description="Start a new dynamic source.",
|
|
|
|
# usage="start <uri>",
|
|
|
|
# "read_start",
|
|
|
|
# fun (uri) -> begin log("dynamic_source.read_start") begin_stream_read(uri) end)
|
|
|
|
#server.register(namespace="dynamic_source",
|
|
|
|
# description="Stop a dynamic source.",
|
|
|
|
# usage="stop <id>",
|
|
|
|
# "read_stop",
|
|
|
|
# fun (s) -> begin log("dynamic_source.read_stop") stop_stream_read(s) end)
|
|
|
|
|
|
|
|
#server.register(namespace="dynamic_source",
|
|
|
|
# description="Stop a dynamic source.",
|
|
|
|
# usage="stop <id>",
|
|
|
|
# "read_stop_all",
|
|
|
|
# fun (s) -> begin log("dynamic_source.read_stop") destroy_dynamic_source_all() end)
|
2011-01-17 16:30:45 +01:00
|
|
|
|
2012-03-08 23:42:38 +01:00
|
|
|
default = amplify(id="silence_src", 0.00001, noise())
|
2023-02-20 22:01:24 +01:00
|
|
|
|
|
|
|
def map_message_offline(m) =
|
|
|
|
[("title", message_offline())]
|
2020-12-24 23:18:15 +01:00
|
|
|
end
|
2023-02-20 22:01:24 +01:00
|
|
|
|
|
|
|
default = map_metadata(map_message_offline, default)
|
2012-03-08 23:42:38 +01:00
|
|
|
ignore(output.dummy(default, fallible=true))
|
2011-02-18 01:46:43 +01:00
|
|
|
|
2012-04-13 19:25:40 +02:00
|
|
|
master_dj_enabled = ref false
|
|
|
|
live_dj_enabled = ref false
|
2012-09-18 23:22:14 +02:00
|
|
|
scheduled_play_enabled = ref false
|
2012-03-05 23:04:13 +01:00
|
|
|
|
|
|
|
def make_master_dj_available()
|
2012-09-15 00:20:46 +02:00
|
|
|
master_dj_enabled := true
|
2012-03-05 23:04:13 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def make_master_dj_unavailable()
|
2012-09-15 00:20:46 +02:00
|
|
|
master_dj_enabled := false
|
2012-03-05 23:04:13 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def make_live_dj_available()
|
2012-09-15 00:20:46 +02:00
|
|
|
live_dj_enabled := true
|
2012-03-05 23:04:13 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def make_live_dj_unavailable()
|
2012-09-15 00:20:46 +02:00
|
|
|
live_dj_enabled := false
|
2012-03-05 23:04:13 +01:00
|
|
|
end
|
|
|
|
|
2012-03-13 19:34:48 +01:00
|
|
|
def make_scheduled_play_available()
|
2012-09-15 00:20:46 +02:00
|
|
|
scheduled_play_enabled := true
|
|
|
|
just_switched := true
|
2012-03-13 19:34:48 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def make_scheduled_play_unavailable()
|
2012-09-15 00:20:46 +02:00
|
|
|
scheduled_play_enabled := false
|
2012-03-13 19:34:48 +01:00
|
|
|
end
|
|
|
|
|
2012-03-12 20:23:06 +01:00
|
|
|
def update_source_status(sourcename, status) =
|
2022-01-17 10:51:32 +01:00
|
|
|
gateway("live '#{sourcename}' '#{status}'")
|
2012-03-12 20:23:06 +01:00
|
|
|
end
|
|
|
|
|
2012-03-12 21:38:18 +01:00
|
|
|
def live_dj_connect(header) =
|
2012-03-12 20:23:06 +01:00
|
|
|
update_source_status("live_dj", true)
|
|
|
|
end
|
|
|
|
|
2012-09-18 23:22:14 +02:00
|
|
|
def live_dj_disconnect() =
|
2012-03-12 20:23:06 +01:00
|
|
|
update_source_status("live_dj", false)
|
|
|
|
end
|
|
|
|
|
2012-03-12 21:38:18 +01:00
|
|
|
def master_dj_connect(header) =
|
2012-03-12 20:23:06 +01:00
|
|
|
update_source_status("master_dj", true)
|
|
|
|
end
|
|
|
|
|
2012-09-18 23:22:14 +02:00
|
|
|
def master_dj_disconnect() =
|
2012-03-12 20:23:06 +01:00
|
|
|
update_source_status("master_dj", false)
|
|
|
|
end
|
|
|
|
|
2019-12-31 04:07:48 +01:00
|
|
|
# Auth function for live stream
|
|
|
|
# @Category LiveStream
|
|
|
|
# @param user Username to check against LibreTime API
|
|
|
|
# @param password Password to check against LibreTime API
|
|
|
|
# @param ~type Type of password to check, "dj" or "master, default: "master"
|
|
|
|
def check_auth(user="", password="", ~type="master") =
|
|
|
|
log("#{type} user #{user} connected",label="#{type}_source")
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2019-12-31 04:07:48 +01:00
|
|
|
# Check auth based on return value from auth script
|
2020-12-24 23:18:15 +01:00
|
|
|
ret = test_process("python3 #{auth_path} --#{type} #{user} #{password}")
|
2019-12-31 04:07:48 +01:00
|
|
|
|
|
|
|
if ret then
|
|
|
|
log("#{type} user #{user} authenticated",label="#{type}_source")
|
|
|
|
else
|
|
|
|
log("#{type} user #{user} auth failed",label="#{type}_source",level=2)
|
|
|
|
end
|
|
|
|
|
|
|
|
ret
|
|
|
|
end
|
|
|
|
|
|
|
|
# Check master source auth
|
|
|
|
# @Category LiveStream
|
|
|
|
# @param user Username to check against LibreTime API
|
|
|
|
# @param password Password to check against LibreTime API
|
|
|
|
def check_master_dj_client(user, password) =
|
|
|
|
check_auth(user, password)
|
2012-02-06 23:51:02 +01:00
|
|
|
end
|
|
|
|
|
2019-12-31 04:07:48 +01:00
|
|
|
# Check dj/show source auth
|
|
|
|
# @Category LiveStream
|
|
|
|
# @param user Username to check against LibreTime API
|
|
|
|
# @param password Password to check against LibreTime API
|
|
|
|
def check_dj_client(user, password) =
|
|
|
|
check_auth(user, password, type="dj")
|
2012-03-02 22:55:11 +01:00
|
|
|
end
|
|
|
|
|
2013-03-01 18:48:32 +01:00
|
|
|
s = switch(id="schedule_noise_switch",
|
|
|
|
track_sensitive=false,
|
|
|
|
transitions=[transition_default, transition],
|
|
|
|
[({!scheduled_play_enabled}, stream_queue), ({true}, default)]
|
|
|
|
)
|
|
|
|
|
|
|
|
s = if dj_live_stream_port != 0 and dj_live_stream_mp != "" then
|
2013-08-22 21:03:25 +02:00
|
|
|
dj_live =
|
2013-03-01 18:48:32 +01:00
|
|
|
audio_to_stereo(
|
|
|
|
input.harbor(id="live_dj_harbor",
|
|
|
|
dj_live_stream_mp,
|
|
|
|
port=dj_live_stream_port,
|
|
|
|
auth=check_dj_client,
|
|
|
|
max=40.,
|
|
|
|
on_connect=live_dj_connect,
|
2013-08-22 21:03:25 +02:00
|
|
|
on_disconnect=live_dj_disconnect))
|
2013-03-01 18:48:32 +01:00
|
|
|
|
|
|
|
ignore(output.dummy(dj_live, fallible=true))
|
|
|
|
|
|
|
|
switch(id="show_schedule_noise_switch",
|
|
|
|
track_sensitive=false,
|
|
|
|
transitions=[transition, transition],
|
|
|
|
[({!live_dj_enabled}, dj_live), ({true}, s)]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
s
|
2012-02-23 17:51:20 +01:00
|
|
|
end
|
2011-02-18 01:46:43 +01:00
|
|
|
|
2013-03-01 18:48:32 +01:00
|
|
|
s = if master_live_stream_port != 0 and master_live_stream_mp != "" then
|
2013-08-22 21:03:25 +02:00
|
|
|
master_dj =
|
2013-05-13 23:52:43 +02:00
|
|
|
audio_to_stereo(
|
|
|
|
input.harbor(id="master_harbor",
|
|
|
|
master_live_stream_mp,
|
|
|
|
port=master_live_stream_port,
|
|
|
|
auth=check_master_dj_client,
|
|
|
|
max=40.,
|
|
|
|
on_connect=master_dj_connect,
|
2013-08-22 21:03:25 +02:00
|
|
|
on_disconnect=master_dj_disconnect))
|
2013-03-01 18:48:32 +01:00
|
|
|
|
|
|
|
ignore(output.dummy(master_dj, fallible=true))
|
|
|
|
|
|
|
|
switch(id="master_show_schedule_noise_switch",
|
|
|
|
track_sensitive=false,
|
|
|
|
transitions=[transition, transition],
|
|
|
|
[({!master_dj_enabled}, master_dj), ({true}, s)]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
s
|
|
|
|
end
|
2012-12-03 17:06:56 +01:00
|
|
|
|
2012-03-02 22:55:11 +01:00
|
|
|
|
2011-02-24 21:16:27 +01:00
|
|
|
# Attach a skip command to the source s:
|
2013-03-15 17:50:23 +01:00
|
|
|
#add_skip_command(s)
|
2011-03-04 02:13:55 +01:00
|
|
|
|
2012-03-05 23:04:13 +01:00
|
|
|
server.register(namespace="streams",
|
2012-09-15 00:20:46 +02:00
|
|
|
description="Stop Master DJ source.",
|
|
|
|
usage="master_dj_stop",
|
|
|
|
"master_dj_stop",
|
|
|
|
fun (s) -> begin log("streams.master_dj_stop") make_master_dj_unavailable() "Done." end)
|
2012-03-05 23:04:13 +01:00
|
|
|
server.register(namespace="streams",
|
2012-09-15 00:20:46 +02:00
|
|
|
description="Start Master DJ source.",
|
|
|
|
usage="master_dj_start",
|
|
|
|
"master_dj_start",
|
|
|
|
fun (s) -> begin log("streams.master_dj_start") make_master_dj_available() "Done." end)
|
2012-03-05 23:04:13 +01:00
|
|
|
server.register(namespace="streams",
|
2012-09-15 00:20:46 +02:00
|
|
|
description="Stop Live DJ source.",
|
|
|
|
usage="live_dj_stop",
|
|
|
|
"live_dj_stop",
|
|
|
|
fun (s) -> begin log("streams.live_dj_stop") make_live_dj_unavailable() "Done." end)
|
2012-03-05 23:04:13 +01:00
|
|
|
server.register(namespace="streams",
|
2012-09-15 00:20:46 +02:00
|
|
|
description="Start Live DJ source.",
|
|
|
|
usage="live_dj_start",
|
|
|
|
"live_dj_start",
|
|
|
|
fun (s) -> begin log("streams.live_dj_start") make_live_dj_available() "Done." end)
|
2012-03-13 19:34:48 +01:00
|
|
|
server.register(namespace="streams",
|
2012-09-15 00:20:46 +02:00
|
|
|
description="Stop Scheduled Play source.",
|
|
|
|
usage="scheduled_play_stop",
|
|
|
|
"scheduled_play_stop",
|
|
|
|
fun (s) -> begin log("streams.scheduled_play_stop") make_scheduled_play_unavailable() "Done." end)
|
2012-03-13 19:34:48 +01:00
|
|
|
server.register(namespace="streams",
|
2012-09-15 00:20:46 +02:00
|
|
|
description="Start Scheduled Play source.",
|
|
|
|
usage="scheduled_play_start",
|
|
|
|
"scheduled_play_start",
|
|
|
|
fun (s) -> begin log("streams.scheduled_play_start") make_scheduled_play_available() "Done." end)
|
2012-03-05 23:04:13 +01:00
|
|
|
|
2011-02-18 01:46:43 +01:00
|
|
|
if output_sound_device then
|
2011-12-02 19:36:59 +01:00
|
|
|
success = ref false
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-12-02 19:36:59 +01:00
|
|
|
log(output_sound_device_type)
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-12-02 19:36:59 +01:00
|
|
|
%ifdef output.alsa
|
2011-12-01 01:01:40 +01:00
|
|
|
if output_sound_device_type == "ALSA" then
|
2011-12-02 19:36:59 +01:00
|
|
|
ignore(output.alsa(s))
|
|
|
|
success := true
|
2011-12-01 01:01:40 +01:00
|
|
|
end
|
|
|
|
%endif
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-12-01 01:01:40 +01:00
|
|
|
%ifdef output.ao
|
|
|
|
if output_sound_device_type == "AO" then
|
2011-12-02 19:36:59 +01:00
|
|
|
ignore(output.ao(s))
|
|
|
|
success := true
|
2011-12-01 01:01:40 +01:00
|
|
|
end
|
|
|
|
%endif
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-12-01 01:01:40 +01:00
|
|
|
%ifdef output.oss
|
|
|
|
if output_sound_device_type == "OSS" then
|
2011-12-02 19:36:59 +01:00
|
|
|
ignore(output.oss(s))
|
|
|
|
success := true
|
2011-12-01 01:01:40 +01:00
|
|
|
end
|
|
|
|
%endif
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-12-01 01:01:40 +01:00
|
|
|
%ifdef output.portaudio
|
|
|
|
if output_sound_device_type == "Portaudio" then
|
2011-12-02 19:36:59 +01:00
|
|
|
ignore(output.portaudio(s))
|
|
|
|
success := true
|
2011-12-01 01:01:40 +01:00
|
|
|
end
|
|
|
|
%endif
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-12-01 01:01:40 +01:00
|
|
|
%ifdef output.pulseaudio
|
|
|
|
if output_sound_device_type == "Pulseaudio" then
|
2011-12-02 19:36:59 +01:00
|
|
|
ignore(output.pulseaudio(s))
|
|
|
|
success := true
|
2011-12-01 01:01:40 +01:00
|
|
|
end
|
|
|
|
%endif
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-12-02 19:36:59 +01:00
|
|
|
if (!success == false) then
|
|
|
|
ignore(output.prefered(s))
|
|
|
|
end
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-02-18 01:46:43 +01:00
|
|
|
end
|
2011-01-17 19:14:59 +01:00
|
|
|
|
2011-11-29 22:25:30 +01:00
|
|
|
if s1_enable == true then
|
2011-12-24 16:59:09 +01:00
|
|
|
if s1_output == 'shoutcast' then
|
|
|
|
s1_namespace := "shoutcast_stream_1"
|
|
|
|
else
|
|
|
|
s1_namespace := s1_mount
|
|
|
|
end
|
2012-08-20 20:40:46 +02:00
|
|
|
server.register(namespace=!s1_namespace, "connected", fun (s) -> begin log("#{!s1_namespace}.connected") !s1_connected end)
|
2012-09-18 23:22:14 +02:00
|
|
|
output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass,
|
|
|
|
s1_mount, s1_url, s1_description, s1_genre, s1_user, s, "1",
|
2012-08-29 23:39:24 +02:00
|
|
|
s1_connected, s1_name, s1_channels)
|
2011-02-18 01:46:43 +01:00
|
|
|
end
|
2011-01-26 23:08:30 +01:00
|
|
|
|
2011-11-29 22:25:30 +01:00
|
|
|
if s2_enable == true then
|
2011-12-24 16:59:09 +01:00
|
|
|
if s2_output == 'shoutcast' then
|
|
|
|
s2_namespace := "shoutcast_stream_2"
|
|
|
|
else
|
|
|
|
s2_namespace := s2_mount
|
|
|
|
end
|
2012-08-20 20:40:46 +02:00
|
|
|
server.register(namespace=!s2_namespace, "connected", fun (s) -> begin log("#{!s2_namespace}.connected") !s2_connected end)
|
2012-09-18 23:22:14 +02:00
|
|
|
output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass,
|
|
|
|
s2_mount, s2_url, s2_description, s2_genre, s2_user, s, "2",
|
2012-08-29 23:39:24 +02:00
|
|
|
s2_connected, s2_name, s2_channels)
|
2012-09-18 23:22:14 +02:00
|
|
|
|
2011-06-20 23:34:16 +02:00
|
|
|
end
|
2011-05-25 19:58:50 +02:00
|
|
|
|
2011-11-29 22:25:30 +01:00
|
|
|
if s3_enable == true then
|
2011-12-24 16:59:09 +01:00
|
|
|
if s3_output == 'shoutcast' then
|
|
|
|
s3_namespace := "shoutcast_stream_3"
|
|
|
|
else
|
|
|
|
s3_namespace := s3_mount
|
|
|
|
end
|
2012-08-20 20:40:46 +02:00
|
|
|
server.register(namespace=!s3_namespace, "connected", fun (s) -> begin log("#{!s3_namespace}.connected") !s3_connected end)
|
2012-09-18 23:22:14 +02:00
|
|
|
output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass,
|
2017-03-12 17:03:30 +01:00
|
|
|
s3_mount, s3_url, s3_description, s3_genre, s3_user, s, "3",
|
|
|
|
s3_connected, s3_name, s3_channels)
|
2011-02-18 01:46:43 +01:00
|
|
|
end
|
2011-06-20 23:34:16 +02:00
|
|
|
|
2015-03-10 17:52:00 +01:00
|
|
|
s4_namespace = ref ''
|
2015-03-03 22:08:53 +01:00
|
|
|
if s4_enable == true then
|
2015-03-11 00:15:38 +01:00
|
|
|
log("Stream 4 Enabled")
|
2015-03-03 22:08:53 +01:00
|
|
|
if s4_output == 'shoutcast' then
|
|
|
|
s4_namespace := "shoutcast_stream_4"
|
|
|
|
else
|
|
|
|
s4_namespace := s4_mount
|
|
|
|
end
|
|
|
|
server.register(namespace=!s4_namespace, "connected", fun (s) -> begin log("#{!s4_namespace}.connected") !s4_connected end)
|
|
|
|
output_to(s4_output, s4_type, s4_bitrate, s4_host, s4_port, s4_pass,
|
|
|
|
s4_mount, s4_url, s4_name, s4_genre, s4_user, s, "4",
|
|
|
|
s4_connected, s4_description, s4_channels)
|
|
|
|
end
|
2015-03-10 17:41:45 +01:00
|
|
|
|
2015-03-03 22:08:53 +01:00
|
|
|
|
2022-01-17 10:51:32 +01:00
|
|
|
gateway("started")
|