NAME
Mac::iTunes::Library::Item - Perl extension for representing an item (song, URL, video) within an iTunes library.
SYNOPSIS
use Mac::iTunes::Library::Item;
my $item = Mac::iTunes::Library::Item->new(
'Track ID' => 1,
'Name' => 'The Fooiest Song',
'Artist' => 'The Bar Band',
);
$item->genre('Ska');
print "We are the " . $item->artist() . " and we play " .
$item->genre() . " music\n";
print "Enjoy our hit song " . $item->name() . "\n";
DESCRIPTION
A data structure for representing an item (song, URL, video) within an iTunes library. Use this along with Mac::iTunes::Library to create an iTunes library from which other information can be gleaned.
EXPORT
None by default.
METHODS
new()
Creates a new Mac::iTunes::Library::Item object that can store all of the data of an iTunes library item.
my $rec = Mac::iTunes::Library::Item->new();
The constructor can also be called initializing any number of the attributes of an item
my $rec = Mac::iTunes::Library::Item->new(
'Track ID' => '73',
'Name' => 'Josie',
'Artist' => 'blink-182',
'Album Artist' => 'blink-182',
'Composer' => 'blink-182',
'Album' => 'Dude Ranch',
'Genre' => 'Pop Punk',
'Kind' => 'MPEG audio file',
'Size' => 31337,
'Total Time' => 31337,
'Year' => '2007',
'Date Modified' => '2007-01-01T01:01:01Z',
'Date Added' => '2007-01-01T01:01:01Z',
'Bit Rate' => 256,
'Sample Rate' => 44100,
'Play Count' => 1,
'Play Date' => -1167613261,
'Play Date UTC' => '2007-01-01T01:01:01Z',
'Skip Count' => 1,
'Skip Count UTC' => '2007-01-01T01:01:01Z',
'Rating' => 50,
'Album Rating' => 50,
'Album Rating Computed' => 1,
'Compilation' => 1,
'Persistent ID' => 'DAC2FC501CCA2031',
'Track Type' => 'File',
'Location' => 'file://localhost/Users/dinomite/Music/blink-182/Dude%20Ranch/Josie.mp3',
'File Folder Count' => 4,
'Library Folder Count' => 1
);
trackID( $id )
Get/set the Track ID attribute for this item.
artist( $artist )
Get/set the Artist attribute for this item.
albumArtist( $albumArtist )
Get/set the Album Artist attribute for this item.
composer( $composer )
Get/set the Composer attribute for this item.
album( $album )
Get/set the Album attribute for this item.
genre( $genre )
Get/set the Genre attribute for this item.
kind( $kind )
Get/set the Kind ("MPEG audio file", etc.) attribute for this item.
size( $size )
Get/set the Size attribute for this item.
totalTime( $totalTime )
Get/set the Total Time attribute for this item.
year( $year )
Get/set the Year attribute for this item.
dateModified( $dateModified )
Get/set the Date Modified attribute for this item.
dateAdded( $dateAdded )
Get/set the Date Added attribute for this item.
bitRate( $bitRate )
Get/set the Date Added attribute for this item.
sampleRate( $sampleRate )
Get/set the Sample Rate attribute for this item.
playCount( $playCount )
Get/set the Play Count attribute for this item.
playDate( $playDate )
Get/set the Play Date attribute for this item.
playDateUTC( $playDateUTC )
Get/set the Play Date UTC attribute for this item.
skipCount( $skipCount )
Get/set the Skip Count attribute for this item.
skipDate( $skipDate )
Get/set the Skip Date attribute for this item.
rating( $rating )
Get/set the Rating attribute for this item.
albumRating( $albumRating )
Get/set the Album Rating attribute for this item.
albumRatingComputed( $albumRatingComputed )
Get/set the Album Rating Computed attribute for this item.
compilation( $albumRatingComputed )
Get/set the Compilation attribute for this item.
persistentID( $persistentID )
Get/set the Persistent ID attribute for this item.
trackType( $trackType )
Get/set the Track Type attribute for this item.
location( $location )
Get/set the Location attribute for this item.
fileFolderCount( $fileFolderCount )
Get/set the File Folder Count attribute for this item.
libraryFolderCount( $libraryFolderCount )
Get/set the Library Folder Count attribute for this item.
SEE ALSO
Mac::iTunes::Library, Mac::iTunes::Library::Playlist, Mac::iTunes::Library::XML
AUTHOR
Drew Stephens <drew@dinomite.net>, http://dinomite.net
SOURCE REPOSITORY
http://mac-itunes.googlecode.com
SVN INFO
$Revision: 78 $ $Date: 2009-12-30 10:33:01 -0700 (Wed, 30 Dec 2009) $ $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.