From 64abd69179cef6d4b8297eb1ed309181320f8c87 Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 12 Jul 2001 23:42:38 +0000 Subject: [PATCH] If the currently playing track is REMOVEd, skip to the next tune. git-svn-id: https://samskivert.googlecode.com/svn/trunk@172 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- projects/robodj/bin/musicd | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/projects/robodj/bin/musicd b/projects/robodj/bin/musicd index 6b58e37b..b825562f 100755 --- a/projects/robodj/bin/musicd +++ b/projects/robodj/bin/musicd @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: musicd,v 1.6 2001/07/12 22:32:56 mdb Exp $ +# $Id: musicd,v 1.7 2001/07/12 23:42:38 mdb Exp $ # # MP3 audio server. Manages playlists of mp3 files that live on a local # filesystem. The playlists can be manipulated by connecting to the server @@ -115,8 +115,14 @@ sub handle_client } } elsif ($input =~ m/^REMOVE (\d+)/) { - # remove this songid from the playlist my $sid = $1; + + # if we're playing the song to remove, skip to the next song + if ($sid = $playing->[1]) { + play_next_tune(); + } + + # remove this songid from the playlist my $sidx = -1; my $i; @@ -145,7 +151,7 @@ sub handle_client (defined $playing ? $playing->[1] : "") . "\n"; my $entry; foreach $entry (@playlist) { - print $cfh join(":", @{$entry}) . "\n"; + print $cfh join("\t", @{$entry}) . "\n"; } } elsif ($input =~ m/^PLAYING/) {