|
@ -28,16 +28,21 @@ append_bool() { |
|
|
|
|
|
|
|
|
start_instance() { |
|
|
start_instance() { |
|
|
local cfg="$1" |
|
|
local cfg="$1" |
|
|
local ao dev |
|
|
|
|
|
|
|
|
local ao dev aux |
|
|
|
|
|
|
|
|
|
|
|
config_get_bool aux "$cfg" 'disabled' '0' |
|
|
|
|
|
[ "$aux" = 1 ] && return 1 |
|
|
|
|
|
|
|
|
procd_open_instance |
|
|
procd_open_instance |
|
|
|
|
|
|
|
|
procd_set_param command /usr/bin/shairport |
|
|
procd_set_param command /usr/bin/shairport |
|
|
|
|
|
|
|
|
append_arg "$cfg" bname "-a" "AirPort" |
|
|
append_arg "$cfg" bname "-a" "AirPort" |
|
|
append_arg "$cfg" log "-l" |
|
|
|
|
|
append_arg "$cfg" buffer "-b" "256" |
|
|
|
|
|
append_arg "$cfg" port "-p" "5002" |
|
|
|
|
|
|
|
|
append_arg "$cfg" log_file "-l" |
|
|
|
|
|
append_arg "$cfg" err_file "-e" |
|
|
|
|
|
append_arg "$cfg" meta_dir "-M" |
|
|
|
|
|
append_arg "$cfg" buffer "-b" |
|
|
|
|
|
append_arg "$cfg" port "-p" |
|
|
append_arg "$cfg" password "-k" |
|
|
append_arg "$cfg" password "-k" |
|
|
append_arg "$cfg" mdns "-m" |
|
|
append_arg "$cfg" mdns "-m" |
|
|
|
|
|
|
|
@ -58,8 +63,34 @@ start_instance() { |
|
|
append_arg "$cfg" mixer_control "-c" |
|
|
append_arg "$cfg" mixer_control "-c" |
|
|
append_arg "$cfg" mixer_index "-i" |
|
|
append_arg "$cfg" mixer_index "-i" |
|
|
fi |
|
|
fi |
|
|
|
|
|
elif [ "$ao" = "ao" ]; then |
|
|
|
|
|
config_get dev "$cfg" ao_driver "" |
|
|
|
|
|
if [ -n "$dev" ]; then |
|
|
|
|
|
procd_append_param command "--" |
|
|
|
|
|
append_arg "$cfg" ao_driver "-d" |
|
|
|
|
|
append_arg "$cfg" ao_id "-i" |
|
|
|
|
|
append_arg "$cfg" ao_name "-n" |
|
|
|
|
|
append_arg "$cfg" ao_options "-o" |
|
|
|
|
|
fi |
|
|
|
|
|
elif [ "$ao" = "pipe" ]; then |
|
|
|
|
|
config_get dev "$cfg" output_fifo "" |
|
|
|
|
|
if [ -n "$dev" ]; then |
|
|
|
|
|
procd_append_param command "--" |
|
|
|
|
|
append_arg "$cfg" output_fifo "" |
|
|
|
|
|
fi |
|
|
|
|
|
elif [ "$ao" = "pulse" ]; then |
|
|
|
|
|
config_get dev "$cfg" pulse_server "" |
|
|
|
|
|
if [ -n "$dev" ]; then |
|
|
|
|
|
procd_append_param command "--" |
|
|
|
|
|
append_arg "$cfg" pulse_server "-a" |
|
|
|
|
|
append_arg "$cfg" pulse_sink "-s" |
|
|
|
|
|
append_arg "$cfg" pulse_appname "-n" |
|
|
|
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
config_get_bool aux "$cfg" 'respawn' '0' |
|
|
|
|
|
[ "$aux" = 1 ] && procd_set_param respawn |
|
|
|
|
|
|
|
|
procd_close_instance |
|
|
procd_close_instance |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|