NAME
Mac::iTunes::Item - Perl extension for representing a item (song, URL, video) within an iTunes library.
SYNOPSIS
use Mac::iTunes::Item;
my $item = Mac::iTunes::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 a 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::Item object that can store all of the data of an iTunes library item.
my $rec = Mac::iTunes::Item->new();
The constructor can also be called initializing any number of the attributes of a item
my $rec = Mac::iTunes::Item->new();
'Track ID' => '73',
'Name' => 'Josie',
'Artist' => 'blink-182',
'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',
'Rating' => 50,
'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
);
$rec->trackID( $id )
Get/set the Track ID attribute for this item.
$rec->artist( $artist )
Get/set the Artist attribute for this item.
$rec->genre( $genre )
Get/set the Genre attribute for this item.
$rec->kind( $kind )
Get/set the Kind ("MPEG audio file", etc.) attribute for this item.
$rec->size( $size )
Get/set the Size attribute for this item.
$rec->totalTime( $totalTime )
Get/set the Total Time attribute for this item.
$rec->year( $year )
Get/set the Year attribute for this item.
$rec->dateModified( $dateModified )
Get/set the Date Modified attribute for this item.
$rec->dateAdded( $dateAdded )
Get/set the Date Added attribute for this item.
$rec->dateAdded( $dateAdded )
Get/set the Date Added attribute for this item.
$rec->sampleRate( $sampleRate )
Get/set the Sample Rate attribute for this item.
$rec->playCount( $playCount )
Get/set the Play Count attribute for this item.
$rec->playDate( $playDate )
Get/set the Play Date attribute for this item.
$rec->playDateUTC( $playDateUTC )
Get/set the Play Date UTC attribute for this item.
$rec->rating( $rating )
Get/set the Rating attribute for this item.
$rec->persistentID( $persistentID )
Get/set the Persistent ID attribute for this item.
$rec->trackType( $trackType )
Get/set the Track Type attribute for this item.
$rec->location( $location )
Get/set the Location attribute for this item.
$rec->fileFolderCount( $fileFolderCount )
Get/set the File Folder Count attribute for this item.
$rec->libraryFolderCount( $libraryFolderCount )
Get/set the Library Folder Count attribute for this item.
SEE ALSO
Mac::iTunes, Mac::iTunes::Library
AUTHOR
Drew Stephens, <lt>drewgstephens@gmail.com<gt>, http://dinomite.net
COPYRIGHT AND LICENSE
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.