code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
protected void copyPrimitives(AbstractID3v2Tag copyObj)
{
logger.config("Copying primitives");
super.copyPrimitives(copyObj);
//Set the primitive types specific to v2_2.
if (copyObj instanceof ID3v22Tag copyObject)
{
this.compression = copyObject.compression;
this.unsynchronization = copyObject.unsynchronization;
}
else if (copyObj instanceof ID3v23Tag copyObject)
{
this.compression = copyObject.compression;
this.unsynchronization = copyObject.unsynchronization;
}
else if (copyObj instanceof ID3v24Tag copyObject)
{
this.compression = false;
this.unsynchronization = copyObject.unsynchronization;
}
} |
Copy primitives applicable to v2.2
| ID3v22Tag::copyPrimitives | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public ID3v22Tag(ID3v22Tag copyObject)
{
//This doesnt do anything.
super(copyObject);
logger.config("Creating tag from another tag of same type");
copyPrimitives(copyObject);
copyFrames(copyObject);
} |
Copy Constructor, creates a new ID3v2_2 Tag based on another ID3v2_2 Tag
@param copyObject
| ID3v22Tag::ID3v22Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public ID3v22Tag(AbstractTag mp3tag)
{
frameMap = new LinkedHashMap();
encryptedFrameMap = new LinkedHashMap();
logger.config("Creating tag from a tag of a different version");
//Default Superclass constructor does nothing
if (mp3tag != null)
{
ID3v24Tag convertedTag;
//Should use the copy constructor instead
if ((!(mp3tag instanceof ID3v23Tag)) && (mp3tag instanceof ID3v22Tag))
{
throw new UnsupportedOperationException("Copy Constructor not called. Please type cast the argument");
}
//If v2.4 can getFields variables from this
else if (mp3tag instanceof ID3v24Tag)
{
convertedTag = (ID3v24Tag) mp3tag;
}
//Any tag (e.g lyrics3 and idv1.1,idv2.3 can be converted to id32.4 so do that
//to simplify things
else
{
convertedTag = new ID3v24Tag(mp3tag);
}
this.setLoggingFilename(convertedTag.getLoggingFilename());
//Set the primitive types specific to v2_2.
copyPrimitives(convertedTag);
//Set v2.2 Frames
copyFrames(convertedTag);
logger.config("Created tag from a tag of a different version");
}
} |
Constructs a new tag based upon another tag of different version/type
@param mp3tag
| ID3v22Tag::ID3v22Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public ID3v22Tag(ByteBuffer buffer, String loggingFilename) throws TagException
{
setLoggingFilename(loggingFilename);
this.read(buffer);
} |
Creates a new ID3v2_2 datatype.
@param buffer
@param loggingFilename
@throws TagException
| ID3v22Tag::ID3v22Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public ID3v22Tag(ByteBuffer buffer) throws TagException
{
this(buffer, "");
} |
Creates a new ID3v2_2 datatype.
@param buffer
@throws TagException
@deprecated use {@link #ID3v22Tag(ByteBuffer,String)} instead
| ID3v22Tag::ID3v22Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public String getIdentifier()
{
return "ID3v2_2.20";
} |
@return an indentifier of the tag type
| ID3v22Tag::getIdentifier | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public int getSize()
{
int size = TAG_HEADER_LENGTH;
size += super.getSize();
return size;
} |
Return frame size based upon the sizes of the frames rather than the size
including padding recorded in the tag header
@return size
| ID3v22Tag::getSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public boolean equals(Object obj)
{
if (!(obj instanceof ID3v22Tag object))
{
return false;
}
if (this.compression != object.compression)
{
return false;
}
return this.unsynchronization == object.unsynchronization && super.equals(obj);
} |
@param obj
@return equality
| ID3v22Tag::equals | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
private void readHeaderFlags(ByteBuffer byteBuffer) throws TagException
{
//Flags
byte flags = byteBuffer.get();
unsynchronization = (flags & MASK_V22_UNSYNCHRONIZATION) != 0;
compression = (flags & MASK_V22_COMPRESSION) != 0;
if (unsynchronization)
{
logger.config(ErrorMessage.ID3_TAG_UNSYNCHRONIZED.getMsg(getLoggingFilename()));
}
if (compression)
{
logger.config(ErrorMessage.ID3_TAG_COMPRESSED.getMsg(getLoggingFilename()));
}
//Not allowable/Unknown Flags
if ((flags & FileConstants.BIT5) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT5));
}
if ((flags & FileConstants.BIT4) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT4));
}
if ((flags & FileConstants.BIT3) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT3));
}
if ((flags & FileConstants.BIT2) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT2));
}
if ((flags & FileConstants.BIT1) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT1));
}
if ((flags & FileConstants.BIT0) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT3));
}
} |
Read tag Header Flags
@param byteBuffer
@throws TagException
| ID3v22Tag::readHeaderFlags | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
protected void readFrames(ByteBuffer byteBuffer, int size)
{
//Now start looking for frames
ID3v22Frame next;
frameMap = new LinkedHashMap();
encryptedFrameMap = new LinkedHashMap();
//Read the size from the Tag Header
this.fileReadSize = size;
logger.finest(getLoggingFilename() + ":" + "Start of frame body at:" + byteBuffer.position() + ",frames sizes and padding is:" + size);
/* todo not done yet. Read the first Frame, there seems to be quite a
** common case of extra data being between the tag header and the first
** frame so should we allow for this when reading first frame, but not subsequent frames
*/
// Read the frames until got to upto the size as specified in header
while (byteBuffer.position() < size)
{
try
{
//Read Frame
logger.finest(getLoggingFilename() + ":" + "looking for next frame at:" + byteBuffer.position());
next = new ID3v22Frame(byteBuffer, getLoggingFilename());
String id = next.getIdentifier();
loadFrameIntoMap(id, next);
}
//Found Padding, no more frames
catch (PaddingException ex)
{
logger.config(getLoggingFilename() + ":Found padding starting at:" + byteBuffer.position());
break;
}
//Found Empty Frame
catch (EmptyFrameException ex)
{
logger.warning(getLoggingFilename() + ":" + "Empty Frame:" + ex.getMessage());
this.emptyFrameBytes += ID3v22Frame.FRAME_HEADER_SIZE;
}
catch (InvalidFrameIdentifierException ifie)
{
logger.config(getLoggingFilename() + ":" + "Invalid Frame Identifier:" + ifie.getMessage());
this.invalidFrames++;
//Dont try and find any more frames
break;
}
//Problem trying to find frame
catch (InvalidFrameException ife)
{
logger.warning(getLoggingFilename() + ":" + "Invalid Frame:" + ife.getMessage());
this.invalidFrames++;
//Dont try and find any more frames
break;
}
//Failed reading frame but may just have invalid data but correct length so lets carry on
//in case we can read the next frame
catch(InvalidDataTypeException idete)
{
logger.warning(getLoggingFilename() + ":Corrupt Frame:" + idete.getMessage());
this.invalidFrames++;
continue;
}
}
} |
Read frames from tag
@param byteBuffer
@param size
| ID3v22Tag::readFrames | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
private ByteBuffer writeHeaderToBuffer(int padding, int size) throws IOException
{
compression = false;
//Create Header Buffer
ByteBuffer headerBuffer = ByteBuffer.allocate(TAG_HEADER_LENGTH);
//TAGID
headerBuffer.put(TAG_ID);
//Major Version
headerBuffer.put(getMajorVersion());
//Minor Version
headerBuffer.put(getRevision());
//Flags
byte flags = (byte) 0;
if (unsynchronization)
{
flags |= (byte) MASK_V22_UNSYNCHRONIZATION;
}
if (compression)
{
flags |= (byte) MASK_V22_COMPRESSION;
}
headerBuffer.put(flags);
//Size As Recorded in Header, don't include the main header length
headerBuffer.put(ID3SyncSafeInteger.valueToBuffer(padding + size));
headerBuffer.flip();
return headerBuffer;
} |
Write the ID3 header to the ByteBuffer.
@param padding
@param size
@return ByteBuffer
@throws IOException
| ID3v22Tag::writeHeaderToBuffer | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public boolean isUnsynchronization()
{
return unsynchronization;
} |
@return is tag unsynchronized
| ID3v22Tag::isUnsynchronization | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public boolean isCompression()
{
return compression;
} |
@return is tag compressed
| ID3v22Tag::isCompression | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public ID3v22Frame createFrame(String id)
{
return new ID3v22Frame(id);
} |
Create Frame
@param id frameid
@return
| ID3v22Tag::createFrame | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public TagField createField(ID3v22FieldKey id3Key, String value) throws KeyNotFoundException, FieldDataInvalidException
{
if (id3Key == null)
{
throw new KeyNotFoundException();
}
return doCreateTagField(new FrameAndSubId(null, id3Key.getFrameId(), id3Key.getSubId()), value);
} |
Create Frame for Id3 Key
Only textual data supported at the moment, should only be used with frames that
support a simple string argument.
@param id3Key
@param value
@return
@throws KeyNotFoundException
@throws FieldDataInvalidException
| ID3v22Tag::createField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public String getFirst(ID3v22FieldKey id3v22FieldKey) throws KeyNotFoundException
{
if (id3v22FieldKey == null)
{
throw new KeyNotFoundException();
}
FieldKey genericKey = ID3v22Frames.getInstanceOf().getGenericKeyFromId3(id3v22FieldKey);
if(genericKey!=null)
{
return super.getFirst(genericKey);
}
else
{
FrameAndSubId frameAndSubId = new FrameAndSubId(null, id3v22FieldKey.getFrameId(), id3v22FieldKey.getSubId());
return super.doGetValueAtIndex(frameAndSubId, 0);
}
} |
Retrieve the first value that exists for this id3v22key
@param id3v22FieldKey
@return
@throws org.jaudiotagger.tag.KeyNotFoundException
| ID3v22Tag::getFirst | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public void deleteField(ID3v22FieldKey id3v22FieldKey) throws KeyNotFoundException
{
if (id3v22FieldKey == null)
{
throw new KeyNotFoundException();
}
super.doDeleteTagField(new FrameAndSubId(null, id3v22FieldKey.getFrameId(), id3v22FieldKey.getSubId()));
} |
Delete fields with this id3v22FieldKey
@param id3v22FieldKey
@throws org.jaudiotagger.tag.KeyNotFoundException
| ID3v22Tag::deleteField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public void deleteField(String id)
{
super.doDeleteTagField(new FrameAndSubId(null, id,null));
} |
Delete fields with this (frame) id
@param id
| ID3v22Tag::deleteField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public Comparator getPreferredFrameOrderComparator()
{
return ID3v22PreferredFrameOrderComparator.getInstanceof();
} |
@return comparator used to order frames in preffrred order for writing to file
so that most important frames are written first.
| ID3v22Tag::getPreferredFrameOrderComparator | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public List<Artwork> getArtworkList()
{
List<TagField> coverartList = getFields(FieldKey.COVER_ART);
List<Artwork> artworkList = new ArrayList<Artwork>(coverartList.size());
for (TagField next : coverartList)
{
FrameBodyPIC coverArt = (FrameBodyPIC) ((AbstractID3v2Frame) next).getBody();
Artwork artwork = ArtworkFactory.getNew();
artwork.setMimeType(ImageFormats.getMimeTypeForFormat(coverArt.getFormatType()));
artwork.setPictureType(coverArt.getPictureType());
if (coverArt.isImageUrl())
{
artwork.setLinked(true);
artwork.setImageUrl(coverArt.getImageUrl());
}
else
{
artwork.setBinaryData(coverArt.getImageData());
}
artworkList.add(artwork);
}
return artworkList;
} |
{@inheritDoc}
| ID3v22Tag::getArtworkList | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public TagField createField(Artwork artwork) throws FieldDataInvalidException
{
AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
FrameBodyPIC body = (FrameBodyPIC) frame.getBody();
if(!artwork.isLinked())
{
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, artwork.getBinaryData());
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
body.setObjectValue(DataTypes.OBJ_IMAGE_FORMAT, ImageFormats.getFormatForMimeType(artwork.getMimeType()));
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
}
else
{
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA,artwork.getImageUrl().getBytes(StandardCharsets.ISO_8859_1));
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
body.setObjectValue(DataTypes.OBJ_IMAGE_FORMAT, FrameBodyAPIC.IMAGE_IS_URL);
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
}
} |
{@inheritDoc}
| ID3v22Tag::createField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
{
if(genericKey == FieldKey.GENRE)
{
List<TagField> fields = getFields(genericKey);
List<String> convertedGenres = new ArrayList<String>();
if (fields != null && fields.size() > 0)
{
AbstractID3v2Frame frame = (AbstractID3v2Frame) fields.get(0);
FrameBodyTCON body = (FrameBodyTCON)frame.getBody();
for(String next:body.getValues())
{
convertedGenres.add(FrameBodyTCON.convertID3v22GenreToGeneric(next));
}
}
return convertedGenres;
}
else
{
return super.getAll(genericKey);
}
} |
Maps the generic key to the id3 key and return the list of values for this field as strings
@param genericKey
@return
@throws KeyNotFoundException
| ID3v22Tag::getAll | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v22Tag.java | Apache-2.0 |
public ID3v23FieldKey getId3KeyFromGenericKey(FieldKey genericKey)
{
return tagFieldToId3.get(genericKey);
} |
@param genericKey
@return id3 key for generic key
| ID3v23Frames::getId3KeyFromGenericKey | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v23Frames.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v23Frames.java | Apache-2.0 |
public FieldKey getGenericKeyFromId3(ID3v23FieldKey fieldKey)
{
return id3ToTagField.get(fieldKey);
} |
Get generic key for ID3 field key
@param fieldKey
@return
| ID3v23Frames::getGenericKeyFromId3 | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v23Frames.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v23Frames.java | Apache-2.0 |
public byte getRelease()
{
return RELEASE;
} |
Retrieve the Release
| ID3v24Tag::getRelease | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public byte getMajorVersion()
{
return MAJOR_VERSION;
} |
Retrieve the Major Version
| ID3v24Tag::getMajorVersion | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public byte getRevision()
{
return REVISION;
} |
Retrieve the Revision
| ID3v24Tag::getRevision | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public ID3v24Tag()
{
frameMap = new LinkedHashMap();
encryptedFrameMap = new LinkedHashMap();
} |
Creates a new empty ID3v2_4 datatype.
| ID3v24Tag::ID3v24Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
protected void copyPrimitives(AbstractID3v2Tag copyObj)
{
logger.config("Copying primitives");
super.copyPrimitives(copyObj);
if (copyObj instanceof ID3v24Tag copyObject)
{
this.footer = copyObject.footer;
this.tagRestriction = copyObject.tagRestriction;
this.updateTag = copyObject.updateTag;
this.imageEncodingRestriction = copyObject.imageEncodingRestriction;
this.imageSizeRestriction = copyObject.imageSizeRestriction;
this.tagSizeRestriction = copyObject.tagSizeRestriction;
this.textEncodingRestriction = copyObject.textEncodingRestriction;
this.textFieldSizeRestriction = copyObject.textFieldSizeRestriction;
}
} |
Copy primitives applicable to v2.4, this is used when cloning a v2.4 datatype
and other objects such as v2.3 so need to check instanceof
| ID3v24Tag::copyPrimitives | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public ID3v24Tag(ID3v24Tag copyObject)
{
logger.config("Creating tag from another tag of same type");
copyPrimitives(copyObject);
copyFrames(copyObject);
} |
Copy Constructor, creates a new ID3v2_4 Tag based on another ID3v2_4 Tag
@param copyObject
| ID3v24Tag::ID3v24Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public ID3v24Tag(AbstractTag mp3tag)
{
logger.config("Creating tag from a tag of a different version");
frameMap = new LinkedHashMap();
encryptedFrameMap = new LinkedHashMap();
if (mp3tag != null)
{
//Should use simpler copy constructor
if ((mp3tag instanceof ID3v24Tag))
{
throw new UnsupportedOperationException("Copy Constructor not called. Please type cast the argument");
}
/* If we get a tag, we want to convert to id3v2_4
* both id3v1 and lyrics3 convert to this type
* id3v1 needs to convert to id3v2_4 before converting to lyrics3
*/
else if (mp3tag instanceof AbstractID3v2Tag)
{
this.setLoggingFilename(((AbstractID3v2Tag)mp3tag).getLoggingFilename());
copyPrimitives((AbstractID3v2Tag) mp3tag);
copyFrames((AbstractID3v2Tag) mp3tag);
}
//IDv1
else if (mp3tag instanceof ID3v1Tag id3tag)
{
// convert id3v1 tags.
ID3v24Frame newFrame;
AbstractID3v2FrameBody newBody;
if (id3tag.title.length() > 0)
{
newBody = new FrameBodyTIT2((byte) 0, id3tag.title);
newFrame = new ID3v24Frame(ID3v24Frames.FRAME_ID_TITLE);
newFrame.setBody(newBody);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
if (id3tag.artist.length() > 0)
{
newBody = new FrameBodyTPE1((byte) 0, id3tag.artist);
newFrame = new ID3v24Frame(ID3v24Frames.FRAME_ID_ARTIST);
newFrame.setBody(newBody);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
if (id3tag.album.length() > 0)
{
newBody = new FrameBodyTALB((byte) 0, id3tag.album);
newFrame = new ID3v24Frame(ID3v24Frames.FRAME_ID_ALBUM);
newFrame.setBody(newBody);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
if (id3tag.year.length() > 0)
{
newBody = new FrameBodyTDRC((byte) 0, id3tag.year);
newFrame = new ID3v24Frame(ID3v24Frames.FRAME_ID_YEAR);
newFrame.setBody(newBody);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
if (id3tag.comment.length() > 0)
{
newBody = new FrameBodyCOMM((byte) 0, "ENG", "", id3tag.comment);
newFrame = new ID3v24Frame(ID3v24Frames.FRAME_ID_COMMENT);
newFrame.setBody(newBody);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
if (((id3tag.genre & ID3v1Tag.BYTE_TO_UNSIGNED) >= 0) && ((id3tag.genre & ID3v1Tag.BYTE_TO_UNSIGNED) != ID3v1Tag.BYTE_TO_UNSIGNED))
{
Integer genreId = id3tag.genre & ID3v1Tag.BYTE_TO_UNSIGNED;
String genre = "(" + genreId + ") " + GenreTypes.getInstanceOf().getValueForId(genreId);
newBody = new FrameBodyTCON((byte) 0, genre);
newFrame = new ID3v24Frame(ID3v24Frames.FRAME_ID_GENRE);
newFrame.setBody(newBody);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
if (mp3tag instanceof ID3v11Tag id3tag2)
{
if (id3tag2.track > 0)
{
newBody = new FrameBodyTRCK((byte) 0, Byte.toString(id3tag2.track));
newFrame = new ID3v24Frame(ID3v24Frames.FRAME_ID_TRACK);
newFrame.setBody(newBody);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
}
}
//Lyrics 3
else if (mp3tag instanceof AbstractLyrics3)
{
//Put the conversion stuff in the individual frame code.
Lyrics3v2 lyric;
if (mp3tag instanceof Lyrics3v2)
{
lyric = new Lyrics3v2((Lyrics3v2) mp3tag);
}
else
{
lyric = new Lyrics3v2(mp3tag);
}
Iterator<Lyrics3v2Field> iterator = lyric.iterator();
Lyrics3v2Field field;
ID3v24Frame newFrame;
while (iterator.hasNext())
{
try
{
field = iterator.next();
newFrame = new ID3v24Frame(field);
frameMap.put(newFrame.getIdentifier(), newFrame);
}
catch (InvalidTagException ex)
{
logger.warning("Unable to convert Lyrics3 to v24 Frame:Frame Identifier");
}
}
}
}
} |
Creates a new ID3v2_4 datatype based on another (non 2.4) tag
@param mp3tag
| ID3v24Tag::ID3v24Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public ID3v24Tag(ByteBuffer buffer, String loggingFilename) throws TagException
{
frameMap = new LinkedHashMap();
encryptedFrameMap = new LinkedHashMap();
setLoggingFilename(loggingFilename);
this.read(buffer);
} |
Creates a new ID3v2_4 datatype.
@param buffer
@param loggingFilename
@throws TagException
| ID3v24Tag::ID3v24Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public ID3v24Tag(ByteBuffer buffer) throws TagException
{
this(buffer, "");
} |
Creates a new ID3v2_4 datatype.
@param buffer
@throws TagException
@deprecated use {@link #ID3v24Tag(ByteBuffer,String)} instead
| ID3v24Tag::ID3v24Tag | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public String getIdentifier()
{
return "ID3v2.40";
} |
@return identifier
| ID3v24Tag::getIdentifier | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public int getSize()
{
int size = TAG_HEADER_LENGTH;
if (extended)
{
size += TAG_EXT_HEADER_LENGTH;
if (updateTag)
{
size += TAG_EXT_HEADER_UPDATE_LENGTH;
}
if (crcDataFlag)
{
size += TAG_EXT_HEADER_CRC_LENGTH;
}
if (tagRestriction)
{
size += TAG_EXT_HEADER_RESTRICTION_LENGTH;
}
}
size += super.getSize();
logger.finer("Tag Size is" + size);
return size;
} |
Return tag size based upon the sizes of the frames rather than the physical
no of bytes between start of ID3Tag and start of Audio Data.
@return size
| ID3v24Tag::getSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public boolean equals(Object obj)
{
if (!(obj instanceof ID3v24Tag object))
{
return false;
}
if (this.footer != object.footer)
{
return false;
}
if (this.imageEncodingRestriction != object.imageEncodingRestriction)
{
return false;
}
if (this.imageSizeRestriction != object.imageSizeRestriction)
{
return false;
}
if (this.tagRestriction != object.tagRestriction)
{
return false;
}
if (this.tagSizeRestriction != object.tagSizeRestriction)
{
return false;
}
if (this.textEncodingRestriction != object.textEncodingRestriction)
{
return false;
}
if (this.textFieldSizeRestriction != object.textFieldSizeRestriction)
{
return false;
}
return this.updateTag == object.updateTag && super.equals(obj);
} |
@param obj
@return equality
| ID3v24Tag::equals | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
private void readHeaderFlags(ByteBuffer byteBuffer) throws TagException
{
//Flags
byte flags = byteBuffer.get();
unsynchronization = (flags & MASK_V24_UNSYNCHRONIZATION) != 0;
extended = (flags & MASK_V24_EXTENDED_HEADER) != 0;
experimental = (flags & MASK_V24_EXPERIMENTAL) != 0;
footer = (flags & MASK_V24_FOOTER_PRESENT) != 0;
//Not allowable/Unknown Flags
if ((flags & FileConstants.BIT3) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT3));
}
if ((flags & FileConstants.BIT2) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT2));
}
if ((flags & FileConstants.BIT1) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT1));
}
if ((flags & FileConstants.BIT0) != 0)
{
logger.warning(ErrorMessage.ID3_INVALID_OR_UNKNOWN_FLAG_SET.getMsg(getLoggingFilename(), FileConstants.BIT0));
}
if (isUnsynchronization())
{
logger.config(ErrorMessage.ID3_TAG_UNSYNCHRONIZED.getMsg(getLoggingFilename()));
}
if (extended)
{
logger.config(ErrorMessage.ID3_TAG_EXTENDED.getMsg(getLoggingFilename()));
}
if (experimental)
{
logger.config(ErrorMessage.ID3_TAG_EXPERIMENTAL.getMsg(getLoggingFilename()));
}
if (footer)
{
logger.warning(ErrorMessage.ID3_TAG_FOOTER.getMsg(getLoggingFilename()));
}
} |
Read header flags
<p>Log info messages for falgs that have been set and log warnings when bits have been set for unknown flags
@param byteBuffer
@throws TagException
| ID3v24Tag::readHeaderFlags | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
private void readExtendedHeader(ByteBuffer byteBuffer, int size) throws InvalidTagException
{
byte[] buffer;
// int is 4 bytes.
int extendedHeaderSize = byteBuffer.getInt();
// the extended header must be at least 6 bytes
if (extendedHeaderSize <= TAG_EXT_HEADER_LENGTH)
{
throw new InvalidTagException(ErrorMessage.ID3_EXTENDED_HEADER_SIZE_TOO_SMALL.getMsg(getLoggingFilename(), extendedHeaderSize));
}
//Number of bytes
byteBuffer.get();
// Read the extended flag bytes
byte extFlag = byteBuffer.get();
updateTag = (extFlag & MASK_V24_TAG_UPDATE) != 0;
crcDataFlag = (extFlag & MASK_V24_CRC_DATA_PRESENT) != 0;
tagRestriction = (extFlag & MASK_V24_TAG_RESTRICTIONS) != 0;
// read the length byte if the flag is set
// this tag should always be zero but just in case
// read this information.
if (updateTag)
{
byteBuffer.get();
}
//CRC-32
if (crcDataFlag)
{
// the CRC has a variable length
byteBuffer.get();
buffer = new byte[TAG_EXT_HEADER_CRC_DATA_LENGTH];
byteBuffer.get(buffer, 0, TAG_EXT_HEADER_CRC_DATA_LENGTH);
crcData = 0;
for (int i = 0; i < TAG_EXT_HEADER_CRC_DATA_LENGTH; i++)
{
crcData <<= 8;
crcData += buffer[i];
}
}
//Tag Restriction
if (tagRestriction)
{
byteBuffer.get();
buffer = new byte[1];
byteBuffer.get(buffer, 0, 1);
tagSizeRestriction = (byte) ((buffer[0] & MASK_V24_TAG_SIZE_RESTRICTIONS) >> 6);
textEncodingRestriction = (byte) ((buffer[0] & MASK_V24_TEXT_ENCODING_RESTRICTIONS) >> 5);
textFieldSizeRestriction = (byte) ((buffer[0] & MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS) >> 3);
imageEncodingRestriction = (byte) ((buffer[0] & MASK_V24_IMAGE_ENCODING) >> 2);
imageSizeRestriction = (byte) (buffer[0] & MASK_V24_IMAGE_SIZE_RESTRICTIONS);
}
} |
Read the optional extended header
@param byteBuffer
@param size
@throws org.jaudiotagger.tag.InvalidTagException
| ID3v24Tag::readExtendedHeader | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
protected void readFrames(ByteBuffer byteBuffer, int size)
{
logger.finest(getLoggingFilename() + ":" + "Start of frame body at" + byteBuffer.position());
//Now start looking for frames
ID3v24Frame next;
frameMap = new LinkedHashMap();
encryptedFrameMap = new LinkedHashMap();
//Read the size from the Tag Header
this.fileReadSize = size;
// Read the frames until got to upto the size as specified in header
logger.finest(getLoggingFilename() + ":" + "Start of frame body at:" + byteBuffer.position() + ",frames data size is:" + size);
while (byteBuffer.position() <= size)
{
String id;
try
{
//Read Frame
logger.finest(getLoggingFilename() + ":" + "looking for next frame at:" + byteBuffer.position());
next = new ID3v24Frame(byteBuffer, getLoggingFilename());
id = next.getIdentifier();
loadFrameIntoMap(id, next);
}
//Found Padding, no more frames
catch (PaddingException ex)
{
logger.config(getLoggingFilename() + ":Found padding starting at:" + byteBuffer.position());
break;
}
//Found Empty Frame
catch (EmptyFrameException ex)
{
logger.warning(getLoggingFilename() + ":" + "Empty Frame:" + ex.getMessage());
this.emptyFrameBytes += TAG_HEADER_LENGTH;
}
catch (InvalidFrameIdentifierException ifie)
{
logger.config(getLoggingFilename() + ":" + "Invalid Frame Identifier:" + ifie.getMessage());
this.invalidFrames++;
//Don't try and find any more frames
break;
}
//Problem trying to find frame
catch (InvalidFrameException ife)
{
logger.warning(getLoggingFilename() + ":" + "Invalid Frame:" + ife.getMessage());
this.invalidFrames++;
//Don't try and find any more frames
break;
}
//Failed reading frame but may just have invalid data but correct length so lets carry on
//in case we can read the next frame
catch(InvalidDataTypeException idete)
{
logger.warning(getLoggingFilename() + ":Corrupt Frame:" + idete.getMessage());
this.invalidFrames++;
continue;
}
}
} |
Read frames from tag
@param byteBuffer
@param size
| ID3v24Tag::readFrames | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
private ByteBuffer writeHeaderToBuffer(int padding, int size) throws IOException
{
//This would only be set if every frame in tag has been unsynchronized, I only unsychronize frames
//that need it, in any case I have been advised not to set it even then.
unsynchronization = false;
// Flags,currently we never calculate the CRC
// and if we dont calculate them cant keep orig values. Tags are not
// experimental and we never create extended header to keep things simple.
extended = false;
experimental = false;
footer = false;
// Create Header Buffer,allocate maximum possible size for the header
ByteBuffer headerBuffer = ByteBuffer.allocate(TAG_HEADER_LENGTH);
//TAGID
headerBuffer.put(TAG_ID);
//Major Version
headerBuffer.put(getMajorVersion());
//Minor Version
headerBuffer.put(getRevision());
//Flags
byte flagsByte = 0;
if (isUnsynchronization())
{
flagsByte |= MASK_V24_UNSYNCHRONIZATION;
}
if (extended)
{
flagsByte |= MASK_V24_EXTENDED_HEADER;
}
if (experimental)
{
flagsByte |= MASK_V24_EXPERIMENTAL;
}
if (footer)
{
flagsByte |= MASK_V24_FOOTER_PRESENT;
}
headerBuffer.put(flagsByte);
//Size As Recorded in Header, don't include the main header length
//Additional Header Size,(for completeness we never actually write the extended header, or footer)
int additionalHeaderSize = 0;
if (extended)
{
additionalHeaderSize += TAG_EXT_HEADER_LENGTH;
if (updateTag)
{
additionalHeaderSize += TAG_EXT_HEADER_UPDATE_LENGTH;
}
if (crcDataFlag)
{
additionalHeaderSize += TAG_EXT_HEADER_CRC_LENGTH;
}
if (tagRestriction)
{
additionalHeaderSize += TAG_EXT_HEADER_RESTRICTION_LENGTH;
}
}
//Size As Recorded in Header, don't include the main header length
headerBuffer.put(ID3SyncSafeInteger.valueToBuffer(padding + size + additionalHeaderSize));
//Write Extended Header
ByteBuffer extHeaderBuffer = null;
if (extended)
{
//Write Extended Header Size
int extendedSize = TAG_EXT_HEADER_LENGTH;
if (updateTag)
{
extendedSize += TAG_EXT_HEADER_UPDATE_LENGTH;
}
if (crcDataFlag)
{
extendedSize += TAG_EXT_HEADER_CRC_LENGTH;
}
if (tagRestriction)
{
extendedSize += TAG_EXT_HEADER_RESTRICTION_LENGTH;
}
extHeaderBuffer = ByteBuffer.allocate(extendedSize);
extHeaderBuffer.putInt(extendedSize);
//Write Number of flags Byte
extHeaderBuffer.put((byte) TAG_EXT_NUMBER_BYTES_DATA_LENGTH);
//Write Extended Flags
byte extFlag = 0;
if (updateTag)
{
extFlag |= MASK_V24_TAG_UPDATE;
}
if (crcDataFlag)
{
extFlag |= MASK_V24_CRC_DATA_PRESENT;
}
if (tagRestriction)
{
extFlag |= MASK_V24_TAG_RESTRICTIONS;
}
extHeaderBuffer.put(extFlag);
//Write Update Data
if (updateTag)
{
extHeaderBuffer.put((byte) 0);
}
//Write CRC Data
if (crcDataFlag)
{
extHeaderBuffer.put((byte) TAG_EXT_HEADER_CRC_DATA_LENGTH);
extHeaderBuffer.put((byte) 0);
extHeaderBuffer.putInt(crcData);
}
//Write Tag Restriction
if (tagRestriction)
{
extHeaderBuffer.put((byte) TAG_EXT_HEADER_RESTRICTION_DATA_LENGTH);
//todo not currently setting restrictions
extHeaderBuffer.put((byte) 0);
}
}
if (extHeaderBuffer != null)
{
extHeaderBuffer.flip();
headerBuffer.put(extHeaderBuffer);
}
headerBuffer.flip();
return headerBuffer;
} |
Write the ID3 header to the ByteBuffer.
TODO Calculate the CYC Data Check
TODO Reintroduce Extended Header
@param padding is the size of the padding
@param size is the size of the body data
@return ByteBuffer
@throws IOException
| ID3v24Tag::writeHeaderToBuffer | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public void createStructure()
{
MP3File.getStructureFormatter().openHeadingElement(TYPE_TAG, getIdentifier());
super.createStructureHeader();
//Header
MP3File.getStructureFormatter().openHeadingElement(TYPE_HEADER, "");
MP3File.getStructureFormatter().addElement(TYPE_UNSYNCHRONISATION, this.isUnsynchronization());
MP3File.getStructureFormatter().addElement(TYPE_CRCDATA, this.crcData);
MP3File.getStructureFormatter().addElement(TYPE_EXPERIMENTAL, this.experimental);
MP3File.getStructureFormatter().addElement(TYPE_EXTENDED, this.extended);
MP3File.getStructureFormatter().addElement(TYPE_PADDINGSIZE, this.paddingSize);
MP3File.getStructureFormatter().addElement(TYPE_FOOTER, this.footer);
MP3File.getStructureFormatter().addElement(TYPE_IMAGEENCODINGRESTRICTION, this.paddingSize);
MP3File.getStructureFormatter().addElement(TYPE_IMAGESIZERESTRICTION, this.imageSizeRestriction);
MP3File.getStructureFormatter().addElement(TYPE_TAGRESTRICTION, this.tagRestriction);
MP3File.getStructureFormatter().addElement(TYPE_TAGSIZERESTRICTION, this.tagSizeRestriction);
MP3File.getStructureFormatter().addElement(TYPE_TEXTFIELDSIZERESTRICTION, this.textFieldSizeRestriction);
MP3File.getStructureFormatter().addElement(TYPE_TEXTENCODINGRESTRICTION, this.textEncodingRestriction);
MP3File.getStructureFormatter().addElement(TYPE_UPDATETAG, this.updateTag);
MP3File.getStructureFormatter().closeHeadingElement(TYPE_HEADER);
//Body
super.createStructureBody();
MP3File.getStructureFormatter().closeHeadingElement(TYPE_TAG);
} |
Display the tag in an XMLFormat
| ID3v24Tag::createStructure | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public boolean isUnsynchronization()
{
return unsynchronization;
} |
Are all frame swithin this tag unsynchronized
<p>Because synchronization occurs at the frame level it is not normally desirable to unsynchronize all frames
and hence this flag is not normally set.
@return are all frames within the tag unsynchronized
| ID3v24Tag::isUnsynchronization | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public ID3v24Frame createFrame(String id)
{
return new ID3v24Frame(id);
} |
Create a new frame with the specified frameid
@param id
@return
| ID3v24Tag::createFrame | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public TagField createField(ID3v24FieldKey id3Key, String value) throws KeyNotFoundException, FieldDataInvalidException
{
if (id3Key == null)
{
throw new KeyNotFoundException();
}
return super.doCreateTagField(new FrameAndSubId(null, id3Key.getFrameId(), id3Key.getSubId()), value);
} |
Create Frame for Id3 Key
Only textual data supported at the moment, should only be used with frames that
support a simple string argument.
@param id3Key
@param value
@return
@throws KeyNotFoundException
@throws FieldDataInvalidException
| ID3v24Tag::createField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public String getFirst(ID3v24FieldKey id3v24FieldKey) throws KeyNotFoundException
{
if (id3v24FieldKey == null)
{
throw new KeyNotFoundException();
}
FieldKey genericKey = ID3v24Frames.getInstanceOf().getGenericKeyFromId3(id3v24FieldKey);
if(genericKey!=null)
{
return super.getFirst(genericKey);
}
else
{
FrameAndSubId frameAndSubId = new FrameAndSubId(null, id3v24FieldKey.getFrameId(), id3v24FieldKey.getSubId());
return super.doGetValueAtIndex(frameAndSubId, 0);
}
} |
Retrieve the first value that exists for this id3v24key
@param id3v24FieldKey
@return
@throws org.jaudiotagger.tag.KeyNotFoundException
| ID3v24Tag::getFirst | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public void deleteField(ID3v24FieldKey id3v24FieldKey) throws KeyNotFoundException
{
if (id3v24FieldKey == null)
{
throw new KeyNotFoundException();
}
super.doDeleteTagField(new FrameAndSubId(null, id3v24FieldKey.getFrameId(), id3v24FieldKey.getSubId()));
} |
Delete fields with this id3v24FieldKey
@param id3v24FieldKey
@throws org.jaudiotagger.tag.KeyNotFoundException
| ID3v24Tag::deleteField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public void deleteField(String id)
{
super.doDeleteTagField(new FrameAndSubId(null, id,null));
} |
Delete fields with this (frame) id
@param id
| ID3v24Tag::deleteField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public Comparator getPreferredFrameOrderComparator()
{
return ID3v24PreferredFrameOrderComparator.getInstanceof();
} |
@return comparator used to order frames in preferred order for writing to file
so that most important frames are written first.
| ID3v24Tag::getPreferredFrameOrderComparator | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public TagField createArtworkField(byte[] data, String mimeType)
{
AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
FrameBodyAPIC body = (FrameBodyAPIC) frame.getBody();
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, data);
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, PictureTypes.DEFAULT_ID);
body.setObjectValue(DataTypes.OBJ_MIME_TYPE, mimeType);
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
} |
Create Artwork
@param data
@param mimeType of the image
@see PictureTypes
@return
| ID3v24Tag::createArtworkField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public TagField createField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
{
if (genericKey == null)
{
throw new KeyNotFoundException();
}
if (genericKey == FieldKey.GENRE)
{
if (values == null)
{
throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
}
String value = values[0];
if (value == null)
{
throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
}
FrameAndSubId formatKey = getFrameAndSubIdFromGenericKey(genericKey);
AbstractID3v2Frame frame = createFrame(formatKey.getFrameId());
FrameBodyTCON framebody = (FrameBodyTCON) frame.getBody();
if(TagOptionSingleton.getInstance().isWriteMp3GenresAsText())
{
framebody.setText(value);
}
else
{
framebody.setText(FrameBodyTCON.convertGenericToID3v24Genre(value));
}
return frame;
}
else
{
return super.createField(genericKey, values);
}
} |
Overridden for special Genre support
@param genericKey is the generic key
@param values
@return
@throws KeyNotFoundException
@throws FieldDataInvalidException
| ID3v24Tag::createField | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
{
if(genericKey == FieldKey.GENRE)
{
List<TagField> fields = getFields(genericKey);
List<String> convertedGenres = new ArrayList<String>();
if (fields != null && fields.size() > 0)
{
AbstractID3v2Frame frame = (AbstractID3v2Frame) fields.get(0);
FrameBodyTCON body = (FrameBodyTCON)frame.getBody();
for(String next:body.getValues())
{
convertedGenres.add(FrameBodyTCON.convertID3v24GenreToGeneric(next));
}
}
return convertedGenres;
}
else
{
return super.getAll(genericKey);
}
} |
Maps the generic key to the id3 key and return the list of values for this field as strings
@param genericKey
@return
@throws KeyNotFoundException
| ID3v24Tag::getAll | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Tag.java | Apache-2.0 |
public ID3v24FieldKey getId3KeyFromGenericKey(FieldKey genericKey)
{
return tagFieldToId3.get(genericKey);
} |
@param genericKey
@return id3 key for generic key
| ID3v24Frames::getId3KeyFromGenericKey | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Frames.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Frames.java | Apache-2.0 |
public FieldKey getGenericKeyFromId3(ID3v24FieldKey fieldKey)
{
return id3ToTagField.get(fieldKey);
} |
Get generic key for ID3 field key
@param fieldKey
@return
| ID3v24Frames::getGenericKeyFromId3 | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Frames.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3v24Frames.java | Apache-2.0 |
public static String getMimeTypeForFormat(String format)
{
return imageFormatsToMimeType.get(format);
} |
Get v2.3 mimetype from v2.2 format
@param format
@return
| ImageFormats::getMimeTypeForFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static String getFormatForMimeType(String mimeType)
{
return imageMimeTypeToFormat.get(mimeType);
} |
Get v2.2 format from v2.3 mimetype
@param mimeType
@return
| ImageFormats::getFormatForMimeType | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static boolean binaryDataIsPngFormat(byte[] data)
{
//Read signature
if(data.length<4)
{
return false;
}
return (0x89 == (data[0] & 0xff)) && (0x50 == (data[1] & 0xff)) && (0x4E == (data[2] & 0xff)) && (0x47 == (data[3] & 0xff));
} |
Is this binary data a png image
@param data
@return true if binary data matches expected header for a png
| ImageFormats::binaryDataIsPngFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static boolean binaryDataIsJpgFormat(byte[] data)
{
if(data.length<4)
{
return false;
}
//Read signature
//Can be Can be FF D8 FF DB (samsung) , FF D8 FF E0 (standard) or FF D8 FF E1 or some other formats
//see http://www.garykessler.net/library/file_sigs.html
//FF D8 is SOI Marker, FFE0 or FFE1 is JFIF Marker
return (0xff == (data[0] & 0xff)) && (0xd8 == (data[1] & 0xff)) && (0xff == (data[2] & 0xff)) && (0xdb <= (data[3] & 0xff));
} |
Is this binary data a jpg image
@param data
@return true if binary data matches expected header for a jpg
Some details http://www.obrador.com/essentialjpeg/headerinfo.htm
| ImageFormats::binaryDataIsJpgFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static boolean binaryDataIsGifFormat(byte[] data)
{
if(data.length<3)
{
return false;
}
//Read signature
return (0x47 == (data[0] & 0xff)) && (0x49 == (data[1] & 0xff)) && (0x46 == (data[2] & 0xff));
} |
Is this binary data a gif image
@param data
@return true if binary data matches expected header for a gif
| ImageFormats::binaryDataIsGifFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static boolean binaryDataIsBmpFormat(byte[] data)
{
if(data.length<2)
{
return false;
}
//Read signature
return (0x42 == (data[0] & 0xff)) && (0x4d == (data[1] & 0xff));
} |
Is this binary data a bmp image
@param data
@return true if binary data matches expected header for a bmp
| ImageFormats::binaryDataIsBmpFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static boolean binaryDataIsPdfFormat(byte[] data)
{
if(data.length<4)
{
return false;
}
//Read signature
return (0x25 == (data[0] & 0xff)) && (0x50 == (data[1] & 0xff)) && (0x44 == (data[2] & 0xff)) && (0x46 == (data[3] & 0xff));
} |
Is this binary data a pdf image
Details at http://en.wikipedia.org/wiki/Magic_number_%28programming%29
@param data
@return true if binary data matches expected header for a pdf
| ImageFormats::binaryDataIsPdfFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static boolean binaryDataIsTiffFormat(byte[] data)
{
if(data.length<4)
{
return false;
}
//Read signature Intel
return (
((0x49 == (data[0] & 0xff)) && (0x49 == (data[1] & 0xff)) && (0x2a == (data[2] & 0xff)) && (0x00 == (data[3] & 0xff)))
||
((0x4d == (data[0] & 0xff)) && (0x4d == (data[1] & 0xff)) && (0x00 == (data[2] & 0xff)) && (0x2a == (data[3] & 0xff)))
);
} |
is this binary data a tiff image
Details at http://en.wikipedia.org/wiki/Magic_number_%28programming%29
@param data
@return true if binary data matches expected header for a tiff
| ImageFormats::binaryDataIsTiffFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static boolean isPortableFormat(byte[] data)
{
return binaryDataIsPngFormat(data) || binaryDataIsJpgFormat(data) || binaryDataIsGifFormat(data);
} |
@param data
@return true if the image format is a portable format recognised across operating systems
| ImageFormats::isPortableFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static String getMimeTypeForBinarySignature(byte[] data)
{
if(binaryDataIsPngFormat(data))
{
return MIME_TYPE_PNG;
}
else if(binaryDataIsJpgFormat(data))
{
return MIME_TYPE_JPEG;
}
else if(binaryDataIsGifFormat(data))
{
return MIME_TYPE_GIF;
}
else if(binaryDataIsBmpFormat(data))
{
return MIME_TYPE_BMP;
}
else if(binaryDataIsPdfFormat(data))
{
return MIME_TYPE_PDF;
}
else if(binaryDataIsTiffFormat(data))
{
return MIME_TYPE_TIFF;
}
else
{
return null;
}
} |
@param data
@return correct mimetype for the image data represented by this byte data
| ImageFormats::getMimeTypeForBinarySignature | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/ImageFormats.java | Apache-2.0 |
public static synchronized TextEncoding getInstanceOf()
{
if (textEncodings == null)
{
textEncodings = new TextEncoding();
}
return textEncodings;
} |
Get singleton for this class.
@return singleton
| TextEncoding::getInstanceOf | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/TextEncoding.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/TextEncoding.java | Apache-2.0 |
public Integer getIdForCharset(final Charset charset)
{
return valueToId.get(charset.name());
} |
Allows to lookup id directly via the {@link Charset} instance.
@param charset charset
@return id, e.g. {@link #ISO_8859_1}, or {@code null}, if not found
| TextEncoding::getIdForCharset | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/TextEncoding.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/TextEncoding.java | Apache-2.0 |
public Charset getCharsetForId(final int id)
{
return idToCharset.get(id);
} |
Allows direct lookup of the {@link Charset} instance via an id.
@param id id, e.g. {@link #ISO_8859_1}
@return charset or {@code null}, if not found
| TextEncoding::getCharsetForId | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/TextEncoding.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/TextEncoding.java | Apache-2.0 |
public List<String> getAlphabeticalValueList()
{
List<String> genres = GenreTypes.getInstanceOf().getAlphabeticalValueList();
genres.add(ID3V2ExtendedGenreTypes.CR.getDescription());
genres.add(ID3V2ExtendedGenreTypes.RX.getDescription());
//Sort
Collections.sort(genres);
return genres;
} |
@return list of all valid v2 genres in alphabetical order
| V2GenreTypes::getAlphabeticalValueList | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/valuepair/V2GenreTypes.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/valuepair/V2GenreTypes.java | Apache-2.0 |
public FrameBodyTBPM()
{
} |
Creates a new FrameBodyTBPM datatype.
| FrameBodyTBPM::FrameBodyTBPM | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | Apache-2.0 |
public FrameBodyTBPM(byte textEncoding, String text)
{
super(textEncoding, text);
} |
Creates a new FrameBodyTBPM datatype.
@param textEncoding
@param text
| FrameBodyTBPM::FrameBodyTBPM | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | Apache-2.0 |
public FrameBodyTBPM(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
{
super(byteBuffer, frameSize);
} |
Creates a new FrameBodyTBPM datatype.
@param byteBuffer
@param frameSize
@throws InvalidTagException
| FrameBodyTBPM::FrameBodyTBPM | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | Apache-2.0 |
public String getIdentifier()
{
return ID3v24Frames.FRAME_ID_BPM;
} |
The ID3v2 frame identifier
@return the ID3v2 frame identifier for this frame type
| FrameBodyTBPM::getIdentifier | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTBPM.java | Apache-2.0 |
public FrameBodyTORY()
{
} |
Creates a new FrameBodyTORY datatype.
| FrameBodyTORY::FrameBodyTORY | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | Apache-2.0 |
public FrameBodyTORY(byte textEncoding, String text)
{
super(textEncoding, text);
} |
Creates a new FrameBodyTORY datatype.
@param textEncoding
@param text
| FrameBodyTORY::FrameBodyTORY | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | Apache-2.0 |
public FrameBodyTORY(FrameBodyTDOR body)
{
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, TextEncoding.ISO_8859_1);
String year=body.getText();
if(body.getText().length()> NUMBER_OF_DIGITS_IN_YEAR)
{
year=body.getText().substring(0, NUMBER_OF_DIGITS_IN_YEAR);
}
setObjectValue(DataTypes.OBJ_TEXT, year);
} |
When converting v4 TDOR to v3 TORY frame
@param body
| FrameBodyTORY::FrameBodyTORY | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | Apache-2.0 |
public FrameBodyTORY(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
{
super(byteBuffer, frameSize);
} |
Creates a new FrameBodyTORY datatype.
@param byteBuffer
@param frameSize
@throws InvalidTagException
| FrameBodyTORY::FrameBodyTORY | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | Apache-2.0 |
public String getIdentifier()
{
return ID3v23Frames.FRAME_ID_V3_TORY;
} |
The ID3v2 frame identifier
@return the ID3v2 frame identifier for this frame type
| FrameBodyTORY::getIdentifier | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTORY.java | Apache-2.0 |
public FrameBodyMCDI()
{
this.setObjectValue(DataTypes.OBJ_DATA, new byte[0]);
} |
Creates a new FrameBodyMCDI datatype.
| FrameBodyMCDI::FrameBodyMCDI | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | Apache-2.0 |
public FrameBodyMCDI(byte[] cdTOC)
{
this.setObjectValue(DataTypes.OBJ_DATA, cdTOC);
} |
Creates a new FrameBodyMCDI datatype.
@param cdTOC
| FrameBodyMCDI::FrameBodyMCDI | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | Apache-2.0 |
public FrameBodyMCDI(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
{
super(byteBuffer, frameSize);
} |
Creates a new FrameBodyMCDI datatype.
@param byteBuffer
@param frameSize
@throws InvalidTagException if unable to create framebody from buffer
| FrameBodyMCDI::FrameBodyMCDI | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | Apache-2.0 |
public String getIdentifier()
{
return ID3v24Frames.FRAME_ID_MUSIC_CD_ID;
} |
The ID3v2 frame identifier
@return the ID3v2 frame identifier for this frame type
| FrameBodyMCDI::getIdentifier | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyMCDI.java | Apache-2.0 |
public FrameBodyUSER()
{
// setObject("Text Encoding", new Byte((byte) 0));
// setObject("Language", "");
// setObject("Text", "");
} |
Creates a new FrameBodyUSER datatype.
| FrameBodyUSER::FrameBodyUSER | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | Apache-2.0 |
public FrameBodyUSER(byte textEncoding, String language, String text)
{
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
setObjectValue(DataTypes.OBJ_LANGUAGE, language);
setObjectValue(DataTypes.OBJ_TEXT, text);
} |
Creates a new FrameBodyUSER datatype.
@param textEncoding
@param language
@param text
| FrameBodyUSER::FrameBodyUSER | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | Apache-2.0 |
public FrameBodyUSER(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
{
super(byteBuffer, frameSize);
} |
Create a new FrameBodyUser by reading from byte buffer
@param byteBuffer
@param frameSize
@throws InvalidTagException
| FrameBodyUSER::FrameBodyUSER | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | Apache-2.0 |
public String getIdentifier()
{
return ID3v24Frames.FRAME_ID_TERMS_OF_USE;
} |
The ID3v2 frame identifier
@return the ID3v2 frame identifier for this frame type
| FrameBodyUSER::getIdentifier | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | Apache-2.0 |
public String getLanguage()
{
return (String) getObjectValue(DataTypes.OBJ_LANGUAGE);
} |
@return lanaguage
| FrameBodyUSER::getLanguage | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | Apache-2.0 |
public void setOwner(String language)
{
setObjectValue(DataTypes.OBJ_LANGUAGE, language);
} |
@param language
| FrameBodyUSER::setOwner | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | Apache-2.0 |
public void write(ByteArrayOutputStream tagBuffer)
{
if (!((AbstractString) getObject(DataTypes.OBJ_TEXT)).canBeEncoded())
{
this.setTextEncoding(TextEncoding.UTF_16);
}
super.write(tagBuffer);
} |
If the text cannot be encoded using current encoder, change the encoder
@param tagBuffer
@throws java.io.IOException
| FrameBodyUSER::write | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyUSER.java | Apache-2.0 |
protected AbstractFrameBodyUrlLink()
{
super();
} |
Creates a new FrameBodyUrlLink datatype.
| AbstractFrameBodyUrlLink::AbstractFrameBodyUrlLink | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
protected AbstractFrameBodyUrlLink(AbstractFrameBodyUrlLink body)
{
super(body);
} |
Copy Constructor
@param body
| AbstractFrameBodyUrlLink::AbstractFrameBodyUrlLink | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
public AbstractFrameBodyUrlLink(String urlLink)
{
setObjectValue(DataTypes.OBJ_URLLINK, urlLink);
} |
Creates a new FrameBodyUrlLink datatype., set up with data.
@param urlLink
| AbstractFrameBodyUrlLink::AbstractFrameBodyUrlLink | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
protected AbstractFrameBodyUrlLink(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
{
super(byteBuffer, frameSize);
} |
Creates a new FrameBodyUrlLink datatype.
@param byteBuffer
@param frameSize
@throws InvalidTagException if unable to create framebody from buffer
| AbstractFrameBodyUrlLink::AbstractFrameBodyUrlLink | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
public void setUrlLink(String urlLink)
{
if (urlLink == null)
{
throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
}
setObjectValue(DataTypes.OBJ_URLLINK, urlLink);
} |
Set URL Link
@param urlLink
| AbstractFrameBodyUrlLink::setUrlLink | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
public String getUrlLink()
{
return (String) getObjectValue(DataTypes.OBJ_URLLINK);
} |
Get URL Link
@return the urllink
| AbstractFrameBodyUrlLink::getUrlLink | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
public void write(ByteArrayOutputStream tagBuffer)
{
CharsetEncoder encoder = StandardCharsets.ISO_8859_1.newEncoder();
String origUrl = getUrlLink();
if (!encoder.canEncode(origUrl))
{
//ALL W Frames only support ISO-8859-1 for the url itself, if unable to encode let us assume
//the link just needs url encoding
setUrlLink(encodeURL(origUrl));
//We still cant convert so just set log error and set to blank to allow save to continue
if (!encoder.canEncode(getUrlLink()))
{
logger.warning(ErrorMessage.MP3_UNABLE_TO_ENCODE_URL.getMsg(origUrl));
setUrlLink("");
}
//it was ok, just note the modification made
else
{
logger.warning(ErrorMessage.MP3_URL_SAVED_ENCODED.getMsg(origUrl, getUrlLink()));
}
}
super.write(tagBuffer);
} |
If the description cannot be encoded using the current encoding change the encoder
| AbstractFrameBodyUrlLink::write | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
private String encodeURL(String url)
{
final String[] splitURL = url.split("(?<!/)/(?!/)", -1);
final StringBuffer sb = new StringBuffer(splitURL[0]);
for (int i = 1; i < splitURL.length; i++)
{
sb.append("/").append(URLEncoder.encode(splitURL[i], StandardCharsets.UTF_8));
}
return sb.toString();
} |
Encode url because may receive url already encoded or not, but we can only store as ISO8859-1
@param url
@return
| AbstractFrameBodyUrlLink::encodeURL | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/AbstractFrameBodyUrlLink.java | Apache-2.0 |
public FrameBodyTFLT()
{
} |
Creates a new FrameBodyTFLT datatype.
| FrameBodyTFLT::FrameBodyTFLT | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | Apache-2.0 |
public FrameBodyTFLT(byte textEncoding, String text)
{
super(textEncoding, text);
} |
Creates a new FrameBodyTFLT datatype.
@param textEncoding
@param text
| FrameBodyTFLT::FrameBodyTFLT | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | Apache-2.0 |
public FrameBodyTFLT(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
{
super(byteBuffer, frameSize);
} |
Creates a new FrameBodyTFLT datatype.
@param byteBuffer
@param frameSize
@throws InvalidTagException
| FrameBodyTFLT::FrameBodyTFLT | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | Apache-2.0 |
public String getIdentifier()
{
return ID3v24Frames.FRAME_ID_FILE_TYPE;
} |
The ID3v2 frame identifier
@return the ID3v2 frame identifier for this frame type
| FrameBodyTFLT::getIdentifier | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTFLT.java | Apache-2.0 |
public FrameBodySEEK()
{
// this.setObject("Minimum Offset to Next Tag", new Integer(0));
} |
Creates a new FrameBodySEEK datatype.
| FrameBodySEEK::FrameBodySEEK | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodySEEK.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/framebody/FrameBodySEEK.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.