On Mon, 17 Apr 2006, Maxime Robache wrote:
I'm looking for comments and for a sponsor concerning the music123
package I just adopted.
1. As it's a maintainer upload, the version number should be 15, not 14.3
-- the latter is used for source NMUs.
2. You may want to add support for other filetypes. For example:
* mpc => mpc123 (since recently in Debian), mppdec (not packaged)
* wav => play (package: sox)
* mid => timidity
* s3m, mod => s3mod
* nsf => nosefart (not packaged)
* sid => sidplay
* mp2 => mpg123
(flamebait warning)
3.
#!/usr/bin/perl -w
%player=("mp3"=>"mpg123","ogg"=>"ogg123","wav"=>"play","mid"=>"timidity","s3m"=>"s3mod","mod"=>"s3mod","mpc"=>"mpc123");
@playlist=grep(/\.(wav|mp3|ogg|mid|s3m|mod|mpc)$/i, @ARGV? @ARGV :
split('\n',`find`));
$type="";
for(@playlist)
{
/.(wav|mp3|ogg|mid|s3m|mod|mpc)$/i;
if ("$type" ne "\L$1")
{
do_play();
undef @chunk;
$type="\L$1";
}
push @chunk, $_;
}
do_play();
sub do_play
{
return unless @chunk;
die "Invalid file type: [$type]\n" unless $player{$type};
system $player{$type}, @chunk;
}
(my /usr/local/bin/123) after adding the command-line args could replace
57KB of Ada code. This is a matter of preference, though, and smells of
language bashing :-p
Regards, 1KB
--
/-----------------------\ Shh, be vewy, vewy quiet,
| [EMAIL PROTECTED] | I'm hunting wuntime ewwows!
\-----------------------/
Segmentation fault (core dumped)
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]