Guest User

Untitled

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