Template-Plugin-MP3-Tag

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl extension Template::Plugin::MP3::Tag.

0.01  Sat Apr 15 04:29:10 2006
	- original version; created by h2xs 1.23 with options
		-XAn Template::Plugin::MP3::Tag

Makefile.PL  view on Meta::CPAN

use 5.008002;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
    NAME              => 'Template::Plugin::MP3::Tag',
    VERSION_FROM      => 'lib/Template/Plugin/MP3/Tag.pm', # finds $VERSION
    PREREQ_PM         => {}, # e.g., Module::Name => 1.1
    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
      (ABSTRACT_FROM  => 'lib/Template/Plugin/MP3/Tag.pm', # retrieve abstract from module
       AUTHOR         => 'A. U. Thor <travail@localdomain>') : ()),
);

README  view on Meta::CPAN

Template-Plugin-MP3-Tag version 0.01
==============================================================================

To install the Template::Plugin::MP3::Tag module you do stereotype things:

perl Makefile.PL
make
make test
make install (as root)

If you find some errors while doing this, please send me
an email describing the problems.

In the directory 'script' and 'template', you will find script 'sample.pl' and
'sample.tt', how to use this module.

And perldoc MP3::Tag for methods implemented this module.

Thank you for using this module.

lib/Template/Plugin/MP3/Tag.pm  view on Meta::CPAN

package Template::Plugin::MP3::Tag;

# ----------------------------------------------------------------------
# $Id: Tag.pm,v 1.7 2006/04/24 03:30:05 travail Exp $
# ----------------------------------------------------------------------

use 5.008002;
use strict;
use warnings;
use vars qw ( $VERSION $AUTOLOAD );
use base qw( Template::Plugin );
use MP3::Tag ();
use Template::Plugin;

my $ETYPE = 'plugin.mp3_tag';
$VERSION = '0.01';

sub new {
    my ( $class, $context, $file ) = @_;

    -e $file || $context->throw( $ETYPE, "File '$file' does not exist" );

    my $mp3_tag = MP3::Tag->new( $file )
        || $context->throw( $ETYPE, "Can't create MP3::Tag object for mp3 file '$file'" );

    bless {
        _CONTEXT => $context,
        _FILE    => $file,
        _MP3_TAG => $mp3_tag
    }, $class;
}

sub AUTOLOAD {
    my $self = shift;

t/template/album.tt  view on Meta::CPAN

[% USE mp3 = MP3::Tag( mp3_file ) %][% mp3.album %]

t/template/artist.tt  view on Meta::CPAN

[% USE mp3 = MP3::Tag( mp3_file ) %][% mp3.artist %]

t/template/comment.tt  view on Meta::CPAN

[% USE mp3 = MP3::Tag( mp3_file ) %][% mp3.comment %]

t/template/genre.tt  view on Meta::CPAN

[% USE mp3 = MP3::Tag( mp3_file ) %][% mp3.genre %]

t/template/title.tt  view on Meta::CPAN

[% USE mp3 = MP3::Tag( mp3_file ) %][% mp3.title %]

t/template/year.tt  view on Meta::CPAN

[% USE mp3 = MP3::Tag( mp3_file ) %][% mp3.year %]

template/sample.tt  view on Meta::CPAN

[% FOREACH filename = files %]
[% USE tag = MP3::Tag(filename) %]
[% USE Jcode %]
[% tag.album.jcode.euc %]
[% tag.artist.jcode.euc %]
[% tag.song.jcode.euc %]
[% tag.track.jcode.euc %]
[% tag.title.jcode.euc %]
[% tag.genre.jcode.euc %]
[% tag.year.jcode.euc %]
[% tag.commen.jcode.euc %]
[% END %]

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 3.160 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-81bb8482316b )