Click to See Complete Forum and Search --> : Control Winamp from a browser


coditoergosum
12-16-2003, 10:17 PM
So, one of my latest projects is to create a system that will integrate with Winamp and allow you to start/stop/load files/list your playlist/etc./etc...

Well the first part (and good majority) of it is done... and needs testing. I'm curious to see if it will actually work on a different system/platform.

You can see it running on my server/pc here: http://gagon.net/phpamp/ . Let me know if you want the source and I'll package it all up in a zip file.

Basically what it does is initiate a curl connection to a Winamp plugin to do various things. The Winamp plugin that has to be installed to make it work is basically a little web server that runs in Winamp. In theory it should work across platforms/networks, i.e. you could have a Unix server in london running the webserver controlling a Windows box in Tokyo with Winamp installed. But the webserver and Winamp are both on the same machine in my setup.

By itself it's a pretty trivial, novelty toy... I mean, it's kind of cool to control Winamp through a browser... but long term it's part of a larger project I have brewing, which you may hear about on CNN in the future... or not... haha.

Anyone want to test it for me?

coditoergosum
12-16-2003, 10:23 PM
Oh yeah, forgot one of the most important parts... here is the plugin winamp needs to make it all work: http://winamp.com/plugins/details.php?id=27865

intenz
12-21-2003, 08:01 AM
Nice, I would like to see the source of that. :)

Pearl0511
12-22-2003, 03:00 PM
hmm. have you looked at this before.
http://www.nullsoft.com/free/wwwinamp/

You might be trying to reinvent the wheel ;)

LordShryku
12-22-2003, 03:13 PM
Hrmmm...the whole "reinventing the wheel" saying never sat right with me. The way I see it, if the wheel had never been reinvented, we would all still be riding in carriages, instead of SUV's with 26 inch wheels on gold spoke rims.

Anyway, I guess what I'm saying that in order to improve things, it doesn't hurt to have someone else try it also. Could you imagine if no other browsers were made except for IE because no one wanted to "reinvent the wheel"?

Moonglobe
12-22-2003, 03:32 PM
Originally posted by LordShryku
Hrmmm...the whole "reinventing the wheel" saying never sat right with me. The way I see it, if the wheel had never been reinvented, we would all still be riding in carriages, instead of SUV's with 26 inch wheels on gold spoke rims.

Anyway, I guess what I'm saying that in order to improve things, it doesn't hurt to have someone else try it also. Could you imagine if no other browsers were made except for IE because no one wanted to "reinvent the wheel"? It's a different matter entirely when the wheel is triangular in the first place ;)

Weedpacket
12-22-2003, 08:28 PM
Originally posted by LordShryku
Hrmmm...the whole "reinventing the wheel" saying never sat right with me. The way I see it, if the wheel had never been reinvented, we would all still be riding in carriages...You mean on logs :)

if no other browsers were made except for IE because no one wanted to "reinvent the wheel"? "I don't know what Microsoft are with IE - it's just reinventing the wheel".


The question about wheel development is: do you (a) spend the time developing a new implementation, or (b) use a perfectly acceptable already-existing implementation? It's a matter of how much time you've got to play with (are you writing a web application or an XML parser to handle template processing?), how much skill you possess and how much experience in the problem domain you have.

It kinda breaks down like this: if coditoergosum wanted a PHP-driven winamp-over-http controller as a component of some other task, then the option is there to just see if anyone else has already written such a thing, and whether what they've written is adequate.

If, on the other hand, the PHP-driven winamp-over-http controller was the actual goal of the exercise (instead of something that had to be got out of the way before going on to the more interesting bits of the current project), then coditoergosum would I guess much rather write a new app.

LordShryku
12-22-2003, 08:32 PM
Well, when it comes to simply playing around to see what you can come up with (which I suspect was the case for this), does reinventing the wheel even matter? I understand that if you're pressed for time, using something that already does everything you need is probably the better bet, but without that time press, who really cares?

coditoergosum
12-23-2003, 01:11 AM
Haha. Quite the discussion over whether or not it's worth the time. I've actually asked myself the same thing... and obviously decided it was. I have seen various other programs that allow you to control winamp from a browser, but none of them really worked the way I wanted. Plus, I want to have total power/flexibility over it. In the future it could hook up with a mysql db with songs/playlists/song history/whatever... and maybe even write some code that analyzes the data to figure out what songs you like the most, what songs you typically listen to during different parts of the day, what songs you listen to when you're in different moods, or whatever... based on the track history, then play the songs when it thinks you want to hear them. Sort of a web application that tries to guess what you want to listen to. Haha. What I've coded so far is just the framework I guess you could say. I could go on and on about the possibilities, but I don't feel like typing that much. :D

The program that Pearl0511 mentioned seems to be very similar to the webserver plugin my script requires. In fact, I might try it out and switch everything over to using it if it performs better. Thing is though, that's just the engine in winamp... or the API if you will. In the grand scheme of things I want to do much more than what these winamp plugins provide... or could ever provide (at least in winamp2/3/5... some future media player might do everything I'm trying to do).

Anyway, I zipped up the files so you can test it yourselves: http://gagon.net/phpamp/zipped/phpamp.zip

The only config that needs to be done is the url. The two xsl files that are included just need to go in the \path\to\winamp\plugins\html dir. The code is kind of sloppy right now, and comments are pretty scarce (plan on cleaning up the code and commenting it next, before adding anything new). Let me know if you have any questions, or even better, suggestions.

goldbug
12-23-2003, 10:37 AM
Definitely not written in php... but it reminds me a lot of Zink (http://freshmeat.net/projects/zink/?topic_id=122%2C123)