|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.tag.TagOptionSingleton
public class TagOptionSingleton
Field Summary | |
---|---|
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 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 frameswhich 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 Kyrics3 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 didgit numbers to aid sorting |
private java.util.HashMap<java.lang.String,java.lang.String> |
parenthesisMap
parenthesis map stuff |
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 |
Constructor Summary | |
---|---|
private |
TagOptionSingleton()
Creates a new TagOptions datatype. |
Method Summary | |
---|---|
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 |
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()
|
byte |
getTimeStampFormat()
Returns the default time stamp format for ID3v2 tags which require it. |
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 unneccessary 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()
|
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 |
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 |
setRemoveTrailingTerminatorOnWrite(boolean removeTrailingTerminatorOnWrite)
Remove unneccessary 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 neccessary, currently only applies to IDv23 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 found
private 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
Constructor Detail |
---|
private TagOptionSingleton()
Method Detail |
---|
public static TagOptionSingleton getInstance()
public static TagOptionSingleton getInstance(java.lang.String instanceKey)
instanceKey
-
public void setFilenameTagSave(boolean filenameTagSave)
filenameTagSave
- public boolean isFilenameTagSave()
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 string
public 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |