Package com.mpatric.mp3agic
Class AbstractID3v2Tag
java.lang.Object
com.mpatric.mp3agic.AbstractID3v2Tag
public abstract class AbstractID3v2Tag extends Object implements ID3v2
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AbstractID3v2Tag()
AbstractID3v2Tag(byte[] bytes)
AbstractID3v2Tag(byte[] bytes, boolean obseleteFormat)
-
Method Summary
-
Field Details
-
ID_IMAGE
- See Also:
- Constant Field Values
-
ID_ENCODER
- See Also:
- Constant Field Values
-
ID_URL
- See Also:
- Constant Field Values
-
ID_ARTIST_URL
- See Also:
- Constant Field Values
-
ID_COMMERCIAL_URL
- See Also:
- Constant Field Values
-
ID_COPYRIGHT_URL
- See Also:
- Constant Field Values
-
ID_AUDIOFILE_URL
- See Also:
- Constant Field Values
-
ID_AUDIOSOURCE_URL
- See Also:
- Constant Field Values
-
ID_RADIOSTATION_URL
- See Also:
- Constant Field Values
-
ID_PAYMENT_URL
- See Also:
- Constant Field Values
-
ID_PUBLISHER_URL
- See Also:
- Constant Field Values
-
ID_COPYRIGHT
- See Also:
- Constant Field Values
-
ID_ORIGINAL_ARTIST
- See Also:
- Constant Field Values
-
ID_BPM
- See Also:
- Constant Field Values
-
ID_COMPOSER
- See Also:
- Constant Field Values
-
ID_PUBLISHER
- See Also:
- Constant Field Values
-
ID_COMMENT
- See Also:
- Constant Field Values
-
ID_TEXT_LYRICS
- See Also:
- Constant Field Values
-
ID_GENRE
- See Also:
- Constant Field Values
-
ID_YEAR
- See Also:
- Constant Field Values
-
ID_DATE
- See Also:
- Constant Field Values
-
ID_ALBUM
- See Also:
- Constant Field Values
-
ID_TITLE
- See Also:
- Constant Field Values
-
ID_KEY
- See Also:
- Constant Field Values
-
ID_ARTIST
- See Also:
- Constant Field Values
-
ID_ALBUM_ARTIST
- See Also:
- Constant Field Values
-
ID_TRACK
- See Also:
- Constant Field Values
-
ID_PART_OF_SET
- See Also:
- Constant Field Values
-
ID_COMPILATION
- See Also:
- Constant Field Values
-
ID_CHAPTER_TOC
- See Also:
- Constant Field Values
-
ID_CHAPTER
- See Also:
- Constant Field Values
-
ID_GROUPING
- See Also:
- Constant Field Values
-
ID_RATING
- See Also:
- Constant Field Values
-
ID_IMAGE_OBSELETE
- See Also:
- Constant Field Values
-
ID_ENCODER_OBSELETE
- See Also:
- Constant Field Values
-
ID_URL_OBSELETE
- See Also:
- Constant Field Values
-
ID_COPYRIGHT_OBSELETE
- See Also:
- Constant Field Values
-
ID_ORIGINAL_ARTIST_OBSELETE
- See Also:
- Constant Field Values
-
ID_BPM_OBSELETE
- See Also:
- Constant Field Values
-
ID_COMPOSER_OBSELETE
- See Also:
- Constant Field Values
-
ID_PUBLISHER_OBSELETE
- See Also:
- Constant Field Values
-
ID_COMMENT_OBSELETE
- See Also:
- Constant Field Values
-
ID_GENRE_OBSELETE
- See Also:
- Constant Field Values
-
ID_YEAR_OBSELETE
- See Also:
- Constant Field Values
-
ID_DATE_OBSELETE
- See Also:
- Constant Field Values
-
ID_ALBUM_OBSELETE
- See Also:
- Constant Field Values
-
ID_TITLE_OBSELETE
- See Also:
- Constant Field Values
-
ID_KEY_OBSELETE
- See Also:
- Constant Field Values
-
ID_ARTIST_OBSELETE
- See Also:
- Constant Field Values
-
ID_ALBUM_ARTIST_OBSELETE
- See Also:
- Constant Field Values
-
ID_TRACK_OBSELETE
- See Also:
- Constant Field Values
-
ID_PART_OF_SET_OBSELETE
- See Also:
- Constant Field Values
-
ID_COMPILATION_OBSELETE
- See Also:
- Constant Field Values
-
ID_GROUPING_OBSELETE
- See Also:
- Constant Field Values
-
PICTURETYPE_OTHER
public static final byte PICTURETYPE_OTHER- See Also:
- Constant Field Values
-
PICTURETYPE_32PXICON
public static final byte PICTURETYPE_32PXICON- See Also:
- Constant Field Values
-
PICTURETYPE_OTHERICON
public static final byte PICTURETYPE_OTHERICON- See Also:
- Constant Field Values
-
PICTURETYPE_FRONTCOVER
public static final byte PICTURETYPE_FRONTCOVER- See Also:
- Constant Field Values
-
PICTURETYPE_BACKCOVER
public static final byte PICTURETYPE_BACKCOVER- See Also:
- Constant Field Values
-
PICTURETYPE_LEAFLET
public static final byte PICTURETYPE_LEAFLET- See Also:
- Constant Field Values
-
PICTURETYPE_MEDIA
public static final byte PICTURETYPE_MEDIA- See Also:
- Constant Field Values
-
PICTURETYPE_LEADARTIST
public static final byte PICTURETYPE_LEADARTIST- See Also:
- Constant Field Values
-
PICTURETYPE_ARTIST
public static final byte PICTURETYPE_ARTIST- See Also:
- Constant Field Values
-
PICTURETYPE_CONDUCTOR
public static final byte PICTURETYPE_CONDUCTOR- See Also:
- Constant Field Values
-
PICTURETYPE_BAND
public static final byte PICTURETYPE_BAND- See Also:
- Constant Field Values
-
PICTURETYPE_COMPOSER
public static final byte PICTURETYPE_COMPOSER- See Also:
- Constant Field Values
-
PICTURETYPE_LYRICIST
public static final byte PICTURETYPE_LYRICIST- See Also:
- Constant Field Values
-
PICTURETYPE_RECORDINGLOCATION
public static final byte PICTURETYPE_RECORDINGLOCATION- See Also:
- Constant Field Values
-
PICTURETYPE_DURING_RECORDING
public static final byte PICTURETYPE_DURING_RECORDING- See Also:
- Constant Field Values
-
PICTURETYPE_DURING_PERFORMANCE
public static final byte PICTURETYPE_DURING_PERFORMANCE- See Also:
- Constant Field Values
-
PICTURETYPE_SCREEN_CAPTURE
public static final byte PICTURETYPE_SCREEN_CAPTURE- See Also:
- Constant Field Values
-
PICTURETYPE_ILLUSTRATION
public static final byte PICTURETYPE_ILLUSTRATION- See Also:
- Constant Field Values
-
PICTURETYPE_BAND_LOGOTYPE
public static final byte PICTURETYPE_BAND_LOGOTYPE- See Also:
- Constant Field Values
-
PICTURETYPE_PUBLISHER_LOGOTYPE
public static final byte PICTURETYPE_PUBLISHER_LOGOTYPE- See Also:
- Constant Field Values
-
TAG
- See Also:
- Constant Field Values
-
FOOTER_TAG
- See Also:
- Constant Field Values
-
HEADER_LENGTH
protected static final int HEADER_LENGTH- See Also:
- Constant Field Values
-
FOOTER_LENGTH
protected static final int FOOTER_LENGTH- See Also:
- Constant Field Values
-
MAJOR_VERSION_OFFSET
protected static final int MAJOR_VERSION_OFFSET- See Also:
- Constant Field Values
-
MINOR_VERSION_OFFSET
protected static final int MINOR_VERSION_OFFSET- See Also:
- Constant Field Values
-
FLAGS_OFFSET
protected static final int FLAGS_OFFSET- See Also:
- Constant Field Values
-
DATA_LENGTH_OFFSET
protected static final int DATA_LENGTH_OFFSET- See Also:
- Constant Field Values
-
FOOTER_BIT
protected static final int FOOTER_BIT- See Also:
- Constant Field Values
-
EXPERIMENTAL_BIT
protected static final int EXPERIMENTAL_BIT- See Also:
- Constant Field Values
-
EXTENDED_HEADER_BIT
protected static final int EXTENDED_HEADER_BIT- See Also:
- Constant Field Values
-
COMPRESSION_BIT
protected static final int COMPRESSION_BIT- See Also:
- Constant Field Values
-
UNSYNCHRONISATION_BIT
protected static final int UNSYNCHRONISATION_BIT- See Also:
- Constant Field Values
-
PADDING_LENGTH
protected static final int PADDING_LENGTH- See Also:
- Constant Field Values
-
unsynchronisation
protected boolean unsynchronisation -
extendedHeader
protected boolean extendedHeader -
experimental
protected boolean experimental -
footer
protected boolean footer -
compression
protected boolean compression -
padding
protected boolean padding -
version
-
-
Constructor Details
-
AbstractID3v2Tag
public AbstractID3v2Tag() -
AbstractID3v2Tag
public AbstractID3v2Tag(byte[] bytes) throws NoSuchTagException, UnsupportedTagException, InvalidDataException -
AbstractID3v2Tag
public AbstractID3v2Tag(byte[] bytes, boolean obseleteFormat) throws NoSuchTagException, UnsupportedTagException, InvalidDataException
-
-
Method Details
-
unpackFlags
protected abstract void unpackFlags(byte[] bytes) -
unpackFrames
protected int unpackFrames(byte[] bytes, int offset, int framesLength) -
addFrame
-
createFrame
- Throws:
InvalidDataException
-
createFrame
-
toBytes
- Specified by:
toBytes
in interfaceID3v1
- Throws:
NotSupportedException
-
packTag
- Throws:
NotSupportedException
-
packFlags
protected abstract void packFlags(byte[] bytes, int i) -
packFrames
- Throws:
NotSupportedException
-
useFrameUnsynchronisation
protected boolean useFrameUnsynchronisation() -
getVersion
- Specified by:
getVersion
in interfaceID3v1
-
invalidateDataLength
protected void invalidateDataLength() -
getDataLength
public int getDataLength()- Specified by:
getDataLength
in interfaceID3v2
-
getLength
public int getLength() -
getFrameSets
- Specified by:
getFrameSets
in interfaceID3v2
-
getPadding
public boolean getPadding()- Specified by:
getPadding
in interfaceID3v2
-
setPadding
public void setPadding(boolean padding)- Specified by:
setPadding
in interfaceID3v2
-
hasFooter
public boolean hasFooter() -
setFooter
public void setFooter(boolean footer) -
hasUnsynchronisation
public boolean hasUnsynchronisation()- Specified by:
hasUnsynchronisation
in interfaceID3v2
-
setUnsynchronisation
public void setUnsynchronisation(boolean unsynchronisation)- Specified by:
setUnsynchronisation
in interfaceID3v2
-
getObseleteFormat
public boolean getObseleteFormat()- Specified by:
getObseleteFormat
in interfaceID3v2
-
getTrack
-
setTrack
-
getPartOfSet
- Specified by:
getPartOfSet
in interfaceID3v2
-
setPartOfSet
- Specified by:
setPartOfSet
in interfaceID3v2
-
isCompilation
public boolean isCompilation()- Specified by:
isCompilation
in interfaceID3v2
-
setCompilation
public void setCompilation(boolean compilation)- Specified by:
setCompilation
in interfaceID3v2
-
getGrouping
- Specified by:
getGrouping
in interfaceID3v2
-
setGrouping
- Specified by:
setGrouping
in interfaceID3v2
-
getArtist
-
setArtist
-
getAlbumArtist
- Specified by:
getAlbumArtist
in interfaceID3v2
-
setAlbumArtist
- Specified by:
setAlbumArtist
in interfaceID3v2
-
getTitle
-
setTitle
-
getAlbum
-
setAlbum
-
getYear
-
setYear
-
getDate
-
setDate
-
getGenre
public int getGenre() -
setGenre
public void setGenre(int genre) -
getBPM
public int getBPM() -
setBPM
public void setBPM(int bpm) -
getKey
-
setKey
-
getGenreDescription
- Specified by:
getGenreDescription
in interfaceID3v1
-
setGenreDescription
Description copied from interface:ID3v2
Set genre from text. This method behaves different depending on the ID3 version. Prior to ID3v2.4, the provided text must match a id3v1 genre description. With ID3v2.4, the genre is written as free text.- Specified by:
setGenreDescription
in interfaceID3v2
- Parameters:
text
- genre string- Throws:
IllegalArgumentException
-
extractGenreNumber
- Throws:
NumberFormatException
-
extractGenreDescription
- Throws:
NumberFormatException
-
getComment
- Specified by:
getComment
in interfaceID3v1
-
setComment
- Specified by:
setComment
in interfaceID3v1
-
getItunesComment
- Specified by:
getItunesComment
in interfaceID3v2
-
setItunesComment
- Specified by:
setItunesComment
in interfaceID3v2
-
extractLyricsFrameData
-
getLyrics
-
setLyrics
-
getComposer
- Specified by:
getComposer
in interfaceID3v2
-
setComposer
- Specified by:
setComposer
in interfaceID3v2
-
getPublisher
- Specified by:
getPublisher
in interfaceID3v2
-
setPublisher
- Specified by:
setPublisher
in interfaceID3v2
-
getOriginalArtist
- Specified by:
getOriginalArtist
in interfaceID3v2
-
setOriginalArtist
- Specified by:
setOriginalArtist
in interfaceID3v2
-
getCopyright
- Specified by:
getCopyright
in interfaceID3v2
-
setCopyright
- Specified by:
setCopyright
in interfaceID3v2
-
getArtistUrl
- Specified by:
getArtistUrl
in interfaceID3v2
-
setArtistUrl
- Specified by:
setArtistUrl
in interfaceID3v2
-
getCommercialUrl
- Specified by:
getCommercialUrl
in interfaceID3v2
-
setCommercialUrl
- Specified by:
setCommercialUrl
in interfaceID3v2
-
getCopyrightUrl
- Specified by:
getCopyrightUrl
in interfaceID3v2
-
setCopyrightUrl
- Specified by:
setCopyrightUrl
in interfaceID3v2
-
getAudiofileUrl
- Specified by:
getAudiofileUrl
in interfaceID3v2
-
setAudiofileUrl
- Specified by:
setAudiofileUrl
in interfaceID3v2
-
getAudioSourceUrl
- Specified by:
getAudioSourceUrl
in interfaceID3v2
-
setAudioSourceUrl
- Specified by:
setAudioSourceUrl
in interfaceID3v2
-
getRadiostationUrl
- Specified by:
getRadiostationUrl
in interfaceID3v2
-
setRadiostationUrl
- Specified by:
setRadiostationUrl
in interfaceID3v2
-
getPaymentUrl
- Specified by:
getPaymentUrl
in interfaceID3v2
-
setPaymentUrl
- Specified by:
setPaymentUrl
in interfaceID3v2
-
getPublisherUrl
- Specified by:
getPublisherUrl
in interfaceID3v2
-
setPublisherUrl
- Specified by:
setPublisherUrl
in interfaceID3v2
-
getUrl
-
setUrl
-
getChapters
- Specified by:
getChapters
in interfaceID3v2
-
setChapters
- Specified by:
setChapters
in interfaceID3v2
-
getChapterTOC
- Specified by:
getChapterTOC
in interfaceID3v2
-
setChapterTOC
- Specified by:
setChapterTOC
in interfaceID3v2
-
getEncoder
- Specified by:
getEncoder
in interfaceID3v2
-
setEncoder
- Specified by:
setEncoder
in interfaceID3v2
-
getAlbumImage
public byte[] getAlbumImage()- Specified by:
getAlbumImage
in interfaceID3v2
-
setAlbumImage
- Specified by:
setAlbumImage
in interfaceID3v2
-
setAlbumImage
public void setAlbumImage(byte[] albumImage, String mimeType, byte imageType, String imageDescription)- Specified by:
setAlbumImage
in interfaceID3v2
-
clearAlbumImage
public void clearAlbumImage()- Specified by:
clearAlbumImage
in interfaceID3v2
-
getAlbumImageMimeType
- Specified by:
getAlbumImageMimeType
in interfaceID3v2
-
clearFrameSet
- Specified by:
clearFrameSet
in interfaceID3v2
-
getWmpRating
public int getWmpRating()- Specified by:
getWmpRating
in interfaceID3v2
-
setWmpRating
public void setWmpRating(int rating)- Specified by:
setWmpRating
in interfaceID3v2
-
extractTextFrameData
-
equals
-