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 944652 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_httpcontrol

Reply #300
If that is the problem, is it possible to select playback order by name just using [PLAYBACK_ORDER], for example I give each nuber value its name? In fact, thinking out loud as I type, I dont need all the playback options, a "default <-> random" button should be enough.
you need a numerical representation of playback order, and [PLAYBACK_ORDER] stands for it: 0 - Default ... 6 - Shuffle (folders) iirc.
[PLAYBACK_ORDER_OPTION] generates html <select><option...></select> construct which obviously doesn't suit your needs.

foo_httpcontrol

Reply #301
Hmmm, it seems I've got it working in Opera, but my android (Webkit) phone doesnt like the JS for my two buttons, everything else on it works fine - album art, track details etc.

Can anyone spot anything obvious in this part of the code as to why it will work in opera but not webkit browsers?

index.html
Code: [Select]
td style="text-align: center;">
                <img id="remtrack" src="delete.png" onclick="MakeRequest('Del', '');" />
                <img id="playorder" src="playorder.png" onclick="MakeRequest('PlaybackOrder', '');" />
            </td>

JS file
Code: [Select]
if (fooVars["isplaying"] == 1)
{
trk = --fooVars["tracknum"];
document.getElementById("remtrack").onclick = "MakeRequest('Del', trk )";
}



if (fooVars["playborder"] == 0)
{
document.getElementById("playorder").src = "rand.png";
document.getElementById("playorder").onclick = "MakeRequest('PlaybackOrder',3)";
}
if (fooVars["playborder"] == 3)
{
document.getElementById("playorder").src = "playorder.png";
document.getElementById("playorder").onclick = "MakeRequest('PlaybackOrder',0)";
}

The playorder image changes if I update it via the desktop, but the buttons just arent clickable through Android, or google chrome.

Granted, this isn't really foo_httpcontrol specific now, so let me know if I should take this problem elsewhere.

foo_httpcontrol

Reply #302
Hmmm, it seems I've got it working in Opera, but my android (Webkit) phone doesnt like the JS for my two buttons, everything else on it works fine - album art, track details etc.
perhaps it is a good idea to look at Chrome's JS error log to figure out what is wrong.

foo_httpcontrol

Reply #303
Only error I seem to be getting is "Resource interpreted as script but transferred with MIME type text/html", the javascript replace of the "onclick" value just doesnt seem to be getting through the the displayed html? Even though the image replace part is getting though, if I change it through foobar.

foo_httpcontrol

Reply #304
the onClick name seems to be case sensitive. and you cannot just assign text to onClick as it is a handler, not property.
instead of
Code: [Select]
document.something.onClick = "someFunction(parameters);";
the right way would be the
Code: [Select]
document.something.onClick = someFunction;
or
Code: [Select]
document.something.onClick = function () { alert('foo'); }


we're really getting off the thread scope...

foo_httpcontrol

Reply #305
Yes sorry for getting off topic a little. But I have managed to fix it!

Code is now;

Code: [Select]
if (fooVars["isplaying"] == 1) {
trk = --fooVars["tracknum"];
document.getElementById("remtrack").onclick = function() { (MakeRequest('Del', trk )); }
}



if (fooVars["playborder"] == 0) {
document.getElementById("playorder").onclick = function() { (MakeRequest('PlaybackOrder',3)); }
document.getElementById("playorder").src = "rand.png";
}
if (fooVars["playborder"] == 3) {
document.getElementById("playorder").onclick = function() { (MakeRequest('PlaybackOrder',0)); }
document.getElementById("playorder").src = "playorder.png";
}

Appreciate the help, and the plugin.


Edit.....

I've finished my remote set up now, looks like this;

 And oblikoamorale for the plug in itself and the help.

foo_httpcontrol

Reply #306
"many thanks, higher power"

foo_httpcontrol

Reply #307
since both links were dead earlier this day, here a mirror:

foo_httpcontrol_0.81.zip

foo_httpcontrol

Reply #308
Had a couple of PMs asking for the files.

Obviously not everyone has a playlist called Kev's  , so I have changed it a bit. The playlist switch button now just flicks through the playlists with text above showing the number of the active playlist (not sure how to get it to display the playlist name instead of number?). As it is at the moment you will need to edit the javascript file if you have more or less than 6 playlists, unless someone has suggestions to improve that part of the code?

LINK

Edit...
Tested to be working in Opera and Webkit based (chrome/android).
All features bar updating of progress/volume bar working in firefox.
Not working in IE7.

foo_httpcontrol

Reply #309
Are there instructions on how to use this?

I have a computer hooked up to my receiver and I'd like to be able to control it from my laptop.  This plugin will do the job, right?  The "Remote IP" would be the IP of my laptop, correct?  Is that the local IP (192.168.1.x) or the IP seen from the internet?  Is there anything else I should know?

foo_httpcontrol

Reply #310
Are there instructions on how to use this?

I have a computer hooked up to my receiver and I'd like to be able to control it from my laptop.  This plugin will do the job, right?  The "Remote IP" would be the IP of my laptop, correct?  Is that the local IP (192.168.1.x) or the IP seen from the internet?  Is there anything else I should know?


you will open the web browser on your laptop and enter the local ip address of the machine hooked up to your receiver

so 192.168.1.x:8888 (8888 is the default port)

 

foo_httpcontrol

Reply #311
Are there instructions on how to use this?

I have a computer hooked up to my receiver and I'd like to be able to control it from my laptop.  This plugin will do the job, right?  The "Remote IP" would be the IP of my laptop, correct?  Is that the local IP (192.168.1.x) or the IP seen from the internet?  Is there anything else I should know?


you will open the web browser on your laptop and enter the local ip address of the machine hooked up to your receiver

so 192.168.1.x:8888 (8888 is the default port)


Thank you.  Where does the 127.0.01 come in?

foo_httpcontrol

Reply #312
Are there instructions on how to use this?

I have a computer hooked up to my receiver and I'd like to be able to control it from my laptop.  This plugin will do the job, right?  The "Remote IP" would be the IP of my laptop, correct?  Is that the local IP (192.168.1.x) or the IP seen from the internet?  Is there anything else I should know?


you will open the web browser on your laptop and enter the local ip address of the machine hooked up to your receiver

so 192.168.1.x:8888 (8888 is the default port)


Thank you.  Where does the 127.0.01 come in?


127.0.0.1 is the loopback IP address which is available on all computers and with that you can reach the same computer. so, you can reach your laptop on your laptop via 127.0.0.1


foo_httpcontrol

Reply #314
@oblikoamorale:

Do you think it could be possible to implement a way to send commands to foobar2000 using the webinterface. That could be handy for making a interface that allows tagging (rating etc.), as well as switches on misc. components... Opputunities are endless
Can't wait for a HD-AAC encoder :P

foo_httpcontrol

Reply #315
it is partly possible via foobar2000 command-line parameters. it gives you access to tagging etc

Code: [Select]
        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


run foobar2000.exe /? for command details

foo_httpcontrol

Reply #316
Removed... Note to self: READ BEFORE POSTING

oblikoamorale: Thx, i missed that one...
Can't wait for a HD-AAC encoder :P

foo_httpcontrol

Reply #317
I've finished my remote set up now, looks like this;

And oblikoamorale for the plug in itself and the help.



Holy crap please do upload that and/or somehow have it incorporated it into the actual package as an automatic page layout when browsing from an iphone/android.

That looks great!

foo_httpcontrol

Reply #318
Huge props to Oblikoamorale for putting this plug-in together!

2 things:

1: when browsing over the network and selecting a networked computer, the JSON formatted string that is returned by PATH_JS dosen't seem to encode the cmd value for 'Network:\' so it escapes the following quote during eval:

Code: [Select]
{

"path":    [ { "cmd": "%20", "path": "Root:\\" }, { "cmd": "Network:\", "path": "Network:\\" }, { "cmd": "%5C%5CMONKEY-BRAIN%5C", "path": "\\\\MONKEY-BRAIN\\" } ],

"parent": "Network%3A%5C",

"browser": [ { "p": "\\\\MONKEY-BRAIN\\Albums\\", "pu": "%5C%5CMONKEY-BRAIN%5CAlbums%5C", "fs": "", "cm": "", "ft": "" } ]

}


I'm currently replacing the text before running eval right now.

2: I'm using AJAX and I'd like to be able to highlight the active track in the playlist on page load. Is there any way to tell what the current track is on page load. After sending a Start or PlayOrPause command PLAYLIST_ITEM_PLAYING returns the index of the track but I can't find a way to get it returned without actually starting playback.

Thanks for any help. Props again, your plug-in kicks ass!

Dave

foo_httpcontrol

Reply #319
no problem, here you go:
Code: [Select]
    v0.82 28 Mar
       add: [TRACK_FOCUSED_NUM] - currently focused item of active playlist;
             [TRACK_PREV_NUM] - previously played item. empty if another
             playlist is selected;
       add: optional param2 parameter for Del command, specifying playlist
            index of item to be deleted. if omitted, active playlist is used.
        fix: [PATH_JS] improperly escaped string;

foo_httpcontrol

Reply #320
Thanks for the quick reply!

The encoding fix is working fine. Regarding the request for the added player info, I guess I didn't explain myself well. Part of the issue I think is how foobar deals with track selection and playing.

In foobar if I have a playlist with say 8 items, I can select and start playback on track 6. I can then click on track 3 and track 6 will keep playing. While foobar is playing I can get the playing track index with PLAYLIST_ITEM_PLAYING and the clicked item, track 3, with PLAYLIST_ITEM_FOCUSED. But if I stop playback, I can only retrieve the 'focused' track and have no way to highlight the track that will begin playing when I press play. This is especially true when first starting foobar as it remembers where it was last in the playlist when it closed and will start playing from there again. I'd like to be able to highlight the track that so that I can tell where foobar will begin playing.

Not sure if foobar exposes the needed information for this. I can keep track of it in javascript once playback has started but I hate the 'blank' status on startup if I can avoid it.

thanks again.

foo_httpcontrol

Reply #321
aha, now I understand what you meant. I've always been using foobar2000 with Playback/Cursor follows playback option checked, so there seemed to be no problem for me to determine the track which will be played on playback start - just retrieve the cursor/focus position.
behaviour changes indeed when you untie cursor/focus from playback. I've re-checked SDK and didn't find the way to get this playback-start-track number. perhaps I'm missing something, and I'll be glad if someone points me in right direction.

foo_httpcontrol

Reply #322
Quote
I've always been using foobar2000 with Playback/Cursor follows playback option checked,



  heh....I've been using foobar for over 4 years and never knew you could do that. Thanks this will do fine for me.



foo_httpcontrol

Reply #323
Anyone gotten 'SwitchCursor' command to work?

I'm not getting a focus change when I send SwitchCursor as the command and a track index as param1. I get the expected reaction if I pass 'Start' as the command and a track index so I don't think it's my HTTPRequest code.

using v0.82

thanks



-----never mind -------
readme.txt listed it as SwitchCursor but the sample UI uses MoveCursor which works fine.

foo_httpcontrol

Reply #324
Hi everyone.

I started using this plugin a few days ago and it's fantastic.

I created a mockup for an alternative design. It's still missing some bits here and there. Im not sure if I have enough time to get a fully working layout done and especially to maintain it. That's why im willing to release this under a Creative Commons Attribution-Noncommercial license  http://creativecommons.org/licenses/by-nc/3.0/