Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#301603 - 18/08/2007 13:06 Hijack v478: "get running order" for .xml web interface.
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Hijack v478 is now available.

New in this version is the long awaited "get current running order" interface for Mark Cushman's empeg party interface stuff.
  • Retrieve the current running order, in the form of a playlist, from the web interface using FID=001&EXT=.xml Note that the leading zeros are *required*, and that this feature only works currently with .xml output, not regular .html (I should fix this someday).

  • For any playlist, one can now specify a limit to the number of items returned, using &COUNT=10 for example (or any positive integer; zero means "return everything").

  • Also for any playlist, a starting offset can be specified, to skip over the first few entries, using &OFFSET=5 for example.

  • The .xml output for FID=001 also sets two additional variables at the top: runOrderLen="nnn" and playListLen="nnn", both based upon the values of the same names, as retrieved from the running order area of the dynamic data paritition.

I have also noticed that the stored "current running order" is not always updated on disk immediately, particularly (or possibly only) when the player is paused.

Enjoy!

Top
#301604 - 18/08/2007 13:53 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Here is some sample output, showing what this initial implementation returns
for FID=001. Hopefully this will do the job, but I'm not completely sure
whether the stylesheet info it returns will confuse the party interface or not (?).

Note that the "<playlist stylesheet= ...>" line is actually a single line of output,
not broken up with newlines as I have done below (to make this thread readable).

Also, I wonder if we should be overriding the tracknr=nn values with the
actual running order index for each entry?

Code:

wget -O- 'http://blueface/?FID=001&EXT=.xml&COUNT=5'

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/default.xsl"?>
<playlist stylesheet="/default.xsl" host="blueface" allow_files="1" allow_commands="1"
type="playlist" tagfid="1" fid="0" length="" year="" options="" genre="" title="" artist=""
source="" comment="" runOrderLen="11421" playListLen="11421">
<items>
<item>
<type>tune</type>
<tagfid>17371</tagfid>
<fid>17370</fid>
<year></year>
<options></options>
<genre>Rock</genre>
<title>SOS</title>
<artist>Abba</artist>
<source>Greatest Hits</source>
<comment>Created by Grip</comment>
<length>3372521</length>
<tracknr>01</tracknr>
<bitrate>vs134</bitrate>
<samplerate>44100</samplerate>
<codec>mp3</codec>
<duration>3:20</duration>
<offset>0</offset>
</item>
<item>
<type>tune</type>
<tagfid>a091</tagfid>
<fid>a090</fid>
<year></year>
<options></options>
<genre>Blues</genre>
<title>Save the Rainforest.. or Else</title>
<artist>Local Anxiety</artist>
<source>Greenpieces</source>
<comment>http://www.mp3.com/</comment>
<length>3635966</length>
<tracknr>10</tracknr>
<bitrate>fs128</bitrate>
<samplerate>44100</samplerate>
<codec>mp3</codec>
<duration>3:47</duration>
<offset>0</offset>
</item>
<item>
<type>tune</type>
<tagfid>10ce1</tagfid>
<fid>10ce0</fid>
<year></year>
<options></options>
<genre>Rock</genre>
<title>Tell Me There's A Heaven</title>
<artist>Chris Rea</artist>
<source>The Road To Hell</source>
<comment></comment>
<length>4988976</length>
<tracknr>10</tracknr>
<bitrate>vs109</bitrate>
<samplerate>44100</samplerate>
<codec>mp3</codec>
<duration>6:03</duration>
<offset>0</offset>
</item>
<item>
<type>tune</type>
<tagfid>7c11</tagfid>
<fid>7c10</fid>
<year></year>
<options></options>
<genre></genre>
<title>Lament</title>
<artist>musicals</artist>
<source>Evita</source>
<comment></comment>
<length>3802204</length>
<tracknr>23</tracknr>
<bitrate>vs127</bitrate>
<samplerate>44100</samplerate>
<codec>mp3</codec>
<duration>3:59</duration>
<offset>0</offset>
</item>
<item>
<type>tune</type>
<tagfid>158c1</tagfid>
<fid>158c0</fid>
<year></year>
<options></options>
<genre>Folk</genre>
<title>The Ballad of Lucy Jordan</title>
<artist>Barra MacNeils</artist>
<source>The Question</source>
<comment></comment>
<length>4457229</length>
<tracknr>03</tracknr>
<bitrate>vs134</bitrate>
<samplerate>44100</samplerate>
<codec>mp3</codec>
<duration>4:24</duration>
<offset>0</offset>
</item>
</items>
</playlist>


Top
#301605 - 18/08/2007 17:56 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
cushman
veteran

Registered: 21/01/2002
Posts: 1380
Loc: Erie, CO
Thanks, Mark! I will take a look at this tonight and see what I can come up with!
_________________________
Mark Cushman

Top
#301606 - 18/08/2007 19:03 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Quote:

  • The .xml output for FID=001 also sets two additional variables at the top: runOrderLen="nnn" and playListLen="nnn", both based upon the values of the same names, as retrieved from the running order area of the dynamic data paritition.


  • Mmm.. I wonder if one/both of those two values should instead indicate the number of entries actually returned (possibly limited by a &COUNT=nn directive) ?

    Top
    #301607 - 18/08/2007 20:53 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
    cushman
    veteran

    Registered: 21/01/2002
    Posts: 1380
    Loc: Erie, CO
    Quote:
    Mmm.. I wonder if one/both of those two values should instead indicate the number of entries actually returned (possibly limited by a &COUNT=nn directive) ?

    The count of <item>s can be had by the stylesheet, it's easy to count child elements in XSL.

    One thing I had in my output format that you do not is the current running order number - the position of the track in the current playlist. This is difficult to calculate if you allow negative offsets, since you would not know if the offset is valid or not. For example:

    I have a playlist of 20 items, I am currently playing track 3, but my view is set up to show the last 5 songs and the next 10 songs. I specify count=15&offset=-5 but because there is no track -1, what is returned is track 1-15.

    Can you specify negative offsets?

    Could you also output a flag on an item to indicate the currently playing track? This would save a round-trip to notify to get the currently playing track. Example of both:

    <item number="3" playing="yes">

    You could omit the playing attribute if it is not playing:

    <item number="4">
    _________________________
    Mark Cushman

    Top
    #301608 - 18/08/2007 21:17 Re: Hijack v478: "get running order" for .xml web interface. [Re: cushman]
    mlord
    carpal tunnel

    Registered: 29/08/2000
    Posts: 14472
    Loc: Canada
    Quote:

    One thing I had in my output format that you do not is the current running order number - the position of the track in the current playlist. This is difficult to calculate if you allow negative offsets, since you would not know if the offset is valid or not. For example:

    I have a playlist of 20 items, I am currently playing track 3, but my view is set up to show the last 5 songs and the next 10 songs. I specify count=15&offset=-5 but because there is no track -1, what is returned is track 1-15.

    Can you specify negative offsets?

    No. Do you want anything changed from the above (not clear to me)?

    Quote:

    Could you also output a flag on an item to indicate the currently playing track? This would save a round-trip to notify to get the currently playing track. Example of both:

    <item number="3" playing="yes">

    You could omit the playing attribute if it is not playing:

    <item number="4">


    Looks like a good idea. Yes. Later..

    Cheers

    Top
    #301609 - 18/08/2007 21:58 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
    cushman
    veteran

    Registered: 21/01/2002
    Posts: 1380
    Loc: Erie, CO
    Quote:
    No. Do you want anything changed from the above (not clear to me)?

    Just allow negative offsets so I can retrieve the previous X songs to the currently playing one. This gives an enhanced Now and Next view that would be useful: "Who sung that last song?".

    Thanks!
    _________________________
    Mark Cushman

    Top
    #301610 - 18/08/2007 23:01 Re: Hijack v478: "get running order" for .xml web interface. [Re: cushman]
    mlord
    carpal tunnel

    Registered: 29/08/2000
    Posts: 14472
    Loc: Canada
    Quote:
    Quote:
    No. Do you want anything changed from the above (not clear to me)?

    Just allow negative offsets so I can retrieve the previous X songs to the currently playing one. This gives an enhanced Now and Next view that would be useful: "Who sung that last song?".

    Thanks!


    I'm still very confused. Have you left something out of the description here?

    The current implementation starts with the beginning of the running order list. A negative offset would have it return garbage.

    ????

    Top
    #301611 - 18/08/2007 23:02 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
    mlord
    carpal tunnel

    Registered: 29/08/2000
    Posts: 14472
    Loc: Canada
    Quote:
    Quote:
    Quote:
    No. Do you want anything changed from the above (not clear to me)?

    Just allow negative offsets so I can retrieve the previous X songs to the currently playing one. This gives an enhanced Now and Next view that would be useful: "Who sung that last song?".

    Thanks!


    I'm still very confused. Have you left something out of the description here?

    The current implementation starts with the beginning of the running order list. A negative offset would have it return garbage.

    ????


    Perhaps you expect the current implementation to automatically skip to the currently playing FID ? It doesn't do that right now. If it did do that, then your request would begin to make sense to me.

    ???

    Top
    #301612 - 19/08/2007 01:21 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
    cushman
    veteran

    Registered: 21/01/2002
    Posts: 1380
    Loc: Erie, CO
    Quote:
    Perhaps you expect the current implementation to automatically skip to the currently playing FID ? It doesn't do that right now. If it did do that, then your request would begin to make sense to me.

    Yup, that's the confusion. I was assuming it would begin at the currently playing song. Your implementation is better - you can lookup the currently playing position and start from there.
    _________________________
    Mark Cushman

    Top
    #301613 - 19/08/2007 12:05 Re: Hijack v478: "get running order" for .xml web interface. [Re: cushman]
    mlord
    carpal tunnel

    Registered: 29/08/2000
    Posts: 14472
    Loc: Canada
    Quote:
    Quote:
    Perhaps you expect the current implementation to automatically skip to the currently playing FID ? It doesn't do that right now. If it did do that, then your request would begin to make sense to me.

    Yup, that's the confusion. I was assuming it would begin at the currently playing song. Your implementation is better - you can lookup the currently playing position and start from there.

    Well, I don't know if it's better or not. Tell me what you want it to do differently from right now, and I'll have a looksee.

    Thanks!

    Top
    #301614 - 19/08/2007 12:07 Re: Hijack v478: "get running order" for .xml web interface. [Re: mlord]
    mlord
    carpal tunnel

    Registered: 29/08/2000
    Posts: 14472
    Loc: Canada
    Quote:
    Quote:
    Quote:
    Perhaps you expect the current implementation to automatically skip to the currently playing FID ? It doesn't do that right now. If it did do that, then your request would begin to make sense to me.

    Yup, that's the confusion. I was assuming it would begin at the currently playing song. Your implementation is better - you can lookup the currently playing position and start from there.

    Well, I don't know if it's better or not. Tell me what you want it to do differently from right now, and I'll have a looksee.

    Thanks!


    Note that you can test what it currently does by manually entering the appropriate URL. Since it still specifies a stylesheet, one can browse the running order in WebLite just like any other playlist.

    http://your.empeg.ip.addr/?FID=001&EXT=.xml&OFFSET=2&COUNT=5

    Top