Help - Search - Members - Calendar
Full Version: foo_httpcontrol
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5
Hancoque
I've found the problem. It occurs after setting the playlist's position to 'absolute'. If offsetHeight and scrollTop are accessed before that happens, the problem doesn't occur. However, as these values are only useful after setting the position to 'absolute' it has to be done in that order.

But I've also found a fix. Simply set the position to 'fixed' instead of 'absolute'. wink.gif
oblikoamorale
my appreciation for this curious tour through innard html debris smile.gif

brief test reveals that IE6.0.2900.5512 doesn't introduce disappearing playlist anymore. playlist won't become scrollable as well, but I guess it's not a big deal.
opera 9.5 and mozilla 2 works fine despite the change.
Canar
QUOTE(carmenm @ Jun 25 2008, 08:36) *

Does anybody see a way to do a template using sproutcore??


Yeah. Sproutcore is just a javascript framework, so you can use it in template design.
oblikoamorale
CODE
    v0.76a 02 Jul 2008
        fix: playlist switcher fought with multipage playlist;
        fix: playing track playlist autoscroller;
3ddfreak
This is one of the best plugins for foobar ever! Thx oblikoamorale! The only thing I cant get to work is coverart? Any suggestions? (I have "cover.jpg" files in my albumfolders. How can I actually display them?)
Ritsl
Using this in the field for 'Album art' in the http_control preferences should do the trick.

$puts(dir,$left(%path%,$strrchr(%path%,\)))$get(dir)folder.jpg|$get(dir)*.jpg

... and using an html template with <img src="[ALBUMART]" alt=""> in it of course.
3ddfreak
QUOTE(Ritsl @ Jul 6 2008, 20:53) *

Using this in the field for 'Album art' in the http_control preferences should do the trick.

$puts(dir,$left(%path%,$strrchr(%path%,\)))$get(dir)folder.jpg|$get(dir)*.jpg

... and using an html template with <img src="[ALBUMART]" alt=""> in it of course.


Yup, it works now! Thx for the fast reply/help! smile.gif
:ub:
Thank you so much oblikoamorale, foo_httpcontrol is THE answer to controlling foobar on a remote machine, and it is very well done! You can't believe how happy I am that I found your plugin.

Here are a few ideas I've had to make the UI more intuitive for less technical users:
  • clearer playback buttons
  • grouped controls
  • floating album art display (click to hide/unhide)
  • simple/expert mode, hiding some more advanced features

The playback control buttons are pure ASCII:
IPB Image

Full screenshot:
IPB Image

If you're interested, these are the foo_httpcontrol HTML files:
http://rapidshare.com/files/131110860/foo_...l_data.zip.html

Dear oblikoamorale, there are a few other ideas that I guess can't be done in html:
  • wouldn't a transparent onepixel.gif be a better fallback cover art than a JPG?
  • it would be nice to have a volume control in the same cool way as the track progress bar
  • the File Browser could be displayed in the "controls" screen, alternating with the playlist

The last point is certainly a bit of work, but maybe it's less work than adding more real "Playlist management" to foo_http_control (change order, drag&drop, etc). For a user who just likes to play entire albums from a directory tree, using foo_http_control might become even easier: they just click "Folder browser", click "Play this folder", and see the "now playing" bar progress through the directory.

The idea is: If the folder browser was appearing underneath the playback controls in the "controls" screen, it could on-and-off replace the playlist in the lower part of the screen, and always show the currently played song in its actual "directory context". The Playlist controls could be replaced with "enqueue folder/subfolder". So, the user could flip back and forth from Playlist to Folders view in a single screen. The %path% variable on the current controls screen could then be permanently replaced with the cool "clickable" path you've done for the browser screen, which would give a nice way to navigate folders right in the controls screen.

Just an idea!

Thanks a lot anyway for this long-awaited plugin!

Best
Ulf
:ub:
...I forgot to mention that, in the screenshot I shared, the "expert mode" was obviously turned off.

If turned on, the complete foo_httpcontrol is visible, of course. The user can control it with a little checkbox in the "Display" control group:

IPB Image
Tim Schuhmacher
Nice skin, but the listbox is the expert mode doesn't work in Firefox 2. (the one with start, enqueue...) It won't show the available options, and it is positioned half over the stop and play controls. Also is expert mode not remembered. For example when expert mode is visable, hit refresh (upd button) and expert mode is disabled.
:ub:
QUOTE(Tim Schuhmacher @ Jul 20 2008, 15:49) *
Nice skin, but the listbox is the expert mode doesn't work in Firefox 2. (the one with start, enqueue...) It won't show the available options, and it is positioned half over the stop and play controls. Also is expert mode not remembered. For example when expert mode is visable, hit refresh (upd button) and expert mode is disabled.

Thanks, Tim! All functionality tested OK on Firefox 3 -- if you can, I recommend the upgrade from FF2: A lot of things improved significantly in FF3.

Nevertheless, here's a version that depends less on CSS2.0, so it should work on a broader range of browsers. Does this work better for you?

IPB Image
http://rapidshare.com/files/131148724/foo_...l_data.zip.html

BTW, yes, the "expert" mode is flagged just inside the page, not in the URL. So it gets reset every time the page is reloaded. It's good to see here that the "expert" settings themselves are persistent! So for instance, when you flip the "Start/Enqueue/..." switch to "Delete", all following clicks in the playlist respect that setting until you go back to expert mode and change it.

Anyway I agree that persistence should be added, but when I made the expert mode I found persistance was less of a problem than I thought in the beginning.

Best,
Ulf
Tim Schuhmacher
Thanks for the quick reply and updated (but downgraded smile.gif ) version. Indeed I should update to Firefox 3. This one works better!
oblikoamorale
QUOTE(:ub: @ Jul 20 2008, 18:02) *
there are a few other ideas that I guess can't be done in html:
  • wouldn't a transparent onepixel.gif be a better fallback cover art than a JPG?
  • it would be nice to have a volume control in the same cool way as the track progress bar
  • the File Browser could be displayed in the "controls" screen, alternating with the playlist


first of all, thanks for the feedback. it is always interesting to see the ways someone use THIS. now, let's get to the answers.
I find having additional option to specify nocover/nocoverinfo filenames an overkill. yes, it seems reasonable being able to select a single pixelled gif to save bandwidth, but to think of it, the ones who are caring of bandwidth saving won't be using cover art anyway. so it doesn't really matter if a fewbyted onepixel.gif or 700 bytes onepixel.jpg is loaded. moreover, the loaded file will be cached by browser anyway.

tracking volume control can definitely be done by javascript means, considering the fact that you can retrieve current volume level by [VOLUME], and set volume by calling /cmd=Volume?param1=NN

QUOTE(:ub: @ Jul 20 2008, 18:02) *
The last point is certainly a bit of work, but maybe it's less work than adding more real "Playlist management" to foo_http_control (change order, drag&drop, etc). For a user who just likes to play entire albums from a directory tree, using foo_http_control might become even easier: they just click "Folder browser", click "Play this folder", and see the "now playing" bar progress through the directory.


I'll try to give your idea a thought. perhaps it is indeed nicer to have one combined page rather than two separated pages, but I've never considered this. the media player classic web inferface was the inspiration and it does have two separated pages.
regarding the ability of being able to fully control playlist.. well, I think it doesn't just needed in our case where things are bound to be as simple as it is possible. anyways, half of the playlist modifications possibilities are available, and the other half is somehow compensated by playback queue access.

QUOTE(:ub: @ Jul 20 2008, 19:11) *
BTW, yes, the "expert" mode is flagged just inside the page, not in the URL. So it gets reset every time the page is reloaded. It's good to see here that the "expert" settings themselves are persistent! So for instance, when you flip the "Start/Enqueue/..." switch to "Delete", all following clicks in the playlist respect that setting until you go back to expert mode and change it.

you're right, this kind of persistence needs to be done on plugin side. and while it is possible to create some kind of user defined variables being stored within the plugin, I don't really know if the time spent on it will really be compensated by achieved functionality.
:ub:
Hi oblikoamorale, thanks for your prompt response!
QUOTE(oblikoamorale @ Jul 21 2008, 16:18) *
QUOTE(:ub: @ Jul 20 2008, 18:02) *
there are a few other ideas that I guess can't be done in html:
  • wouldn't a transparent onepixel.gif be a better fallback cover art than a JPG?
I find having additional option to specify nocover/nocoverinfo filenames an overkill. yes, it seems reasonable being able to select a single pixelled gif to save bandwidth
This could be a misunderstanding, actually: the idea was not to save a few hundred bytes, but to have a transparent graphic for "fallback" in case that no cover art is found. afaik, jpg graphics can't be transparent, but gif graphics can.

Here's one more idea to share before I go for the pub now cool.gif -- a great feature would of course be if you could make FB2K's command interface available via URL parameters: So, you could pass FB2K commands straight through to FB2K when your plugin receives them via the cmd parameter. This would enable HTML developers to add functionality right in the template: For instance, I would like to be able to set %rating% tags in music files right from a button in the HTML user interface. If I knew I could just pass a FB2K command to FB2K via the URL, your plugin could enable such command-passing without actual modifications to your plugin itself...

Ulf
oblikoamorale
QUOTE(:ub: @ Jul 21 2008, 23:22) *

This could be a misunderstanding, actually: the idea was not to save a few hundred bytes, but to have a transparent graphic for "fallback" in case that no cover art is found. afaik, jpg graphics can't be transparent, but gif graphics can.

eheh, it's just an one tiny bit of a pixel, isn't it? well, all right, it will be possible to specify coverinfo file names in future versions.
QUOTE(:ub: @ Jul 21 2008, 23:22) *

Here's one more idea to share before I go for the pub now cool.gif -- a great feature would of course be if you could make FB2K's command interface available via URL parameters: So, you could pass FB2K commands straight through to FB2K when your plugin receives them via the cmd parameter. This would enable HTML developers to add functionality right in the template: For instance, I would like to be able to set %rating% tags in music files right from a button in the HTML user interface. If I knew I could just pass a FB2K command to FB2K via the URL, your plugin could enable such command-passing without actual modifications to your plugin itself...

I'm afraid there's no universal way of making all of the commands (hehhh...) to be available without programming support for each and every one. is it really needed?
how will you estimate the number of users needing such thing? smile.gif
:ub:
QUOTE(oblikoamorale @ Jul 22 2008, 16:32) *

'm afraid there's no universal way of making all of the commands (hehhh...) to be available without programming support for each and every one. is it really needed?
Hi oblikomorale, when I suggested passing commands to foobar via your http plugin, I though of something like http://192.168.178.2:8888/?foo_cmd=/playing_command:"Custom Info/Rate 5" that would pass everything after "foo_cmd=" to foobar's command line: \foobar2000\foobar2000.exe /playing_command:"Custom Info/Rate 5".

Don't you think this would be doable in a generic way? Of course, it was not my intention to suggest writing individual code for every API command.

Btw, I've made another small enhancement to the HTML: by clicking the album art, the cover.jpg now switches between 3 states: small -- invisible -- fullscreen -- small invisible.. etc etc. It's quite nice to display and hide large covers with a click smile.gif

http://rapidshare.com/files/132240691/foo_...l_data.zip.html

Do you think you could make the new settings "image appearance" and "expert mode" persistent in your plugin: similar to "volume", which is also persistent already?

Best
Ulf

oblikoamorale
don't know how useful these additions are going to be, but here you go:
CODE
    v0.77 26 Jul
        add: user specified macro values. for example, calling the following:
             http://127.0.0.1:8888/?cmd=SetVar&param1=VarName&param2=VarValue
             initializes [VarName] macro with VarValue.
             note that the [VarName] macro doesn't get replaced unless VarName
             variable is initialized;
        add: ability  to  execute  currently  running  foobar  with  specified
             command line parameters. make  sure  to  urlencode  command  line
             parameter (just in case). example:
             http://127.0.0.1:8888/?cmd=CmdLine&param1=%2fplaypause
        add: customizable nocover and nocoverinfo image names;
        fix: heap corruption in jnetlib's getheader();
:ub:
QUOTE(oblikoamorale @ Jul 26 2008, 20:30) *
don't know how useful these additions are going to be, but here you go:
Thanks, oblikomorale!

I've been testing it and it works: smile.gif Using plugins RunCMD and Quicktagger (or PlaybackStatistics), it's now possible to set a %rating% tag for songs per foo_httpcontrol, and display the song's %rating% tag in the playlist.

So as promised, let me extend my HTML skin with some rating functionality, and persistent cover art display. I'll be back...

Thanks a lot for your quick response!

Ulf
btz
Loving the plugin, great work. and the themes aswell.

just have one little problem, no albumart is showing up in any of the themes. even tho foobar finds the pictures just fine, the webinterface wont :S

all my albumarts are called folder.jpg and located in the folder of the albums

would be nice if anyone could tell me what im doing wrong smile.gif
viniciusferrao
Awesome! smile.gif

But... can we have a better iPhone interface? Automatic browser detection too? ^^

Okay, I'm asking too much tongue.gif
sIIhZt
sorry if i missed this being mentioned before, but is there a way to run a foobar script from the webinterface?
i really need that feature as i'm using various scripts like all the time
oblikoamorale
btz, put this into album art field of http control preferences page:
$directory_path(%path%)\folder.jpg

viniciusferrao, if you want interface improvements I'm afraid you have to spend some time implementing them by yourself.

larskl, define foobar script please. I'm quite curious what would it be.
RainDawg
Is there a foobar2000 scripting language? Hrm....I've managed to miss this little beauty.
sIIhZt
QUOTE
larskl, define foobar script please. I'm quite curious what would it be.

Masstagger scripts I meant. Afaik that's the only kind of scripting available so I use it heavily and it'd really be nice to have it available in this plugins.
For example I use it for rating songs as I listen to them, amongst other stuff.
sIIhZt
After playing with the existing interfaces I noticed one big problem with all of them: they use synchronous requests, making the updates require screen updates. So I wrote this AJAX powered webui!

Due to the way this plugin is designed you'll have to open http://localhost:8888/index.html instead of just http://localhost:8888/ in your browser (the "index.html" part is important, else you'll just get some text) but besides that it works just fine.

IPB Image

Download: http://www.2shared.com/file/3717567/6947f4...ntrol_data.html
Mirror: http://www.uploading.com/files/9XPZ4C6M/fo...l_data.zip.html

Note: Doesn't work with IE, tested in Opera 9.5 and Firefox 3
oblikoamorale
larski, it's the one of an interesting approach, nice.
regarding support of tagging, it is available via cmdline interface, I guess. just look a bit up the thread.
sIIhZt
Thx, that works fine. Must have missed that post sad.gif
sIIhZt
made my webui with firefox as well (IE is still not supported and will not be):

http://www.2shared.com/file/3717567/6947f4...ntrol_data.html
http://www.uploading.com/files/9XPZ4C6M/fo...l_data.zip.html
rexit2
I just discovered this today. Great Work, Thanks!
I would love to have some way of keyword searching the playlist or the directories. (other then using the *find* feature in the web browser) Maybe this is possible already, I'm just not aware of how to go about this. Thanks, again smile.gif
3ddfreak
Trying to get this to work on my nokia N82. Anyone who managed to get it to work on an Nseries phone?
oblikoamorale
QUOTE(3ddfreak @ Aug 7 2008, 16:54) *

Trying to get this to work on my nokia N82. Anyone who managed to get it to work on an Nseries phone?

perhaps you should start with stripping down as much javascript as possible and heavily reducing the amount of displayed information.
alkasar
QUOTE(larskl @ Aug 6 2008, 20:54) *

thanks for the port. I am using FF 3 on Vista. Ii looks really good and is a pretty reactive interface.

volumebar and progress bar are not clickable. (except extreme right/left). I am a nub, but tried to read your code and it seems your intention was to make the areas clickable. A bug ?

also, if i may : the layout is really big! could you reduce size so that it fits without scrolling on a regular size screen... i mean about 500 pixel height should be sufficient. For example, thiner prgress bar and put the volume % in the volumebar would save space and be even better looking.

are you working on playlist management in ajax as well ? the potential of this interface seems really great.
sIIhZt
hm, overlooked the bars not working in FF. No idea why they don't work there, works fine in Opera (which is my main browser and thus the browser this was created for).
I'm not planning to make any further changes on this interface at the moment as it has all the features I need but feel free to built uppon it or reuse any of the code/ideas used
Auric
QUOTE(alkasar @ Aug 7 2008, 07:30) *

are you working on playlist management in ajax as well ? the potential of this interface seems really great.


I've been toying around with this a bit myself, with the goal of making an iPhone UI that is more consistent with the iPod app. The playlist is a bit difficult to work with though, since there appears to be some table formatting built-in.
Auric
Would it be possible to move the playlist formatting (the table rows and links) out of the internal code and either into a parameter in the settings or an external file?
oblikoamorale
being exactly specific in what data you want to receive should really help me, as it will save my time.

removing builtin table formatting seems a good way except it doesn't answer to the question where playlist highlighting data should be going. we can't just drop it, right?

so, won't you mind to be a good sport, go ahead and elaborate on the request? smile.gif
Auric
QUOTE(oblikoamorale @ Aug 8 2008, 21:19) *

being exactly specific in what data you want to receive should really help me, as it will save my time.

removing builtin table formatting seems a good way except it doesn't answer to the question where playlist highlighting data should be going. we can't just drop it, right?

so, won't you mind to be a good sport, go ahead and elaborate on the request? smile.gif


If you are referring to the odd, even and focus classes, you already mentioned one possibility earlier in this thread: store the playlist as an array in an external file. You wouldn't need to pass the highlighting data because the user would have all the information he needs to make his own. There are other possibilities too, but I think that would probably be the most efficient.

The only question is how to store the array. XML might be the obvious choice, though I opted for JSON in my template since it does not require an external interpreter and is therefore faster. The downside is that I ran in to a host of issues with quotes. Since JSON data is really just a JavaScript array, it doesn't like quotes or apostrophes within the data. The user-specified formatting strings in your component do not have this problem, as they are apparently stripped of quotes before being stored as a macro. The extra formatting code (e.g. highlight classes), however, is not stripped of quotes. At the moment, I'm using a few lines of JavaScript to parse the playlist and pull out the quotes where necessary.
oblikoamorale
QUOTE(Auric @ Aug 9 2008, 18:35) *
The only question is how to store the array. XML might be the obvious choice, though I opted for JSON in my template since it does not require an external interpreter and is therefore faster.

care to show example of your own JSON playlist data structures and code digging through them? it might help to push myself towards the right direction.
Auric
QUOTE(oblikoamorale @ Aug 9 2008, 09:59) *

care to show example of your own JSON playlist data structures and code digging through them? it might help to push myself towards the right direction.


Sure.

The JSON data is stored in the foo_httpcontrol_controls_tpl file, much like Larskl's solution. As I said, it's basically just a JavaScript array:
CODE
{
"playlist": "[PLAYLIST]",
"volume": "[VOLUME]",
"isplaying": "[IS_PLAYING]",
"ispaused": "[IS_PAUSED]",
"lastaction": "[LAST_ACTION]",
"trackpos": "[TRACK_POS]",
"tracklen": "[TRACK_LEN]",
"helper1": "[HELPER1]",
"helper2": "[HELPER2]",
"helper3": "[HELPER3]",
"albumart": "[ALBUMART]"
}

Here's the code that parses it, taken from the AJAX function called on state changes:
CODE
jsonString = httpRequestStatus.responseText;
plString = jsonString.substring(jsonString.indexOf('<'),jsonString.indexOf('",'));
plStringNew = plString.replace(/"/g,'');
plStringNew = plStringNew.replace(/'/g,"");
h1String = jsonString.substring(jsonString.indexOf("<div>"),jsonString.indexOf('</div>"'));
h1StringNew = h1String.replace(/"/g,'');
jsonString = jsonString.replace(plString,plStringNew);
jsonString = jsonString.replace(h1String,h1StringNew);
fooVars = eval("(" + jsonString + ")");

7 of those 9 lines are doing nothing but stripping quotes. Since the JSON data structure itself uses quotes, I can't just strip all of them out of the file, so those lines isolate the playlist and helper1 macros -- the ones that potentially have quotes in them -- and strip their quotes. The code only makes sense if you know that the playlist macro is the very first "<" in the data array, and the helper1 macro is the first div. I apologize for the confusing code; cleanup will come later.

In any case, the import bit is the eval() function. You can use the built-in JavaScript interpreter to parse JSON data instead of having to load a DOM parser for XML.
oblikoamorale
thanks for the tip on JSON! it looked easy enough, so the following quick and dirty fb2k state structure based on your example came upon my mind:
CODE
var fb2k =
{
    "playlist": [ { entry_1 }, { entry_etc } ],        // to implement
// example of custom titleformatted entry:
// "track": "Some track title", "len": "5:01", "playing": "%is_playing%", "focus": "{IS_FOCUSED}", "previously_played": "{PREVIOUSLY_PLAYED}", "q_num" : "{QUEUE_NUM}"
//
// {IS_FOCUSED}, {QUEUE_NUM}, {PREVIOUSLY_PLAYED} need to be implemented, this data is not available in titleformatting
    "playlist_page": "[PLAYLIST_PAGE]",                // to implement
    "playlist_total_pages": "[PLAYLIST_PAGES]",        // to implement
    "playlist_total_time": "[PLAYLIST_TOTAL_TIME]",
    "queue_total_time": "[QUEUE_TOTAL_TIME]",
    "playlists": [                                  // to implement
       { "name": "Playlist 1", "items" : "102" },
       { "name": "Playlist etc", "items" : "54" } ],
    "playlists_current": "[PLAYLIST_CURRENT]",        // to implement
    "playlists_total": "[PLAYLIST_TOTAL]",            // to implement
    "playback_order": "[PLAYBACK_ORDER]",            // to implement
    "volume": "[VOLUME]",
    "isplaying": "[IS_PLAYING]",
    "ispaused": "[IS_PAUSED]",
    "isenqueueing": "[IS_ENQUEUEING]",
    "lastaction": "[LAST_ACTION]",
    "stopaftercurrent": "[SAC]",
    "autorefresh": "[AUTO_REFRESH]",
    "trackpos": "[TRACK_POS]",
    "tracklen": "[TRACK_LEN]",
    "tracknum": "[TRACK_NUM]",
    "trackstotal": "[TRACKS_TOTAL]",
    "helper1": "[HELPER1]",
    "helper2": "[HELPER2]",
    "helper3": "[HELPER3]",
    "albumart": "[ALBUMART]"
}

please correct me if anything neccessary is forgotten.
the quotes issue can be avoided by replacing " with &quote; in every titleformatted field within the plugin.
Auric
Looks good, except for a few minor typos. %is_playing% should be [IS_PLAYING], {IS_FOCUSED} should be [IS_FOCUSED], etc, but I'm sure you would've caught that before implementation.
oblikoamorale
I do realise this might look somewhat scary, but at least it seems to work smile.gif
CODE
    v0.78 10 Aug
        add: [PLAYLIST_ACTIVE] - active playlist index,
             [PLAYLIST_PAGE] - current page of active playlist,
             [PLAYLIST_PAGES_COUNT] - number of playlist pages,
             [PLAYLIST_ITEM_FOCUSED], [PLAYLIST_ITEM_PLAYING], and
             [PLAYLIST_ITEM_PREV_PLAYED] - focused, now playing
             and previously played playlist items.

             [PLAYLIST_JS] - javascript array with current playlist items.
             each array element is defined by playlist row titleformatting
             string set in preferences. for example, the following
             playlist row value:
             { "track": "$replace(%title%,",)", "len": "%length%", "queue" : "%queue_indexes%" }
             creates you this array:
             [ { "track": "Laila", "len": "5:29", "queue" : "?" },
               { "track": "Outward bound", "len": "4:53", "queue" : "?" },
               ...etc...
               { "track": "December", "len": "3:19", "queue" : "?" },
               { "track": "South", "len": "4:49", "queue" : "?" } ]

             [PLAYLIST_JS] - javascript array with current playlist info
             (playlist name and playlist items count).
             sample return value:
             [ { "name": "local", "count": "0" }, { "name": "test", "count": "3" } ]

             these additions allows you to have important parts of fb2k state
             exported as a javascript array, for example:

             var fb2k =
             {
                 "playlist_items": [PLAYLIST_JS],
                "playlist": { "currentpage": "[PLAYLIST_PAGE]",
                              "totalpages": "[PLAYLIST_PAGES]",
                              "item_focus": "[PLAYLIST_ITEM_FOCUS]",
                              "item_playing": "[PLAYLIST_ITEM_PLAYING]",
                              "item_previouslyplayed": "[PLAYLIST_ITEM_PREV_PLAYED]" },
                            "playlist_total_time": "[PLAYLIST_TOTAL_TIME]",
                            "queue_total_time": "[QUEUE_TOTAL_TIME]",
                            "playlists": [PLAYLISTS_JS],
                            "playlist_current": "[PLAYLIST_ACTIVE]",
                            "playback_order": "[PLAYBACK_ORDER]",
                            "volume": "[VOLUME]",
                            "isplaying": "[IS_PLAYING]",
                            "ispaused": "[IS_PAUSED]",
                            "isenqueueing": "[IS_ENQUEUEING]",
                            "lastaction": "[LAST_ACTION]",
                            "stopaftercurrent": "[SAC]",
                            "autorefresh": "[AUTO_REFRESH]",
                            "trackpos": "[TRACK_POS]",
                            "tracklen": "[TRACK_LEN]",
                            "tracknum": "[TRACK_NUM]",
                            "trackstotal": "[TRACKS_TOTAL]",
                            "helper1": "[HELPER1]",
                            "helper2": "[HELPER2]",
                            "helper3": "[HELPER3]",
                            "albumart": "[ALBUMART]"
             }
Auric
The JSON playlist works great, thanks!

On a side note, it seems that the macros are only updated when no command is sent in the HTTP request, in other words to retrieve the playlist. If a command is sent, such as to play or pause, the macro data is incomplete.

Here's an example:
CODE
{

"playlist": [ { "number": "01", "track": "The Pretender", "len": "4:29" }, { "number": "02", "track": "Let It Die", "len": "4:05" }, { "number": "03", "track": "Erase Replace", "len": "4:13" }, { "number": "04", "track": "Long Road To Ruin", "len": "3:45" }, { "number": "05", "track": "Come Alive", "len": "5:11" }, { "number": "06", "track": "Stranger Things Have Happened", "len": "5:21" }, { "number": "07", "track": "Cheer Up Boys, Your Make-up Is Running", "len": "3:41" }, { "number": "08", "track": "Summer's End", "len": "4:38" }, { "number": "09", "track": "The Ballad of the Beaconsfield Miners", "len": "2:32" }, { "number": "10", "track": "Statues", "len": "3:48" }, { "number": "11", "track": "But Honestly", "len": "4:36" }, { "number": "12", "track": "Home", "len": "4:53" } ],
"volume": "99",
"isPlaying": "1",
"currentTrack": "4294967295",
"trackpos": "0",
"tracklen": "0",
"helper1": "",
"helper2": "",
"helper3": "",
"albumArt": "/nocoverinfo.jpg"
}


The PLAYLIST_JS, VOLUME and IS_PLAYING macros are there, but the others are either empty or -- in the case of PLAYLIST_ITEM_PLAYING (currentTrack) -- just wacky. The album in the example does have available cover art, so that macro isn't working either.

I've been working around it by running the request function with no command on an interval timer, but that's not very efficient. Any idea what might be causing this?


Also, for anyone interested, here's a screenshot of my playlist, just like the iPod UI:
IPB Image
oblikoamorale
QUOTE(Auric @ Aug 11 2008, 05:33) *
On a side note, it seems that the macros are only updated when no command is sent in the HTTP request, in other words to retrieve the playlist. If a command is sent, such as to play or pause, the macro data is incomplete.

you should re-request data a few moments after playback has been started. the thing is that playback starts immediately after request, but the information about playing track won't available in the same command request session.
I don't know any workaround or what am I doing wrong, so I suggest the approach similar to the one used in the default template:

if ([HELPER1] == '' && ([IS_PLAYING] || [IS_PAUSED])) // if playing but track info is not loaded yet, reload page
setTimeout('pc()',500);
fusen
QUOTE(Auric @ Aug 10 2008, 19:33) *

The JSON playlist works great, thanks!

On a side note, it seems that the macros are only updated when no command is sent in the HTTP request, in other words to retrieve the playlist. If a command is sent, such as to play or pause, the macro data is incomplete.

Here's an example:
CODE
{

"playlist": [ { "number": "01", "track": "The Pretender", "len": "4:29" }, { "number": "02", "track": "Let It Die", "len": "4:05" }, { "number": "03", "track": "Erase Replace", "len": "4:13" }, { "number": "04", "track": "Long Road To Ruin", "len": "3:45" }, { "number": "05", "track": "Come Alive", "len": "5:11" }, { "number": "06", "track": "Stranger Things Have Happened", "len": "5:21" }, { "number": "07", "track": "Cheer Up Boys, Your Make-up Is Running", "len": "3:41" }, { "number": "08", "track": "Summer's End", "len": "4:38" }, { "number": "09", "track": "The Ballad of the Beaconsfield Miners", "len": "2:32" }, { "number": "10", "track": "Statues", "len": "3:48" }, { "number": "11", "track": "But Honestly", "len": "4:36" }, { "number": "12", "track": "Home", "len": "4:53" } ],
"volume": "99",
"isPlaying": "1",
"currentTrack": "4294967295",
"trackpos": "0",
"tracklen": "0",
"helper1": "",
"helper2": "",
"helper3": "",
"albumArt": "/nocoverinfo.jpg"
}


The PLAYLIST_JS, VOLUME and IS_PLAYING macros are there, but the others are either empty or -- in the case of PLAYLIST_ITEM_PLAYING (currentTrack) -- just wacky. The album in the example does have available cover art, so that macro isn't working either.

I've been working around it by running the request function with no command on an interval timer, but that's not very efficient. Any idea what might be causing this?


Also, for anyone interested, here's a screenshot of my playlist, just like the iPod UI:
IPB Image


will you be making this available?
Auric
QUOTE(fusen @ Aug 11 2008, 13:06) *

will you be making this available?


Yes, when it's done, and assuming Apple won't jump down my throat about copyright issues. Pandora uses almost the exact same UI though, so I don't think it'll be a problem.
Chairman85
QUOTE(Auric @ Aug 11 2008, 17:28) *

QUOTE(fusen @ Aug 11 2008, 13:06) *

will you be making this available?


Yes, when it's done, and assuming Apple won't jump down my throat about copyright issues. Pandora uses almost the exact same UI though, so I don't think it'll be a problem.

Awesome. smile.gif Looks perfect.
Auric
Any chance we could get the browser macro formatted with JSON like the playlist?
oblikoamorale
yes, it is doable, but only if you or anyone else will actually use this one.
Auric
QUOTE(oblikoamorale @ Aug 22 2008, 20:30) *

yes, it is doable, but only if you or anyone else will actually use this one.


I can't speak for anyone else, but I certainly would, just as I'm using the JSON playlist now. I don't want to release my template without browser functionality, which is why I haven't posted it yet.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.