NAME

Mac::iTunes::Library - Perl extension for representing an iTunes library

SYNOPSIS

use Mac::iTunes::Library;

my $library = Mac::iTunes::Library->new();
my $item = Mac::iTunes::Library::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";

DESCRIPTION

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.

EXPORT

None by default.

METHODS

new()

Creates a new Mac::iTunes::Library object that can store Mac::iTunes::Library::Item objects.

version()

Get/set the plist version number.

majorVersion()

Get/set the Major Version number

minorVersion()

Get/set the Minor Version number

applicationVersion()

Get/set the Application Version number

features()

Get/set the Features attribute

showContentRatings()

Get/set the Show Content Ratings attribute

musicFolder()

Get/set the Music Folder attribute

libraryPersistentID()

Get/set the Library Persistent ID

num()

Get the number of tracks in the library

size()

Get the total size of the library

time()

Get the total time of the library

artist()

Get the hash of the number of tracks for each artist.

partist()

Get the hash of the number of plays (playcount) for each artist.

genre()

Get the hash of the number of tracks in each genre.

pgenre()

Get the hash of the number of plays (playcount) for each genre.

type()

Get the hash of item types in the library

items()

Get the hash of Items (Artist->Name->[item, item]) contained in the library.

add( Mac::iTunes::Library::Item )

Add an item to the library

SEE ALSO

Mac::iTunes::Library::XML, Mac::iTunes::Library::Item, Mac::iTunes::Library::Playlist

AUTHOR

Drew Stephens <drewgstephens@gmail.com>, http://dinomite.net

SVN INFO

$Revision: 54 $ $Date: 2008-08-05 23:51:26 -0700 (Tue, 05 Aug 2008) $ $Author: drewgstephens $

COPYRIGHT AND LICENSE

Copyright (C) 2007-2008 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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 439:

You forgot a '=back' before '=head1'