public class TagOptionSingleton
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT |
private static java.lang.String |
defaultOptions |
private boolean |
filenameTagSave |
private boolean |
id3v1Save
if we should save any fields of the ID3v1 tag or not.
|
private boolean |
id3v1SaveAlbum
if we should save the album field of the ID3v1 tag or not.
|
private boolean |
id3v1SaveArtist
if we should save the artist field of the ID3v1 tag or not.
|
private boolean |
id3v1SaveComment
if we should save the comment field of the ID3v1 tag or not.
|
private boolean |
id3v1SaveGenre
if we should save the genre field of the ID3v1 tag or not.
|
private boolean |
id3v1SaveTitle
if we should save the title field of the ID3v1 tag or not.
|
private boolean |
id3v1SaveTrack
if we should save the track field of the ID3v1 tag or not.
|
private boolean |
id3v1SaveYear
if we should save the year field of the ID3v1 tag or not.
|
private byte |
id3v23DefaultTextEncoding
This is 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.
|
private byte |
id3v24DefaultTextEncoding
This is 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
|
private byte |
id3v24UnicodeTextEncoding
This is 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
|
private boolean |
id3v2PaddingCopyTag
When adjusting the ID3v2 padding, if should we copy the current ID3v2
tag to the new MP3 file.
|
private boolean |
id3v2PaddingWillShorten
When adjusting the ID3v2 padding, if we should shorten the length of the
ID3v2 tag padding.
|
private boolean |
id3v2Save
if we should save any fields of the ID3v2 tag or not.
|
private ID3V2Version |
id3v2Version |
private boolean |
isAndroid
There are a couple of problems with the Java implementation on Google Android, enabling this value
switches on Google workarounds
|
private 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
|
private boolean |
isWriteMp4GenresAsText |
private java.util.HashMap<java.lang.Class<? extends ID3v24FrameBody>,java.util.LinkedList<java.lang.String>> |
keywordMap |
private java.lang.String |
language
default language for any ID3v2 tags frames which require it.
|
private boolean |
lyrics3KeepEmptyFieldIfRead
if we should keep an empty Lyrics3 field while we're reading.
|
private boolean |
lyrics3Save
if we should save any fields of the Lyrics3 tag or not.
|
private boolean |
lyrics3SaveEmptyField
if we should save empty Lyrics3 field or not.
|
private java.util.HashMap<java.lang.String,java.lang.Boolean> |
lyrics3SaveFieldMap
Map of lyric ID's to Boolean objects if we should or should not save the
specific lyrics3 field.
|
private int |
numberMP3SyncFrame
number of frames to sync when trying to find the start of the MP3 frame
data.
|
private boolean |
originalSavedAfterAdjustingID3v2Padding |
private boolean |
padNumbers
Frames such as TRCK and TPOS sometimes pad single digit numbers to aid sorting
Currently only applies to ID3 files
|
private PadNumberOption |
padNumberTotalLength
Number of padding zeroes digits 1- 9, numbers larger than nine will be padded accordingly based on the value.
|
private java.util.HashMap<java.lang.String,java.lang.String> |
parenthesisMap
parenthesis map stuff
|
private int |
playerCompatability
When this is set and using the generic interface jaudiotagger will make some adjustments
when saving field so they work best with the specified Tagger
|
private boolean |
removeTrailingTerminatorOnWrite
iTunes needlessly writes null terminators at the end for TextEncodedStringSizeTerminated values,
if this option is enabled these characters are removed
|
private java.util.HashMap<java.lang.String,java.lang.String> |
replaceWordMap
HashMap listing words to be replaced if found |
private 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.
|
private static java.util.HashMap<java.lang.String,TagOptionSingleton> |
tagOptionTable |
private byte |
timeStampFormat
default time stamp format for any ID3v2 tag frames which require it.
|
private boolean |
truncateTextWithoutErrors
Some formats impose maxmimum lengths for fields , if the text provided is longer
than the formats allows it will truncate and write a warning, if this is not set
it will throw an exception
|
private boolean |
unsyncTags
Unsynchronize tags/frames this is rarely required these days and can cause more
problems than it solves
|
private long |
writeChunkSize
max size of data to copy when copying audiodata from one file to another
|
Modifier | Constructor and Description |
---|---|
private |
TagOptionSingleton()
Creates a new TagOptions datatype.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyword(java.lang.Class<? extends ID3v24FrameBody> id3v2FrameBodyClass,
java.lang.String keyword) |
void |
addParenthesis(java.lang.String open,
java.lang.String close) |
void |
addReplaceWord(java.lang.String oldWord,
java.lang.String newWord) |
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
|
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
|
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
|
ID3V2Version |
getID3V2Version() |
static TagOptionSingleton |
getInstance() |
static TagOptionSingleton |
getInstance(java.lang.String instanceKey) |
static java.lang.String |
getInstanceKey() |
java.util.Iterator<java.lang.Class<? extends ID3v24FrameBody>> |
getKeywordIterator() |
java.util.Iterator<java.lang.String> |
getKeywordListIterator(java.lang.Class<? extends ID3v24FrameBody> id3v2_4FrameBody) |
java.lang.String |
getLanguage()
Returns the default language for any ID3v2 tag frames which require it.
|
boolean |
getLyrics3SaveField(java.lang.String id)
Returns true if we should save the Lyrics3 field asked for in the
argument.
|
java.util.HashMap<java.lang.String,java.lang.Boolean> |
getLyrics3SaveFieldMap() |
java.lang.String |
getNewReplaceWord(java.lang.String oldWord) |
int |
getNumberMP3SyncFrame()
Returns the number of MP3 frames to sync when trying to find the start
of the MP3 frame data.
|
java.util.Iterator<java.lang.String> |
getOldReplaceWordIterator() |
java.util.Iterator<java.lang.String> |
getOpenParenthesisIterator() |
PadNumberOption |
getPadNumberTotalLength()
Total length of number, i.e if set to 2 the value 1 would be stored as 01, if set to 3 would bs stored as 001
|
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
|
byte |
getTimeStampFormat()
Returns the default time stamp format for ID3v2 tags which require it.
|
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.
|
boolean |
isAndroid() |
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
|
boolean |
isFilenameTagSave() |
boolean |
isId3v1Save() |
boolean |
isId3v1SaveAlbum() |
boolean |
isId3v1SaveArtist() |
boolean |
isId3v1SaveComment() |
boolean |
isId3v1SaveGenre() |
boolean |
isId3v1SaveTitle() |
boolean |
isId3v1SaveTrack() |
boolean |
isId3v1SaveYear() |
boolean |
isId3v2PaddingCopyTag() |
boolean |
isId3v2PaddingWillShorten() |
boolean |
isId3v2Save() |
boolean |
isLyrics3KeepEmptyFieldIfRead() |
boolean |
isLyrics3Save() |
boolean |
isLyrics3SaveEmptyField() |
boolean |
isOpenParenthesis(java.lang.String open) |
boolean |
isOriginalSavedAfterAdjustingID3v2Padding() |
boolean |
isPadNumbers() |
boolean |
isRemoveTrailingTerminatorOnWrite()
Do we remove unnecessary trailing null characters on write
|
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.
|
boolean |
isTruncateTextWithoutErrors() |
boolean |
isUnsyncTags() |
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
|
void |
setAndroid(boolean android) |
void |
setEncodeUTF16BomAsLittleEndian(boolean encodeUTF16BomAsLittleEndian) |
void |
setFilenameTagSave(boolean filenameTagSave) |
void |
setId3v1Save(boolean id3v1Save) |
void |
setId3v1SaveAlbum(boolean id3v1SaveAlbum) |
void |
setId3v1SaveArtist(boolean id3v1SaveArtist) |
void |
setId3v1SaveComment(boolean id3v1SaveComment) |
void |
setId3v1SaveGenre(boolean id3v1SaveGenre) |
void |
setId3v1SaveTitle(boolean id3v1SaveTitle) |
void |
setId3v1SaveTrack(boolean id3v1SaveTrack) |
void |
setId3v1SaveYear(boolean id3v1SaveYear) |
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
|
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
|
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
|
void |
setId3v2PaddingCopyTag(boolean id3v2PaddingCopyTag) |
void |
setId3v2PaddingWillShorten(boolean id3v2PaddingWillShorten) |
void |
setId3v2Save(boolean id3v2Save) |
void |
setID3V2Version(ID3V2Version id3v2Version) |
void |
setInstanceKey(java.lang.String instanceKey) |
void |
setLanguage(java.lang.String lang)
Sets the default language for any ID3v2 tag frames which require it.
|
void |
setLyrics3KeepEmptyFieldIfRead(boolean lyrics3KeepEmptyFieldIfRead) |
void |
setLyrics3Save(boolean lyrics3Save) |
void |
setLyrics3SaveEmptyField(boolean lyrics3SaveEmptyField) |
void |
setLyrics3SaveField(java.lang.String id,
boolean save)
Sets if we should save the Lyrics3 field.
|
void |
setNumberMP3SyncFrame(int numberMP3SyncFrame)
Sets the number of MP3 frames to sync when trying to find the start of
the MP3 frame data.
|
void |
setOriginalSavedAfterAdjustingID3v2Padding(boolean originalSavedAfterAdjustingID3v2Padding) |
void |
setPadNumbers(boolean padNumbers) |
void |
setPadNumberTotalLength(PadNumberOption padNumberTotalLength) |
void |
setPlayerCompatability(int playerCompatability) |
void |
setRemoveTrailingTerminatorOnWrite(boolean removeTrailingTerminatorOnWrite)
Remove unnecessary trailing null characters on write
|
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.
|
void |
setTimeStampFormat(byte tsf)
Sets the default time stamp format for ID3v2 tags which require it.
|
void |
setToDefault() |
void |
setTruncateTextWithoutErrors(boolean truncateTextWithoutErrors)
Set truncate without errors
|
void |
setUnsyncTags(boolean unsyncTags)
Unsync tag where necessary, currently only applies to IDv23
|
void |
setWriteChunkSize(long writeChunkSize) |
void |
setWriteMp4GenresAsText(boolean writeMp4GenresAsText) |
private static java.util.HashMap<java.lang.String,TagOptionSingleton> tagOptionTable
private static java.lang.String DEFAULT
private static java.lang.String defaultOptions
private java.util.HashMap<java.lang.Class<? extends ID3v24FrameBody>,java.util.LinkedList<java.lang.String>> keywordMap
private java.util.HashMap<java.lang.String,java.lang.Boolean> lyrics3SaveFieldMap
private java.util.HashMap<java.lang.String,java.lang.String> parenthesisMap
private java.util.HashMap<java.lang.String,java.lang.String> replaceWordMap
HashMap
listing words to be replaced if foundprivate java.lang.String language
private boolean filenameTagSave
private boolean id3v1Save
private boolean id3v1SaveAlbum
private boolean id3v1SaveArtist
private boolean id3v1SaveComment
private boolean id3v1SaveGenre
private boolean id3v1SaveTitle
private boolean id3v1SaveTrack
private boolean id3v1SaveYear
private boolean id3v2PaddingCopyTag
private boolean id3v2PaddingWillShorten
private boolean id3v2Save
private boolean lyrics3KeepEmptyFieldIfRead
private boolean lyrics3Save
private boolean lyrics3SaveEmptyField
private boolean originalSavedAfterAdjustingID3v2Padding
private byte timeStampFormat
private int numberMP3SyncFrame
private boolean unsyncTags
private boolean removeTrailingTerminatorOnWrite
private byte id3v23DefaultTextEncoding
private byte id3v24DefaultTextEncoding
private byte id3v24UnicodeTextEncoding
private boolean resetTextEncodingForExistingFrames
private boolean truncateTextWithoutErrors
private boolean padNumbers
private PadNumberOption padNumberTotalLength
private boolean isAndroid
private boolean isEncodeUTF16BomAsLittleEndian
private int playerCompatability
private long writeChunkSize
private boolean isWriteMp4GenresAsText
private ID3V2Version id3v2Version
private TagOptionSingleton()
public static TagOptionSingleton getInstance()
public static TagOptionSingleton getInstance(java.lang.String instanceKey)
instanceKey
- public void setFilenameTagSave(boolean filenameTagSave)
filenameTagSave
- public boolean isFilenameTagSave()
public void setID3V2Version(ID3V2Version id3v2Version)
id3v2Version
- public ID3V2Version getID3V2Version()
public void setInstanceKey(java.lang.String instanceKey)
instanceKey
- public static java.lang.String getInstanceKey()
public void setId3v1Save(boolean id3v1Save)
id3v1Save
- public boolean isId3v1Save()
public void setId3v1SaveAlbum(boolean id3v1SaveAlbum)
id3v1SaveAlbum
- public boolean isId3v1SaveAlbum()
public void setId3v1SaveArtist(boolean id3v1SaveArtist)
id3v1SaveArtist
- public boolean isId3v1SaveArtist()
public void setId3v1SaveComment(boolean id3v1SaveComment)
id3v1SaveComment
- public boolean isId3v1SaveComment()
public void setId3v1SaveGenre(boolean id3v1SaveGenre)
id3v1SaveGenre
- public boolean isId3v1SaveGenre()
public void setId3v1SaveTitle(boolean id3v1SaveTitle)
id3v1SaveTitle
- public boolean isId3v1SaveTitle()
public void setId3v1SaveTrack(boolean id3v1SaveTrack)
id3v1SaveTrack
- public boolean isId3v1SaveTrack()
public void setId3v1SaveYear(boolean id3v1SaveYear)
id3v1SaveYear
- public boolean isId3v1SaveYear()
public void setId3v2PaddingCopyTag(boolean id3v2PaddingCopyTag)
id3v2PaddingCopyTag
- public boolean isId3v2PaddingCopyTag()
public void setId3v2PaddingWillShorten(boolean id3v2PaddingWillShorten)
id3v2PaddingWillShorten
- public boolean isId3v2PaddingWillShorten()
public void setId3v2Save(boolean id3v2Save)
id3v2Save
- public boolean isId3v2Save()
public java.util.Iterator<java.lang.Class<? extends ID3v24FrameBody>> getKeywordIterator()
public java.util.Iterator<java.lang.String> getKeywordListIterator(java.lang.Class<? extends ID3v24FrameBody> id3v2_4FrameBody)
id3v2_4FrameBody
- public void setLanguage(java.lang.String lang)
lang
- language ID, [ISO-639-2] ISO/FDIS 639-2 definitionpublic java.lang.String getLanguage()
public void setLyrics3KeepEmptyFieldIfRead(boolean lyrics3KeepEmptyFieldIfRead)
lyrics3KeepEmptyFieldIfRead
- public boolean isLyrics3KeepEmptyFieldIfRead()
public void setLyrics3Save(boolean lyrics3Save)
lyrics3Save
- public boolean isLyrics3Save()
public void setLyrics3SaveEmptyField(boolean lyrics3SaveEmptyField)
lyrics3SaveEmptyField
- public boolean isLyrics3SaveEmptyField()
public void setLyrics3SaveField(java.lang.String id, boolean save)
id
- Lyrics3 id stringsave
- true if you want to save this specific Lyrics3 field.public boolean getLyrics3SaveField(java.lang.String id)
id
- Lyrics3 id stringpublic java.util.HashMap<java.lang.String,java.lang.Boolean> getLyrics3SaveFieldMap()
public java.lang.String getNewReplaceWord(java.lang.String oldWord)
oldWord
- public void setNumberMP3SyncFrame(int numberMP3SyncFrame)
numberMP3SyncFrame
- number of MP3 frames to syncpublic int getNumberMP3SyncFrame()
public java.util.Iterator<java.lang.String> getOldReplaceWordIterator()
public boolean isOpenParenthesis(java.lang.String open)
open
- public java.util.Iterator<java.lang.String> getOpenParenthesisIterator()
public void setOriginalSavedAfterAdjustingID3v2Padding(boolean originalSavedAfterAdjustingID3v2Padding)
originalSavedAfterAdjustingID3v2Padding
- public boolean isOriginalSavedAfterAdjustingID3v2Padding()
public void setTimeStampFormat(byte tsf)
tsf
- the new default time stamp formatpublic byte getTimeStampFormat()
public void setToDefault()
public void addKeyword(java.lang.Class<? extends ID3v24FrameBody> id3v2FrameBodyClass, java.lang.String keyword) throws TagException
id3v2FrameBodyClass
- keyword
- TagException
public void addParenthesis(java.lang.String open, java.lang.String close)
open
- close
- public void addReplaceWord(java.lang.String oldWord, java.lang.String newWord)
oldWord
- newWord
- public boolean isUnsyncTags()
public void setUnsyncTags(boolean unsyncTags)
unsyncTags
- set whether tags are unsynchronized when written if contain bit pattern that could
be mistaken for audio markerpublic boolean isRemoveTrailingTerminatorOnWrite()
public void setRemoveTrailingTerminatorOnWrite(boolean removeTrailingTerminatorOnWrite)
removeTrailingTerminatorOnWrite
- public byte getId3v23DefaultTextEncoding()
public void setId3v23DefaultTextEncoding(byte id3v23DefaultTextEncoding)
id3v23DefaultTextEncoding
- public byte getId3v24DefaultTextEncoding()
public void setId3v24DefaultTextEncoding(byte id3v24DefaultTextEncoding)
id3v24DefaultTextEncoding
- public byte getId3v24UnicodeTextEncoding()
public void setId3v24UnicodeTextEncoding(byte id3v24UnicodeTextEncoding)
id3v24UnicodeTextEncoding
- public boolean isResetTextEncodingForExistingFrames()
public void setResetTextEncodingForExistingFrames(boolean resetTextEncodingForExistingFrames)
resetTextEncodingForExistingFrames
- public boolean isTruncateTextWithoutErrors()
public void setTruncateTextWithoutErrors(boolean truncateTextWithoutErrors)
truncateTextWithoutErrors
- public boolean isPadNumbers()
public void setPadNumbers(boolean padNumbers)
public boolean isAndroid()
public void setAndroid(boolean android)
public int getPlayerCompatability()
public void setPlayerCompatability(int playerCompatability)
public boolean isEncodeUTF16BomAsLittleEndian()
public void setEncodeUTF16BomAsLittleEndian(boolean encodeUTF16BomAsLittleEndian)
public long getWriteChunkSize()
public void setWriteChunkSize(long writeChunkSize)
public boolean isWriteMp4GenresAsText()
public void setWriteMp4GenresAsText(boolean writeMp4GenresAsText)
public PadNumberOption getPadNumberTotalLength()
public void setPadNumberTotalLength(PadNumberOption padNumberTotalLength)
Copyright © 2005-2013 java.net. All Rights Reserved.