version 1.6, 2007/02/08 23:02:30 |
version 1.7, 2010/10/28 20:21:29 |
|
|
#!/usr/bin/perl |
#!/usr/bin/perl |
# $RedRiver: playmp3s.pl,v 1.5 2007/02/08 18:13:33 andrew Exp $ |
# $RedRiver: playmp3s.pl,v 1.6 2007/02/08 23:02:30 andrew Exp $ |
######################################################################## |
######################################################################## |
# PlayMP3.pl *** play's MP3s off a playlist using mp3play |
# PlayMP3.pl *** play's MP3s off a playlist using mp3play |
# |
# |
|
|
DisplayPlaying($cfgs{currenthtml},$filename); |
DisplayPlaying($cfgs{currenthtml},$filename); |
Print_PlayLog("done\n"); |
Print_PlayLog("done\n"); |
|
|
|
Print_PlayLog("Adding Last. . ."); |
|
AddLast($filename, $cfgs{playedlist}, $Num_History, $cfgs{playedhtml}, $cfgs{addurl}); |
|
Print_PlayLog("done\n"); |
|
|
if ($save_playlist) { |
if ($save_playlist) { |
Print_PlayLog("Saving Playlist. . ."); |
Print_PlayLog("Saving Playlist. . ."); |
save_playlist($cfgs{list},@playlist) || bail("Unable to save playlist!: $!"); |
save_playlist($cfgs{list},@playlist) || bail("Unable to save playlist!: $!"); |
|
|
Print_PlayLog("$player\n"); |
Print_PlayLog("$player\n"); |
`$player`; |
`$player`; |
|
|
|
|
# my $kid = 0; |
# my $kid = 0; |
# while ($kid ne -1 && ContinueRun()) { |
# while ($kid ne -1 && ContinueRun()) { |
# while ($kid ne -1) { |
# while ($kid ne -1) { |
|
|
# } |
# } |
|
|
|
|
if ($song) { |
|
Print_PlayLog("Adding Last. . ."); |
|
delete ${ $Full_Playlist{list} }{$song}; |
|
|
|
AddLast($filename, $cfgs{playedlist}, $Num_History, $cfgs{playedhtml}, $cfgs{addurl}); |
|
Print_PlayLog("done\n"); |
|
} |
|
|
|
Print_PlayLog("Displaying Nothing . . ."); |
Print_PlayLog("Displaying Nothing . . ."); |
DisplayPlaying($cfgs{currenthtml},"Nothing"); |
DisplayPlaying($cfgs{currenthtml},"Nothing"); |
Print_PlayLog("done\n"); |
Print_PlayLog("done\n"); |
|
|
my %played; |
my %played; |
@played{@played_list} = (); |
@played{@played_list} = (); |
|
|
|
|
delete $Full_Playlist{list}; |
delete $Full_Playlist{list}; |
|
|
my $list_size = 0; |
my $list_size = 0; |
|
|
my $addurl = shift; |
my $addurl = shift; |
|
|
my @LIST = get_playlist($lastlist); |
my @LIST = get_playlist($lastlist); |
|
|
|
DisplayPrevious($htmlfile, $addurl, @LIST) if $htmlfile; |
|
|
unshift @LIST, $lastsong; |
unshift @LIST, $lastsong; |
splice (@LIST, $history) if $history; |
splice (@LIST, $history) if $history; |
save_playlist($lastlist,@LIST); |
save_playlist($lastlist,@LIST); |
DisplayPrevious($htmlfile, $addurl, @LIST); |
|
|
# Remove song from full list so we don't play it again. |
|
delete $Full_Playlist{list}{$lastsong}; |
} |
} |
|
|
|
|