2054185d4d63e8594f8d56cc50d7e2e9a7f3b455
[project/luci.git] / applications / luci-uvc_streamer / luasrc / model / cbi / uvc_streamer.lua
1 --[[
2
3 LuCI UVC Streamer
4 (c) 2008 Yanira <forum-2008@email.de>
5
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
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 ]]--
15
16 -- find current lan address and port of first uvc_streamer config section
17 local uci = luci.model.uci.cursor_state()
18 local addr = uci:get("network", "lan", "ipaddr")
19 local port
20
21 uci:foreach( "uvc_streamer", "uvc_streamer",
22 function(section) port = port or tonumber(section.port) end )
23
24 m = Map("uvc_streamer", translate("uvc_streamer"),
25 translatef("uvc_streamer_desc", nil, addr, port, addr, port))
26
27 s = m:section(TypedSection, "uvc_streamer", translate("settings"))
28 s.addremove = false
29 s.anonymous = true
30
31 s:option(Flag, "enabled", translate("enabled", "Enable"))
32
33 s:option(Value, "device", translate("device")).rmempty = true
34
35 nm = s:option(Value, "resolution", translate("resolution"))
36 nm:value("640x480")
37 nm:value("320x240")
38 nm:value("160x120")
39
40 s:option(Value, "framespersecond", translate("framespersecond")).rmempty = true
41
42 s:option(Value, "port", translate("port", "Port")).rmempty = true
43
44 return m