Mac::iTunes::Library - Perl extension for representing an iTunes library
use Mac::iTunes::Library; my $library = Mac::iTunes::Library->new(); my $item = Mac::iTunes::Item->new( 'Track ID' => 1, 'Name' => 'The Fooiest Song', 'Artist' => 'The Bar Band', ); $library->add($item); print "This library has only " . $library->num() . "item.\n";
A data structure for representing an iTunes library.
The library keeps track of the number of tracks by each artist (a hash of Artist => num_tracks) and the number of songs in each genre (Genre => num_tracks). Additionally, the total playcounts for each artist (Artist => playcount_of_all_songs) and genre (Genre => playcount_of_all_songs) are tallied. Finally, all of the items in the library are available, sorted by artist.
None by default.
Creates a new Mac::iTunes::Library object that can store Mac::iTunes::Item objects.
Get the number of tracks in the library
Get the total size of the library
Get the total time of the library
Get the hash of the number of tracks for each artist.
Get the hash of the number of plays (playcount) for each artist.
Get the hash of the number of tracks in each genre.
Get the hash of the number of plays (playcount) for each genre.
Get the hash of item types in the library
Get the hash of Items (Artist->Name->[item, item]) contained in the library.
Add an item to the library
Mac::iTunes, Mac::iTunes::Item
Drew Stephens, <lt>drewgstephens@gmail.com<gt>, http://dinomite.net
Copyright (C) 2007 by Drew Stephens
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Mac::iTunes::XML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mac::iTunes::XML
CPAN shell
perl -MCPAN -e shell install Mac::iTunes::XML
For more information on module installation, please visit the detailed CPAN module installation guide.