#!/usr/bin/perl # ############################ # --==Oldschool Music Player==-- # # # # Coded by Perforin | dark-codez # # # # www.dark-codez.org # # # # Join the dark side of coding! # ############################# my $version = 2.0; use Win32::MediaPlayer; if (@ARGV < 1) { print " \n +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n"; print " |O|l|d|s|c|h|o|o|l| |P|l|a|y|e|r|\n"; print " +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n\n\n"; print " +-+-+-+-+-+-+SyNtaX+-+-+-+-+-+-+\n\n"; print " \UUsage1: \E\n"; print " perl player.pl music.mp3 100\n"; print " Play one Music-File!\n"; print " \UUsage2: \E\n"; print " perl player.pl -all C:\ 100\n"; print " Play all music files in the Directory!\n"; print " \UUsage3: \E\n"; print " perl player.pl -last \n"; print " Displays the last song!\n\n"; print " +-+-+-+-+-+-+SyNtaX+-+-+-+-+-+-+\n"; exit; } if ($ARGV[0] =~ "-last") { open(PLAYED,"; close(PLAYED); print "\n"; print @PLAYED; exit; } elsif ($ARGV[0] =~ "-all") { my $Dir = $ARGV[1]; chomp($Direction); my $Vol = $ARGV[2]; chomp($Vol); if ($Vol =~ /a-z/ or /A-Z/) {print "Wrong Volume!\n" and exit; } chdir "$Dir"; print " \n +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n"; print " |O|l|d|s|c|h|o|o|l| |P|l|a|y|e|r|\n"; print " +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n\n"; print " BE OLDSCHOOL! USE OLSCHOOL PLAYER \n\n\n"; print " AND FEEL THE SOUND OF YOUR BLACK BOX!\n\n\n"; foreach $music (<*.mp3>,<*.wma>,<*.wav>,<*.midi>) { open(PLAYED,">played.txt"); $winmm = new Win32::MediaPlayer; $winmm->load("$music"); $winmm->play; $winmm->volume($Vol); $winmm->seek('00:00'); print " Oldschool Player plays: $music\n\n"; print PLAYED "$Direction"."\n"; my $i = 1; print ' Total Length : '.$winmm->length(1),$/; while($winmm->pos(1) != $winmm->length(1)) { print ' Now Position: '.$winmm->pos(1)."\r"; $i++ } $winmm->close; print " \n\n\n Track finished! \n\n\n"; close(PLAYED); } } else { my $Direction = $ARGV[0]; chomp($Direction); my $Volume = $ARGV[1]; chomp($Volume); if ($Volume =~ /a-z/ or /A-Z/) {print "Wrong Volume!\n" and exit; } print " \n +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n"; print " |O|l|d|s|c|h|o|o|l| |P|l|a|y|e|r|\n"; print " +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n\n"; print " BE OLDSCHOOL! USE OLSCHOOL PLAYER \n\n\n"; print " AND FEEL THE SOUND OF YOUR BLACK BOX!\n\n\n"; open(PLAYED,">played.txt"); $winmm = new Win32::MediaPlayer; $winmm->load("$Direction"); $winmm->play; $winmm->volume($Volume); $winmm->seek('00:00'); print " Oldschool Player plays: $Direction\n\n"; print PLAYED "$Direction"."\n"; my $i = 1; print ' Total Length : '.$winmm->length(1),$/; while($winmm->pos(1) != $winmm->length(1)) { print ' Now Position: '.$winmm->pos(1)."\r"; $i++ } $winmm->close; print " \n\n\n Track finished! \n\n\n"; close(PLAYED); }