To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
Code CritiqueHaving someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.
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.
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"?
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
__________________
there's no place i can be, since i found serenity.
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,126
Quote:
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
Quote:
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.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Last edited by Weedpacket; 12-22-2003 at 08:34 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?
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.
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).
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.