Files
samskivert/projects/robodj/bin/append
T
mdb 7ff3ddc7ac 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
2001-03-22 02:41:36 +00:00

27 lines
594 B
Perl
Executable File

#!/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;