Output something sane when we aren't playing any songs. Added a "SKIP"
command which allows the currently playing song to be skipped. git-svn-id: https://samskivert.googlecode.com/svn/trunk@109 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
#
|
#
|
||||||
# $Id: musicd,v 1.1 2001/03/22 02:41:36 mdb Exp $
|
# $Id: musicd,v 1.2 2001/03/22 02:44:26 mdb Exp $
|
||||||
#
|
#
|
||||||
# MP3 audio server. Manages playlists of mp3 files that live on a local
|
# MP3 audio server. Manages playlists of mp3 files that live on a local
|
||||||
# filesystem. The playlsits can be manipulated by connecting to the server
|
# filesystem. The playlsits can be manipulated by connecting to the server
|
||||||
@@ -101,8 +101,8 @@ sub handle_client
|
|||||||
print $cfh "200 Playlist cleared.\n";
|
print $cfh "200 Playlist cleared.\n";
|
||||||
|
|
||||||
} elsif ($input =~ m/^PLAYLIST/) {
|
} elsif ($input =~ m/^PLAYLIST/) {
|
||||||
print $cfh "200 Playlist songs: " . @playlist .
|
print $cfh "200 Playlist songs: " . @playlist . " current: " .
|
||||||
" current: $playing\n";
|
(defined $playing ? $playing : "<none>") . "\n";
|
||||||
my $path;
|
my $path;
|
||||||
foreach $path (@playlist) {
|
foreach $path (@playlist) {
|
||||||
print $cfh "$path\n";
|
print $cfh "$path\n";
|
||||||
@@ -121,6 +121,12 @@ sub handle_client
|
|||||||
$mp3->pause();
|
$mp3->pause();
|
||||||
print $cfh "200 Music paused (use PLAY to unpause).\n";
|
print $cfh "200 Music paused (use PLAY to unpause).\n";
|
||||||
|
|
||||||
|
} elsif ($input =~ m/^SKIP/) {
|
||||||
|
# stop this tune and skip to the next one
|
||||||
|
$mp3->stop();
|
||||||
|
play_next_tune();
|
||||||
|
print $cfh "200 Skipped current song.\n";
|
||||||
|
|
||||||
} elsif ($input =~ m/^CLOSE/) {
|
} elsif ($input =~ m/^CLOSE/) {
|
||||||
print $cfh "200 Bye bye.\n";
|
print $cfh "200 Bye bye.\n";
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user