Wrote an mp3 music playing server that can be remotely controlled via TCP

connections using perl and MPEG::MP3Play. Ah how easy it can be to write
things in glue languages.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@108 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2001-03-22 02:41:36 +00:00
parent 219d25a195
commit 7ff3ddc7ac
3 changed files with 229 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/perl -w
#
# $Id: append,v 1.1 2001/03/22 02:41:36 mdb Exp $
#
# Appends the supplied song or songs to the playlist of a running MP3
# daemon.
use strict;
use IO::Socket;
my $usage = "Usage: $0 mp3_file [mp3_file ...]\n";
my $path = shift or die $usage;
my $port = 2500;
my $sock = new IO::Socket::INET(PeerAddr => "localhost",
PeerPort => $port,
Proto => "tcp");
do {
# send the command
print $sock "APPEND $path\n";
# print the response
print scalar <$sock>;
} while ($path = shift);
close $sock;