Methods Summary |
---|
public void | addKeyword(java.lang.Class id3v2FrameBodyClass, java.lang.String keyword)
if (!AbstractID3v2FrameBody.class.isAssignableFrom(id3v2FrameBodyClass))
{
throw new TagException("Invalid class type. Must be AbstractId3v2FrameBody " + id3v2FrameBodyClass);
}
if ((keyword != null) && (keyword.length() > 0))
{
LinkedList<String> keywordList;
if (!keywordMap.containsKey(id3v2FrameBodyClass))
{
keywordList = new LinkedList<String>();
keywordMap.put(id3v2FrameBodyClass, keywordList);
}
else
{
keywordList = keywordMap.get(id3v2FrameBodyClass);
}
keywordList.add(keyword);
}
|
public void | addParenthesis(java.lang.String open, java.lang.String close)
parenthesisMap.put(open, close);
|
public void | addReplaceWord(java.lang.String oldWord, java.lang.String newWord)
replaceWordMap.put(oldWord, newWord);
|
public byte | getId3v23DefaultTextEncoding()Get the default text encoding to use for new v23 frames, when unicode is required
UTF16 will always be used because that is the only valid option for v23/v22
return id3v23DefaultTextEncoding;
|
public byte | getId3v24DefaultTextEncoding()Get the default text encoding to use for new v24 frames, it defaults to simple ISO8859
but by changing this value you could always used UTF8 for example whether you needed to or not
return id3v24DefaultTextEncoding;
|
public byte | getId3v24UnicodeTextEncoding()Get the text encoding to use for new v24 frames when unicode is required, it defaults to UTF16 just
because this encoding is understand by all ID3 versions
return id3v24UnicodeTextEncoding;
|
public static org.jaudiotagger.tag.TagOptionSingleton | getInstance()
return getInstance(defaultOptions);
|
public static org.jaudiotagger.tag.TagOptionSingleton | getInstance(java.lang.String instanceKey)
TagOptionSingleton tagOptions = tagOptionTable.get(instanceKey);
if (tagOptions == null)
{
tagOptions = new TagOptionSingleton();
tagOptionTable.put(instanceKey, tagOptions);
}
return tagOptions;
|
public static java.lang.String | getInstanceKey()
return defaultOptions;
|
public java.util.Iterator | getKeywordIterator()
return keywordMap.keySet().iterator();
|
public java.util.Iterator | getKeywordListIterator(java.lang.Class id3v2_4FrameBody)
return keywordMap.get(id3v2_4FrameBody).iterator();
|
public java.lang.String | getLanguage()Returns the default language for any ID3v2 tag frames which require it.
return language;
|
public boolean | getLyrics3SaveField(java.lang.String id)Returns true if we should save the Lyrics3 field asked for in the
argument. Defaults to true.
return lyrics3SaveFieldMap.get(id);
|
public java.util.HashMap | getLyrics3SaveFieldMap()
return lyrics3SaveFieldMap;
|
public java.lang.String | getNewReplaceWord(java.lang.String oldWord)
return replaceWordMap.get(oldWord);
|
public int | getNumberMP3SyncFrame()Returns the number of MP3 frames to sync when trying to find the start
of the MP3 frame data. The start of the MP3 frame data is the start of
the music and is different from the ID3v2 frame data. WinAmp 2.8 seems
to sync 3 frames. Default is 5.
return numberMP3SyncFrame;
|
public java.util.Iterator | getOldReplaceWordIterator()
return replaceWordMap.keySet().iterator();
|
public java.util.Iterator | getOpenParenthesisIterator()
return parenthesisMap.keySet().iterator();
|
public int | getPlayerCompatability()When this is set and using the generic interface jaudiotagger will make some adjustmensts
when saving field sso they work best with the specified Tagger
return playerCompatability;
|
public byte | getTimeStampFormat()Returns the default time stamp format for ID3v2 tags which require it.
$01 Absolute time, 32 bit sized, using MPEG frames as unit
$02 Absolute time, 32 bit sized, using milliseconds as unit
return timeStampFormat;
|
public long | getWriteChunkSize()When we have to create new audio files and shift audio data to fit in more metadata this value
set the maximum amount in bytes that can be transferred in one call, this is to protect against
various OutOfMemoryExceptions that cna occur, especially on networked filesystems.
return writeChunkSize;
|
public boolean | isAndroid()
return isAndroid;
|
public boolean | isEncodeUTF16BomAsLittleEndian()When you specify a field should be stored as UTF16 in ID3 this means write with BOM indicating whether
written as Little Endian or Big Endian, its defaults to little Endian
return isEncodeUTF16BomAsLittleEndian;
|
public boolean | isFilenameTagSave()
return filenameTagSave;
|
public boolean | isId3v1Save()
return id3v1Save;
|
public boolean | isId3v1SaveAlbum()
return id3v1SaveAlbum;
|
public boolean | isId3v1SaveArtist()
return id3v1SaveArtist;
|
public boolean | isId3v1SaveComment()
return id3v1SaveComment;
|
public boolean | isId3v1SaveGenre()
return id3v1SaveGenre;
|
public boolean | isId3v1SaveTitle()
return id3v1SaveTitle;
|
public boolean | isId3v1SaveTrack()
return id3v1SaveTrack;
|
public boolean | isId3v1SaveYear()
return id3v1SaveYear;
|
public boolean | isId3v2PaddingCopyTag()
return id3v2PaddingCopyTag;
|
public boolean | isId3v2PaddingWillShorten()
return id3v2PaddingWillShorten;
|
public boolean | isId3v2Save()
return id3v2Save;
|
public boolean | isLyrics3KeepEmptyFieldIfRead()
return lyrics3KeepEmptyFieldIfRead;
|
public boolean | isLyrics3Save()
return lyrics3Save;
|
public boolean | isLyrics3SaveEmptyField()
return lyrics3SaveEmptyField;
|
public boolean | isOpenParenthesis(java.lang.String open)
return parenthesisMap.containsKey(open);
|
public boolean | isOriginalSavedAfterAdjustingID3v2Padding()
return originalSavedAfterAdjustingID3v2Padding;
|
public boolean | isPadNumbers()
return padNumbers;
|
public boolean | isRemoveTrailingTerminatorOnWrite()Do we remove unnecessary trailing null characters on write
return removeTrailingTerminatorOnWrite;
|
public boolean | isResetTextEncodingForExistingFrames()When writing frames if this is set to true then the frame will be written
using the defaults disregarding the text encoding originally used to create
the frame.
return resetTextEncodingForExistingFrames;
|
public boolean | isTruncateTextWithoutErrors()
return truncateTextWithoutErrors;
|
public boolean | isUnsyncTags()
return unsyncTags;
|
public boolean | isWriteMp4GenresAsText()If enabled we always use the ©gen atom rather than the gnre atom when writing genres to mp4s
This is known to help some android apps
return isWriteMp4GenresAsText;
|
public void | setAndroid(boolean android)
isAndroid = android;
|
public void | setEncodeUTF16BomAsLittleEndian(boolean encodeUTF16BomAsLittleEndian)
isEncodeUTF16BomAsLittleEndian = encodeUTF16BomAsLittleEndian;
|
public void | setFilenameTagSave(boolean filenameTagSave)
this.filenameTagSave = filenameTagSave;
|
public void | setId3v1Save(boolean id3v1Save)
this.id3v1Save = id3v1Save;
|
public void | setId3v1SaveAlbum(boolean id3v1SaveAlbum)
this.id3v1SaveAlbum = id3v1SaveAlbum;
|
public void | setId3v1SaveArtist(boolean id3v1SaveArtist)
this.id3v1SaveArtist = id3v1SaveArtist;
|
public void | setId3v1SaveComment(boolean id3v1SaveComment)
this.id3v1SaveComment = id3v1SaveComment;
|
public void | setId3v1SaveGenre(boolean id3v1SaveGenre)
this.id3v1SaveGenre = id3v1SaveGenre;
|
public void | setId3v1SaveTitle(boolean id3v1SaveTitle)
this.id3v1SaveTitle = id3v1SaveTitle;
|
public void | setId3v1SaveTrack(boolean id3v1SaveTrack)
this.id3v1SaveTrack = id3v1SaveTrack;
|
public void | setId3v1SaveYear(boolean id3v1SaveYear)
this.id3v1SaveYear = id3v1SaveYear;
|
public void | setId3v23DefaultTextEncoding(byte id3v23DefaultTextEncoding)Set the default text encoding to use for new v23 frames, when unicode is required
UTF16 will always be used because that is the only valid option for v23/v22
if ((id3v23DefaultTextEncoding == TextEncoding.ISO_8859_1) || (id3v23DefaultTextEncoding == TextEncoding.UTF_16))
{
this.id3v23DefaultTextEncoding = id3v23DefaultTextEncoding;
}
|
public void | setId3v24DefaultTextEncoding(byte id3v24DefaultTextEncoding)Set the default text encoding to use for new v24 frames, it defaults to simple ISO8859
but by changing this value you could always used UTF8 for example whether you needed to or not
if ((id3v24DefaultTextEncoding == TextEncoding.ISO_8859_1) || (id3v24DefaultTextEncoding == TextEncoding.UTF_16) || (id3v24DefaultTextEncoding == TextEncoding.UTF_16BE) || (id3v24DefaultTextEncoding == TextEncoding.UTF_8))
{
this.id3v24DefaultTextEncoding = id3v24DefaultTextEncoding;
}
|
public void | setId3v24UnicodeTextEncoding(byte id3v24UnicodeTextEncoding)Set the text encoding to use for new v24 frames when unicode is required, it defaults to UTF16 just
because this encoding is understand by all ID3 versions
if ((id3v24UnicodeTextEncoding == TextEncoding.UTF_16) || (id3v24UnicodeTextEncoding == TextEncoding.UTF_16BE) || (id3v24UnicodeTextEncoding == TextEncoding.UTF_8))
{
this.id3v24UnicodeTextEncoding = id3v24UnicodeTextEncoding;
}
|
public void | setId3v2PaddingCopyTag(boolean id3v2PaddingCopyTag)
this.id3v2PaddingCopyTag = id3v2PaddingCopyTag;
|
public void | setId3v2PaddingWillShorten(boolean id3v2PaddingWillShorten)
this.id3v2PaddingWillShorten = id3v2PaddingWillShorten;
|
public void | setId3v2Save(boolean id3v2Save)
this.id3v2Save = id3v2Save;
|
public void | setInstanceKey(java.lang.String instanceKey)
TagOptionSingleton.defaultOptions = instanceKey;
|
public void | setLanguage(java.lang.String lang)Sets the default language for any ID3v2 tag frames which require it.
While the value will already exist when reading from a file, this value
will be used when a new ID3v2 Frame is created from scratch.
if (Languages.getInstanceOf().getIdToValueMap().containsKey(lang))
{
language = lang;
}
|
public void | setLyrics3KeepEmptyFieldIfRead(boolean lyrics3KeepEmptyFieldIfRead)
this.lyrics3KeepEmptyFieldIfRead = lyrics3KeepEmptyFieldIfRead;
|
public void | setLyrics3Save(boolean lyrics3Save)
this.lyrics3Save = lyrics3Save;
|
public void | setLyrics3SaveEmptyField(boolean lyrics3SaveEmptyField)
this.lyrics3SaveEmptyField = lyrics3SaveEmptyField;
|
public void | setLyrics3SaveField(java.lang.String id, boolean save)Sets if we should save the Lyrics3 field. Defaults to true.
this.lyrics3SaveFieldMap.put(id, save);
|
public void | setNumberMP3SyncFrame(int numberMP3SyncFrame)Sets the number of MP3 frames to sync when trying to find the start of
the MP3 frame data. The start of the MP3 frame data is the start of the
music and is different from the ID3v2 frame data. WinAmp 2.8 seems to
sync 3 frames. Default is 5.
this.numberMP3SyncFrame = numberMP3SyncFrame;
|
public void | setOriginalSavedAfterAdjustingID3v2Padding(boolean originalSavedAfterAdjustingID3v2Padding)
this.originalSavedAfterAdjustingID3v2Padding = originalSavedAfterAdjustingID3v2Padding;
|
public void | setPadNumbers(boolean padNumbers)
this.padNumbers = padNumbers;
|
public void | setPlayerCompatability(int playerCompatability)
this.playerCompatability = playerCompatability;
|
public void | setRemoveTrailingTerminatorOnWrite(boolean removeTrailingTerminatorOnWrite)Remove unnecessary trailing null characters on write
this.removeTrailingTerminatorOnWrite = removeTrailingTerminatorOnWrite;
|
public void | setResetTextEncodingForExistingFrames(boolean resetTextEncodingForExistingFrames)When writing frames if this is set to true then the frame will be written
using the defaults disregarding the text encoding originally used to create
the frame.
this.resetTextEncodingForExistingFrames = resetTextEncodingForExistingFrames;
|
public void | setTimeStampFormat(byte tsf)Sets the default time stamp format for ID3v2 tags which require it.
While the value will already exist when reading from a file, this value
will be used when a new ID3v2 Frame is created from scratch.
$01 Absolute time, 32 bit sized, using MPEG frames as unit
$02 Absolute time, 32 bit sized, using milliseconds as unit
if ((tsf == 1) || (tsf == 2))
{
timeStampFormat = tsf;
}
|
public void | setToDefault()
keywordMap = new HashMap<Class<? extends ID3v24FrameBody>, LinkedList<String>>();
filenameTagSave = false;
id3v1Save = true;
id3v1SaveAlbum = true;
id3v1SaveArtist = true;
id3v1SaveComment = true;
id3v1SaveGenre = true;
id3v1SaveTitle = true;
id3v1SaveTrack = true;
id3v1SaveYear = true;
id3v2PaddingCopyTag = true;
id3v2PaddingWillShorten = false;
id3v2Save = true;
language = "eng";
lyrics3KeepEmptyFieldIfRead = false;
lyrics3Save = true;
lyrics3SaveEmptyField = false;
lyrics3SaveFieldMap = new HashMap<String, Boolean>();
numberMP3SyncFrame = 3;
parenthesisMap = new HashMap<String, String>();
replaceWordMap = new HashMap<String, String>();
timeStampFormat = 2;
unsyncTags = false;
removeTrailingTerminatorOnWrite = true;
id3v23DefaultTextEncoding = TextEncoding.ISO_8859_1;
id3v24DefaultTextEncoding = TextEncoding.ISO_8859_1;
id3v24UnicodeTextEncoding = TextEncoding.UTF_16;
resetTextEncodingForExistingFrames = false;
truncateTextWithoutErrors = false;
padNumbers = false;
isAndroid = false;
isEncodeUTF16BomAsLittleEndian = true;
writeChunkSize=5000000;
isWriteMp4GenresAsText=false;
//default all lyrics3 fields to save. id3v1 fields are individual
// settings. id3v2 fields are always looked at to save.
Iterator<String> iterator = Lyrics3v2Fields.getInstanceOf().getIdToValueMap().keySet().iterator();
String fieldId;
while (iterator.hasNext())
{
fieldId = iterator.next();
lyrics3SaveFieldMap.put(fieldId, true);
}
try
{
addKeyword(FrameBodyCOMM.class, "ultimix");
addKeyword(FrameBodyCOMM.class, "dance");
addKeyword(FrameBodyCOMM.class, "mix");
addKeyword(FrameBodyCOMM.class, "remix");
addKeyword(FrameBodyCOMM.class, "rmx");
addKeyword(FrameBodyCOMM.class, "live");
addKeyword(FrameBodyCOMM.class, "cover");
addKeyword(FrameBodyCOMM.class, "soundtrack");
addKeyword(FrameBodyCOMM.class, "version");
addKeyword(FrameBodyCOMM.class, "acoustic");
addKeyword(FrameBodyCOMM.class, "original");
addKeyword(FrameBodyCOMM.class, "cd");
addKeyword(FrameBodyCOMM.class, "extended");
addKeyword(FrameBodyCOMM.class, "vocal");
addKeyword(FrameBodyCOMM.class, "unplugged");
addKeyword(FrameBodyCOMM.class, "acapella");
addKeyword(FrameBodyCOMM.class, "edit");
addKeyword(FrameBodyCOMM.class, "radio");
addKeyword(FrameBodyCOMM.class, "original");
addKeyword(FrameBodyCOMM.class, "album");
addKeyword(FrameBodyCOMM.class, "studio");
addKeyword(FrameBodyCOMM.class, "instrumental");
addKeyword(FrameBodyCOMM.class, "unedited");
addKeyword(FrameBodyCOMM.class, "karoke");
addKeyword(FrameBodyCOMM.class, "quality");
addKeyword(FrameBodyCOMM.class, "uncensored");
addKeyword(FrameBodyCOMM.class, "clean");
addKeyword(FrameBodyCOMM.class, "dirty");
addKeyword(FrameBodyTIPL.class, "f.");
addKeyword(FrameBodyTIPL.class, "feat");
addKeyword(FrameBodyTIPL.class, "feat.");
addKeyword(FrameBodyTIPL.class, "featuring");
addKeyword(FrameBodyTIPL.class, "ftng");
addKeyword(FrameBodyTIPL.class, "ftng.");
addKeyword(FrameBodyTIPL.class, "ft.");
addKeyword(FrameBodyTIPL.class, "ft");
iterator = GenreTypes.getInstanceOf().getValueToIdMap().keySet().iterator();
while (iterator.hasNext())
{
addKeyword(FrameBodyCOMM.class, iterator.next());
}
}
catch (TagException ex)
{
// this shouldn't happen, indicates coding error
throw new RuntimeException(ex);
}
addReplaceWord("v.", "vs.");
addReplaceWord("vs.", "vs.");
addReplaceWord("versus", "vs.");
addReplaceWord("f.", "feat.");
addReplaceWord("feat", "feat.");
addReplaceWord("featuring", "feat.");
addReplaceWord("ftng.", "feat.");
addReplaceWord("ftng", "feat.");
addReplaceWord("ft.", "feat.");
addReplaceWord("ft", "feat.");
iterator = this.getKeywordListIterator(FrameBodyTIPL.class);
addParenthesis("(", ")");
addParenthesis("[", "]");
addParenthesis("{", "}");
addParenthesis("<", ">");
|
public void | setTruncateTextWithoutErrors(boolean truncateTextWithoutErrors)Set truncate without errors
this.truncateTextWithoutErrors = truncateTextWithoutErrors;
|
public void | setUnsyncTags(boolean unsyncTags)Unsync tag where necessary, currently only applies to IDv23
this.unsyncTags = unsyncTags;
|
public void | setWriteChunkSize(long writeChunkSize)
this.writeChunkSize = writeChunkSize;
|
public void | setWriteMp4GenresAsText(boolean writeMp4GenresAsText)
isWriteMp4GenresAsText = writeMp4GenresAsText;
|