2 LuCI - Lua Configuration Interface - Shairport support
4 Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
15 m = Map("shairport", "Shairport", translate("Shairport is a simple AirPlay server implementation, here you can configure the settings."))
17 s = m:section(TypedSection, "shairport", "")
21 enable=s:option(Flag, "disabled", translate("Enabled"))
25 enable.rmempty = false
26 respawn=s:option(Flag, "respawn", translate("Respawn"))
27 respawn.default = false
29 bname = s:option(Value, "bname", translate("Airport Name"))
32 pw = s:option(Value, "password", translate("Password"))
36 port=s:option(Value, "port", translate("Port"))
38 port.datatype = "port"
40 buffer=s:option(Value, "buffer", translate("Buffer fill"))
42 buffer.datatype = "uinteger"
44 log_file=s:option(Value, "log_file", translate("Log file"))
45 log_file.rmempty = true
46 --log_file.datatype = "file"
48 err_file=s:option(Value, "err_file", translate("Error file"))
49 err_file.rmempty = true
50 --err_file.datatype = "file"
52 meta_dir=s:option(Value, "meta_dir", translate("Metadata directory"))
53 meta_dir.rmempty = true
54 meta_dir.datatype = "directory"
56 cmd_start=s:option(Value, "cmd_start", translate("Command when playback begins"))
57 cmd_start.rmempty = true
59 cmd_stop=s:option(Value, "cmd_stop", translate("Command when playback ends"))
60 cmd_stop.rmempty = true
62 cmd_wait=s:option(Flag, "cmd_wait", translate("Block while the commands run"))
63 cmd_wait.default = false
65 mdns=s:option(ListValue, "mdns", translate("mDNS"))
67 mdns:value("", translate("Default"))
70 mdns:value("external_avahi")
71 mdns:value("external_dns_sd")
72 mdns:value("tinysvcmdns")
74 audio_output=s:option(ListValue, "audio_output", translate("Audio output"))
75 audio_output.rmempty = true
76 audio_output:value("", translate("Default"))
77 audio_output:value("alsa")
78 audio_output:value("ao")
79 audio_output:value("dummy")
80 audio_output:value("pulse")
81 audio_output:value("pipe")
84 output_dev=s:option(Value, "output_dev", translate("Output device"))
85 output_dev.rmempty = true
86 output_dev:depends("audio_output", "alsa")
88 mixer_dev=s:option(Value, "mixer_dev", translate("Mixer device"))
89 mixer_dev.rmempty = true
90 mixer_dev:depends("audio_output", "alsa")
92 mixer_type=s:option(ListValue, "mixer_type", translate("Mixer type"))
93 mixer_type.rmempty = true
94 mixer_type:value("", translate("Default"))
95 mixer_type:value("software")
96 mixer_type:value("hardware")
97 mixer_type:depends("audio_output", "alsa")
99 mixer_control=s:option(Value, "mixer_control", translate("Mixer control"))
100 mixer_control.rmempty = true
101 mixer_control:depends("audio_output", "alsa")
103 mixer_index = s:option(ListValue, "mixer_index", translate("Mixer index"))
104 mixer_index.rmempty = true
105 mixer_index:depends("audio_output", "alsa")
106 mixer_index:value("", translate("Default"))
107 local pats = io.popen("find /proc/asound/ -type d -name 'card*' | sort")
112 if not l then break end
114 l = string.gsub(l, "/proc/asound/card", "")
123 ao_driver=s:option(Value, "ao_driver", translate("AO driver"))
124 ao_driver.rmempty = true
125 ao_driver:depends("audio_output", "ao")
127 ao_name=s:option(Value, "ao_name", translate("AO name"))
128 ao_name.rmempty = true
129 ao_name:depends("audio_output", "ao")
131 ao_id = s:option(ListValue, "ao_id", translate("AO id"))
133 ao_id:depends("audio_output", "ao")
134 ao_id:value("", translate("Default"))
135 local pats = io.popen("find /proc/asound/ -type d -name 'card*' | sort")
140 if not l then break end
142 l = string.gsub(l, "/proc/asound/card", "")
150 ao_options=s:option(Value, "ao_options", translate("AO options"))
151 ao_options.rmempty = true
152 ao_options:depends("audio_output", "ao")
155 output_fifo=s:option(Value, "output_fifo", translate("Output FIFO"))
156 output_fifo.rmempty = true
157 output_fifo:depends("audio_output", "pipe")
160 pulse_server=s:option(Value, "pulse_server", translate("Pulse server"))
161 pulse_server.rmempty = true
162 pulse_server:depends("audio_output", "pulse")
164 pulse_sink=s:option(Value, "pulse_sink", translate("Pulse sink"))
165 pulse_sink.rmempty = true
166 pulse_sink:depends("audio_output", "pulse")
168 pulse_appname=s:option(Value, "pulse_appname", translate("Pulse application name"))
169 pulse_appname.rmempty = true
170 pulse_appname:depends("audio_output", "pulse")