This is actually version 2! When you start the script, it will show you how to use it. Itīs very simple... and oldschool :P
#!/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,"<played.txt") || die print "Cannot find list!"."\n"; @PLAYED = <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); }

In reply to Music-Player by Perforin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.