Class AudioInfo
java.lang.Object
com.jackmeng.halcyoninae.tailwind.AudioInfo
- Direct Known Subclasses:
StubAudioInfo
This class holds information regarding an audio
file; specifically, an MP3 file which can be parsed
into ID3 tags.
Other formats that are supported such as raw PCM,WAV,OGG are not parsable.
- Since:
- 3.0
- Author:
- Jack Meng
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final BufferedImage
private File
private org.jaudiotagger.audio.AudioHeader
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
private org.jaudiotagger.tag.Tag
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkAudioInfo
(AudioInfo info) boolean
Checks if the given String is in any way empty.void
Initializes the tags map and adds default values to the mapstatic void
void
Returns the artwork of the Audio File, if there isn't any, then it returns the specified default artwork.static BufferedImage
getRaw
(org.jaudiotagger.tag.FieldKey key) Returns the value raw from the tagger.Get a specific key from the parsed tagsgetTags()
Returns the map of tags to the Audio fileboolean
void
initTags()
Initializes the tags map and adds the appropriate values from the parsed Audio File to the map.
-
Field Details
-
KEY_ABSOLUTE_FILE_PATH
- See Also:
-
KEY_FILE_NAME
- See Also:
-
KEY_MEDIA_DURATION
- See Also:
-
KEY_MEDIA_TITLE
- See Also:
-
KEY_BITRATE
- See Also:
-
KEY_SAMPLE_RATE
- See Also:
-
KEY_ALBUM
- See Also:
-
KEY_GENRE
- See Also:
-
KEY_MEDIA_ARTIST
- See Also:
-
KEY_ARTWORK
- See Also:
-
KEY_TRACK
- See Also:
-
DEFAULT
-
f
-
tags
-
t
private org.jaudiotagger.tag.Tag t -
header
private org.jaudiotagger.audio.AudioHeader header
-
-
Constructor Details
-
AudioInfo
Constructs the AudioInfo object with the specified file.- Parameters:
f
- The file to construct the AudioInfo object with.
-
AudioInfo
public AudioInfo(File f, boolean s) throws org.jaudiotagger.audio.exceptions.InvalidAudioFrameException, org.jaudiotagger.audio.exceptions.CannotReadException, IOException, org.jaudiotagger.tag.TagException, org.jaudiotagger.audio.exceptions.ReadOnlyFileException - Throws:
org.jaudiotagger.audio.exceptions.InvalidAudioFrameException
org.jaudiotagger.audio.exceptions.CannotReadException
IOException
org.jaudiotagger.tag.TagException
org.jaudiotagger.audio.exceptions.ReadOnlyFileException
-
AudioInfo
Constructs the AudioInfo object with the specified file path.- Parameters:
locale
- The file path to construct the AudioInfo object with. (ABSOLUTE FILE PATH)
-
AudioInfo
public AudioInfo()Initializes the tags map and adds default values to the mapDefault init
-
-
Method Details
-
getDefaultIcon
- Returns:
- BufferedImage
-
checkAudioInfo
- Parameters:
info
-- Returns:
- boolean
-
checkEmptiness
Checks if the given String is in any way empty.- Parameters:
s
- The string to check- Returns:
- (true | | false) Depending on if the string is empty or not.
-
forceSet
- Parameters:
forceSetMap
-
-
defInitTags
public void defInitTags()Initializes the tags map and adds default values to the map -
initTags
public void initTags()Initializes the tags map and adds the appropriate values from the parsed Audio File to the map. -
getArtwork
Returns the artwork of the Audio File, if there isn't any, then it returns the specified default artwork.- Returns:
- A BufferedImage representing the artwork without any modifications.
-
hasArtwork
public boolean hasArtwork()- Returns:
- boolean
-
getTags
Returns the map of tags to the Audio file- Returns:
- A Map of String, String representing the parsed tags from the audio file.
-
getTag
Get a specific key from the parsed tags- Parameters:
key
- the Key see above- Returns:
- The value of the key
-
getRaw
Returns the value raw from the tagger. Checking is done to avoid any type of exceptions- Parameters:
key
- A FieldKey object representing the desired value to seek for.- Returns:
- The value of the key.
-
launchAsDialog
- Returns:
- AudioInfoDialog
-
extractArtwork
- Parameters:
ai
-
-