Skip to content
Snippets Groups Projects
Verified Commit 419b2bba authored by Ole Binder's avatar Ole Binder
Browse files

Refactor: Consolidate input devices into list

parent 4924e292
No related branches found
No related tags found
1 merge request!17Yaml configuration file
......@@ -40,8 +40,11 @@ def get_input_line(source_id, device) =
end
end
def create_input_line(source_id, device) =
in_line = get_input_line(source_id, device)
input_count = ref(0)
def create_input_line(device) =
source_id = "line_in_#{input_count}"
in_line = get_input_line(source_id, device.name)
# Enable metadata insertion and store callbacks
in_line = insert_metadata(id=source_id, in_line)
......@@ -65,7 +68,7 @@ def create_input_line(source_id, device) =
fun (json_string) ->
begin
log(
"Received JSON to set track metadata on channel 'in_line_0' to:\n #{
"Received JSON to set track metadata on channel '#{source_id}' to:\n #{
json_string
}"
)
......@@ -75,17 +78,11 @@ def create_input_line(source_id, device) =
"OK"
end
)
input_count := input_count() + 1
end
#####################################
# SOURCES #
#####################################
if a0_in != "" then create_input_line("in_line_0", a0_in) end
# if a1_in != "" then create_input_line("in_line_1", a1_in) end
# if a2_in != "" then create_input_line("in_line_2", a2_in) end
# if a3_in != "" then create_input_line("in_line_3", a3_in) end
\ No newline at end of file
list.iter(create_input_line, config.audio.devices.input)
......@@ -244,19 +244,8 @@ end
# we save the device name in the corresponding variable name
# I guess the variable name is then later used to create the in- and outputs
# a0_in = get_setting("", "input_device_0", "AURA_ENGINE_INPUT_DEVICE")
a0_in = list.hd(config.audio.devices.input).name
# a1_in = list.assoc(default="", "input_device_1", ini)
# a2_in = list.assoc(default="", "input_device_2", ini)
# a3_in = list.assoc(default="", "input_device_3", ini)
# a4_in = list.assoc(default="", "input_device_4", ini)
# a0_out = get_setting("", "output_device_0", "AURA_ENGINE_OUTPUT_DEVICE")
a0_out = list.hd(config.audio.devices.output).name
# a1_out = list.assoc(default="", "output_device_1", ini)
# a2_out = list.assoc(default="", "output_device_2", ini)
# a3_out = list.assoc(default="", "output_device_3", ini)
# a4_out = list.assoc(default="", "output_device_4", ini)
# ALSA / pulse settings
# soundsystem = get_setting("alsa", "soundsystem", "AURA_ENGINE_SOUNDSYSTEM")
soundsystem = config.audio.soundsystem
......@@ -266,16 +255,19 @@ use_jack = soundsystem == "jack"
log(
"\nAudio Settings:"
)
log(
"\tOutput device: #{a0_out}"
)
if
a0_in != ""
then
def print_device(device) =
log(
"\tInput device: #{a0_in}"
"\t\t- #{device.name}"
)
end
log(
"\tOutput Devices:"
)
list.iter(print_device, config.audio.devices.output)
log(
"\tInput Devices:"
)
list.iter(print_device, config.audio.devices.input)
# ReplayGain Settings
# enable_replaygain_resolver =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment