summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-shairplay/luasrc/model
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2014-10-28 16:29:29 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2014-10-28 16:29:29 +0100
commita33be327312ee5fd0981be65001074e72a7f3d81 (patch)
treefcd90e7fc10200867ff6235575f7343e5c0b67cd /applications/luci-shairplay/luasrc/model
parent2826426c6a518867d695f05e514e41703deac3a1 (diff)
applications/luci-shairplay: add new package.
This adds support for configuring shairplay. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'applications/luci-shairplay/luasrc/model')
-rw-r--r--applications/luci-shairplay/luasrc/model/cbi/shairplay.lua75
1 files changed, 75 insertions, 0 deletions
diff --git a/applications/luci-shairplay/luasrc/model/cbi/shairplay.lua b/applications/luci-shairplay/luasrc/model/cbi/shairplay.lua
new file mode 100644
index 0000000000..553917454e
--- /dev/null
+++ b/applications/luci-shairplay/luasrc/model/cbi/shairplay.lua
@@ -0,0 +1,75 @@
+--[[
+LuCI - Lua Configuration Interface - Shairplay support
+
+Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+m = Map("shairplay", "Shairplay", translate("Shairplay is a simple AirPlay server implementation, here you can configure the settings."))
+
+s = m:section(TypedSection, "shairplay", "")
+s.addremove = true
+s.anonymous = false
+
+enable=s:option(Flag, "disabled", translate("Enabled"))
+enable.enabled="0"
+enable.disabled="1"
+enable.default = "1"
+respawn=s:option(Flag, "respawn", translate("Respawn"))
+respawn.default = false
+
+apname = s:option(Value, "apname", translate("Airport Name"))
+apname.rmempty = true
+
+port=s:option(Value, "port", translate("Port"))
+port.rmempty = true
+port.datatype = "port"
+
+pw = s:option(Value, "password", translate("Password"))
+pw.rmempty = true
+pw.password = true
+
+hwaddr=s:option(Value, "hwaddr", translate("HW Address"))
+hwaddr.rmempty = true
+hwaddr.datatype = "macaddr"
+
+ao_driver=s:option(ListValue, "ao_driver", translate("AO Driver"))
+ao_driver:value("", translate("Default"))
+ao_driver:value("alsa")
+--ao_driver:value("alsa05")
+--ao_driver:value("arts")
+--ao_driver:value("esd")
+--ao_driver:value("irix")
+--ao_driver:value("nas")
+ao_driver:value("oss")
+--ao_driver:value("sun")
+
+ao_devicename=s:option(Value, "ao_devicename", translate("AO Device Name"))
+ao_devicename.rmempty = true
+
+ao_deviceid = s:option(ListValue, "ao_deviceid", translate("AO Device ID"))
+ao_deviceid.rmempty = true
+ao_deviceid:value("", translate("Default"))
+local pats = io.popen("find /proc/asound/ -type d -name 'card*' | sort")
+if pats then
+ local l
+ while true do
+ l = pats:read("*l")
+ if not l then break end
+
+ l = string.gsub(l, "/proc/asound/card", "")
+ if l then
+ ao_deviceid:value(l)
+ end
+ end
+ pats:close()
+end
+
+return m