Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_httpcontrol (Read 931050 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

foo_httpcontrol

Reply #75
Small request: currently the page refreshes automatically when a song is over and playback jumps to the next item. Fine. However it doesn't refresh if the user changes the playing song using the foobar interface.
Could the plugin send a refresh request each time someone changes the played item (let's say after a 5 seconds delay so the browser doesn't become crazy if I hit "Random" repeatedly)?

foo_httpcontrol

Reply #76
Small request: currently the page refreshes automatically when a song is over and playback jumps to the next item. Fine. However it doesn't refresh if the user changes the playing song using the foobar interface.
Could the plugin send a refresh request each time someone changes the played item (let's say after a 5 seconds delay so the browser doesn't become crazy if I hit "Random" repeatedly)?

communication between plugin and client page in plugin-to-page direction is not possible. things work only in opposite.

foo_httpcontrol

Reply #77
What about an element within the webpage code wich would regularly check if the playing song has changed?

foo_httpcontrol

Reply #78
What about an element within the webpage code wich would regularly check if the playing song has changed?

it would require too much work with code redesign as I haven't been planning AJAX'y behaviour from the very start.
I agree that this kind of behaviour would definitely be cool, but considering the fact that the main idea behind this component consists of controlling foobar running on machine you don't want or don't have any alternative access to, it seems a little bit unnneded.

foo_httpcontrol

Reply #79
Yeah it would be overkill for quite a little improvement after all.

Another suggestion: could we set the default behaviour of the "playlist action"? I would like it to be set on "Focus" by default and to stay that way when I click on an item (currently it switches back to "Start" everytime).

 

foo_httpcontrol

Reply #80
Another suggestion: could we set the default behaviour of the "playlist action"? I would like it to be set on "Focus" by default and to stay that way when I click on an item (currently it switches back to "Start" everytime).

replacing the line N 140 in control template file:
Code: [Select]
    act = [LAST_ACTION];

with
Code: [Select]
    act = 3;

would do the trick

foo_httpcontrol

Reply #81
Thanks.

foo_httpcontrol

Reply #82
I've organised some kind of radio streaming jukebox on localnet, and in terms of privacy it seems convinient to have a certain list of visible directories in file browser instead of all hard drive.
Code: [Select]
    v0.70 17 May 2008
        fix: failed reading template files when foobar path contained non-ascii characters;
        add: default playlist action reverts to 'Start' after any non-playlist related action;
        add: display of playback queue length;
        add: restrictive list of directories allowed to browse;

foo_httpcontrol

Reply #83
A small feature request: I'd like to be able to show only files with extensions that foobar2000 supports. Right now I'm just hiding unsupported file types via CSS, but that only fools the average Joe as the file names are still visible in the HTML source.

And another small request: Could you make it possible to separate HTML, CSS and JavaScript into different files? That would make it much easier to maintain customizations to the code. Defining a subdirectory in the components directory that would behave like the root directory of a "normal" web server would be great as it would also allow graphics to be used or any other files.

foo_httpcontrol

Reply #84
A small feature request: I'd like to be able to show only files with extensions that foobar2000 supports. Right now I'm just hiding unsupported file types via CSS, but that only fools the average Joe as the file names are still visible in the HTML source.
what exactly for do you need this, may I ask? it's just that this thing is intended for personal use where seeing non playable files in list means no harm, I think.
And another small request: Could you make it possible to separate HTML, CSS and JavaScript into different files? That would make it much easier to maintain customizations to the code. Defining a subdirectory in the components directory that would behave like the root directory of a "normal" web server would be great as it would also allow graphics to be used or any other files.
I'm not motivated and/or interested in going this way. I suppose the better, reliable and much faster way of achieving desired functionality would be a combination of apache, php and foobar COM automation server plugin.

foo_httpcontrol

Reply #85
what exactly for do you need this, may I ask? it's just that this thing is intended for personal use where seeing non playable files in list means no harm, I think.
In the distant past people had to bring their CDs to parties. In the not so distant past they brought their external hard drives. But now they can can access all their music without bringing anything.  I use this plugin in combination with the Icecast server and set foobar2000 to null output and thereby have a remote music jukebox. Though I use password protection I want to leave access open to the "public" after the authentication. But people should do nothing more then to browse my music files. They should definitely not be able to see all my hard drives' contents. And there are music files scattered all over three different drives, so I cannot just restrict access to some folders, or the list of allowed folders would be really long.

I'm not motivated and/or interested in going this way. I suppose the better, reliable and much faster way of achieving desired functionality would be a combination of apache, php and foobar COM automation server plugin.
Well, all right.

foo_httpcontrol

Reply #86
what exactly for do you need this, may I ask? it's just that this thing is intended for personal use where seeing non playable files in list means no harm, I think.
In the distant past people had to bring their CDs to parties. In the not so distant past they brought their external hard drives. But now they can can access all their music without bringing anything.  I use this plugin in combination with the Icecast server and set foobar2000 to null output and thereby have a remote music jukebox. Though I use password protection I want to leave access open to the "public" after the authentication. But people should do nothing more then to browse my music files. They should definitely not be able to see all my hard drives' contents. And there are music files scattered all over three different drives, so I cannot just restrict access to some folders, or the list of allowed folders would be really long.

eheh, thanks, you've made me chuckle, and that's definitely good! and it's interesting to know someone else is using it as a remote jukebox as well.
I guess one more preferences checkbox hiding non-playable files wouldn't hurt. will do!

foo_httpcontrol

Reply #87
Thanks!

foo_httpcontrol

Reply #88
What for, really? In the foobar Media Library you can already define folders and filemasks... wouldn't this be redundant?

foo_httpcontrol

Reply #89
probably because the media library access interface is not implemented? or perhaps not everybody is using media library?

Hancoque: I've reuploaded current version with non playable files filter.

foo_httpcontrol

Reply #90
This is a very cool component. Thank you very much for making it.
Question 1. I can't see the volume up/down control you added in 0.69. (Firefox 2.0.0.14). How do I add it?
do I replace :
Code: [Select]
<select title="Volume level" onchange="pc('Volume',this.value);">[VOLUME_OPTION]</select>%&nbsp;


with

Code: [Select]
<select title="Volume Up" onchange="pc('Volume',this.value);">[VOLUME_OPTION]</select>%&nbsp;
<select title="Volume Down" onchange="pc('Volume',this.value);">[VOLUME_OPTION]</select>%&nbsp;


if yes, where do I set the % change per up/down?

Question 2. Could the htm template be skinned using Flash?

Thanks again.


foo_httpcontrol

Reply #92
This is a very cool component. Thank you very much for making it.
Question 1. I can't see the volume up/down control you added in 0.69. (Firefox 2.0.0.14). How do I add it?

it isn't included in the template as it is going to be needed only on rare occasions. to control volume in this way you'll probably want something like
Code: [Select]
<input name="VolumeUp" type="button" value="V_Up" onClick="pc(this.name, 20);">
<input name="VolumeDown" type="button" value="V_Down" onClick="pc(this.name, 20);">

where 20 is step in percents.
Question 2. Could the htm template be skinned using Flash?

I don't really know how flash works from inside, but I suppose yes, it could. although it would be somewhat hard, I think, as you'll need to parse the html within the flash.

foo_httpcontrol

Reply #93
it seems that programming a threaded micro-webserver is no big deal at all, and is fun.
although I still have no sound idea what it might be needed for, I've already found one use, to set a page favicon. and foobar stock icon loads perfectly fine in opera

btw, latest version has one nice bug: it doesn't display root page in file browser if 'hide non-playables' checkbox is on. but I guess it's ok, as no one noticed it yet.

foo_httpcontrol

Reply #94
well, at least I can enjoy the favicon now
Code: [Select]
    v0.71 21 May 2008
        add: multithreaded (restricted up to four simultaneous sessions)
             mini-web-server, able to serve any files from home directory.
             the following mime types are supported: css, gif, htm, html, ico,
             jpg, jpe, jpeg, js, png, xml.
        add: optional logging of remote ip addresses in console;

foo_httpcontrol

Reply #95
So, finally you did it.

There is still a problem when trying to separate the JavaScript code from the HTML template, though. The JavaScript code contains markers that are not replaced by the actual code if they are not in the main template file. Also parsing linked JavaScript files would solve the problem.

I'm trying to rewrite the HTML templates to the XHTML 1.1 specification using valid code, but there's one thing I cannot fix in the template: The plugin dynamically inserts checked (for checkboxes) and selected (for drop-down menu options) into the code. XHTML disallows this. Instead checked="checked" and selected="selected" has to be used to produce valid code. What speaks against using XHTML for the templates in general?

If you are willing to convert the templates to valid XHTML, here are some hints to solve issues that break the application in XHTML mode:

1. JavaScript code should be enclosed this way:
Quote
//<![CDATA[
...
//]]>

2. The form element must not contain the attributes name and target. Remove the latter altogether and replace the former by id and use document.getElementById('cmd_form') instead of document.cmd_form.

3. The CSS styles width, height and left need to have units specified (like px), otherwise they are not applied if the document is treated as XHTML. Simply adding +"px" to the corresponding JavaScript statements solves the problem:
Quote
document.getElementById('np').style.width=Math.floor(np_width * t_sec / t_length)+"px";
Quote
height=getElementById("np").offsetHeight*2-2+"px";
left=getElementById("npd").offsetLeft+"px";

4. Write all HTML event handlers small (onload instead of onLoad for example).

Edit: I just finished my XHTML 1.1 compliant (and working) versions of the templates. You might want to take a look: foo_httpcontrol_data.zip

Edit (2): The server sends a charset called utf8. I think it has to be utf-8 instead. The XHTML validator complains that there's a charset mismatch.

foo_httpcontrol

Reply #96
I'm trying to rewrite the HTML templates to the XHTML 1.1 specification using valid code, but there's one thing I cannot fix in the template: The plugin dynamically inserts checked (for checkboxes) and selected (for drop-down menu options) into the code. XHTML disallows this. Instead checked="checked" and selected="selected" has to be used to produce valid code. What speaks against using XHTML for the templates in general?

What speaks in favor? This is a subject on which holy wars have been fought  Let's not go there...

Quote
2. The form element must not contain the attributes name and target. Remove the latter altogether and replace the former by id and use document.getElementById('cmd_form') instead of document.cmd_form.

3. The CSS styles width, height and left need to have units specified (like px), otherwise they are not applied if the document is treated as XHTML.

This is good advice even for a HTML purist like me. It would also be nice to use a Doctype that doesn't trigger Quirks mode. But this is already in reach of the intrepid customizers. I should try if I can make use of Opera's support for WebForms 2 to create a nicer interface

Quote
The server sends a charset called utf8. I think it has to be utf-8 instead. The XHTML validator complains that there's a charset mismatch.
Yes, that should be utf-8 indeed, though my browser has no trouble recognizing it as such.


foo_httpcontrol

Reply #98
soulruins: looks great! very thanks for posting the shot, appreciated.

to those who are concerned, here are the guidelines I think I should be keeping to make customization process transparent:
1. don't generate any html formatted data within the plugin at all. perhaps the pregenerated playl- and file browser lists should be left alive, but necessarily with optional possibility to retrieve raw data, to be formatted on user-side by means of js.
2. move every macro substitution into a single javascript file containing as much foobar state data as possible, in form of defined variables/arrays. therefore including this js into any html page makes the page able to display foobar state information in any form.

perhaps this is an obvious overkill and such heavy relying on js isn't a very bright idea, but this way looks like the only reasonable one to give the user full control of any visual appearance aspect.

any thoughts?

foo_httpcontrol

Reply #99
I think it's no problem to generate (X)HTML code in the plugin *if* the code stays absolutely neutral concerning (X)HTML standards and visual styles. For the case that code differs between HTML and XHTML there might be a checkbox in the plugin options page what to use. But I think it's sufficient to generally conform to XHTML because it has more future potential and can be seen as the successor of HTML 4 where things are more standardized and unified. Concerning visual styles only IDs and classes should be used (no direct formatting).

By the way: I found malformed HTML in the browser list. The first entry ([ .. ]) contains this code:
Code: [Select]
<tr colspan=4><td>...</td>
instead of this:
Code: [Select]
<tr><td colspan="4">...</td>