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: Idea - Remote (over tcp/ip|http) (Read 22936 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Idea - Remote (over tcp/ip|http)

First post so go easy on me, eh? 

I've been reading the board for a couple of days and playing around with FB for about a week or so.  Great tool - kicks everything else in the butt!

Well, as the subject line says, I have an idea.  I debated over which forum to place this - perhaps General or Plugins?  then I saw this dev forum and decided since it's a dev issue this is the place.  If that's wrong, I apologise.

Anyway, the idea:

Let me control one "FBServer" executable via a remote "FBClient" executable.

Yes, I've seen the foo_remote widget.  That's not what I mean - it's as "remote" as my right hand is from my left (not very remote at all).  What I need is the FBClient running on my laptop (XP box), to control the FBServer thing running on my main music server (W2K box).

Wouldn't that be cool?  I think so!

I'm doing this already - sort of - by using TightVNC.  But that's overkill.

OK, so that's the idea.  What follows is just some implementation pointers that will hopefully foster further discussion...

It seems that FB is already very modularised.  That's cool.  So this idea requires a new module that listens for "commands" sent over tcp/ip|http - I'm not concerned which right now, but let's go with http.

Let's say my music server is 10.10.10.2.  Let's say FB is installed and configured to listen on port NN.

A button on the remote sends
  http://10.10.10.2:NN/?command=nexttrack

FBServer receives the request and does the obvious (jumps to next track)

Another button on the remote sends
  http://10.10.10.2:NN/?command=nextplaylist
or perhaps
  http://10.10.10.2:NN/?playlist=pink+floyd+3

I think you all get the general idea. 

Of course, it's entirely possible that the commands are configured both ends by the user.  That is:  they could all be numbers and what a given numbered command does is down to the mapping compiled by the user (much like the UI menus/commands and other stuff are driven right now)

  http://10.10.10.2:NN/?command=5

So the user decides which part of the server UI is mapped to "5" and the user also decides which menu/button on the client sends the "5".

OK, that's long enough for a first post!  Hope this little seed germinates!

Ruzz

Idea - Remote (over tcp/ip|http)

Reply #1
I started on a pocket pc version of a foobar front-end to control foobar on a PC a couple of months back, but got distracted with some other plugins. Now that I see some interest in this, I might continue with it.

Paulski

Idea - Remote (over tcp/ip|http)

Reply #2
The tcp/ip or http plugin might be very usful also for other purposes than those mentioned by ruzz.

Let's say that some of You use linux IRC client remotely by SSH/Telnet client (i.e. Putty). I do either and my client is IRSSI.
The problem is that I can't install any script for my IRSSI which would automate writing the "/me is now playing song_name" stuff remotely while using Foobar locally.

It is actually possible in Winamp, using httpQ plugin (which is the simple tcp/ip server) with adequate script for my IRSSI (can be found here).

It would be nice if Foobar can have its own tcp/ip|http server plugin, so I could use the "now playing" stuff again =]

Idea - Remote (over tcp/ip|http)

Reply #3
Why don't you try Girder from www.girder.nl.
Install this program on both computers (server and laptop) and you can controll any action (aplication) on the server from your laptop. Let me know if you need some more info about Girder configuration.

Idea - Remote (over tcp/ip|http)

Reply #4
This is something I, too, would really like to see.  As I remember this thread covers this one guy that developed a similar thing, but it was only for beta-something and seems to have gone.

I often makeshift-DJ at LAN parties with a couple friends and it'd be nice to sit in a chair with a laptop and be able to control foobar on the computer with the good speakers...Resorted to Winamp last time >_<; httpQ worked perfectly.

Anyone with the network programming knowledge to implement such a thing would be appreciated greatly.

Idea - Remote (over tcp/ip|http)

Reply #5
OK, it's time to say it straight - let's start thinking "out of the box"...

Quote
Why don't you try Girder from www.girder.nl.
Install this program on both computers (server and laptop) and you can controll any action (aplication) on the server from your laptop. Let me know if you need some more info about Girder configuration.


Sorry, but that sounds the same as VNC - I already have that (like I said).  The point here, is to control a server component via a minimalistic client component - they don't necessarily have to be different machines.

If it's done "right", the client could be installed on any type of device capable of sending tcp/ip|http  (my phone, my palmtop, you-name-it).

see?

And, like cromo said, you may just want to send command strings via ssh/putty clients/servers - there's no need then to "see" the server at all - hell, the server may not even have a desktop to see!

If the FBServer component is installed on a machine, any software capable of sending http could control it.  You could (if you were so inclined) have MS Word drive the server component either "locally" or remotely.

Quote
I often makeshift-DJ at LAN parties with a couple friends and it'd be nice to sit in a chair with a laptop and be able to control foobar on the computer with the good speakers...


zackly!  I bet there are many similar scenarios.  For me, I have a similar setup - my "music server" is routed to my main hifi.  My laptop, via the wireless lan could be "anywhere" (within reason).  I just want to change songs/change playlists from the laptop - without the overkill lan overhead of VNC.  With a FBServer component, many things would become possible.

Idea - Remote (over tcp/ip|http)

Reply #6
Quote
I started on a pocket pc version of a foobar front-end to control foobar on a PC a couple of months back, but got distracted with some other plugins. Now that I see some interest in this, I might continue with it.

Paulski

Interesting.  How did you plan on the server receiving the requests?

Idea - Remote (over tcp/ip|http)

Reply #7
I actually rather like that idea. It probably wouldn't be especially useful for me, but it's still a good idea. I'm thinking it would consist of the following things:

1) A server plugin. This might be a UI plugin, but it'd probably be better as just a general plugin with callbacks and such. It would have a small embedded web server that serves up status pages (preferrably with TAGZ-based templates) and interprets commands sent as POST commands to perform the specified action. A nice touch would be the ability to execute menu commands based on their name, like "Playback/Order/Random" for instance. Obviously in that case the slashes would have to be changed to something HTTP-compliant, but that's trivial. "Play this" type commands could be done by either a search string or by playlist number, including the possibility of actually adding the file(s) from the database to the playlist if they aren't already there. There are some pretty full-featured (relatively speaking) web servers that are exceptionally tiny and fast, so it wouldn't need to be too big.

2) A client plugin. This would actually more likely be an optional non-HTML interface to the server plugin, much like the various GUIs for mlDonkey (www.mldonkey.org - an open-source eDonkey client). This is obviously an icing on the cake type thing, but would be nice anyway.

I would code this myself, but I still haven't managed to get the hang of playlist manipulation in the foobar SDK, so it'll have to wait until either I figure it out or someone else codes it.

Idea - Remote (over tcp/ip|http)

Reply #8
Quote
1) A server plugin. This might be a UI plugin, but it'd probably be better as just a general plugin with callbacks and such. It would have a small embedded web server that serves up status pages (preferrably with TAGZ-based templates) and interprets commands sent as POST commands to perform the specified action.


POST or GET is fine - no prefs here.  You could even code it to take either!
Quote
A nice touch would be the ability to execute menu commands based on their name, like "Playback/Order/Random" for instance.


Suggest you don't do that.  TH!NK:  multilang support.  If you go with logical command mapping (as I suggested earlier) you'll avoid needing to recode for FB/Swahili

Suggest someone who knows the UI API "in depth" codifies the mapping so that an agreed "standard" can be achieved. And, of course, internally the numbers are consts/variables named as you'd expect:

CMD_PLAYBACK/CMD_ORDER/CMD_RANDOM

or

CMD_PLAYBACK_ORDER_RANDOM

or whatever...

Quote
There are some pretty full-featured (relatively speaking) web servers that are exceptionally tiny and fast, so it wouldn't need to be too big.


And, let's face it, we're not exactly talking about needing many features.  This is sounding pretty cool...

Quote
2) A client plugin. This would actually more likely be an optional non-HTML interface to the server plugin, much like the various GUIs for mlDonkey (www.mldonkey.org - an open-source eDonkey client). This is obviously an icing on the cake type thing, but would be nice anyway.


Like I implied aerlier, the client is largely a matter of user choice - it may not be something you (or anyone else here) codes.  Could be simple html page/form, MS word/excel...  or, indeed, another FB with client plugin.

Quote
I would code this myself, but I still haven't managed to get the hang of playlist manipulation in the foobar SDK, so it'll have to wait until either I figure it out or someone else codes it.


cool - I can wait
.............................
..............
....

done it yet?   

Idea - Remote (over tcp/ip|http)

Reply #9
Lots of mention of a client-plugin and such. Why not just an HTTP server plugin, and it could be accessed via any browser?

Idea - Remote (over tcp/ip|http)

Reply #10
Quote
Lots of mention of a client-plugin and such. Why not just an HTTP server plugin, and it could be accessed via any browser?

That sounds like the best idea -- if the embedded server can get commands via HTML, things are really easy.  All you'd have to do is write a page like

Code: [Select]
DELUX FOOBAR WEB INTERFACE MANAGER!

_Play_                --> "http://xxx.xxx.xxx.xxx:21/?command=play"
_Don't Play_          --> "http://.../?command=stop"
_Play Something Else_ --> "..."

CLICK THE BUTTONS FOR INTERFACE MANAGEMENT


and so forth.

There'd have to be some intelligence behind the playlist control, but once the server is written the "client" is trivial.

Idea - Remote (over tcp/ip|http)

Reply #11
Quote
Lots of mention of a client-plugin and such. Why not just an HTTP server plugin, and it could be accessed via any browser?


No reason "why not".  As I think I've already suggested, the client is largely immaterial - in my post immediately before yours I mentioned a simple html page.

It's the the server component that "does the business" - that's the key.  But hey, If someone wants to code a specific client, why the hell not! 

so... the big question...

Is someone going to take ownership of this?

 

Please?  B)

Idea - Remote (over tcp/ip|http)

Reply #12
Quote
... but once the server is written the "client" is trivial.


    zackly.

Idea - Remote (over tcp/ip|http)

Reply #13
Quote
Quote

A nice touch would be the ability to execute menu commands based on their name, like "Playback/Order/Random" for instance.


Suggest you don't do that.  TH!NK:  multilang support.  If you go with logical command mapping (as I suggested earlier) you'll avoid needing to recode for FB/Swahili

Suggest someone who knows the UI API "in depth" codifies the mapping so that an agreed "standard" can be achieved. And, of course, internally the numbers are consts/variables named as you'd expect:

CMD_PLAYBACK/CMD_ORDER/CMD_RANDOM

or

CMD_PLAYBACK_ORDER_RANDOM

or whatever...

I don't see what's wrong with symbolic names:
1) They're already used in foobar, and you can execute them like this:
Code: [Select]
menu_manager::run_command("Playback/Stop");

2) FB/Swahili? You're not gonna see this, at least not from Peter. As he has said multiple times, he doesn't want to support localization. And as far as localization of the remote gui is concerned, I don't think that the user will care about the actual command sent by the stop button - whether it is "Playback/Stop" or, say, 27.

Idea - Remote (over tcp/ip|http)

Reply #14
DON'T FORGET! Localization would have to include all 3rd party components!

Idea - Remote (over tcp/ip|http)

Reply #15
imho two separate plugin [ideas] make sence:
1) full-featured  B) http-server w/playlist editing, adding files/urls and so on
2) telnet interface. This will be my favorite as i have just one machine w/win32 on my work, all others - FreeBSD boxes, and no foobar on *n*x   

p.s. f@#$%ng win32 threads... so easy to use (afaik) that programmers couldn't resist on using threads and handles...7-Zip is another one unportable victim...
who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep

Idea - Remote (over tcp/ip|http)

Reply #16
Telnet interface is an AWESOME AWESOME idea.  That would be the ideal solution IMHO.

Idea - Remote (over tcp/ip|http)

Reply #17
Here's something I made last night. Its a client/server foobar controller written in python (which means you'll need python to run it) which works over tcp/ip networks. The server (fbserv.py) is just a console based app. I've included both a console (fbclient.py) and GUI (fbguiclient.py) client.
I'd recommend using the console client because the GUI one is still a little buggy and doesnt support a lot of features.
To get started in the console client just type 'help'.

Download: Foobar2000 Control client/server

Extra Notes:
The server app uses foobar.py so make sure that that it is in the same directory as fbserv.py on the server comp.
If you want the server to run in the background (no console window) rename it from 'fbserv.py' to 'fbserv.pyw'.
This also requires the foo_remote plugin.

Also, I'm going to write a cgi script that will allow people to control foobar via the web.
:: Antipodean ::

Idea - Remote (over tcp/ip|http)

Reply #18
Here's the cgi script I mentioned previously that I was going to write. It's written in python and uses the general purpose foobar module (foobar.py) I wrote a couple of weeks ago.
I think this is the kind of thing people were after. It will let you control foobar via your browser. Don't expect too much though, it's fairly minimalistic.. just how I like it.

Foobar control CGI script
and the foobar module if you havent got it already.

This script will let you do direct requests via the url, for example:
'http://127.0.0.1/cgi-bin/fb.py?control=play/pause' to toggle play/pause
'http://127.0.0.1/cgi-bin/fb.py?tracknum=5' to play track 5

This isn't a standalone web sever like people were talking about, you will still need to set up some kind of webserver and configure it to run python scripts.

Perhaps this can also be a good reason for everybody to install/learn python..
:: Antipodean ::

Idea - Remote (over tcp/ip|http)

Reply #19
Hi,

I made a little php script to run on a webserver with php support on windows(the machine I have good speakers on  B) ).  I made this for my use as im lazy and dont wont to have to reach over to that box to advance to the next song so I made this script to do it though the browser.

A note about the script: its not very complex or "smart" it only does the options through the command line provied by the /? switch.

So if anybody wants to try it you can grab it  here

The only thing you will need to configure is the $foobar variable to with the full path to the foobar2000.exe.

If anyone decides to give it a try and thinks its worth adding any extras to it let me know

later.

Idea - Remote (over tcp/ip|http)

Reply #20
I have just started looking into this problem this evening.  I thought of using SOAP -- specifically gSOAP (http://www.cs.fsu.edu/~engelen/soap.html) which lets you knock up pretty noddy little client/server applications very quickly.  I'm not sure if foobar is set up to run a web service as a plugin, but it would let you handle all manner of neat little remote control problems.  Neither am I sure that I'm HARDCORE enough to code a foobar plugin  Still, it'll be a fun project.

Idea - Remote (over tcp/ip|http)

Reply #21
Hy,

just thought about the same thing. Wonderful you allready had the same idea, and did some good work. Anyway, is there some source code around? Because, I´d like to have a plug-in just like httpq, and control it with a java-applet in a browser. This way, you could control foobar with a nice gui from just everywhere where a browser and at least a jdk 1.1 is installed (you could even control it via your mobil )
This would make it possible for me to let foobar run on my computer with a good soundcard, and control it in my livingroom with an old laptop (pentium 133).

cu, pop3smtp23.

Idea - Remote (over tcp/ip|http)

Reply #22
Quote
I started on a pocket pc version of a foobar front-end to control foobar on a PC a couple of months back, but got distracted with some other plugins. Now that I see some interest in this, I might continue with it.

Paulski

I'd be *very* interested in this plugin.  I'd also be willing to help (at least as much as I can).
Dan

Idea - Remote (over tcp/ip|http)

Reply #23
I would love to have a client/server app such as the one being discussed. The reason is that I have a music server with a great sound card located in the basement. The card is wired to the stereo upstairs and the computer is currently controlled by tightVNC. This works, but it is overkill for controlling foobar. So client on my upstairs computer would be awesome!

I love to help, but I don’t have the skills to make a meaningful contribution. I’m just voice my support for this project.

Thanks in advance!

Idea - Remote (over tcp/ip|http)

Reply #24
I put together this little control server that works as a plugin for foobar2000. Compiled against the 0.7 SDK. No documentation for it other than the help command;p but you will figure it out!

Started to do this so I could control my stereo via a bluetooth PDA or something if I ever get one;p and make a fancy little app on there to send the commands, search, browse the playlist and what not. Then I would have a standalone pc with foobar running to plugged into my stereo. Well I don't have a stereo yet either;) But that is the plan! lol.
Then I could sit on the balcony and play tunes!

Just telnet to port 3333 or whatever you configure it as in the options page, and it should be pretty straightforward. When you list the playlist it just dumps out like ALBUM ARTIST, ARTIST, ALBUM, TRACKNUMBER, TITLE, DATE, GENRE delimited by the | character. Those are configurable on the options page.

http://www.hydrogenaudio.org/forums/index....showtopic=38114

Anyway maybe it would be useful to someone else. Maybe if people like it I could keep working on it and post it in the third party plugins section.

Let me know if you break it! Thanks!

Cheers!

edit:  will recompile this when the new 0.9 sdk is out