shairplay.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. -- Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
  2. -- Licensed to the public under the Apache License 2.0.
  3. m = Map("shairplay", "Shairplay", translate("Shairplay is a simple AirPlay server implementation, here you can configure the settings."))
  4. s = m:section(TypedSection, "shairplay", "")
  5. s.addremove = true
  6. s.anonymous = false
  7. enable=s:option(Flag, "disabled", translate("Enabled"))
  8. enable.enabled="0"
  9. enable.disabled="1"
  10. enable.default = "1"
  11. enable.rmempty = false
  12. respawn=s:option(Flag, "respawn", translate("Respawn"))
  13. respawn.default = false
  14. apname = s:option(Value, "apname", translate("Airport Name"))
  15. apname.rmempty = true
  16. port=s:option(Value, "port", translate("Port"))
  17. port.rmempty = true
  18. port.datatype = "port"
  19. pw = s:option(Value, "password", translate("Password"))
  20. pw.rmempty = true
  21. pw.password = true
  22. hwaddr=s:option(Value, "hwaddr", translate("HW Address"))
  23. hwaddr.rmempty = true
  24. hwaddr.datatype = "macaddr"
  25. ao_driver=s:option(ListValue, "ao_driver", translate("AO Driver"))
  26. ao_driver:value("", translate("Default"))
  27. ao_driver:value("alsa")
  28. --ao_driver:value("alsa05")
  29. --ao_driver:value("arts")
  30. --ao_driver:value("esd")
  31. --ao_driver:value("irix")
  32. --ao_driver:value("nas")
  33. ao_driver:value("oss")
  34. --ao_driver:value("sun")
  35. ao_devicename=s:option(Value, "ao_devicename", translate("AO Device Name"))
  36. ao_devicename.rmempty = true
  37. ao_deviceid = s:option(ListValue, "ao_deviceid", translate("AO Device ID"))
  38. ao_deviceid.rmempty = true
  39. ao_deviceid:value("", translate("Default"))
  40. local pats = io.popen("find /proc/asound/ -type d -name 'card*' | sort")
  41. if pats then
  42. local l
  43. while true do
  44. l = pats:read("*l")
  45. if not l then break end
  46. l = string.gsub(l, "/proc/asound/card", "")
  47. if l then
  48. ao_deviceid:value(l)
  49. end
  50. end
  51. pats:close()
  52. end
  53. return m