1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlcprint'>'?>
4 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
5 < status.xml: VLC media player web interface
6 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
7 < Copyright (C) 2005-2009 the VideoLAN team
10 < Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
12 < This program is free software; you can redistribute it and/or modify
13 < it under the terms of the GNU General Public License as published by
14 < the Free Software Foundation; either version 2 of the License, or
15 < (at your option) any later version.
17 < This program is distributed in the hope that it will be useful,
18 < but WITHOUT ANY WARRANTY; without even the implied warranty of
19 < MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 < GNU General Public License for more details.
22 < You should have received a copy of the GNU General Public License
23 < along with this program; if not, write to the Free Software
24 < Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
29 local input = _GET['input']
30 local command = _GET['command']
31 local id = tonumber(_GET['id'] or -1)
32 local val = _GET['val']
33 local options = _GET['option']
34 if type(options) ~= "table" then -- Deal with the 0 or 1 option case
38 ---[[]] vlc.msg.err("requests/status.xml got:","input: "..tostring(input),"command: "..tostring(command),"id: "..tostring(id),"val: "..tostring(val))
40 local function stripslashes(s)
41 return string.gsub(s,"\\(%.)","%1")
44 local status = vlc.playlist.status()
46 if command == "in_play" then
48 vlc.msg.err( "<options>" )
49 for a,b in ipairs(options) do
52 vlc.msg.err( "</options>" )
54 vlc.playlist.add({{path=stripslashes(input),options=options}})
55 elseif command == "in_enqueue" then
56 vlc.playlist.enqueue({{path=stripslashes(input),options=options}})
57 elseif command == "pl_play" then
59 elseif command == "pl_pause" then
61 elseif command == "pl_stop" then
63 elseif command == "pl_next" then
65 elseif command == "pl_previous" then
67 elseif command == "pl_delete" then
68 vlc.msg.err("FIXME: pl_delete unimplemented")
69 --vlc.playlist.delete(id)
70 elseif command == "pl_empty" then
72 elseif command == "pl_sort" then
73 vlc.playlist.sort( val, id > 0 )
74 elseif command == "pl_random" then
76 elseif command == "pl_loop" then
78 elseif command == "pl_repeat" then
79 vlc.playlist.repeat_()
80 elseif command == "pl_sd" then
81 if vlc.sd.is_loaded(val) then
86 elseif command == "fullscreen" then
88 elseif command == "snapshot" then
90 elseif command == "volume" then
92 elseif command == "seek" then
94 elseif command == "key" then
95 common.hotkey("key-"..val)
103 local input = vlc.object.input()
104 local item = vlc.input.item()
105 local playlist = vlc.object.playlist()
106 local vout = input and vlc.object.find(input,'vout','child')
109 <volume><?vlc print(vlc.volume.get()) ?></volume>
110 <length><?vlc if input then print(math.floor(vlc.var.get(input,"length"))) else print(0) end?></length>
111 <time><?vlc if input then print(math.floor(vlc.var.get(input,"time"))) else print(0) end?></time>
112 <state><?vlc print(status) ?></state>
113 <position><?vlc if input then print(vlc.var.get(input,"position")) else print(0) end?></position>
114 <fullscreen><?vlc if vout then vlc.var.get(vout,"fullscreen") else print(0) end?></fullscreen>
115 <random><?vlc print(vlc.var.get(playlist,"random")) ?></random>
116 <loop><?vlc print(vlc.var.get(playlist,"loop")) ?></loop>
117 <repeat><?vlc print(vlc.var.get(playlist,"repeat")) ?></repeat>
119 <category name="meta">
122 local metas = item:metas()
123 for k,v in pairs(metas) do
124 print("<info name='"..k.."'>"..vlc.strings.convert_xml_special_chars(v).."</info>")
131 local info = item:info()
132 for k, v in pairs(info) do
133 print("<category name='"..k.."'>")
134 for k2, v2 in pairs(v) do
135 print("<info name='"..k2.."'>"..vlc.strings.convert_xml_special_chars(v2).."</info>")
145 local stats = item:stats()
146 for k,v in pairs(stats) do
147 local tag = string.gsub(k,"_","")
148 print("<"..tag..">"..tostring(v).."</"..tag..">\n")