Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XmlListModel{
- id: xmlModel
- query: "/root"
- XmlRole{ name: "fullscreen"; query: "fullscreen/string()"}
- XmlRole{ name: "time"; query: "time/string()"}
- XmlRole{ name: "volume"; query: "volume/string()"}
- XmlRole{ name: "length"; query: "length/string()"}
- XmlRole{ name: "random"; query: "random/string()"}
- XmlRole{ name: "state"; query: "state/string()"}
- XmlRole{ name: "loop"; query: "loop/string()"}
- XmlRole{ name: "repeat"; query: "repeat/string()"}
- XmlRole{ name: "filename"; query: "information/category/info[@name='filename']/string()"}
- }
- function getVLCstatus()
- {
- console.log(" start: getVLCstatus")
- var httpReq = new XMLHttpRequest()
- var url = "http://" + ip + ":" + port + "/requests/status.xml";
- httpReq.open("GET", url, true);
- // Send the proper header information along with the request
- httpReq.setRequestHeader("Authorization", "Basic " + Qt.btoa(username + ":" + password));
- httpReq.setRequestHeader('Content-Type', 'text/xml');
- httpReq.onreadystatechange = function()
- {
- if(httpReq.readyState === XMLHttpRequest.DONE)
- {
- if(httpReq.status == 200)
- {
- xmlModel.xml = httpReq.responseText
- console.log("Volume: ", xmlModel.get(0).volume)
- }
- }
- }
- httpReq.send();
- }
Advertisement
Add Comment
Please, Sign In to add comment