++ed by:
TOBYINK

1 PAUSE user(s)
2 non-PAUSE user(s).

Edward J. Allen III
and 1 contributors

NAME

Music::Tag::Generic - Parent Class for Music::Tag objects

SYNOPSIS

    package Music::Tag::SuperMusic;

        use base qw(Music::Tag::Generic);

        sub set_tag {
                my $self = shift;
                $self->info->artist($self->info->artist . " is super");
                return $self->info;
        }

        1;

DESCRIPTION

Base class. See Music::Tag.

PLUGINS

All plugins should set @ISA to include Music::Tag::Generic and contain one or more of the following methods:

new()

Set in template. If you override, it should take as options a reference to a Music::Tag object and an href of options.

info()

Should return a reference to the associated Music::Tag object. If passed an object, should set the associated Music::Tag object to it.

get_tag()

Populates the data in the Music::Tag object.

set_tag()

Optional method to save info.

required_values()

Optional method returns a list of required data values required for "get_tag()" in Music::Tag::Generic.

set_values()

Optional method (for now) returns a list of data values that can be set with "get_tag()" in Music::Tag::Generic.

saved_values()

Optional method returns a list of data values that can be saved with "set_tag()" in Music::Tag::Generic.

strip_tag()

Optional method to remove info.

close()

Optional method to close open file handles.

tagchange()

Inherited method that can be called to announce a data-value change from what is read on file. Used by secondary plugins like Amazon, MusicBrainz, and File. This is preferred to using <$self-info->changed(1)>>.

simplify()

A useful method for simplifying artist names and titles. Takes a string, and returns a sting with no whitespace. Also removes accents (if Text::Unaccent::PurePerl is available) and converts numbers like 1,2,3 as words to one, two, three... (English is used here. Let me know if it would be helpful to change this. I do not change words to numbers because I prefer sorting "5 Star" under f). Removes known articles, such as a, the, an, le les, de if they are not at the end of a string.

simple_compare($a, $b, $required_percent)

Returns 1 on match, 0 on no match, and -1 on approximate match. $required_percent is a value from 0...1 which is the percentage of similarity required for match.

status()

Inherited method to print a pretty status message. If first argument is a number, assumes this is required verbosity.

error()

Inherited method to print an error message.

changed()

Same as $self->info->changed(). Please use tagchange method instead.

wav_out()

If plugin is for a media tag, return stream of wav to filehandle $fh.

Return True on success, False on failure, undef if not supported.

options()

Returns a hashref of options (or sets options, just like Music::Tag method).

default_options

Method should return default options.

SEE ALSO

Music::Tag

AUTHOR

Edward Allen III <ealleniii _at_ cpan _dot_ org>

COPYRIGHT

Copyright © 2007,2008 Edward Allen III. Some rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 364:

Non-ASCII character seen before =encoding in '©'. Assuming UTF-8