The better way to do this is through the use of PHP's COM functions. You can
do this if you get a plugin for winamp
(http://www.adcock8.freeserve.co.uk/). This will allow you to control winamp
completely (you can do anything a skin can do) in most programming languages
(VB, C, and of  course PHP).
For some ideas on how to get started:
http://roboteddy.ath.cx/scripts/showsource.php?file=winamp.php

Ted
----- Original Message -----
From: "Ross Fleming" <[EMAIL PROTECTED]>
To: "PHP Windows mailing list" <[EMAIL PROTECTED]>
Sent: Sunday, April 28, 2002 10:53 PM
Subject: [PHP-WIN] Running winamp thru php (was "executing an external
program")


> Since giving Ranier advice on external programs, I've knocked up a simple
> web-based interface for winamp that can be controlled over the internet
> (useful in a networked flat where one PC is simply a music box, I can
leave
> apache running and remove the monitor/keyboard etc just to leave the box
and
> the speakers).  I'd started this project briefly a while ago (as some on
the
> list may remember) but gave up.  It works now, and I thought some people
on
> the list would appreciate a look at it.  (yes I know there are webbased
> winamp controllers available, but where's the fun in that?.. ;)  )
>
> Here's the php code for it
>
> <<contents of index.php>>
>
> <?
> $directory = "D:/mp3s";   // Set the directory we're looking at..
>
> if (isset($filename)) {
>   $link = "d:\\mp3s\\";
>   $link .= urldecode($filename);
>   exec("COMMAND.COM /C START c:\progra~1\winamp\winamp.exe \"$link\"
>NUL");
>   header("Location:index.php?status=playing&arg=$filename");
> }
>
> if ($status=="playing") {
>   $proper = urldecode($arg);
>   echo "Now playing: <H3>$arg</H3>";
> }
>
> $count=0;
> $handle=opendir($directory);
> echo "Choose a song to play from <B>$directory</B>:<BR>";
>
> while (false !== ($file = readdir($handle))) {
>   if ($file != "." && $file != "..") {
>     if (substr($file, -4)==".mp3"){
>       // ignore any non-mp3 files
>       $filelist[$count++] = $file;
>     }
>   }
> }
>
> closedir($handle);
>
> sort ($filelist);  // alphabetize the files
>
> for ($i=0; $i<$count; $i++) {
>   $link = urlencode($filelist[$i]);
>   echo "<A HREF=\"index.php?filename=$link\">$filelist[$i]</A><BR>";
> }
> ?>
>
> Ross
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to