entagged.audioformats.mp3
Class Id3V2TagConverter

java.lang.Object
  extended by entagged.audioformats.mp3.Id3V2TagConverter

public final class Id3V2TagConverter
extends Object

This class converts the fields (frames) from tags from an older to a newer version.

The best way to describe its function is to show an example:
Let's convert an Id3v2.3 tag into the version 2.4 and illustrate the need of a special handler (like this class).

A major change in the version switch 2.3->2.4 occured on the information of the recording time.
To represent a fully qualified date and time for that in the Id3v2.4 you will just need the field (frame) "TDRC" which is a textfield containing formatted date-time description. It allows mulitple time-patterns to be used, the most accurate variation is "yyyy-MM-ddTHH:mm:ss" with "THH" representing the hour out of 24.

For the same information you need three different fields (frames) with Id3v2.3. They are

So you see, If we want to convert this recoding time, we can't just simply convert the names of the field. We must collect information and join the data.
Who knows what else must be handled.

Author:
Christian Laireiter

Field Summary
static String DATE
          Field name of the "TDAT" field of version v2.3.
static String RECORD_DAT
          Field name of the "TDAT" field of version v2.3.
static String RECORDING_TIME
          Field name of the "TDRC" field of version 2.4.
static String TIME
          Field name of the "TIME" field of version v2.3.
static String YEAR
          Field name of the "TYER" field of version v2.3.
 
Constructor Summary
Id3V2TagConverter()
           
 
Method Summary
static Id3v2Tag convert(Id3v2Tag tag, int targetVersion)
          This method will convert the given tag into the given Id3v2 version.
Allowed values for targetVersion are:
Id3v2Tag.ID3V23 Id3v2Tag.ID3V24 The version of the given tag must be lower than the one to be converted two.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE

public static final String DATE
Field name of the "TDAT" field of version v2.3.

See Also:
Constant Field Values

RECORD_DAT

public static final String RECORD_DAT
Field name of the "TDAT" field of version v2.3.

See Also:
Constant Field Values

TIME

public static final String TIME
Field name of the "TIME" field of version v2.3.

See Also:
Constant Field Values

YEAR

public static final String YEAR
Field name of the "TYER" field of version v2.3.

See Also:
Constant Field Values

RECORDING_TIME

public static final String RECORDING_TIME
Field name of the "TDRC" field of version 2.4.

See Also:
Constant Field Values
Constructor Detail

Id3V2TagConverter

public Id3V2TagConverter()
Method Detail

convert

public static Id3v2Tag convert(Id3v2Tag tag,
                               int targetVersion)
This method will convert the given tag into the given Id3v2 version.
Allowed values for targetVersion are:
The version of the given tag must be lower than the one to be converted two.

Parameters:
tag - The tag to be converted.
targetVersion - The version to be converted to.
Returns:
The converted tag.


Copyright © 2007-2008. All Rights Reserved.