Guest User

Untitled

a guest
Jan 18th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. XmlListModel{
  2. id: xmlModel
  3. query: "/root"
  4. XmlRole{ name: "fullscreen"; query: "fullscreen/string()"}
  5. XmlRole{ name: "time"; query: "time/string()"}
  6. XmlRole{ name: "volume"; query: "volume/string()"}
  7. XmlRole{ name: "length"; query: "length/string()"}
  8. XmlRole{ name: "random"; query: "random/string()"}
  9. XmlRole{ name: "state"; query: "state/string()"}
  10. XmlRole{ name: "loop"; query: "loop/string()"}
  11. XmlRole{ name: "repeat"; query: "repeat/string()"}
  12. XmlRole{ name: "state"; query: "state/string()"}
  13.  
  14. XmlRole{ name: "filename"; query: "information/category/info[@name='filename']/string()"}
  15. }
  16.  
  17. function getVLCstatus()
  18. {
  19. console.log(" start: getVLCstatus")
  20. var httpReq = new XMLHttpRequest()
  21. var url = "http://" + ip + ":" + port + "/requests/status.xml";
  22.  
  23. httpReq.open("GET", url, true);
  24.  
  25. // Send the proper header information along with the request
  26. httpReq.setRequestHeader("Authorization", "Basic " + Qt.btoa(username + ":" + password));
  27. httpReq.setRequestHeader('Content-Type', 'text/xml');
  28. httpReq.onreadystatechange = function()
  29. {
  30. if(httpReq.readyState === XMLHttpRequest.DONE)
  31. {
  32. if(httpReq.status == 200)
  33. {
  34. xmlModel.xml = httpReq.responseText
  35. }
  36. }
  37. }
  38. httpReq.send();
  39. console.log("Volume: ", xmlModel.get(0).volume)
  40. }
Advertisement
Add Comment
Please, Sign In to add comment