Audio-DB

 view release on metacpan or  search on metacpan

bin/song_distribution.PLS  view on Meta::CPAN


__END__

=pod

=head1 NAME

song_distribution - create a histogram of song distribution by year

=head1 SYNPOSIS

This script demonstrates how to glean some information from your music
collection.  It generates a PNG image showing the distribution of
songs in your collection by year.  This is a simple way to show 1)
when your quest for acquiring new music waned or 2) times in your life
when you were in financial straits. It requires that the GD graphics
drawing library and perl module be installed on your system.

=head1 OPTIONS

Options [database]
   dsn      the name of your database
   user     database username, if required
   pass     database password if required
   adaptor  either dbi::sqlite or dbi::mysql (defaults to dbi::mysql)

Options [image]
   start    starting year to display
   end      ending year to display
   width    [optional] the width of the image in pixels
   height   [optional] the height of the image in pixels
   bground  [optional] background color for the image as an [r g b] array reference
   fground  [optional] foreground color for the boxes as an [r g b] array reference
   omit_totals  [optional] pass true to turn off display of year totals

You may need to tinker with start,end and width,height to get an
acceptable image depending on the range of years in your collection.

eg:

song_distribution  --adaptor dbi::mysql --dsn music \
                   --width 800 --height 500 --start 1950 --end 2004 \
                   --bground 255,0,0


=head1 IMPORTANT NOTE

If running this script on a Windows system, you made need to modify
this script, setting the output of STDERR to BINMODE prior to printing
the image.

=head1 AUTHOR

 Todd Harris (harris@cshl.org);
 $Id: song_distribution.PLS,v 1.1 2005/02/27 16:56:25 todd Exp $

=cut

!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;



( run in 0.886 second using v1.01-cache-2.11-cpan-39bf76dae61 )