![]() |
![]()
| ![]() |
![]()
NAMEMP3::Archive::Format - Helper class for MP3::Archive SYNOPSISuse MP3::Archive::Format; my $f=MP3::Archive::Format->new; if($f->validate($file,$format) { print("Track num: ",$f->tracknum($file,$format), "Artist: ",$f->($file,$format), "Album: ",$f->($file,$format), "Track: ",$f->($file,$format), "Ext: ",$f->($file,$format),"\n"); } print("Correct path: ", $f->makepathname($fromfile,$artist,$album,$format),"/", $f->makefilename($fromfile,$tracknum,$artist,$album,$track,$ext,$format),"\n"); DESCRIPTIONMP3::Archive::Format is a helper class for MP3::Archive. Many of the methods in it are essentially duplicates of ones in MP3::Archive(3), but with the formats specified explicitly rather than inferred from configuration. These are used internally, but can also be useful if you need more control from your application. METHODSnewCreates an instance of MP3::Archive::Format tracknum, artist, album, track, ext, validate, makefilename, makepathnameThese methods are essentially the same as their counterparts in MP3::Archive, with the exception that they expect a format as well as a filename (eg "artist($file, $format)", and do not take an optional tracktype. A format is a reference to an array of strings containing regular expressions. See MP3::Archive::Config(3) for details on formats. INTERNAL METHODSreplace($format,$var,$tag)Replaces $tag with $var in $format. $tag can be one of "TRKNUM", "ARTIST", "ALBUM", or "TRACK". parse($file,$format,$tag)Parse formats. $tag is the tag (eg "ARTIST") we are interested in. Returns the matching data. If called in array context, also returns the offset of the start of that data. BUGSNone known. Please report any found to ianb@nessie.mcc.ac.uk SEE ALSOMP3::Archive(3) MP3::Archive::Config(3), mp3lint(1), mp3-archive-tools(1) AUTHORIan Beckwith <ianb@nessie.mcc.ac.uk>
|