Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl Mp3 Player

by Albannach (Monsignor)
on Sep 19, 2002 at 03:22 UTC ( [id://199068]=note: print w/replies, xml ) Need Help??


in reply to Perl Mp3 Player

Well I don't know your opinion of Winamp, but at least it has a defined API. You can even do very basic stuff via the command line.

Update ...and strangely enough there is also Winamp::Control

--
I'd like to be able to assign to an luser

Replies are listed 'Best First'.
Re: Re: Perl Mp3 Player
by grummerX (Pilgrim) on Sep 19, 2002 at 10:44 UTC
    Here's a (slightly trimmed) script I use to control Winamp:
    #!c:/perl/bin/perl -w use strict; use Win32::API; use constant WM_USER => 1024; use constant WM_COMMAND => 273; my %commands = ( PREV => 40044, NEXT => 40048, PLAY => 40045, PAUSE => 40046, STOP => 40047, # Lots of other commands trimmed for space... ); my $cmd = uc shift; if (exists $commands{$cmd}){ my $FindWindow = new Win32::API( 'user32', 'FindWindow', ['P', 'N'], 'I' ); my $SendMessage = new Win32::API( 'user32', 'SendMessage', ['I', 'I', 'I', 'I'], 'I' ); my $hwndWinamp = $FindWindow->Call('Winamp v1.x', 0); $SendMessage->Call( $hwndWinamp, WM_COMMAND, $commands{$cmd}, 0 ) if $hwndWinamp; } else { print "Invalid command.\n"; }
    The most useful Winamp related script I have is the one that locks my computer and pauses Winamp. This snippet checks to see if Winamp is currently playing, and if so sends a "pause" command:
    if ($hwndWinamp){ if ($SendMessage->Call($hwndWinamp,WM_USER,0,104) == 1) { $SendMessage->Call($hwndWinamp,WM_COMMAND,40046,0); } }

    --grummerX

Re: Re: Perl Mp3 Player
by BUU (Prior) on Sep 19, 2002 at 03:42 UTC
    "It requires the httpQ winamp-plugin ". I can not find this on winamps offical site. Thats one thing, another thing is that requires winamp, which would take up a lot (relatively speaking) of extra resources for the gui and so forth. As opposed to just playing the bloody mp3.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://199068]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-24 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found