IPB

Welcome Guest ( Log In | Register )

44 Pages V  « < 6 7 8 9 10 > »   
Reply to this topicStart new topic
foo_httpcontrol, control foobar via http
oblikoamorale
post Aug 6 2008, 05:12
Post #176





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



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.
Go to the top of the page
+Quote Post
sIIhZt
post Aug 6 2008, 11:11
Post #177





Group: Members
Posts: 37
Joined: 3-September 05
Member No.: 24289



Thx, that works fine. Must have missed that post sad.gif

This post has been edited by larskl: Aug 6 2008, 11:14
Go to the top of the page
+Quote Post
sIIhZt
post Aug 6 2008, 20:54
Post #178





Group: Members
Posts: 37
Joined: 3-September 05
Member No.: 24289



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
Go to the top of the page
+Quote Post
rexit2
post Aug 7 2008, 07:45
Post #179





Group: Members
Posts: 67
Joined: 5-April 02
Member No.: 1698



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
Go to the top of the page
+Quote Post
3ddfreak
post Aug 7 2008, 13:54
Post #180





Group: Members
Posts: 12
Joined: 31-December 06
Member No.: 39158



Trying to get this to work on my nokia N82. Anyone who managed to get it to work on an Nseries phone?
Go to the top of the page
+Quote Post
oblikoamorale
post Aug 7 2008, 15:42
Post #181





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



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.
Go to the top of the page
+Quote Post
alkasar
post Aug 7 2008, 16:30
Post #182





Group: Members
Posts: 71
Joined: 14-November 06
Member No.: 37575



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.
Go to the top of the page
+Quote Post
sIIhZt
post Aug 7 2008, 19:17
Post #183





Group: Members
Posts: 37
Joined: 3-September 05
Member No.: 24289



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
Go to the top of the page
+Quote Post
Auric
post Aug 7 2008, 20:47
Post #184





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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.

This post has been edited by Auric: Aug 7 2008, 20:48
Go to the top of the page
+Quote Post
Auric
post Aug 9 2008, 01:32
Post #185





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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?
Go to the top of the page
+Quote Post
oblikoamorale
post Aug 9 2008, 06:19
Post #186





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



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

This post has been edited by oblikoamorale: Aug 9 2008, 06:21
Go to the top of the page
+Quote Post
Auric
post Aug 9 2008, 15:35
Post #187





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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.
Go to the top of the page
+Quote Post
oblikoamorale
post Aug 9 2008, 18:59
Post #188





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



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.
Go to the top of the page
+Quote Post
Auric
post Aug 9 2008, 19:39
Post #189





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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.

This post has been edited by Auric: Aug 9 2008, 19:40
Go to the top of the page
+Quote Post
oblikoamorale
post Aug 10 2008, 10:07
Post #190





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



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.
Go to the top of the page
+Quote Post
Auric
post Aug 10 2008, 14:26
Post #191





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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.

This post has been edited by Auric: Aug 10 2008, 14:28
Go to the top of the page
+Quote Post
oblikoamorale
post Aug 10 2008, 21:19
Post #192





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



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]"
             }


This post has been edited by oblikoamorale: Aug 10 2008, 21:22
Go to the top of the page
+Quote Post
Auric
post Aug 11 2008, 02:33
Post #193





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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:


This post has been edited by Auric: Aug 11 2008, 03:43
Go to the top of the page
+Quote Post
oblikoamorale
post Aug 11 2008, 04:11
Post #194





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



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);

This post has been edited by oblikoamorale: Aug 11 2008, 04:14
Go to the top of the page
+Quote Post
fusen
post Aug 11 2008, 22:06
Post #195





Group: Members
Posts: 19
Joined: 5-May 08
Member No.: 53295



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:


will you be making this available?
Go to the top of the page
+Quote Post
Auric
post Aug 11 2008, 22:28
Post #196





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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.
Go to the top of the page
+Quote Post
Chairman85
post Aug 13 2008, 04:02
Post #197





Group: Members
Posts: 72
Joined: 13-March 03
Member No.: 5461



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.
Go to the top of the page
+Quote Post
Auric
post Aug 22 2008, 22:56
Post #198





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



Any chance we could get the browser macro formatted with JSON like the playlist?

This post has been edited by Auric: Aug 22 2008, 22:56
Go to the top of the page
+Quote Post
oblikoamorale
post Aug 23 2008, 05:30
Post #199





Group: Developer
Posts: 302
Joined: 24-March 08
Member No.: 52244



yes, it is doable, but only if you or anyone else will actually use this one.
Go to the top of the page
+Quote Post
Auric
post Aug 23 2008, 16:12
Post #200





Group: Members
Posts: 45
Joined: 25-May 03
Member No.: 6808



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.
Go to the top of the page
+Quote Post

44 Pages V  « < 6 7 8 9 10 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th July 2014 - 01:26