Announcement

Collapse
No announcement yet.

XML displayed

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    XML displayed

    I have a file that is generated by JRiver media center whose contents look like the following:

    <Response Status="OK">
    <Item Name="State">2</Item>
    <Item Name="FileKey">37156</Item>
    <Item Name="PositionMS">164823</Item>
    <Item Name="DurationMS">267232</Item>
    <Item Name="ElapsedTimeDisplay">2:44</Item>
    <Item Name="RemainingTimeDisplay">-1:43</Item>
    <Item Name="TotalTimeDisplay">4:27</Item>
    <Item Name="PositionDisplay">2:44 / 4:27</Item>
    <Item Name="PlayingNowPosition">6</Item>
    <Item Name="PlayingNowTracks">80</Item>
    <Item Name="PlayingNowPositionDisplay">7 of 80</Item>
    <Item Name="PlayingNowChangeCounter">172902</Item>
    <Item Name="Bitrate">128</Item>
    <Item Name="SampleRate">44100</Item>
    <Item Name="Channels">2</Item>
    <Item Name="Chapter">0</Item>
    <Item Name="Volume">0.14</Item>
    <Item Name="VolumeDisplay">14% (-29.0 dB)</Item>
    <Item Name="ImageURL">MCWS/v1/File/GetImage?File=37156</Item>
    <Item Name="Name">107-turin_brake-sfishing_for_a_dream_(radio_edit)</Item>
    <Item Name="Status">Playing</Item>
    </Response>

    I'm assuming I should be able to parse some of this data to display on one of my screens.

    Can anyone provide any guidance?

    Thanks in advance,
    GB

    #2
    Here's a good article on parsing XML docs.
    http://vbnetsample.blogspot.com/2007...ldocument.html
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      I posted a script about two weeks ago that will do some basic XML parsing, one of the times it is slightly easier to use VBScript is with XML as it does not require any additional referencing whereas vb.net does. That script can be adapted for this purpose relatively easily.

      The most conventional way is by reading the XML file by script and then writing the requisite data to a device string and status tracking this in HSTouch. I am not sure how you would trigger the script though from JRMC and keep the data updated.

      You could also host a web page on the HS webserver that decoded the XML and then produced a html page that you could keep in a web frame in HSTouch (?).

      Comment


        #4
        I would rather not do the html insertion - I have another HSTouch page with html inserted in it and it doesn't look very pleasant. I'm trying to have it look a bit cleaner.

        As far as keeping the data updated, I'm not looking to get so granular that the current track time is playing (second by second), but I would like the artist's name and song title to show. This way I can list on my home page what song is currently playing.

        Comment

        Working...
        X