From 0b859218c3166a70022df95d8be7859b998609cd Mon Sep 17 00:00:00 2001 From: David Trattnig <david.trattnig@o94.at> Date: Thu, 19 Mar 2020 18:13:43 +0100 Subject: [PATCH] More channels and updated naming of channels. --- modules/liquidsoap.1.3.3/engine.liq | 84 -------- modules/liquidsoap.1.3.3/in_filesystem.liq | 29 --- modules/liquidsoap.1.3.3/in_soundcard.liq | 48 ----- modules/liquidsoap.1.3.3/in_stream.liq | 29 --- modules/liquidsoap.1.3.3/out_filesystem.liq | 98 ---------- modules/liquidsoap.1.3.3/out_soundcard.liq | 49 ----- modules/liquidsoap.1.3.3/out_stream.liq | 130 ------------- modules/liquidsoap.1.3.3/serverfunctions.liq | 195 ------------------- modules/liquidsoap/engine.liq | 5 +- modules/liquidsoap/in_filesystem.liq | 7 +- modules/liquidsoap/in_soundcard.liq | 12 +- modules/liquidsoap/in_stream.liq | 4 +- modules/liquidsoap/out_filesystem.liq | 10 +- modules/liquidsoap/out_soundcard.liq | 14 +- modules/liquidsoap/out_stream.liq | 20 +- modules/liquidsoap/serverfunctions.liq | 54 ++++- 16 files changed, 90 insertions(+), 698 deletions(-) delete mode 100644 modules/liquidsoap.1.3.3/engine.liq delete mode 100644 modules/liquidsoap.1.3.3/in_filesystem.liq delete mode 100644 modules/liquidsoap.1.3.3/in_soundcard.liq delete mode 100644 modules/liquidsoap.1.3.3/in_stream.liq delete mode 100644 modules/liquidsoap.1.3.3/out_filesystem.liq delete mode 100644 modules/liquidsoap.1.3.3/out_soundcard.liq delete mode 100644 modules/liquidsoap.1.3.3/out_stream.liq delete mode 100644 modules/liquidsoap.1.3.3/serverfunctions.liq diff --git a/modules/liquidsoap.1.3.3/engine.liq b/modules/liquidsoap.1.3.3/engine.liq deleted file mode 100644 index 552b86fd..00000000 --- a/modules/liquidsoap.1.3.3/engine.liq +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/liquidsoap - -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -icecast_vorbis_metadata = false -inputs = ref [] - -# load settings from ini file -%include "settings.liq" - -# include some functions -%include "library.liq" - -# include fallback functions -%include "fallback.liq" - -################# -# create inputs # -################# - -# enable play from filesystem -%include "in_filesystem.liq" - -# enable stream overtakes -%include "in_stream.liq" - -# enabled line in from soundcard -%include "in_soundcard.liq" - -# fill the mixer -mixer = mix(id="mixer", list.append([input_filesystem_0, input_filesystem_1, input_filesystem_2, input_filesystem_3, input_filesystem_4, input_http_0, input_http_1], !inputs)) - - -# output source with fallbacks -stripped_stream = strip_blank(id='strip_blank', track_sensitive=false, max_blank=fallback_max_blank, min_noise=fallback_min_noise, threshold=fallback_threshold, mixer) - -# enable fallback -output_source = fallback(id="fallback", track_sensitive=false, [stripped_stream, timeslot_fallback, show_fallback, mksafe(station_fallback)]) - -################## -# create outputs # -################## - -# create soundcard output -%include "out_soundcard.liq" - -# recording output -%include "out_filesystem.liq" - -# stream output -%include "out_stream.liq" - -# enable socket functions -%include "serverfunctions.liq" - -######################## -# start initialization # -######################## - -system('#{list.assoc("install_dir", ini)}/guru.py --init-player --quiet') - - diff --git a/modules/liquidsoap.1.3.3/in_filesystem.liq b/modules/liquidsoap.1.3.3/in_filesystem.liq deleted file mode 100644 index 24a2bb96..00000000 --- a/modules/liquidsoap.1.3.3/in_filesystem.liq +++ /dev/null @@ -1,29 +0,0 @@ -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -input_filesystem_0 = request.equeue(id="in_filesystem_0") -input_filesystem_1 = request.equeue(id="in_filesystem_1") -input_filesystem_2 = request.equeue(id="in_filesystem_2") -input_filesystem_3 = request.equeue(id="in_filesystem_3") -input_filesystem_4 = request.equeue(id="in_filesystem_4") \ No newline at end of file diff --git a/modules/liquidsoap.1.3.3/in_soundcard.liq b/modules/liquidsoap.1.3.3/in_soundcard.liq deleted file mode 100644 index 27ef9911..00000000 --- a/modules/liquidsoap.1.3.3/in_soundcard.liq +++ /dev/null @@ -1,48 +0,0 @@ -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -if a0_in != "" then - # we can ignore the result, since it is stored in the list 'inputs' - set_input(a0_in, "linein_0") -end - -if a1_in != "" then - ignore(set_input(a1_in, "linein_1")) -end - -if a2_in != "" then - ignore(set_input(a2_in, "linein_2")) -end - -if a3_in != "" then - ignore(set_input(a3_in, "linein_3")) -end - -if a4_in != "" then - ignore(set_input(a4_in, "linein_4")) - -# input_4 = ref output.dummy(blank()) -# set_input(input_4, a4_in, "linein_4") -# inputs := list.append([!input_4], !inputs) -end \ No newline at end of file diff --git a/modules/liquidsoap.1.3.3/in_stream.liq b/modules/liquidsoap.1.3.3/in_stream.liq deleted file mode 100644 index 05840c0b..00000000 --- a/modules/liquidsoap.1.3.3/in_stream.liq +++ /dev/null @@ -1,29 +0,0 @@ -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -# this is overwritten as soon as a streamovertake is programmed, but liquidsoap needs it to initialize this input -starturl = "http://stream.fro.at/fro-128.ogg" - -input_http_0 = input.http(id="in_http_0", starturl) -input_http_1 = input.http(id="in_http_1", starturl) \ No newline at end of file diff --git a/modules/liquidsoap.1.3.3/out_filesystem.liq b/modules/liquidsoap.1.3.3/out_filesystem.liq deleted file mode 100644 index b6dd0657..00000000 --- a/modules/liquidsoap.1.3.3/out_filesystem.liq +++ /dev/null @@ -1,98 +0,0 @@ -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -r0_enable = list.assoc(default="", "rec_0", ini) == "y" -r1_enable = list.assoc(default="", "rec_1", ini) == "y" -r2_enable = list.assoc(default="", "rec_2", ini) == "y" -r3_enable = list.assoc(default="", "rec_3", ini) == "y" -r4_enable = list.assoc(default="", "rec_4", ini) == "y" - -r0_folder = list.assoc(default="", "rec_0_folder", ini) -r0_duration = int_of_string(list.assoc(default="", "rec_0_duration", ini)) -r0_encoding = list.assoc(default="", "rec_0_encoding", ini) -r0_bitrate = int_of_string(list.assoc(default="", "rec_0_bitrate", ini)) -r0_channels = list.assoc(default="", "rec_0_channels", ini) -r0_filenamepattern = r0_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r0_encoding - -r1_folder = list.assoc(default="", "rec_1_folder", ini) -r1_duration = int_of_string(list.assoc(default="", "rec_1_duration", ini)) -r1_encoding = list.assoc(default="", "rec_1_encoding", ini) -r1_bitrate = int_of_string(list.assoc(default="", "rec_1_bitrate", ini)) -r1_channels = list.assoc(default="", "rec_1_channels", ini) -r1_filenamepattern = r1_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r1_encoding - -r2_folder = list.assoc(default="", "rec_2_folder", ini) -r2_duration = int_of_string(list.assoc(default="", "rec_2_duration", ini)) -r2_encoding = list.assoc(default="", "rec_2_encoding", ini) -r2_bitrate = int_of_string(list.assoc(default="", "rec_2_bitrate", ini)) -r2_channels = list.assoc(default="", "rec_2_channels", ini) -r2_filenamepattern = r2_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r2_encoding - -r3_folder = list.assoc(default="", "rec_3_folder", ini) -r3_duration = int_of_string(list.assoc(default="", "rec_3_duration", ini)) -r3_encoding = list.assoc(default="", "rec_3_encoding", ini) -r3_bitrate = int_of_string(list.assoc(default="", "rec_3_bitrate", ini)) -r3_channels = list.assoc(default="", "rec_3_channels", ini) -r3_filenamepattern = r3_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r3_encoding - -r4_folder = list.assoc(default="", "rec_4_folder", ini) -r4_duration = int_of_string(list.assoc(default="", "rec_4_duration", ini)) -r4_encoding = list.assoc(default="", "rec_4_encoding", ini) -r4_bitrate = int_of_string(list.assoc(default="", "rec_4_bitrate", ini)) -r4_channels = list.assoc(default="", "rec_4_channels", ini) -r4_filenamepattern = r4_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r4_encoding - -r0_is_recording = ref false -r1_is_recording = ref false -r2_is_recording = ref false -r3_is_recording = ref false -r4_is_recording = ref false - -if r0_enable == true then - # enable recording status for that recorder - server.register(namespace="out_filesystem_0", "recording", fun (s) -> begin if !r0_is_recording == false then "false" else "true" end end) - - # start the recorder - start_recorder(r0_folder, r0_duration, r0_encoding, r0_bitrate, r0_channels, r0_filenamepattern, r0_is_recording, output_source, "0") -end - -if r1_enable == true then - server.register(namespace="out_filesystem_1", "recording", fun (s) -> begin if !r1_is_recording == false then "false" else "true" end end) - start_recorder(r1_folder, r1_duration, r1_encoding, r1_bitrate, r1_channels, r1_filenamepattern, r1_is_recording, output_source, "1") -end - -if r2_enable == true then - server.register(namespace="out_filesystem_2", "recording", fun (s) -> begin if !r2_is_recording == false then "false" else "true" end end) - start_recorder(r2_folder, r2_duration, r2_encoding, r2_bitrate, r2_channels, r2_filenamepattern, r2_is_recording, output_source, "2") -end - -if r3_enable == true then - server.register(namespace="out_filesystem_3", "recording", fun (s) -> begin if !r3_is_recording == false then "false" else "true" end end) - start_recorder(r3_folder, r3_duration, r3_encoding, r3_bitrate, r3_channels, r3_filenamepattern, r3_is_recording, output_source, "3") -end - -if r4_enable == true then - server.register(namespace="out_filesystem_4", "recording", fun (s) -> begin if !r4_is_recording == false then "false" else "true" end end) - start_recorder(r4_folder, r4_duration, r4_encoding, r4_bitrate, r4_channels, r4_filenamepattern, r4_is_recording, output_source, "4") -end \ No newline at end of file diff --git a/modules/liquidsoap.1.3.3/out_soundcard.liq b/modules/liquidsoap.1.3.3/out_soundcard.liq deleted file mode 100644 index 2a3f09d2..00000000 --- a/modules/liquidsoap.1.3.3/out_soundcard.liq +++ /dev/null @@ -1,49 +0,0 @@ -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -if a0_out != "" then - ignore(get_output(output_source, a0_out, "lineout_0")) -end - -if a1_out != "" then - ignore(get_output(output_source, a1_out, "lineout_1")) -end - -if a2_out != "" then - ignore(get_output(output_source, a2_out, "lineout_2")) -end - -if a3_out != "" then - ignore(get_output(output_source, a3_out, "lineout_3")) -end - -if a4_out != "" then - ignore(get_output(output_source, a4_out, "lineout_4")) - - #output_4 = ref output.dummy(blank()) - #get_output(output_4, output_source, a4_out, "lineout_4") - - #output_4 := get_output(output_source, a4_out, "lineout_4") - #get_output(output_source, a4_out, "aura_lineout_4") -end diff --git a/modules/liquidsoap.1.3.3/out_stream.liq b/modules/liquidsoap.1.3.3/out_stream.liq deleted file mode 100644 index de40fb9f..00000000 --- a/modules/liquidsoap.1.3.3/out_stream.liq +++ /dev/null @@ -1,130 +0,0 @@ -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -# Output streaming settings -# What a mess... -s0_enable = list.assoc(default="", "stream_0", ini) == "y" -s1_enable = list.assoc(default="", "stream_1", ini) == "y" -s2_enable = list.assoc(default="", "stream_2", ini) == "y" -s3_enable = list.assoc(default="", "stream_3", ini) == "y" -s4_enable = list.assoc(default="", "stream_4", ini) == "y" - -s0_encoding = list.assoc(default="", "stream_0_encoding", ini) -s0_bitrate = int_of_string(list.assoc(default="", "stream_0_bitrate", ini)) -s0_host = list.assoc(default="", "stream_0_host", ini) -s0_port = int_of_string(list.assoc(default="", "stream_0_port", ini)) -s0_user = list.assoc(default="", "stream_0_user", ini) -s0_pass = list.assoc(default="", "stream_0_password", ini) -s0_mount = list.assoc(default="", "stream_0_mountpoint", ini) -s0_url = list.assoc(default="", "stream_0_displayurl", ini) -s0_desc = list.assoc(default="", "stream_0_description", ini) -s0_genre = list.assoc(default="", "stream_0_genre", ini) -s0_name = list.assoc(default="", "stream_0_name", ini) -s0_channels = list.assoc(default="", "stream_0_channels", ini) - -s1_encoding = list.assoc(default="", "stream_1_encoding", ini) -s1_bitrate = int_of_string(list.assoc(default="", "stream_1_bitrate", ini)) -s1_host = list.assoc(default="", "stream_1_host", ini) -s1_port = int_of_string(list.assoc(default="", "stream_1_port", ini)) -s1_user = list.assoc(default="", "stream_1_user", ini) -s1_pass = list.assoc(default="", "stream_1_password", ini) -s1_mount = list.assoc(default="", "stream_1_mountpoint", ini) -s1_url = list.assoc(default="", "stream_1_displayurl", ini) -s1_desc = list.assoc(default="", "stream_1_description", ini) -s1_genre = list.assoc(default="", "stream_1_genre", ini) -s1_name = list.assoc(default="", "stream_1_name", ini) -s1_channels = list.assoc(default="", "stream_1_channels", ini) - -s2_encoding = list.assoc(default="", "stream_2_encoding", ini) -s2_bitrate = int_of_string(list.assoc(default="", "stream_2_bitrate", ini)) -s2_host = list.assoc(default="", "stream_2_host", ini) -s2_port = int_of_string(list.assoc(default="", "stream_2_port", ini)) -s2_user = list.assoc(default="", "stream_2_user", ini) -s2_pass = list.assoc(default="", "stream_2_password", ini) -s2_mount = list.assoc(default="", "stream_2_mountpoint", ini) -s2_url = list.assoc(default="", "stream_2_displayurl", ini) -s2_desc = list.assoc(default="", "stream_2_description", ini) -s2_genre = list.assoc(default="", "stream_2_genre", ini) -s2_name = list.assoc(default="", "stream_2_name", ini) -s2_channels = list.assoc(default="", "stream_2_channels", ini) - -s3_encoding = list.assoc(default="", "stream_3_encoding", ini) -s3_bitrate = int_of_string(list.assoc(default="", "stream_3_bitrate", ini)) -s3_host = list.assoc(default="", "stream_3_host", ini) -s3_port = int_of_string(list.assoc(default="", "stream_3_port", ini)) -s3_user = list.assoc(default="", "stream_3_user", ini) -s3_pass = list.assoc(default="", "stream_3_password", ini) -s3_mount = list.assoc(default="", "stream_3_mountpoint", ini) -s3_url = list.assoc(default="", "stream_3_displayurl", ini) -s3_desc = list.assoc(default="", "stream_3_description", ini) -s3_genre = list.assoc(default="", "stream_3_genre", ini) -s3_name = list.assoc(default="", "stream_3_name", ini) -s3_channels = list.assoc(default="", "stream_3_channels", ini) - -s4_encoding = list.assoc(default="", "stream_4_encoding", ini) -s4_bitrate = int_of_string(list.assoc(default="", "stream_4_bitrate", ini)) -s4_host = list.assoc(default="", "stream_4_host", ini) -s4_port = int_of_string(list.assoc(default="", "stream_4_port", ini)) -s4_user = list.assoc(default="", "stream_4_user", ini) -s4_pass = list.assoc(default="", "stream_4_password", ini) -s4_mount = list.assoc(default="", "stream_4_mountpoint", ini) -s4_url = list.assoc(default="", "stream_4_displayurl", ini) -s4_desc = list.assoc(default="", "stream_4_description", ini) -s4_genre = list.assoc(default="", "stream_4_genre", ini) -s4_name = list.assoc(default="", "stream_4_name", ini) -s4_channels = list.assoc(default="", "stream_4_channels", ini) - -s0_connected = ref '' -s1_connected = ref '' -s2_connected = ref '' -s3_connected = ref '' -s4_connected = ref '' - -if s0_enable == true then - # enable connection status for that stream - server.register(namespace="out_http_0", "connected", fun (s) -> begin !s0_connected end) - - # aaand stream - stream_to_icecast("out_http_0", s0_encoding, s0_bitrate, s0_host, s0_port, s0_pass, s0_mount, s0_url, s0_desc, s0_genre, s0_user, output_source, "0", s0_connected, s0_name, s0_channels) -end - -if s1_enable == true then - server.register(namespace="out_http_1", "connected", fun (s) -> begin !s1_connected end) - stream_to_icecast("out_http_1", s1_encoding, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_desc, s1_genre, s1_user, output_source, "1", s1_connected, s1_name, s1_channels) -end - -if s2_enable == true then - server.register(namespace="out_http_2", "connected", fun (s) -> begin !s2_connected end) - stream_to_icecast("out_http_2", s2_encoding, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_desc, s2_genre, s2_user, output_source, "2", s2_connected, s2_name, s2_channels) -end - -if s3_enable == true then - server.register(namespace="out_http_3", "connected", fun (s) -> begin !s3_connected end) - stream_to_icecast("out_http_3", s3_encoding, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_desc, s3_genre, s3_user, output_source, "3", s3_connected, s3_name, s3_channels) -end - -if s4_enable == true then - server.register(namespace="out_http_4", "connected", fun (s) -> begin !s4_connected end) - stream_to_icecast("out_http_4", s4_encoding, s4_bitrate, s4_host, s4_port, s4_pass, s4_mount, s4_url, s4_desc, s4_genre, s4_user, output_source, "4", s4_connected, s4_name, s4_channels) -end diff --git a/modules/liquidsoap.1.3.3/serverfunctions.liq b/modules/liquidsoap.1.3.3/serverfunctions.liq deleted file mode 100644 index 27bbd103..00000000 --- a/modules/liquidsoap.1.3.3/serverfunctions.liq +++ /dev/null @@ -1,195 +0,0 @@ -# -# engine -# -# Playout Daemon for autoradio project -# -# -# Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> -# -# This file is part of engine. -# -# engine is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# engine is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with engine. If not, see <http://www.gnu.org/licenses/>. -# - -# shutdown server function -#server.register(namespace='server', -# description="shutdown server", -# usage="stop", -# "stop", -# fun(x,y) -> shutdown ) - - - -# -# to reduce complexity of lqs => query 'mixer.inputs' over socket and parse it in python -#server.register(namespace="auraengine", -# "enabled_lineins", -# fun (s) -> begin -# log("auraengine.enabled_lineins") -# "0:#{!linein_0_enabled}, 1:#{!linein_1_enabled}, 2:#{!linein_2_enabled}, 3:#{!linein_3_enabled}, 4:#{!linein_4_enabled}" -# end -#) - -#server.register(namespace="auraengine", -# "enabled_lineouts", -# fun(s) -> begin -# log("auraengine.enabled_lineouts") -# "0:#{!lineout_0_enabled}, 1:#{!lineout_1_enabled}, 2:#{!lineout_2_enabled}, 3:#{!lineout_3_enabled}, 4:#{!lineout_4_enabled}" -# end -#) - -# are outgoing streams connected? -server.register(namespace="auraengine", - description="returns if outgoing streams are connected", - usage="out_streams_connected", - "out_streams_connected", - fun (s) -> begin - log("streams.connection_status") - "0:#{!s0_connected}, 1:#{!s1_connected}, 2:#{!s2_connected}, 3:#{!s3_connected}, 4:#{!s4_connected}" - end -) - -# return a state of the inputs/outputs of the soundserver as JSON -server.register(namespace = "auraengine", - description="returns enabled lineouts/lineins, connected outgoing streams, and recorder. Also returns fallbacksettings.", - usage="state", - "state", - fun(s) -> begin - log("auraengine.state") - - ret = '{' - ret = ret^'"streams": {' - ret = ret^'"stream_0": {"enabled": #{s0_enable}, "connected": #{!s0_connected}},' - ret = ret^'"stream_1": {"enabled": #{s1_enable}, "connected": #{!s1_connected}},' - ret = ret^'"stream_2": {"enabled": #{s2_enable}, "connected": #{!s2_connected}},' - ret = ret^'"stream_3": {"enabled": #{s3_enable}, "connected": #{!s3_connected}},' - ret = ret^'"stream_4": {"enabled": #{s4_enable}, "connected": #{!s4_connected}}' - ret = ret^'},' - ret = ret^'"recorder": {' - ret = ret^'"recorder_0": {"enabled": #{r0_enable}, "recording": #{!r0_is_recording}},' - ret = ret^'"recorder_1": {"enabled": #{r1_enable}, "recording": #{!r1_is_recording}},' - ret = ret^'"recorder_2": {"enabled": #{r2_enable}, "recording": #{!r2_is_recording}},' - ret = ret^'"recorder_3": {"enabled": #{r3_enable}, "recording": #{!r3_is_recording}},' - ret = ret^'"recorder_4": {"enabled": #{r4_enable}, "recording": #{!r4_is_recording}}' - ret = ret^'},' - ret = ret^'"linein": {' - ret = ret^'"linein_0": {"enabled": #{a0_in != ""}},' - ret = ret^'"linein_1": {"enabled": #{a1_in != ""}},' - ret = ret^'"linein_2": {"enabled": #{a2_in != ""}},' - ret = ret^'"linein_3": {"enabled": #{a3_in != ""}},' - ret = ret^'"linein_4": {"enabled": #{a4_in != ""}}' - ret = ret^'},' - ret = ret^'"lineout": {' - ret = ret^'"lineout_0": {"enabled": #{a0_out != ""}},' - ret = ret^'"lineout_1": {"enabled": #{a1_out != ""}},' - ret = ret^'"lineout_2": {"enabled": #{a2_out != ""}},' - ret = ret^'"lineout_3": {"enabled": #{a3_out != ""}},' - ret = ret^'"lineout_4": {"enabled": #{a4_out != ""}}' - ret = ret^'}' - ret = ret^'}' - ret - - # outgoing streams enabled? - #ret = "stream_0_enabled:#{!s0_enable}, stream_1_enabled:#{!s1_enable}, stream_2_enabled:#{!s2_enable}, stream_3_enabled:#{!s3_enable}, stream_4_enabled:#{!s4_enable}, " - # outgoing recorder enabled - #ret = ret^"recorder_0_enabled:#{r0_enable}, recorder_1_enabled:#{r1_enable}, recorder_2_enabled:#{r2_enable}, recorder_3_enabled:#{r3_enable}, recorder_4_enabled:#{r4_enable}, " - #ret = ret^"linein_0_enabled:#{a0_in != ''}, linein_1_enabled:#{a1_in != ''}, linein_2_enabled:#{a2_in != ''}, linein_3_enabled:#{a3_in != ''}, linein_4_enabled:#{a4_in != ''}, " - #ret = ret^"lineout_0_enabled:#{a0_out != ''}, lineout_1_enabled:#{a1_out != ''}, lineout_2_enabled:#{a2_out != ''}, lineout_3_enabled:#{a3_out != ''}, lineout_4_enabled:#{a4_out != ''}, " - #ret = ret^"fallback_max_blank:#{fallback_max_blank}, fallback_min_noise:#{fallback_min_noise}, fallback_threshold:#{fallback_threshold}" - - end -) - -# enable the seek function for the input from the filesystem -server.register(namespace = source.id(input_filesystem_0), - description="seek to relative position in #{source.id(input_filesystem_0)}", - usage = "seek <duration in seconds>", - "seek", - fun(t) -> begin - log("Seeking #{t} sec") - t = float_of_string(default=0.,t) - ret = source.seek(input_filesystem_0, t) - "Seeked #{ret} seconds." - end -) - -server.register(namespace = source.id(input_filesystem_1), - description="seek to relative position in #{source.id(input_filesystem_1)}", - usage = "seek <duration in seconds>", - "seek", - fun(t) -> begin - log("Seeking #{t} sec") - t = float_of_string(default=0.,t) - ret = source.seek(input_filesystem_1, t) - "Seeked #{ret} seconds." - end -) - -server.register(namespace = source.id(input_filesystem_2), - description="seek to relative position in #{source.id(input_filesystem_2)}", - usage = "seek <duration in seconds>", - "seek", - fun(t) -> begin - log("Seeking #{t} sec") - t = float_of_string(default=0.,t) - ret = source.seek(input_filesystem_2, t) - "Seeked #{ret} seconds." - end -) - -server.register(namespace = source.id(input_filesystem_3), - description="seek to relative position in #{source.id(input_filesystem_3)}", - usage = "seek <duration in seconds>", - "seek", - fun(t) -> begin - log("Seeking #{t} sec") - t = float_of_string(default=0.,t) - ret = source.seek(input_filesystem_3, t) - "Seeked #{ret} seconds." - end -) - -server.register(namespace = source.id(input_filesystem_4), - description="seek to relative position in #{source.id(input_filesystem_4)}", - usage = "seek <duration in seconds>", - "seek", - fun(t) -> begin - log("Seeking #{t} sec") - t = float_of_string(default=0.,t) - ret = source.seek(input_filesystem_4, t) - "Seeked #{ret} seconds." - end -) - -def fadeTo(source_number) = - if source_number == "" then - print(source_number) - "Usage: mixer.fadeto <source nb> #{source_number}" - else - r = server.execute("mixer.select #{source_number} true") - print(r) - "Donee!" - end -end - -# enable fadeTo for the mixer -server.register(namespace = "mixer", - description = "is fading from one mixer input to another", - usage = "fadeto <source number>", - "fadeto", - fadeTo -) - -ignore(fade_in_time) -ignore(fade_out_time) \ No newline at end of file diff --git a/modules/liquidsoap/engine.liq b/modules/liquidsoap/engine.liq index b2811d24..23bf55fc 100644 --- a/modules/liquidsoap/engine.liq +++ b/modules/liquidsoap/engine.liq @@ -50,10 +50,11 @@ inputs = ref [] %include "in_soundcard.liq" # fill the mixer -mixer = mix(id="mixer", list.append([input_fs, input_http], !inputs)) +mixer = mix(id="mixer", list.append([input_filesystem_0, input_filesystem_1, input_filesystem_2, input_filesystem_3, input_filesystem_4, input_http_0, input_http_1], !inputs)) + # output source with fallbacks -stripped_stream = strip_blank(track_sensitive=false, max_blank=fallback_max_blank, min_noise=fallback_min_noise, threshold=fallback_threshold, mixer) +stripped_stream = strip_blank(id='strip_blank', track_sensitive=false, max_blank=fallback_max_blank, min_noise=fallback_min_noise, threshold=fallback_threshold, mixer) # enable fallback output_source = fallback(id="fallback", track_sensitive=false, [stripped_stream, timeslot_fallback, show_fallback, mksafe(station_fallback)]) diff --git a/modules/liquidsoap/in_filesystem.liq b/modules/liquidsoap/in_filesystem.liq index 127022ef..04821c8e 100644 --- a/modules/liquidsoap/in_filesystem.liq +++ b/modules/liquidsoap/in_filesystem.liq @@ -22,8 +22,11 @@ # along with engine. If not, see <http://www.gnu.org/licenses/>. # -# a hard one -input_fs = request.equeue(id="fs") +input_filesystem_0 = request.equeue(id="in_filesystem_0") +input_filesystem_1 = request.equeue(id="in_filesystem_1") +input_filesystem_2 = request.equeue(id="in_filesystem_2") +input_filesystem_3 = request.equeue(id="in_filesystem_3") +input_filesystem_4 = request.equeue(id="in_filesystem_4") #input_fs = cue_cut(mksafe(request.equeue(id="fs"))) diff --git a/modules/liquidsoap/in_soundcard.liq b/modules/liquidsoap/in_soundcard.liq index 0289a3b0..27ef9911 100644 --- a/modules/liquidsoap/in_soundcard.liq +++ b/modules/liquidsoap/in_soundcard.liq @@ -24,25 +24,25 @@ if a0_in != "" then # we can ignore the result, since it is stored in the list 'inputs' - set_input(a0_in, "aura_linein_0") + set_input(a0_in, "linein_0") end if a1_in != "" then - ignore(set_input(a1_in, "aura_linein_1")) + ignore(set_input(a1_in, "linein_1")) end if a2_in != "" then - ignore(set_input(a2_in, "aura_linein_2")) + ignore(set_input(a2_in, "linein_2")) end if a3_in != "" then - ignore(set_input(a3_in, "aura_linein_3")) + ignore(set_input(a3_in, "linein_3")) end if a4_in != "" then - ignore(set_input(a4_in, "aura_linein_4")) + ignore(set_input(a4_in, "linein_4")) # input_4 = ref output.dummy(blank()) -# set_input(input_4, a4_in, "aura_linein_4") +# set_input(input_4, a4_in, "linein_4") # inputs := list.append([!input_4], !inputs) end \ No newline at end of file diff --git a/modules/liquidsoap/in_stream.liq b/modules/liquidsoap/in_stream.liq index 5487d06d..a522ea35 100644 --- a/modules/liquidsoap/in_stream.liq +++ b/modules/liquidsoap/in_stream.liq @@ -27,7 +27,9 @@ #starturl = "http://trance.out.airtime.pro:8000/trance_a" starturl = "http://chill.out.airtime.pro:8000/chill_a" -input_http = input.http(buffer=10.0, max=60.0, timeout=60.0, id="http", starturl) + +input_http_0 = input.http(id="in_http_0", buffer=10.0, max=60.0, timeout=60.0, starturl) +input_http_1 = input.http(id="in_http_1", buffer=10.0, max=60.0, timeout=60.0, starturl) # Route input stream to an dummy output to avoid buffer-overrun messages output.dummy(id="DUMMY_STREAM_OUTPUT", fallible=true, input_http) \ No newline at end of file diff --git a/modules/liquidsoap/out_filesystem.liq b/modules/liquidsoap/out_filesystem.liq index 9e9022ee..b6dd0657 100644 --- a/modules/liquidsoap/out_filesystem.liq +++ b/modules/liquidsoap/out_filesystem.liq @@ -71,28 +71,28 @@ r4_is_recording = ref false if r0_enable == true then # enable recording status for that recorder - server.register(namespace="recorder_0", "recording", fun (s) -> begin if !r0_is_recording == false then "false" else "true" end end) + server.register(namespace="out_filesystem_0", "recording", fun (s) -> begin if !r0_is_recording == false then "false" else "true" end end) # start the recorder start_recorder(r0_folder, r0_duration, r0_encoding, r0_bitrate, r0_channels, r0_filenamepattern, r0_is_recording, output_source, "0") end if r1_enable == true then - server.register(namespace="recorder_1", "recording", fun (s) -> begin if !r1_is_recording == false then "false" else "true" end end) + server.register(namespace="out_filesystem_1", "recording", fun (s) -> begin if !r1_is_recording == false then "false" else "true" end end) start_recorder(r1_folder, r1_duration, r1_encoding, r1_bitrate, r1_channels, r1_filenamepattern, r1_is_recording, output_source, "1") end if r2_enable == true then - server.register(namespace="recorder_2", "recording", fun (s) -> begin if !r2_is_recording == false then "false" else "true" end end) + server.register(namespace="out_filesystem_2", "recording", fun (s) -> begin if !r2_is_recording == false then "false" else "true" end end) start_recorder(r2_folder, r2_duration, r2_encoding, r2_bitrate, r2_channels, r2_filenamepattern, r2_is_recording, output_source, "2") end if r3_enable == true then - server.register(namespace="recorder_3", "recording", fun (s) -> begin if !r3_is_recording == false then "false" else "true" end end) + server.register(namespace="out_filesystem_3", "recording", fun (s) -> begin if !r3_is_recording == false then "false" else "true" end end) start_recorder(r3_folder, r3_duration, r3_encoding, r3_bitrate, r3_channels, r3_filenamepattern, r3_is_recording, output_source, "3") end if r4_enable == true then - server.register(namespace="recorder_4", "recording", fun (s) -> begin if !r4_is_recording == false then "false" else "true" end end) + server.register(namespace="out_filesystem_4", "recording", fun (s) -> begin if !r4_is_recording == false then "false" else "true" end end) start_recorder(r4_folder, r4_duration, r4_encoding, r4_bitrate, r4_channels, r4_filenamepattern, r4_is_recording, output_source, "4") end \ No newline at end of file diff --git a/modules/liquidsoap/out_soundcard.liq b/modules/liquidsoap/out_soundcard.liq index 1f9d85d3..2a3f09d2 100644 --- a/modules/liquidsoap/out_soundcard.liq +++ b/modules/liquidsoap/out_soundcard.liq @@ -23,27 +23,27 @@ # if a0_out != "" then - ignore(get_output(output_source, a0_out, "aura_lineout_0")) + ignore(get_output(output_source, a0_out, "lineout_0")) end if a1_out != "" then - ignore(get_output(output_source, a1_out, "aura_lineout_1")) + ignore(get_output(output_source, a1_out, "lineout_1")) end if a2_out != "" then - ignore(get_output(output_source, a2_out, "aura_lineout_2")) + ignore(get_output(output_source, a2_out, "lineout_2")) end if a3_out != "" then - ignore(get_output(output_source, a3_out, "aura_lineout_3")) + ignore(get_output(output_source, a3_out, "lineout_3")) end if a4_out != "" then - ignore(get_output(output_source, a4_out, "aura_lineout_4")) + ignore(get_output(output_source, a4_out, "lineout_4")) #output_4 = ref output.dummy(blank()) - #get_output(output_4, output_source, a4_out, "aura_lineout_4") + #get_output(output_4, output_source, a4_out, "lineout_4") - #output_4 := get_output(output_source, a4_out, "aura_lineout_4") + #output_4 := get_output(output_source, a4_out, "lineout_4") #get_output(output_source, a4_out, "aura_lineout_4") end diff --git a/modules/liquidsoap/out_stream.liq b/modules/liquidsoap/out_stream.liq index baa87a9e..de40fb9f 100644 --- a/modules/liquidsoap/out_stream.liq +++ b/modules/liquidsoap/out_stream.liq @@ -103,28 +103,28 @@ s4_connected = ref '' if s0_enable == true then # enable connection status for that stream - server.register(namespace="stream_0", "connected", fun (s) -> begin !s0_connected end) + server.register(namespace="out_http_0", "connected", fun (s) -> begin !s0_connected end) # aaand stream - stream_to_icecast("stream_0", s0_encoding, s0_bitrate, s0_host, s0_port, s0_pass, s0_mount, s0_url, s0_desc, s0_genre, s0_user, output_source, "0", s0_connected, s0_name, s0_channels) + stream_to_icecast("out_http_0", s0_encoding, s0_bitrate, s0_host, s0_port, s0_pass, s0_mount, s0_url, s0_desc, s0_genre, s0_user, output_source, "0", s0_connected, s0_name, s0_channels) end if s1_enable == true then - server.register(namespace="stream_1", "connected", fun (s) -> begin !s1_connected end) - stream_to_icecast("stream_1", s1_encoding, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_desc, s1_genre, s1_user, output_source, "1", s1_connected, s1_name, s1_channels) + server.register(namespace="out_http_1", "connected", fun (s) -> begin !s1_connected end) + stream_to_icecast("out_http_1", s1_encoding, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_desc, s1_genre, s1_user, output_source, "1", s1_connected, s1_name, s1_channels) end if s2_enable == true then - server.register(namespace="stream_2", "connected", fun (s) -> begin !s2_connected end) - stream_to_icecast("stream_2", s2_encoding, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_desc, s2_genre, s2_user, output_source, "2", s2_connected, s2_name, s2_channels) + server.register(namespace="out_http_2", "connected", fun (s) -> begin !s2_connected end) + stream_to_icecast("out_http_2", s2_encoding, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_desc, s2_genre, s2_user, output_source, "2", s2_connected, s2_name, s2_channels) end if s3_enable == true then - server.register(namespace="stream_3", "connected", fun (s) -> begin !s3_connected end) - stream_to_icecast("stream_3", s3_encoding, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_desc, s3_genre, s3_user, output_source, "3", s3_connected, s3_name, s3_channels) + server.register(namespace="out_http_3", "connected", fun (s) -> begin !s3_connected end) + stream_to_icecast("out_http_3", s3_encoding, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_desc, s3_genre, s3_user, output_source, "3", s3_connected, s3_name, s3_channels) end if s4_enable == true then - server.register(namespace="stream_4", "connected", fun (s) -> begin !s4_connected end) - stream_to_icecast("stream_4", s4_encoding, s4_bitrate, s4_host, s4_port, s4_pass, s4_mount, s4_url, s4_desc, s4_genre, s4_user, output_source, "4", s4_connected, s4_name, s4_channels) + server.register(namespace="out_http_4", "connected", fun (s) -> begin !s4_connected end) + stream_to_icecast("out_http_4", s4_encoding, s4_bitrate, s4_host, s4_port, s4_pass, s4_mount, s4_url, s4_desc, s4_genre, s4_user, output_source, "4", s4_connected, s4_name, s4_channels) end diff --git a/modules/liquidsoap/serverfunctions.liq b/modules/liquidsoap/serverfunctions.liq index 04b3fad5..27bbd103 100644 --- a/modules/liquidsoap/serverfunctions.liq +++ b/modules/liquidsoap/serverfunctions.liq @@ -112,14 +112,62 @@ server.register(namespace = "auraengine", ) # enable the seek function for the input from the filesystem -server.register(namespace = source.id(input_fs), - description="seek to relative position in #{source.id(input_fs)}", +server.register(namespace = source.id(input_filesystem_0), + description="seek to relative position in #{source.id(input_filesystem_0)}", usage = "seek <duration in seconds>", "seek", fun(t) -> begin log("Seeking #{t} sec") t = float_of_string(default=0.,t) - ret = source.seek(input_fs, t) + ret = source.seek(input_filesystem_0, t) + "Seeked #{ret} seconds." + end +) + +server.register(namespace = source.id(input_filesystem_1), + description="seek to relative position in #{source.id(input_filesystem_1)}", + usage = "seek <duration in seconds>", + "seek", + fun(t) -> begin + log("Seeking #{t} sec") + t = float_of_string(default=0.,t) + ret = source.seek(input_filesystem_1, t) + "Seeked #{ret} seconds." + end +) + +server.register(namespace = source.id(input_filesystem_2), + description="seek to relative position in #{source.id(input_filesystem_2)}", + usage = "seek <duration in seconds>", + "seek", + fun(t) -> begin + log("Seeking #{t} sec") + t = float_of_string(default=0.,t) + ret = source.seek(input_filesystem_2, t) + "Seeked #{ret} seconds." + end +) + +server.register(namespace = source.id(input_filesystem_3), + description="seek to relative position in #{source.id(input_filesystem_3)}", + usage = "seek <duration in seconds>", + "seek", + fun(t) -> begin + log("Seeking #{t} sec") + t = float_of_string(default=0.,t) + ret = source.seek(input_filesystem_3, t) + "Seeked #{ret} seconds." + end +) + +server.register(namespace = source.id(input_filesystem_4), + description="seek to relative position in #{source.id(input_filesystem_4)}", + usage = "seek <duration in seconds>", + "seek", + fun(t) -> begin + log("Seeking #{t} sec") + t = float_of_string(default=0.,t) + ret = source.seek(input_filesystem_4, t) "Seeked #{ret} seconds." end ) -- GitLab