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-2006 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']
34 --vlc.msg.err("requests/status.xml got:","input: "..tostring(input),"command: "..tostring(command),"id: "..tostring(id),"val: "..tostring(val))
36 local function stripslashes(s)
37 return string.gsub(s,"\\(%.)","%1")
40 local status = vlc.playlist.status()
42 if command == "in_play" then
44 for o in string.gmatch(input," :[^ ]*") do -- FIXME: options should be in seperate variables, not in the same string as the input.
45 table.insert(options,string.sub(o,3))
47 vlc.playlist.add({{path=stripslashes(input),options=options}})
48 elseif command == "in_enqueue" then
49 vlc.playlist.enqueue(stripslashes(input))
50 elseif command == "pl_play" then
52 elseif command == "pl_pause" then
53 vlc.msg.err("FIXME: pl_pause implementation is ugly")
54 common.hotkey("key-play-pause") -- gruik
55 elseif command == "pl_stop" then
57 elseif command == "pl_next" then
59 elseif command == "pl_previous" then
61 elseif command == "pl_delete" then
62 vlc.msg.err("FIXME: pl_delete unimplemented")
63 --vlc.playlist.delete(id)
64 elseif command == "pl_empty" then
66 elseif command == "pl_sort" then
67 vlc.playlist.sort( val, id > 0 )
68 elseif command == "pl_random" then
70 elseif command == "pl_loop" then
72 elseif command == "pl_repeat" then
73 vlc.playlist.repeat_()
74 elseif command == "pl_sd" then
75 if vlc.sd.is_loaded(val) then
80 elseif command == "fullscreen" then
82 elseif command == "snapshot" then
84 elseif command == "volume" then
85 vlc.volume.set(tonumber(val))
86 elseif command == "seek" then
88 elseif command == "key" then
89 common.hotkey("key-"..val)
97 local input = vlc.object.input()
98 local playlist = vlc.object.playlist()
99 local vout = input and vlc.object.find(input,'vout','child')
102 <volume><?vlc print(vlc.volume.get()) ?></volume>
103 <length><?vlc if input then print(vlc.var.get(input,"length")) else print(0) end?></length>
104 <time><?vlc if input then print(vlc.var.get(input,"time")) else print(0) end?></time>
105 <state><?vlc print(status) ?></state>
106 <position><?vlc if input then print(vlc.var.get(input,"position")) else print(0) end?></position>
107 <fullscreen><?vlc if vout then vlc.var.get(vout,"fullscreen") else print(0) end?></fullscreen>
108 <random><?vlc print(vlc.var.get(playlist,"random")) ?></random>
109 <loop><?vlc print(vlc.var.get(playlist,"loop")) ?></loop>
110 <repeat><?vlc print(vlc.var.get(playlist,"repeat")) ?></repeat>
114 local info = vlc.input_info()
115 for k, v in pairs(info) do
116 print("<category name='"..k.."'>")
117 for k2, v2 in pairs(v) do
118 print("<info name='"..k2.."'>"..v2.."</info>")
128 local stats = vlc.playlist.stats()
129 for k,v in pairs(stats) do
130 local tag = string.gsub(k,"_","")
131 print("<"..tag..">"..tostring(v).."</"..tag..">\n")