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:
toBytesin 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:
getVersionin interfaceID3v1
-
invalidateDataLength
protected void invalidateDataLength() -
getDataLength
public int getDataLength()- Specified by:
getDataLengthin interfaceID3v2
-
getLength
public int getLength() -
getFrameSets
- Specified by:
getFrameSetsin interfaceID3v2
-
getPadding
public boolean getPadding()- Specified by:
getPaddingin interfaceID3v2
-
setPadding
public void setPadding(boolean padding)- Specified by:
setPaddingin interfaceID3v2
-
hasFooter
public boolean hasFooter() -
setFooter
public void setFooter(boolean footer) -
hasUnsynchronisation
public boolean hasUnsynchronisation()- Specified by:
hasUnsynchronisationin interfaceID3v2
-
setUnsynchronisation
public void setUnsynchronisation(boolean unsynchronisation)- Specified by:
setUnsynchronisationin interfaceID3v2
-
getObseleteFormat
public boolean getObseleteFormat()- Specified by:
getObseleteFormatin interfaceID3v2
-
getTrack
-
setTrack
-
getPartOfSet
- Specified by:
getPartOfSetin interfaceID3v2
-
setPartOfSet
- Specified by:
setPartOfSetin interfaceID3v2
-
isCompilation
public boolean isCompilation()- Specified by:
isCompilationin interfaceID3v2
-
setCompilation
public void setCompilation(boolean compilation)- Specified by:
setCompilationin interfaceID3v2
-
getGrouping
- Specified by:
getGroupingin interfaceID3v2
-
setGrouping
- Specified by:
setGroupingin interfaceID3v2
-
getArtist
-
setArtist
-
getAlbumArtist
- Specified by:
getAlbumArtistin interfaceID3v2
-
setAlbumArtist
- Specified by:
setAlbumArtistin 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:
getGenreDescriptionin interfaceID3v1
-
setGenreDescription
Description copied from interface:ID3v2Set 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:
setGenreDescriptionin interfaceID3v2- Parameters:
text- genre string- Throws:
IllegalArgumentException
-
extractGenreNumber
- Throws:
NumberFormatException
-
extractGenreDescription
- Throws:
NumberFormatException
-
getComment
- Specified by:
getCommentin interfaceID3v1
-
setComment
- Specified by:
setCommentin interfaceID3v1
-
getItunesComment
- Specified by:
getItunesCommentin interfaceID3v2
-
setItunesComment
- Specified by:
setItunesCommentin interfaceID3v2
-
extractLyricsFrameData
-
getLyrics
-
setLyrics
-
getComposer
- Specified by:
getComposerin interfaceID3v2
-
setComposer
- Specified by:
setComposerin interfaceID3v2
-
getPublisher
- Specified by:
getPublisherin interfaceID3v2
-
setPublisher
- Specified by:
setPublisherin interfaceID3v2
-
getOriginalArtist
- Specified by:
getOriginalArtistin interfaceID3v2
-
setOriginalArtist
- Specified by:
setOriginalArtistin interfaceID3v2
-
getCopyright
- Specified by:
getCopyrightin interfaceID3v2
-
setCopyright
- Specified by:
setCopyrightin interfaceID3v2
-
getArtistUrl
- Specified by:
getArtistUrlin interfaceID3v2
-
setArtistUrl
- Specified by:
setArtistUrlin interfaceID3v2
-
getCommercialUrl
- Specified by:
getCommercialUrlin interfaceID3v2
-
setCommercialUrl
- Specified by:
setCommercialUrlin interfaceID3v2
-
getCopyrightUrl
- Specified by:
getCopyrightUrlin interfaceID3v2
-
setCopyrightUrl
- Specified by:
setCopyrightUrlin interfaceID3v2
-
getAudiofileUrl
- Specified by:
getAudiofileUrlin interfaceID3v2
-
setAudiofileUrl
- Specified by:
setAudiofileUrlin interfaceID3v2
-
getAudioSourceUrl
- Specified by:
getAudioSourceUrlin interfaceID3v2
-
setAudioSourceUrl
- Specified by:
setAudioSourceUrlin interfaceID3v2
-
getRadiostationUrl
- Specified by:
getRadiostationUrlin interfaceID3v2
-
setRadiostationUrl
- Specified by:
setRadiostationUrlin interfaceID3v2
-
getPaymentUrl
- Specified by:
getPaymentUrlin interfaceID3v2
-
setPaymentUrl
- Specified by:
setPaymentUrlin interfaceID3v2
-
getPublisherUrl
- Specified by:
getPublisherUrlin interfaceID3v2
-
setPublisherUrl
- Specified by:
setPublisherUrlin interfaceID3v2
-
getUrl
-
setUrl
-
getChapters
- Specified by:
getChaptersin interfaceID3v2
-
setChapters
- Specified by:
setChaptersin interfaceID3v2
-
getChapterTOC
- Specified by:
getChapterTOCin interfaceID3v2
-
setChapterTOC
- Specified by:
setChapterTOCin interfaceID3v2
-
getEncoder
- Specified by:
getEncoderin interfaceID3v2
-
setEncoder
- Specified by:
setEncoderin interfaceID3v2
-
getAlbumImage
public byte[] getAlbumImage()- Specified by:
getAlbumImagein interfaceID3v2
-
setAlbumImage
- Specified by:
setAlbumImagein interfaceID3v2
-
setAlbumImage
public void setAlbumImage(byte[] albumImage, String mimeType, byte imageType, String imageDescription)- Specified by:
setAlbumImagein interfaceID3v2
-
clearAlbumImage
public void clearAlbumImage()- Specified by:
clearAlbumImagein interfaceID3v2
-
getAlbumImageMimeType
- Specified by:
getAlbumImageMimeTypein interfaceID3v2
-
clearFrameSet
- Specified by:
clearFrameSetin interfaceID3v2
-
getWmpRating
public int getWmpRating()- Specified by:
getWmpRatingin interfaceID3v2
-
setWmpRating
public void setWmpRating(int rating)- Specified by:
setWmpRatingin interfaceID3v2
-
extractTextFrameData
-
equals
-