View difference between Paste ID: L4MEgkCt and tUsnrB0G
SHOW: | | - or go back to the newest paste.
1-
    XmlListModel{
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-
        
13+
14
    }
15
    
16
    function getVLCstatus()
17
    {
18-
    { 
18+
19
        var httpReq = new XMLHttpRequest()
20
        var url = "http://" + ip + ":" + port + "/requests/status.xml";
21
22-
        
22+
23
        // Send the proper header information along with the request
24-
        
24+
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-
        console.log("Volume: ", xmlModel.get(0).volume)
39+