Help - Search - Members - Calendar
Full Version: foo_httpcontrol
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5
oblikoamorale
I might be wrong, but I decided to stick to classic html for better compatibility.
CODE
    v0.72 24 May 2008
        WARNING: delete previous version of foo_httpcontrol.dll and start
                 Foobar, answer "No" when you're asked whether you want to
                 keep plugin settings.                                        

        add: reorganization of templates and settings to provide more
             customization possibilities. default templates are valid HTML
             4.01 transitional now;
        fix: utf-8 instead of utf8 in content-type encoding;
        fix: safety checks;
soulruins
oblikoamorale, Ehhh! smile.gif Nice work!

Update iPhone template:
IPB Image
Download
saivert
I see a lot of people complaining about the lack of customizability with foo_httpcontrol. Well, this component is about getting a web frontend for foobar2000 with little to no hassle. If you want to go all nuts about configuring and creating your own user interface/frontend, there is another component called foo_controlserver which only exposes a telnet-like interface to foobar2000. You can then write your own PHP/Perl web frontend which connects to this server to issue commands to foobar2000 and retrieve data.

I'm doing this here: http://beta.saivert.com/foobar2000%20webui/

For what foo_httpcontrol represents I'm satisfied. It basically is a no-brainer while my own script is a complex AJAX monster.

Both foo_httpcontrol and foo_controlsever could do with improvements. Nothing is ever perfect (in a realistic world) but don't go over board with demands. Sometimes keeping it simple and splitting up radical new ideas in new projects is the better way to do it.

oblikoamorale
no one would object that dedicated server combined with a decent scripting language and foo_controlserver (or, what I personally like better, foo_comserver2) is a zillion times better approach, and that's exactly what I've already said somewhere up the thread.
but every tool has its use, and anyone is free to take the way they suppose is optimal. I'm cooking this thing in the way I like and need in my daily use, and don't pretend it to be anything else that it really is.
oblikoamorale
CODE

    v0.73 26 May 2008
        add: templates optimized for iphone, by soulruins;
        add: helper1-3 titleformats are always formatted in playlist now playing
             item context;
             for perfomance reasons playlist row titleformat is formatted in
             playlist context only for queued items, what makes possible to
             use introduced in 0.9.5.3 %queue_*% fields instead of built-in
             #queue_info#.
        fix: probability of insane playlist and queue lengths in totals;
Tim Schuhmacher
I removed the previous version and didn't keep the settings. But now I get the following error (in Firefox):
"failed to read file: E:\Music\Sorted\foo_httpcontrol_controls_tpl.html, error: 2."

Where 'E:\Music\Sorted\' is the home directory and browse path. I get the same error when I leave browse path blank. When I leave both input blanks the plugin works fine. This problem didn't occur with the previous version.

What could it be?

And the queue index isn't shown. Only total time of the queued tracks
oblikoamorale
home dir specifies a directory where plugin will look for template files, and also it serves as a document root of webserver. you should leave it blank if you're satisfied with keeping the above data in components/foo_httpcontrol_data.

for queue indexes to work you have to update foobar to latest version. I'm using 0.9.5.3 built-in queue info field now.
Jonas Nyrup
If I play a track from one playlist in foobar and have focus on another playlist in httpcontrol it fails to display the right track.
httpcontrol displays information about the track which has the same place in the focused playlist as the actual track has in its playlist.
Tim Schuhmacher
@oblikoamorale: you're right. thanks
oblikoamorale
CODE
    v0.74 27 May 2008
        fix: wrong playlist context (active instead of playing) in helper1-
             helper3 title formats;
Jonas Nyrup
thanks for the quick fix.
carmenm
i am starting to use this plugin using Fluid on mac, so NICE!
I was wondering is there a way to stream the albumart ? (usually a folder.jpg in playing file dir)
oblikoamorale
QUOTE(carmenm @ May 28 2008, 15:00) *

i am starting to use this plugin using Fluid on mac, so NICE!

care to post a screenshot?
QUOTE(carmenm @ May 28 2008, 15:00) *

I was wondering is there a way to stream the albumart ? (usually a folder.jpg in playing file dir)

if albumart is an external file of the certain name, why not, I can make it. although I don't know why would anyone need it, to be honest.
Chipicui
Well... in my case not a real need, certainly...
but it would be nice if we could have the option to see the album art ("cover.jpg" in the album folder, for me).
And I mention the word "option" because it could make for a very slow redraw, so I'm not sure if i'd use it on wifi connection, but I'd certainly do while using the wired network.
carmenm
QUOTE(oblikoamorale @ May 28 2008, 14:26) *

QUOTE(carmenm @ May 28 2008, 15:00) *

i am starting to use this plugin using Fluid on mac, so NICE!

care to post a screenshot?
QUOTE(carmenm @ May 28 2008, 15:00) *

I was wondering is there a way to stream the albumart ? (usually a folder.jpg in playing file dir)

if albumart is an external file of the certain name, why not, I can make it. although I don't know why would anyone need it, to be honest.


IPB Image
I need to make a black template now quite like my IM on the right

I use my macbook to control my foobar. My pc with foobar doesnt have a screen tongue.gif so it s nice to see the albumart of what i am playing in my http interface. And album art is external file always called folder.jpg and placed in the same dir as the track file .

Thanks for your concern

EDIT: would it be possible for the web interface to update itself when we make modifications to foo_httpcontrol_controls_tpl.html? Currently i have to restart foobar for each modification
Ritsl
I've optimized the control page for use in a sidebar. Copied the volume up/down from the iphone setup, moved around some buttons, changed the code a bit, changed the styles so the main player buttons stretch to fill the sidebar width. Simplified the markup for the progress bar, adjusted the related styles and the script to make the click-to-seek work independent of the length of the text in it. In my version, you'll get a bordered box you can click in. Also works fine when the text in the progress bar wraps.

Developed and tested in Opera 9.5, also seems works to work fine in Firefox 3 and Opera 9.27 (with minor issues), and looks the same in Safari 3, though that browser doesn't sport a sidebar :-)
Screenshot is taken using the Tango CL skin in Opera.

Screenshot
Zipped HTML File
carmenm
IPB Image
getting closer to something that i want
pstrg
QUOTE(oblikoamorale @ May 27 2008, 12:41) *

CODE
    v0.74 27 May 2008
        fix: wrong playlist context (active instead of playing) in helper1-
             helper3 title formats;


Replaced 0.72 for this newer version.
Strange that now, after each entry (to the right of the duration) the following text appears: #queue_info#
oblikoamorale
QUOTE(carmenm @ May 28 2008, 20:43) *
I use my macbook to control my foobar. And album art is external file always called folder.jpg and placed in the same dir as the track file .
so, I suggest something like this: album art will be retrieved by virtual request of /albumart.jpg. plugin will look for folder.jpg in playing track directory. if folder.jpg is not found there, first of jpg residing in the same dir will be shown. if there still is no picture, I'll show a /nocover.jpg.

and thanks for the shots, they're interesting!

QUOTE(carmenm @ May 28 2008, 20:43) *
EDIT: would it be possible for the web interface to update itself when we make modifications to foo_httpcontrol_controls_tpl.html? Currently i have to restart foobar for each modification
technically - yes. right now I'm reading these files on startup and keep them in memory, for perfomance reasons, again. I'll benchmark reading templates on each request. if no perfomance hit is going to be discovered, I'll leave it be.

QUOTE(Ritsl @ May 29 2008, 03:47) *

I've optimized the control page for use in a sidebar.
yay, I didn't know opera 9.5 had something like built-in sidebar. your work looks promising, gotta try it! thanks for sharing.


QUOTE(pstrg @ May 29 2008, 05:22) *
Replaced 0.72 for this newer version.
Strange that now, after each entry (to the right of the duration) the following text appears: #queue_info#

use the following playlist row format. also you'll need updating to 0.9.5.3
CODE
<td class="p">[%album artist% ]['['%album%[ CD%discnumber%][ #%tracknumber%]']' ]%title%[ '//' %track artist%]</td><td class="t">%length%</td>[<td class="q">%queue_indexes%</td>]
Ritsl
QUOTE(oblikoamorale @ May 29 2008, 05:11) *
QUOTE(Ritsl @ May 29 2008, 03:47) *
I've optimized the control page for use in a sidebar.
yay, I didn't know opera 9.5 had something like built-in sidebar. your work looks promising, gotta try it! thanks for sharing.
Opera has had customizable panels since version 5.10 smile.gif Just check the box 'Show in panel' in the bookmark properties. I've reordered and prettified the buttons a bit more, and sneakily updated the existing files online.
pstrg
QUOTE
use the following playlist row format. also you'll need updating to 0.9.5.3
CODE
<td class="p">[%album artist% ]['['%album%[ CD%discnumber%][ #%tracknumber%]']' ]%title%[ '//' %track artist%]</td><td class="t">%length%</td>[<td class="q">%queue_indexes%</td>]


Was already using 0.9.5.3; with the new playlist row string above problem was solved.
Thanks!
pstrg
I'm trying to modify foo_httpcontrol_controls_tpl.html as shown below in color:

<input name="Stop" title="Stop playback" type="button" style="font-size: 12pt; font-family: webdings;" value="<" onclick="pc(this.name);">

With that, I wanted to change the button captions to Webdings chars that resemble players' signs: "<" for instance is a solid square in that font.
It works with IE (which I don't use) but with Mozilla Firefox 3.0 RC1 the font-size parameter does modify size but the font-family one doesn't change font to Webdings (although Allow pages to use their own fonts is set).

[2008-05-30 update]

I have learned that *dings fonts are not displayable anymore by design in the newest release of Firefox.
Could not find a way to circumvent the limitation yet (directions on http://www.mvps.org/dmcritchie/firefox/firefox.htm do not work anymore).
saivert
Why not just a "reload page templates" button on the preferences page?
carmenm
QUOTE(saivert @ May 30 2008, 01:08) *

Why not just a "reload page templates" button on the preferences page?

Could do it but would be even greater if we had a command for reload page templates. I would use this instead of refresh command.
oblikoamorale
CODE
    v0.75 30 May 2008
        add: templates optimized for opera sidebar, by Ritsl;
        add: Browse path values must be separated by '|' instead of ';' now;
        add: templates are reloaded on each page request;
        add, especially for album art addicts: [ALBUMART] macro.
             returns an url link to album art picture.
             picture search variants must be specified in "Album art"
             preferences title formatted field, separated by '|'.

             example of field value, which makes plugin look for folder.jpg
             and then, if folder.jpg is not found, for any jpg in playing
             track directory:
             $puts(dir,$left(%path%,$strrchr(%path%,\)))$get(dir)folder.jpg|$get(dir)*.jpg
            
             if nothing is found, /nocover.jpg is returned.
             if track is not playing, /nocoverinfo.jpg is returned.

             example of macro usage:
             <img src="[ALBUMART]">
soulruins
Perfect! Update iPhone (PDA) template for v0.75:

IPB Image
Download
foo_peter
@oblikoamorale

Wow! amazing... amazing ... Thanks a lot !
Works really fine here..


oblikoamorale
d'oh! I forgot to remove the 'no-cache' http header in 0.75, which evil nature prevents caching and generates unneccessary traffic when serving favicon, pictures and any other files (excluding always reloading main interface). fixed 0.75 is re-uploaded.
soulruins
Again update iPhone (PDA) template for v0.75:

IPB Image
Download
  • add top panel
  • add rating and genre items
  • add iphone spring_board icon
  • del tech info (ver, bitrate etc)
  • fix vert/horiz view
carmenm
Amazing oblikoamorale !!! Thank you so much!
drcursor
Easter egg:

"
Happy birthday, oblikoamorale! :-)

"
..so...happy birthday!
Ritsl
Here's my latest version of the Opera/Firefox sidebar, updated to include album art as offered in 0.7.5, and also simplified much more:
IPB ImageThis screenshot shows it in combination with the brand new Opera 9.5 skin.

Download the zipped files (previous version also included, with the same update for album art)

And thanks for the reload support, oblikoamorale. Made it so much easier to tweak the HTML smile.gif
foo_peter
It is simply a dream and even if I have stoned me, I will see this now rather than in my Foobar

now actually missing only the lyrics I get to this point because someone can help me?

Thank you in advance and all made this possible

IPB Image


foo_peter
alkasar
this is a great plugin smile.gif thanks a lot.

Is it possible to enhance the html template to have vertical scroll only on the playlist area ?
the goal is to have buttons and now_playing area always visible.
Hancoque
You can accomplish this by putting a div element around the playlist table. Assign it a unique id (I use "playlist"), so that it looks like this:
CODE
<div id="playlist">
    <table id="pl">
        [PLAYLIST]
        ...
    </table>
</div>

Now add the following JavaScript function to the JavaScript section in the HTML head:
CODE
function fit() {
    var playlist = document.getElementById('playlist');

    playlist.style.position = 'static'; // important for the onresize event
    var top = playlist.offsetTop;
    var left = playlist.offsetLeft;

    playlist.style.overflowY = 'auto';

    playlist.style.top = top + 'px';
    playlist.style.left = left + 'px';
    playlist.style.right = left + 'px';
    playlist.style.bottom = '8px'; // fit this to your taste
    playlist.style.position = 'absolute';
}

To make sure it is executed every time the page (re)loads or is resized, the body element has to be modified this way:
CODE
<body onload="mouse_capture_init(); fit();" onresize="fit();">
carmenm
Does anybody see a way to do a template using sproutcore??
oblikoamorale
nice, Hancoque. thanks. once been trying to make something similar, but failed. nice.
Ritsl
Indeed nice. I've updated my Opera/Firefox sidebar templates to include the table scroll smile.gif
Athyndmion
Excellent plugin. Thanks a lot, oblikoamorale.

I installed it on my girl friend's computer, who listens to her music on a desktop computer, but she prefers using her laptop on her sofa for other geeky activities. So she was interested in having a tool to control her music remotely.

There is a problem, though. When she connects to foo_httpcontrol server using Firefox, it quickly reaches 99% CPU usage, and she has to kill Firefox. She has a 512MB / 1.5GHz laptop with Win XP SP2, she uses Firefox 2.0.0.14 and foo_httpcontrol 0.75.
I tried to connect to her server with my own laptop (4GB / 2.6GHz dual core under Win XP SP3) and I get 50% CPU usage for 10 to 20 seconds, then it drops to 0-3% for a while, and jump back to 50%.

Her playlist is big, which is probably the problem (but I read you are testing the plugin on a 23k playlist). She has about 38k tracks.

--

BTW, I personnally use foo_httpcontrol in conjunction with a edcast streaming server and a secured ssh connection with a tunnel. The stream is public, non secured, but the http control can only be performed locally (So I ssh/tunnel the http requests). It works very well with my 10k playlist, but I do not tried with the last version of foo_httpcontrol.
oblikoamorale
38k tracks is an obvious overload.
it takes some time for plugin to process so many tracks internally, but it should be less than a second. and, what's more significant, generated html page size in this case is enormous, something around 5Mb. apparently mozilla is having troubles loading and displaying such big pages.
perhaps it is a good idea to try opera 9.5. 23k playlist displays just fine, even with instant page redrawing option turned on.
but in my opinion, the only comfortable solution in case of a (very) big playlists is to uncheck 'retrieve playlist' in plugin settings.
Athyndmion
QUOTE(oblikoamorale @ Jun 28 2008, 13:18) *

but in my opinion, the only comfortable solution in case of a (very) big playlists is to uncheck 'retrieve playlist' in plugin settings.


Thank you. I was thinking of such possibility, but I did not look at the settings. I was also wondering if it would be possible to reduce the size of the web page by, e.g., only displaying the list of artists or albums, and when you click on one of them, it retrieves the list of tracks for the particular artist / album.
This is probably far more complex to implement since the playlist is not necessarily ordered by artist/album.

An alternative solution would be to retrieve tracks according to a query that would be given through a web form. So, if the query is carefully chosen, there would not be a huge list to display.

I will also take a look at opera 9.5, but I love Firefox too.
Hamallainen
To reduce the page size wouldn't it be possible to display only a limited amout of the playlist splitted in multiple pages ?
For exemple : with a 10k songs playlist. Only display 1k songs at once but splitted in 10 pages.
The number of songs displayed per page could be defined in the préferences
oblikoamorale
Athyndmion, sadly I'm not interested in reproducing autoplaylists/playlists query/media library etc in html interface.

Hamallainen, I've thought about it before but got stuck on two things: I'm amazingly lazy, and personally I don't need such page switching. and I'm lazy again.

sorry.
oblikoamorale
well... some spare time today has been spent fiddling with this bastard:
CODE
    v0.76 29 Jun 2008
        add: improved remote access logging;
        add: scrollable playlist area (by Hancoque);
        add: autoscroll to now playing track;
        add: multipage playlist. number of per-page entries is set in
             "Page entries" settings field. entering 0 disables multipage;
        fix: mostly invisible glitches;
Hamallainen
so you're not so lazy wink.gif
The multi page works quite well. Big playlist should not be a problem anymore.
And the scrollable playlist is a nice addition too.
Thanks to you and Hancoque
Hancoque
Strangely the playlist disappears in IE7 when a now-playing track is present. It has something to do with the autoscroll feature.
oblikoamorale
can't test due to absence of IE7... thanks g#d I don't have it smile.gif
try removing the autoscroll part in fit() function of the template file maybe?
Hancoque
I've just tested it with your default template and found out that the fit function doesn't have any effect in quirks mode when using IE6 or IE7. If I remove the doctype declaration in my own otherwise XHTML compliant template and thus force the browser to interpret it in quirks mode I experience the same problem. In standards compliance mode however IE7 correctly applies the fit function to make the playlist scrollable while in IE6 it still doesn't work (which is either my fault or that of IE6). But as I said, the playlist gets eaten by IE7 if the code inside the "if (npelem)" condition is executed. Just accessing npelem.offsetTop, offsetHeight or scrollTop triggers the bug. So you don't even have to change any values, which means that even code like below already causes the problem:

CODE
if (npelem)
{
    var foo = npelem.offsetTop;
}

CODE
if (npelem)
{
    var foo = offsetHeight;
}

CODE
if (npelem)
{
    var foo = scrollTop;
}

Strange, isn't it?
Ritsl
I've had a problem with 0.76: the playlist wasn't shown anymore. Tried in various browsers, switched to the original template and saw the same. But then I stopped the music, switched playlists and things started working properly again. After some more trying, I figured out that after switching to a new playlist, it tries to automatically go to the page were the 'now playing' song is on - even though that song is not present on the newly chosen playlist. If the page number is not available in the new playlist because it is shorter, the playlist will not be shown at all.

Presumably this is the same thing as Hancoque is talking about.
oblikoamorale
Hancoque, could it be that assigning nowplaying id to an <tr> element of playlist causes this weird problem? what do you, as html guru, would suggest?

Ritsl, thanks for detailed report! I think it is a different issue which I thought I've fixed already.
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.