# $Id: Write.pm 2206 2007-03-17 02:02:40Z comdog $ package Mac::iTunes::Library::Write; use strict; use base qw(Mac::iTunes); use vars qw($VERSION $XML_HEAD $XML_FOOT); $VERSION = 1.10; #sprintf "%d.%02d", q$Revision: 2206 $ =~ m/ (\d+) \. (\d+) /gx; =head1 NAME Mac::iTunes::Library::Write - create an iTunes Music Library file =head1 SYNOPSIS see the Mac::iTunes documentation =head1 DESCRIPTION This module turns a Mac::iTunes object into an C file. =head1 METHODS =over 4 =item as_xml =cut BEGIN { $XML_HEAD =<<"XML"; Major Version 1 Minor Version 1 Application Version 3.0 Tracks XML $XML_FOOT =<<"XML"; XML } sub as_xml { my $self = shift; my $str = $XML_HEAD; $str .= $XML_FOOT; return $str; } sub item_xml { my $self = shift; my $item = shift; my $str =<<"XML"; 67 Track ID $$item{id} Name $$item{title} Artist $$item{artist} Album $$item{album} Genre $$item{genre} Kind MPEG audio file Size $$item{size} Total Time $$item{seconds} Track Number $$item{track} Track Count $$item{total_tracks} Date Modified $$item{modified} Date Added $$item{added} Bit Rate $$item{bit_rate} Sample Rate $$item{sample_rate} File Type $$item{file_type} File Creator $$item{file_creator} Location $$item{url} File Folder Count $$item{file_count} Library Folder Count $$item{library_count} XML return $str; } =back =head1 SOURCE AVAILABILITY This source is part of a SourceForge project which always has the latest sources in CVS, as well as all of the previous releases. http://sourceforge.net/projects/brian-d-foy/ If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately. =head1 SEE ALSO L =head1 BUGS * just wait. =head1 AUTHOR brian d foy, C<< >> =head1 COPYRIGHT AND LICENSE Copyright (c) 2002-2007 brian d foy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut "See why 1984 won't be like 1984";