I do realise this might look somewhat scary, but at least it seems to work
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]"
}