|
NAMETemplate::Plugin::MP3 - Interface to the MP3::Info Module SYNOPSIS [% USE mp3 = MP3("Montana.mp3") %]
[% mp3.title %]
[% mp3.album %]
# perldoc MP3::Info for more ideas
DESCRIPTION"Template::Plugin::MP3" provides a simple wrapper for using "MP3::Info" in object oriented mode; see MP3::Info for more details. CONSTRUCTOR and CONFIGURATION"Template::Plugin::MP3" takes a filename as its primary argument: [% USE MP3("Tryin_To_Grow_A_Chin.mp3") %]
Optional configuration info can also be specified in the constructor: [% USE MP3("Camarillo_Brillo.mp3", utf8 => 1, dir => "/mp3") %]
The name of the file can also be specified as a named parameter ("name"): [% USE MP3(name => "A_Token_Of_My_Extreme.mp3", dir => "/mp3") %] "Template::Plugin::MP3" understands the following options:
If the constructor cannot create an instance using the filename passed, a "plugin.mp3" Exception is thrown, which will need to be caught appropriately: [% TRY %]
[% USE mp3 = MP3("Willie The Pimp.mp3") %]
[% CATCH plugin.mp3 %]
Can't find that MP3; are you sure you spelled it right?
[% CATCH %]
Unexpected exception: [% error %]
[% END %]
METHODS"Template::Plugin::MP3" provides the following, mostly intuitive, methods:
"MP3::Info" defines some other fields that I don't grok; try [% MP3.Dump %] to see them all. Of course, all of the above methods don't return the advertised value if the tag being read does not contain useful information. OTHER STUFF"Template::Plugin::MP3" provides access to the @mp3_genres and @winamp_genres arrays via the mp3_genres() and winamp_genres() class methods, or collectively through the genres() class method: [% FOREACH genre = MP3.genres %]
* [% genre;
END %]
AUTHORSdarren chamberlain <darren@cpan.org> Doug Gorley <douggorley@shaw.ca> COPYRIGHT(C) 2003 darren chamberlain This library is free software; you may distribute it and/or modify it under the same terms as Perl itself. SEE ALSOTemplate::Plugin, MP3::Info
|