[Mplayer-dev-eng] Fwd: mplayer contrib.

Felix Buenemann atmosfear at users.sourceforge.net
Mon Jul 23 04:38:43 CEST 2001


Hi Arpi,

----- Original Message -----
From: "Arpi" <arpi at thot.banki.hu>
To: <mplayer-dev-eng at lists.sourceforge.net>
Sent: Sunday, July 22, 2001 11:59 PM
Subject: [Mplayer-dev-eng] Fwd: mplayer contrib.


> is it usable?
> i don't understand perl, but it seems to simple.
it's messy, I can write better and shorter script perl.

>
> --------- Forwarded message ---------
> From: David Chan <prometheus at theendofthetunnel.org>
> To: arpi at thot.banki.hu
> Subject: mplayer contrib.
>
> This is a multi-part message in MIME format.
>
> Hello,
>     I am very impressed with Mplayer.  I love the lack of
> a GUI and am amazed at how efficently it plays a wide
> variety of codecs.
>
>     I am writing because I felt that Mplayer lacks a cool
> feature, which is the ability to play multiple files in
> succession.  ie:
>     `mplayer file1.mpg file2.avi file3.mpeg`
> but dont worry  cause i'm  not about to whine and plead
> for features, i just wrote a perl wrapper program to use
> with Mplayer.  I felt this would be the easiest way.
>
> I have attached my program for you to review, i cant
> say much for the code, but it works.  you can even
> pass Mplayer  flags to it, though you may have to
> put quotes around it.   I would be honored if you would
> distribute it with Mplayer.
>
> Thanks
> David Chan.
> <david at spinster.org>
>
> PS- You may consider mp GPL'd  and the standard
> disclaimer applies. :)
>
>
> #!/usr/bin/perl
>
> # A simple wrapper for Mplayer
> # mp (c) 2001 David Chan <david at spinster.org>
> # This code is distributed under the terms of the GPL 
> #
> # MPlayer Info:
> # MPlayer 0.17a-IdegCounter  (C) 2000-2001 Arpad Gereoffy
<arpi at thot.banki.hu>
>
> # set your default flags here...
> # $D_FLAGS = "-vo x11 -abs 1000";
not needed simply pass @argv which contains all switches in a scalar
context.
>
> $EXE = `which mplayer`;
hmm think we can assume mplayer in path but add constant at beginning of
file to set path to it if needed.

> chomp($EXE);
> $EXE .= ' '.$D_FLAGS;
not needed
>
> if ($#ARGV <= 0) {
> print "\nUsage: mp ['-Mplayer Flags'] file1 file2 ...\n\n";
> }
that should be die() so script exits.
>
> for ($i=0;$i<= $#ARGV ;$i++) {
> if ($ARGV[$i] =~ /^-/ ) {
regexp will fail with switches like -dvd /dev/dvd and stuff so we should
also add a check to test wether srgumentd not starting with - are regular
files.
> $EXE .= ' '.$ARGV[$i]." ";
> print "adjusting to $EXE\n";
we can do that on the argv array directly

> }else{
> $tEXE = $EXE." \"".$ARGV[$i]."\"";
> print "\tNow playing $tEXE\n";
> print `$tEXE`;
> }
not needed when using array perl can do print @array which will print
elements seperated by spaces.
> }
>
>
>
>
> _______________________________________________
> Mplayer-dev-eng mailing list
> Mplayer-dev-eng at lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/mplayer-dev-eng
>


_______________________________________________
Mplayer-dev-eng mailing list
Mplayer-dev-eng at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list