Skip to content
Snippets Groups Projects
Commit e530ebcf authored by Gottfried Gaisbauer's avatar Gottfried Gaisbauer
Browse files

soundserver got a server command which returns what inputs/outputs are enabled in JSON

parent 114b84db
No related branches found
No related tags found
No related merge requests found
......@@ -3,30 +3,30 @@
icecast_vorbis_metadata = false
inputs = ref []
# load settings from ini file
%include "settings.liq"
%include "library.liq"
%include "fallback.liq"
##################
# create sources #
##################
# include some functions
%include "library.liq"
input_fs = request.queue(id="fs")
#input_http = input.http(id="http", "http://stream.fro.at/fro-128.ogg")
input_http = input.http(id="http", "http://chill.out.airtime.pro:8000/chill_a")
#inputs := list.append([request.queue(id="fs")], !inputs)
#inputs := list.append([input.http(id="http", "http://stream.fro.at/fro-128.ogg")], !inputs)
%include "in_alsa.liq"
# include fallback functions
%include "fallback.liq"
# fill the mixer
#mixer = ref output.dummy(blank())
#################
# create inputs #
#################
#ii = list.fold(parse_list, (), !dyn_sources)
mixer = mix(id="mixer", list.append([input_fs, input_http], !inputs))
# enable play from filesystem
%include "in_filesystem.liq"
#mixer = mix(id="mixer", [input_fs, input_http, !input_0, !input_1, !input_2, !input_3]) # , !input4])
# 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_fs, input_http], !inputs))
# output source with fallbacks
# stripped_stream = strip_blank(max_blank=fallback_max_blank, min_noise=fallback_min_noise, threshold=fallback_threshold, mixer)
......@@ -37,6 +37,7 @@ ignore(timeslot_fallback)
ignore(station_fallback)
ignore(show_fallback)
# enable fallback
output_source = mixer # fallback(id="fallback", track_sensitive=false, [mksafe(stripped_stream), timeslot_fallback, show_fallback, station_fallback])
##################
......@@ -47,13 +48,13 @@ output_source = mixer # fallback(id="fallback", track_sensitive=false, [mksafe(s
%include "out_soundcard.liq"
# recording output
%include "out_recorder.liq"
%include "out_filesystem.liq"
# stream output
%include "out_stream.liq"
# enable socket functions
# %include "serverfunctions.liq"
%include "serverfunctions.liq"
########################
# start initialization #
......
# a hard one
input_fs = request.queue(id="fs")
\ No newline at end of file
if a0_in != "" then
# we can ignore the result, since it is stored in the list 'inputs'
set_input(a0_in, "aura_linein_0")
end
if a1_in != "" then
ignore(set_input(a1_in, "aura_linein_1"))
end
if a2_in != "" then
ignore(set_input(a2_in, "aura_linein_2"))
end
if a3_in != "" then
ignore(set_input(a3_in, "aura_linein_3"))
end
if a4_in != "" then
ignore(set_input(a4_in, "aura_linein_4"))
# input_4 = ref output.dummy(blank())
# set_input(input_4, a4_in, "aura_linein_4")
# inputs := list.append([!input_4], !inputs)
end
\ No newline at end of file
# 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"
starturl = "http://chill.out.airtime.pro:8000/chill_a"
input_http = input.http(id="http", starturl)
\ No newline at end of file
......@@ -178,4 +178,4 @@ def start_recorder(folder, duration, encoding, bitrate, channels, filenamepatter
%include "outgoing_recordings/wav.liq"
end
%endif
end
\ No newline at end of file
end
r0_enable = list.assoc("rec_0", ini) == "y"
r1_enable = list.assoc("rec_1", ini) == "y"
r2_enable = list.assoc("rec_2", ini) == "y"
r3_enable = list.assoc("rec_3", ini) == "y"
r4_enable = list.assoc("rec_4", ini) == "y"
r0_folder = list.assoc("rec_0_folder", ini)
r0_duration = int_of_string(list.assoc("rec_0_duration", ini))
r0_encoding = list.assoc("rec_0_encoding", ini)
r0_bitrate = int_of_string(list.assoc("rec_0_bitrate", ini))
r0_channels = list.assoc("rec_0_channels", ini)
r0_filenamepattern = r0_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r0_encoding
r1_folder = list.assoc("rec_1_folder", ini)
r1_duration = int_of_string(list.assoc("rec_1_duration", ini))
r1_encoding = list.assoc("rec_1_encoding", ini)
r1_bitrate = int_of_string(list.assoc("rec_1_bitrate", ini))
r1_channels = list.assoc("rec_1_channels", ini)
r1_filenamepattern = r1_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r1_encoding
r2_folder = list.assoc("rec_2_folder", ini)
r2_duration = int_of_string(list.assoc("rec_2_duration", ini))
r2_encoding = list.assoc("rec_2_encoding", ini)
r2_bitrate = int_of_string(list.assoc("rec_2_bitrate", ini))
r2_channels = list.assoc("rec_2_channels", ini)
r2_filenamepattern = r2_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r2_encoding
r3_folder = list.assoc("rec_3_folder", ini)
r3_duration = int_of_string(list.assoc("rec_3_duration", ini))
r3_encoding = list.assoc("rec_3_encoding", ini)
r3_bitrate = int_of_string(list.assoc("rec_3_bitrate", ini))
r3_channels = list.assoc("rec_3_channels", ini)
r3_filenamepattern = r3_folder^"/%Y-%m-%d/%Y-%m-%d-%H-%M."^r3_encoding
r4_folder = list.assoc("rec_4_folder", ini)
r4_duration = int_of_string(list.assoc("rec_4_duration", ini))
r4_encoding = list.assoc("rec_4_encoding", ini)
r4_bitrate = int_of_string(list.assoc("rec_4_bitrate", ini))
r4_channels = list.assoc("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="recorder_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)
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)
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)
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)
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
#################
# Read INI File #
#################
def read_ini(file)
ret = get_process_lines("cat "^file )
......@@ -10,7 +13,7 @@ def read_ini(file)
#print(line)
#print((list.hd(l),line['1']))
list.append([(list.hd(l),line['1'])],l')
else
if list.length(l) >= 1 then
......@@ -26,4 +29,4 @@ def read_ini(file)
install_dir = dirname(dirname(list.hd(pwd)))
list.fold(f, [("install_dir", install_dir)], ret)
end
end
\ No newline at end of file
......@@ -5,23 +5,93 @@
# "stop",
# fun(x,y) -> shutdown )
server.register(namespace="streams",
"connection_status",
fun (s) -> begin
log("streams.connection_status")
"1:#{!s0_connected}, 2:#{!s1_connected}, 3:#{!s2_connected}, 4:#{!s3_connected}, 5:#{!s4_connected}"
end
)
#
# to reduce complexity of lqs => query 'mixer.inputs' over socket and parse it in python
#server.register(namespace="linein",
# "usage_status",
#server.register(namespace="auraengine",
# "enabled_lineins",
# fun (s) -> begin
# log("linein.usage_status")
# 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",
"state"
\ No newline at end of file
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}},'
ret = ret^'"stream_1": {"enabled": #{s1_enable}},'
ret = ret^'"stream_2": {"enabled": #{s2_enable}},'
ret = ret^'"stream_3": {"enabled": #{s3_enable}},'
ret = ret^'"stream_4": {"enabled": #{s4_enable}}'
ret = ret^'},'
ret = ret^'"recorder": {'
ret = ret^'"recorder_0": {"enabled": #{r0_enable}},'
ret = ret^'"recorder_1": {"enabled": #{r1_enable}},'
ret = ret^'"recorder_2": {"enabled": #{r2_enable}},'
ret = ret^'"recorder_3": {"enabled": #{r3_enable}},'
ret = ret^'"recorder_4": {"enabled": #{r4_enable}}'
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 = "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}"
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
)
\ No newline at end of file
# define file name pattern
filenamepattern = ref audiobase^"/%Y-%m-%d/%Y-%m-%d-%H-%M.flac"
# Der aktuelle Dateiname für die Aufnahme
recordingfile = ref ""
# bewahre uns davor, dass zweimal gleichzeitig die gleiche Date aufgenommen wird
is_record_active = ref false
#wir definieren eine Referenz für die Stop-Funktion, die aber bisher noch nichts tun kann
stop_f = ref (fun () -> ())
def start_wav_output(recfile, filenamepattern, recorder_number)
duration = int_of_string(list.assoc("rec_"^recorder_number^"_duration", ini))
channels = int_of_string(list.assoc("rec_"^recorder_number^"_channels", ini))
samplesize = int_of_string(list.assoc("rec_"^recorder_number^"_samplesize", ini))
ignore(duration)
ignore(channels)
ignore(samplesize)
# def on_start()
# recfile := list.hd(get_process_lines("date +#{!filenamepattern}"))
# end
# def on_close(filename)
# recordingfile := list.hd(get_process_lines("date +#{!filenamepattern}"))
# end
print(channels)
print(samplesize)
#out_wav = output.file(id="recorder", perm = 0o664, on_start=on_start, on_close=on_close, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
#out_wav(%wav(stereo=true, channels=2, samplesize=8, header=true, !filenamepattern, output_source)
#ignore(out_wav)
output.dummy(id="wav_dummy_recording", blank())
# if channels == 2 then
# output.file(id="recorder", %wav(stereo=true, channels=2, samplesize=8, header=true), perm = 0o664, on_start=on_start, on_close=on_close, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 }, !filenamepattern, audio_to_stereo(output_source))
## out_wav(output_source)
# else
# output.file(id="recorder", %wav(stereo=true, channels=1, samplesize=8, header=true), perm = 0o664, on_start=on_start, on_close=on_close, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 }, !filenamepattern, output_source)
# out_wav(output_source)
# end
#if channels == 2 then
# if samplesize < 12 then
# ignore(out_wav(%wav(stereo=true, channels=2, samplesize=8, header=true), !filenamepattern, output_source))
# else
# ignore(out_wav(%wav(stereo=true, channels=2, samplesize=16, header=true), !filenamepattern, output_source))
# end
#else
# if samplesize < 12 then
# ignore(out_wav(%wav(stereo=true, channels=1, samplesize=8, header=true), !filenamepattern, output_source))
# else
# ignore(out_wav(%wav(stereo=true, channels=1, samplesize=16, header=true), !filenamepattern, output_source))
# end
#end
end
def start_flac_output(recorder_number, filenamepattern, duration)
# duration = int_of_string(list.assoc("rec_"^recorder_number^"_samplerate", ini))
# samplerate = list.assoc("rec_"^recorder_number^"_samplerate", ini)
channels = int_of_string(list.assoc("rec_"^recorder_number^"_channels", ini))
# compression = int_of_string(list.assoc("rec_"^recorder_number^"_compression", ini))
# bits_per_sample = int_of_string(list.assoc("rec_"^recorder_number^"_bits_per_sample", ini))
#output.file(id="recorder", %flac(samplerate=44100, channels=1, compression=7, bits_per_sample=32), perm = 0o664, on_start=on_start, !filenamepattern, on_close=on_close, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 }, output_source)
recfile = ref ''
def on_start()
recfile := list.hd(get_process_lines("date +#{filenamepattern}"))
end
def on_close(filename)
recfile := list.hd(get_process_lines("date +#{filenamepattern}"))
end
# dumbass liquidsoap cannot handle one output definition for mono and stereo
output_filesystem_mono = output.file(id="recorder", perm = 0o664, on_start=on_start, on_close=on_close, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
output_filesystem_stereo = output.file(id="recorder", perm = 0o664, on_start=on_start, on_close=on_close, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
ignore(output_filesystem_mono)
ignore(output_filesystem_stereo)
if channels == 2 then
output.dummy(id="flac_dummy_recording_stereo", blank())
# output_stereof(%flac(samplerate=44100, channels=1, compression=1, bits_per_sample=16), !filenamepattern, output_source)
else
output.dummy(id="flac_dummy_recording_mono", blank())
# output_icecast_monof(%flac(samplerate=44100, channels=1, compression=1, bits_per_sample=16), !filenamepattern, output_source)
end
end
def enable_stop_function(record)
# Die Stopfunkton zeigt nun auf die Shutdown-Funktion der aktuellen Source
stop_f := fun () -> begin
log('stop recording')
# Aufnahme sauber beenden
ignore(server.execute('recorder.stop'))
# Source zerstören
source.shutdown(record)
# Variable zurücksetzen
recordingfile := ""
end
end
def set_recorder_output(rec_filetype, recorder_number)
# flac output
if rec_filetype == 'flac' then
log("output file type is FLAC")
record = start_flac_output(recorder_number)
enable_stop_function(record)
# WAV output
else
log("output file type is WAV")
record = start_wav_output(recorder_number)
enable_stop_function(record)
end
end
# shows current file and how many bytes were written so far
def currecording()
curfile = !recordingfile
if curfile != "" then
bytes_written = list.hd(get_process_lines("echo $(($(stat -c%s "^curfile^")))"))
"#{curfile}, #{bytes_written}B"
else
""
end
end
\ No newline at end of file
def get_icecast_mp3_stream(number)
stream_bitrate = int_of_string(list.assoc("stream_#{number}_bitrate", ini))
stream_mountpoint = list.assoc("stream_#{number}_mountpoint", ini)
stream_host = list.assoc("stream_#{number}_host", ini)
stream_port = int_of_string(list.assoc("stream_#{number}_port", ini))
stream_name = list.assoc("stream_#{number}_name", ini)
stream_url = list.assoc("stream_#{number}_url", ini)
stream_genre = list.assoc("stream_#{number}_genre", ini)
stream_description = list.assoc("stream_#{number}_description", ini)
stream_user = list.assoc("stream_#{number}_user", ini)
stream_password = list.assoc("stream_#{number}_password", ini)
if stream_bitrate == 24 then
icecast_stream = output.icecast(%mp3(bitrate = 24, samplerate = 22050), mount=stream_mountpoint, host=stream_host, port=stream_port, name=stream_name, url=stream_url, genre=stream_genre, description=stream_description, user=stream_user, password=stream_password, icy_metadata="true", fallible=true, buffer(output_source))
clock.assign_new(id="stream_#{number}",
[icecast_stream]
)
icecast_stream
else
icecast_stream = output.icecast(%mp3(samplerate = 44100), mount=stream_mountpoint, host=stream_host, port=stream_port, name=stream_name, url=stream_url, genre=stream_genre, description=stream_description, user=stream_user, password=stream_password, icy_metadata="true", fallible=true, buffer(output_source))
clock.assign_new(id="stream_#{number}",
[icecast_stream]
)
icecast_stream
end
end
def get_icecast_ogg_stream(number)
stream_quality = float_of_string(list.assoc("stream_#{number}_quality", ini))
stream_mountpoint = list.assoc("stream_#{number}_mountpoint", ini)
stream_host = list.assoc("stream_#{number}_host", ini)
stream_port = int_of_string(list.assoc("stream_#{number}_port", ini))
stream_name = list.assoc("stream_#{number}_name", ini)
stream_url = list.assoc("stream_#{number}_url", ini)
stream_genre = list.assoc("stream_#{number}_genre", ini)
stream_description = list.assoc("stream_#{number}_description", ini)
stream_user = list.assoc("stream_#{number}_user", ini)
stream_password = list.assoc("stream_#{number}_password", ini)
if stream_quality >= 0.5 then
icecast_stream = output.icecast(%vorbis(quality = 1.0), mount=stream_mountpoint, host=stream_host, port=stream_port, name=stream_name, url=stream_url, genre=stream_genre, description=stream_description, user=stream_user, password=stream_password, icy_metadata="true", fallible=true, buffer(output_source))
clock.assign_new(id="stream_#{number}",
[icecast_stream]
)
icecast_stream
else
icecast_stream = output.icecast(%vorbis(quality = 0.1), mount=stream_mountpoint, host=stream_host, port=stream_port, name=stream_name, url=stream_url, genre=stream_genre, description=stream_description, user=stream_user, password=stream_password, icy_metadata="true", fallible=true, buffer(output_source))
clock.assign_new(id="stream_#{number}",
[icecast_stream]
)
icecast_stream
end
end
def get_harbour_mp3_stream(number)
stream_bitrate = int_of_string(list.assoc("stream_#{number}_bitrate", ini))
stream_user = list.assoc("stream_#{number}_user", ini)
stream_password = list.assoc("stream_#{number}_password", ini)
stream_port = int_of_string(list.assoc("stream_#{number}_port", ini))
stream_url = list.assoc("stream_#{number}_url", ini)
stream_mountpoint = list.assoc("stream_#{number}_mountpoint", ini)
if stream_bitrate == 24 then
harbourstream = output.harbor(%mp3(bitrate = 24, samplerate = 22050), user=stream_user, password=stream_password, id="stream", port=stream_port, url=stream_url, mount=stream_mountpoint, icy_metadata="true", fallible=true, buffer(output_source))
clock.assign_new(id="stream_#{number}",
[harbourstream]
)
harbourstream
else
harbourstream = output.harbor(%mp3, user=stream_user, password=stream_password, id="stream", port=stream_port, url=stream_url, mount=stream_mountpoint, icy_metadata="true", fallible=true, buffer(output_source))
clock.assign_new(id="stream_#{number}",
[harbourstream]
)
harbourstream
end
end
def get_stream(number)
stream = list.assoc("stream_#{number}", ini)
stream_type = list.assoc("stream_#{number}_type", ini)
stream_format = list.assoc("stream_#{number}_format", ini)
# is stream enabled?
if stream == "y" then
log("activating stream #{number}")
if stream_type == "icecast" then
log("its an icecast stream")
if stream_format == "mp3" then
log("filled with mp3")
get_icecast_mp3_stream(number)
elsif stream_format == "vorbis" then
log("filled with ogg")
get_icecast_ogg_stream(number)
else
output.dummy(id="no_valid_stream_format_DUMMY_ICECAST", blank())
end
elsif stream_type == "harbor" then
log("its an harbor stream")
if stream_format == "mp3" then
get_harbour_mp3_stream(number)
else
output.dummy(id="no_valid_stream_format_DUMMY_HARBOUR", blank())
end
else
output.dummy(id="no_valid_stream_type_DUMMY", blank())
end
else
output.dummy(id="no_stream_enabled_DUMMY", blank())
end
end
def set_streams()
stream_0 = get_stream(0)
#stream_1 = get_stream(1)
#stream_2 = get_stream(2)
#stream_3 = get_stream(3)
#stream_4 = get_stream(4)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment