home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / vlc-2-0-5-win32.exe / lua / http / requests / status.xml < prev    next >
Extensible Markup Language  |  2012-12-12  |  3KB  |  82 lines

  1. <?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlcprint'>'?>
  2. <?vlc --[[
  3. vim:syntax=lua
  4. <!--  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
  5. <  status.xml: VLC media player web interface
  6. < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
  7. <  Copyright (C) 2005-2009 the VideoLAN team
  8. <  $Id$
  9. <  Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
  10. <              Rob Jonson <rob -at- hobbyistsoftware -dot- com>
  11. <  This program is free software; you can redistribute it and/or modify
  12. <  it under the terms of the GNU General Public License as published by
  13. <  the Free Software Foundation; either version 2 of the License, or
  14. <  (at your option) any later version.
  15. <  This program is distributed in the hope that it will be useful,
  16. <  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. <  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. <  GNU General Public License for more details.
  19. <  You should have received a copy of the GNU General Public License
  20. <  along with this program; if not, write to the Free Software
  21. <  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  22. < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  23. ]]?>
  24.  
  25. <?vlc
  26.  
  27. --package.loaded.httprequests = nil --uncomment to debug changes
  28. require "httprequests"
  29.  
  30. httprequests.processcommands()
  31.  
  32. local statusTable=httprequests.getstatus(false)
  33.  
  34. print('<root>\n')
  35. httprequests.printTableAsXml(statusTable,0)
  36.  
  37. local item = vlc.input.item()
  38.  
  39. --data in the information section is presented in a non-standard way to keep compatibility.
  40.  
  41. ?>
  42. <information>
  43.     <category name="meta">
  44.     <?vlc
  45.       if item then
  46.         local metas = item:metas()
  47.         for k,v in pairs(metas) do
  48.           print("<info name='"..httprequests.xmlString(k).."'>"..httprequests.xmlString(v).."</info>")
  49.         end
  50.       end
  51.     ?>
  52.     </category>
  53.   <?vlc
  54.     if item then
  55.       local info = item:info()
  56.       for k, v in pairs(info) do
  57.         print("<category name='"..httprequests.xmlString(k).."'>")
  58.           for k2, v2 in pairs(v) do
  59.             print("<info name='"..httprequests.xmlString(k2).."'>"..httprequests.xmlString(v2).."</info>")
  60.           end
  61.         print("</category>")
  62.       end
  63.     end
  64.   ?>
  65.   </information>
  66.   <stats>
  67.   <?vlc
  68.     if item then
  69.       local stats = item:stats()
  70.       for k,v in pairs(stats) do
  71.         local tag = string.gsub(k,"_","")
  72.         print("<"..httprequests.xmlString(tag)..">"..httprequests.xmlString(v).."</"..httprequests.xmlString(tag)..">\n")
  73.       end
  74.     end
  75.   ?>
  76.   </stats>
  77. </root>
  78.