code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
833 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public InvalidFrameException(String msg) { super(msg); }
Creates a new InvalidFrameException datatype. @param msg the detail message.
InvalidFrameException::InvalidFrameException
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/InvalidFrameException.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/InvalidFrameException.java
Apache-2.0
public InvalidFrameException(String msg, Throwable ex) { super(msg, ex); }
Creates a new InvalidFrameException datatype. @param msg the detail message. @param ex the cause.
InvalidFrameException::InvalidFrameException
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/InvalidFrameException.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/InvalidFrameException.java
Apache-2.0
public boolean hasField(FieldKey genericKey) { return getFields(genericKey).size() != 0; }
@param genericKey @return
Mp4Tag::hasField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public boolean hasField(Mp4FieldKey mp4FieldKey) { return getFields(mp4FieldKey.getFieldName()).size() != 0; }
@param mp4FieldKey @return
Mp4Tag::hasField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException { List<String> values = new ArrayList<String>(); List<TagField> fields = getFields(genericKey); for(TagField tagfield:fields) { if(genericKey==FieldKey.TRACK) { values.add(((Mp4TrackField)tagfield).getTrackNo().toString()); } else if(genericKey==FieldKey.TRACK_TOTAL) { values.add(((Mp4TrackField)tagfield).getTrackTotal().toString()); } else if(genericKey==FieldKey.DISC_NO) { values.add(((Mp4DiscNoField)tagfield).getDiscNo().toString()); } else if(genericKey==FieldKey.DISC_TOTAL) { values.add(((Mp4DiscNoField)tagfield).getDiscTotal().toString()); } else { values.add(tagfield.toString()); } } return values; }
Maps the generic key to the specific key and return the list of values for this field as strings @param genericKey @return @throws KeyNotFoundException
Mp4Tag::getAll
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public List<TagField> get(Mp4FieldKey mp4FieldKey) throws KeyNotFoundException { if (mp4FieldKey == null) { throw new KeyNotFoundException(); } return super.getFields(mp4FieldKey.getFieldName()); }
Retrieve the values that exists for this mp4keyId (this is the internalid actually used) @param mp4FieldKey @throws org.jaudiotagger.tag.KeyNotFoundException @return
Mp4Tag::get
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public String getValue(FieldKey genericKey, int index) throws KeyNotFoundException { List<TagField> fields = getFields(genericKey); if(fields.size()>index) { TagField field = fields.get(index); if(genericKey==FieldKey.TRACK) { return ((Mp4TrackField)field).getTrackNo().toString(); } else if(genericKey==FieldKey.DISC_NO) { return ((Mp4DiscNoField)field).getDiscNo().toString(); } else if(genericKey==FieldKey.TRACK_TOTAL) { return ((Mp4TrackField)field).getTrackTotal().toString(); } else if(genericKey==FieldKey.DISC_TOTAL) { return ((Mp4DiscNoField)field).getDiscTotal().toString(); } else { return field.toString(); } } return ""; }
Retrieve the indexed value that exists for this generic key @param genericKey @return
Mp4Tag::getValue
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public String getFirst(Mp4FieldKey mp4Key) throws KeyNotFoundException { if (mp4Key == null) { throw new KeyNotFoundException(); } return super.getFirst(mp4Key.getFieldName()); }
Retrieve the first value that exists for this mp4key @param mp4Key @return @throws org.jaudiotagger.tag.KeyNotFoundException
Mp4Tag::getFirst
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public void deleteField(FieldKey genericKey) throws KeyNotFoundException { if (genericKey == null) { throw new KeyNotFoundException(); } String mp4FieldName = tagFieldToMp4Field.get(genericKey).getFieldName(); if (genericKey == FieldKey.KEY) { deleteField(Mp4FieldKey.KEY_OLD); deleteField(mp4FieldName); } else if (genericKey == FieldKey.TRACK) { String trackTotal = this.getFirst(FieldKey.TRACK_TOTAL); if(trackTotal.length()==0) { super.deleteField(mp4FieldName); } else { Mp4TrackField field = (Mp4TrackField)this.getFirstField(FieldKey.TRACK_TOTAL); field.setTrackNo(0); } } else if (genericKey == FieldKey.TRACK_TOTAL) { String track = this.getFirst(FieldKey.TRACK); if(track.length()==0) { super.deleteField(mp4FieldName); } else { Mp4TrackField field = (Mp4TrackField)this.getFirstField(FieldKey.TRACK); field.setTrackTotal(0); } } else if (genericKey == FieldKey.DISC_NO) { String discTotal = this.getFirst(FieldKey.DISC_TOTAL); if(discTotal.length()==0) { super.deleteField(mp4FieldName); } else { Mp4DiscNoField field = (Mp4DiscNoField)this.getFirstField(FieldKey.DISC_TOTAL); field.setDiscNo(0); } } else if (genericKey == FieldKey.DISC_TOTAL) { String discno = this.getFirst(FieldKey.DISC_NO); if(discno.length()==0) { super.deleteField(mp4FieldName); } else { Mp4DiscNoField field = (Mp4DiscNoField)this.getFirstField(FieldKey.DISC_NO); field.setDiscTotal(0); } } else if(genericKey == FieldKey.GENRE) { super.deleteField(Mp4FieldKey.GENRE.getFieldName()); super.deleteField(Mp4FieldKey.GENRE_CUSTOM.getFieldName()); } else { super.deleteField(mp4FieldName); } }
Delete fields with this generic key @param genericKey
Mp4Tag::deleteField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public void deleteField(Mp4FieldKey mp4Key) throws KeyNotFoundException { if (mp4Key == null) { throw new KeyNotFoundException(); } super.deleteField(mp4Key.getFieldName()); }
Delete fields with this mp4key @param mp4Key @throws org.jaudiotagger.tag.KeyNotFoundException
Mp4Tag::deleteField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public TagField createArtworkField(byte[] data) { return new Mp4TagCoverField(data); }
Create artwork field @param data raw image data @return @throws org.jaudiotagger.tag.FieldDataInvalidException
Mp4Tag::createArtworkField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public TagField createField(Artwork artwork) throws FieldDataInvalidException { return new Mp4TagCoverField(artwork.getBinaryData()); }
Create artwork field @return
Mp4Tag::createField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public void setField(Mp4FieldKey fieldKey, String value) throws KeyNotFoundException, FieldDataInvalidException { TagField tagfield = createField(fieldKey,value); setField(tagfield); }
Set mp4 field @param fieldKey @param value @throws KeyNotFoundException @throws FieldDataInvalidException
Mp4Tag::setField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public TagField createField(Mp4FieldKey mp4FieldKey, String value) throws KeyNotFoundException, FieldDataInvalidException { if (value == null) { throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg()); } if (mp4FieldKey == null) { throw new KeyNotFoundException(); } //This is boolean stored as 1, but calling program might setField as 'true' so we handle this //case internally , any other values it is set to we treat as false if(mp4FieldKey==Mp4FieldKey.COMPILATION) { if(value.equalsIgnoreCase("true") || value.equals("1")) { return createCompilationField(true); } else { return createCompilationField(false); } } else if(mp4FieldKey==Mp4FieldKey.GENRE) { if (Mp4GenreField.isValidGenre(value)) { return new Mp4GenreField(value); } else { throw new IllegalArgumentException(ErrorMessage.NOT_STANDARD_MP$_GENRE.getMsg()); } } else if(mp4FieldKey==Mp4FieldKey.GENRE_CUSTOM) { return new Mp4TagTextField(GENRE_CUSTOM.getFieldName(), value); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.DISC_NO) { return new Mp4DiscNoField(value); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.TRACK_NO) { return new Mp4TrackField(value); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.BYTE) { return new Mp4TagByteField(mp4FieldKey, value, mp4FieldKey.getFieldLength()); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.NUMBER) { return new Mp4TagTextNumberField(mp4FieldKey.getFieldName(), value); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.REVERSE_DNS) { return new Mp4TagReverseDnsField(mp4FieldKey, value); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.ARTWORK) { throw new UnsupportedOperationException(ErrorMessage.ARTWORK_CANNOT_BE_CREATED_WITH_THIS_METHOD.getMsg()); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.TEXT) { return new Mp4TagTextField(mp4FieldKey.getFieldName(), value); } else if(mp4FieldKey.getSubClassFieldType()==Mp4TagFieldSubType.UNKNOWN) { throw new UnsupportedOperationException(ErrorMessage.DO_NOT_KNOW_HOW_TO_CREATE_THIS_ATOM_TYPE.getMsg(mp4FieldKey.getFieldName())); } else { throw new UnsupportedOperationException(ErrorMessage.DO_NOT_KNOW_HOW_TO_CREATE_THIS_ATOM_TYPE.getMsg(mp4FieldKey.getFieldName())); } }
Create Tag Field using mp4 key Uses the correct subclass for the key @param mp4FieldKey @param value @return @throws KeyNotFoundException @throws FieldDataInvalidException
Mp4Tag::createField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4Tag.java
Apache-2.0
public ByteBuffer convert(Tag tag, int padding) throws UnsupportedEncodingException { try { //Add metadata raw content ByteArrayOutputStream baos = new ByteArrayOutputStream(); Iterator<TagField> it = tag.getFields(); boolean processedArtwork = false; while (it.hasNext()) { TagField frame = it.next(); //To ensure order is maintained dont process artwork until iterator hits it. if (frame instanceof Mp4TagCoverField) { if (processedArtwork) { //ignore } else { processedArtwork = true; //Because each artwork image is held within the tag as a separate field, but when //they are written they are all held under a single covr box we need to do some checks //and special processing here if we have any artwork image (this code only necessary //if we have more than 1 but do it anyway even if only have 1 image) ByteArrayOutputStream covrDataBaos = new ByteArrayOutputStream(); try { for (TagField artwork : tag.getFields(FieldKey.COVER_ART)) { covrDataBaos.write(((Mp4TagField) artwork).getRawContentDataOnly()); } } catch (KeyNotFoundException knfe) { //This cannot happen throw new RuntimeException("Unable to find COVERART Key"); } //Now create the parent Data byte[] data = covrDataBaos.toByteArray(); baos.write(Utils.getSizeBEInt32(Mp4BoxHeader.HEADER_LENGTH + data.length)); baos.write(Mp4FieldKey.ARTWORK.getFieldName().getBytes(StandardCharsets.ISO_8859_1)); baos.write(data); } } else { baos.write(frame.getRawContent()); } } //Wrap into ilst box ByteArrayOutputStream ilst = new ByteArrayOutputStream(); ilst.write(Utils.getSizeBEInt32(Mp4BoxHeader.HEADER_LENGTH + baos.size())); ilst.write(Mp4AtomIdentifier.ILST.getFieldName().getBytes(StandardCharsets.ISO_8859_1)); ilst.write(baos.toByteArray()); //Put into ByteBuffer ByteBuffer buf = ByteBuffer.wrap(ilst.toByteArray()); buf.rewind(); return buf; } catch (IOException ioe) { //Should never happen as not writing to file at this point throw new RuntimeException(ioe); } }
Convert tagdata to rawdata ready for writing to file @param tag @param padding TODO padding parameter currently ignored @return @throws UnsupportedEncodingException
Mp4TagCreator::convert
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagCreator.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagCreator.java
Apache-2.0
Mp4FieldKey(String fieldName, Mp4TagFieldSubType subclassType, Mp4FieldType fieldType) { this.fieldName = fieldName; this.subclassType = subclassType; this.fieldType = fieldType; }
For usual metadata fields that use a data field @param fieldName @param fieldType of data atom
Mp4FieldKey::Mp4FieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
Mp4FieldKey(String fieldName, Mp4TagFieldSubType subclassType,Mp4FieldType fieldType, Tagger tagger) { this.fieldName = fieldName; this.subclassType = subclassType; this.fieldType = fieldType; this.tagger = tagger; }
For usual metadata fields that use a data field, but not recognised as standard field @param fieldName @param fieldType of data atom @param tagger
Mp4FieldKey::Mp4FieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
Mp4FieldKey(String fieldName, Mp4TagFieldSubType subclassType,Mp4FieldType fieldType, int fieldLength) { this.fieldName = fieldName; this.subclassType = subclassType; this.fieldType = fieldType; this.fieldLength = fieldLength; }
For usual metadata fields that use a data field where the field length is fixed such as Byte fields @param fieldName @param fieldType @param fieldLength
Mp4FieldKey::Mp4FieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
Mp4FieldKey(String issuer, String identifier, Mp4FieldType fieldType) { this.issuer = issuer; this.identifier = identifier; this.fieldName = Mp4TagReverseDnsField.IDENTIFIER + ":" + issuer + ":" + identifier; this.subclassType = Mp4TagFieldSubType.REVERSE_DNS; this.fieldType = fieldType; }
For reverse dns fields that use an internal fieldname of '----' and have additional issuer and identifier fields, we use all three seperated by a ':' ) to give us a unique key @param issuer @param identifier @param fieldType of data atom
Mp4FieldKey::Mp4FieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
Mp4FieldKey(String issuer, String identifier, Mp4FieldType fieldType, Tagger tagger) { this.issuer = issuer; this.identifier = identifier; this.fieldName = Mp4TagReverseDnsField.IDENTIFIER + ":" + issuer + ":" + identifier; this.subclassType = Mp4TagFieldSubType.REVERSE_DNS; this.fieldType = fieldType; this.tagger = tagger; }
For reverse dns fields that use an internal fieldname of '----' and have additional issuer and identifier fields, we use all three seperated by a ':' ) to give us a unique key For non-standard fields @param issuer @param identifier @param fieldType of data atom @param tagger
Mp4FieldKey::Mp4FieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public String getFieldName() { return fieldName; }
This is the value of the fieldname that is actually used to write mp4 @return
Mp4FieldKey::getFieldName
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public Mp4FieldType getFieldType() { return fieldType; }
@return fieldtype
Mp4FieldKey::getFieldType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public Mp4TagFieldSubType getSubClassFieldType() { return subclassType; }
@return subclassType
Mp4FieldKey::getSubClassFieldType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public boolean isReverseDnsType() { return identifier.startsWith(Mp4TagReverseDnsField.IDENTIFIER); }
@return true if this is a reverse dns key
Mp4FieldKey::isReverseDnsType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public String getIssuer() { return issuer; }
@return issuer (Reverse Dns Fields Only)
Mp4FieldKey::getIssuer
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public String getIdentifier() { return identifier; }
@return identifier (Reverse Dns Fields Only)
Mp4FieldKey::getIdentifier
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public int getFieldLength() { return fieldLength; }
@return field length (currently only used by byte fields)
Mp4FieldKey::getFieldLength
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4FieldKey.java
Apache-2.0
public Tagger geTagger() { return tagger; }
@return tagger that defined (and probably craeted) instance of field
Mp4NonStandardFieldKey::geTagger
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4NonStandardFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4NonStandardFieldKey.java
Apache-2.0
protected Mp4TagField(ByteBuffer data) throws UnsupportedEncodingException { build(data); }
Used by subclasses that canot identify their id until after they have been built such as ReverseDnsField @param data @throws UnsupportedEncodingException
Mp4TagField::Mp4TagField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
Apache-2.0
protected Mp4TagField(Mp4BoxHeader parentHeader, ByteBuffer data) throws UnsupportedEncodingException { this.parentHeader = parentHeader; build(data); }
Used by reverese dns when reading from file, so can identify when there is a data atom @param parentHeader @param data @throws UnsupportedEncodingException
Mp4TagField::Mp4TagField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
Apache-2.0
protected byte[] getIdBytes() { return getId().getBytes(StandardCharsets.ISO_8859_1); }
@return field identifier as it will be held within the file
Mp4TagField::getIdBytes
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
Apache-2.0
public byte[] getRawContent() throws UnsupportedEncodingException { logger.fine("Getting Raw data for:" + getId()); try { //Create Data Box byte[] databox = getRawContentDataOnly(); //Wrap in Parent box ByteArrayOutputStream outerbaos = new ByteArrayOutputStream(); outerbaos.write(Utils.getSizeBEInt32(Mp4BoxHeader.HEADER_LENGTH + databox.length)); outerbaos.write(getId().getBytes(StandardCharsets.ISO_8859_1)); outerbaos.write(databox); return outerbaos.toByteArray(); } catch (IOException ioe) { //This should never happen as were not actually writing to/from a file throw new RuntimeException(ioe); } }
Convert back to raw content, includes parent and data atom as views as one thing externally @return @throws UnsupportedEncodingException
Mp4TagField::getRawContent
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
Apache-2.0
public byte[] getRawContentDataOnly() throws UnsupportedEncodingException { logger.fine("Getting Raw data for:" + getId()); try { //Create Data Box ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] data = getDataBytes(); baos.write(Utils.getSizeBEInt32(Mp4DataBox.DATA_HEADER_LENGTH + data.length)); baos.write(Mp4DataBox.IDENTIFIER.getBytes(StandardCharsets.ISO_8859_1)); baos.write(new byte[]{0}); baos.write(new byte[]{0, 0, (byte) getFieldType().getFileClassId()}); baos.write(new byte[]{0, 0, 0, 0}); baos.write(data); return baos.toByteArray(); } catch (IOException ioe) { //This should never happen as were not actually writing to/from a file throw new RuntimeException(ioe); } }
Get raw content for the data component only @return @throws UnsupportedEncodingException
Mp4TagField::getRawContentDataOnly
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/Mp4TagField.java
Apache-2.0
public static boolean isValidGenre(String genreId) { //Is it an id (within old id3 range) try { short genreVal = Short.parseShort(genreId); if ((genreVal - 1) <= GenreTypes.getMaxStandardGenreId()) { return true; } } catch (NumberFormatException nfe) { //Do Nothing test as String instead } //Is it the String value ? Integer id3GenreId = GenreTypes.getInstanceOf().getIdForValue(genreId); if (id3GenreId != null) { return id3GenreId <= GenreTypes.getMaxStandardGenreId(); } return false; }
Precheck to see if the value is a valid genre or whether you should use a custom genre. @param genreId @return
Mp4GenreField::isValidGenre
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4GenreField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4GenreField.java
Apache-2.0
public Mp4GenreField(String genreId) { super(Mp4FieldKey.GENRE.getFieldName(), genreId); //Is it an id try { short genreVal = Short.parseShort(genreId); if (genreVal <= GenreTypes.getMaxStandardGenreId()) { numbers = new ArrayList<Short>(); numbers.add(++genreVal); return; } //Default numbers = new ArrayList<Short>(); numbers.add((short) (1)); return; } catch (NumberFormatException nfe) { //Do Nothing test as String instead } //Is it the String value ? Integer id3GenreId = GenreTypes.getInstanceOf().getIdForValue(genreId); if (id3GenreId != null) { if (id3GenreId <= GenreTypes.getMaxStandardGenreId()) { numbers = new ArrayList<Short>(); numbers.add((short) (id3GenreId + 1)); return; } } numbers = new ArrayList<Short>(); numbers.add((short) (1)); }
Construct genre, if cant find match just default to first genre @param genreId key into ID3v1 list (offset by one) or String value in ID3list
Mp4GenreField::Mp4GenreField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4GenreField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4GenreField.java
Apache-2.0
public Mp4TagTextNumberField(String id, String numberArray) { super(id, numberArray); }
Create a new number, already parsed in subclasses @param id @param numberArray
Mp4TagTextNumberField::Mp4TagTextNumberField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
Apache-2.0
protected byte[] getDataBytes() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (Short number : numbers) { try { baos.write(Utils.getSizeBEInt16(number)); } catch (IOException e) { //This should never happen because we are not writing to file at this point. throw new RuntimeException(e); } } return baos.toByteArray(); }
Recreate the raw data content from the list of numbers @return
Mp4TagTextNumberField::getDataBytes
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
Apache-2.0
public Mp4FieldType getFieldType() { return Mp4FieldType.IMPLICIT; }
@return type numeric
Mp4TagTextNumberField::getFieldType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
Apache-2.0
public List<Short> getNumbers() { return numbers; }
@return the individual numbers making up this field
Mp4TagTextNumberField::getNumbers
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextNumberField.java
Apache-2.0
public Mp4TagTextField(String id, ByteBuffer data) throws UnsupportedEncodingException { super(id, data); }
Construct from File @param id parent id @param data atom data @throws UnsupportedEncodingException
Mp4TagTextField::Mp4TagTextField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextField.java
Apache-2.0
public Mp4TagTextField(String id, String content) { super(id); this.content = content; }
Construct new Field @param id parent id @param content data atom data
Mp4TagTextField::Mp4TagTextField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagTextField.java
Apache-2.0
public Mp4TagReverseDnsField(Mp4BoxHeader parentHeader, ByteBuffer data) throws UnsupportedEncodingException { super(parentHeader, data); }
Construct from existing file data @param parentHeader @param data @throws UnsupportedEncodingException
Mp4TagReverseDnsField::Mp4TagReverseDnsField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
Apache-2.0
public Mp4TagReverseDnsField(Mp4FieldKey id, String content) { super(id.getFieldName()); this.issuer = id.getIssuer(); this.descriptor = id.getIdentifier(); this.content = content; }
Newly created Reverse Dns field @param id @param content
Mp4TagReverseDnsField::Mp4TagReverseDnsField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
Apache-2.0
public Mp4TagReverseDnsField(final String fieldName, final String issuer, final String identifier, final String content) { super(fieldName); this.issuer = issuer; this.descriptor = identifier; this.content = content; }
Newly created Reverse Dns field bypassing the Mp4TagField enum for creation of temporary reverse dns fields @param fieldName @param issuer @param identifier @param content
Mp4TagReverseDnsField::Mp4TagReverseDnsField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
Apache-2.0
public void setIssuer(String issuer) { this.issuer = issuer; }
Set the issuer, usually reverse dns of the Companies domain @param issuer
Mp4TagReverseDnsField::setIssuer
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
Apache-2.0
public void setDescriptor(String descriptor) { this.descriptor = descriptor; }
Set the descriptor for the data (what type of data it is) @param descriptor
Mp4TagReverseDnsField::setDescriptor
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagReverseDnsField.java
Apache-2.0
public Mp4TagCoverField() { super(Mp4FieldKey.ARTWORK.getFieldName()); }
Empty CoverArt Field
Mp4TagCoverField::Mp4TagCoverField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
Apache-2.0
public int getDataAndHeaderSize() { return dataAndHeaderSize; }
@return data and header size
Mp4TagCoverField::getDataAndHeaderSize
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
Apache-2.0
public Mp4TagCoverField(ByteBuffer raw,Mp4FieldType imageType) throws UnsupportedEncodingException { super(Mp4FieldKey.ARTWORK.getFieldName(), raw); this.imageType=imageType; if(!Mp4FieldType.isCoverArtType(imageType)) { logger.warning(ErrorMessage.MP4_IMAGE_FORMAT_IS_NOT_TO_EXPECTED_TYPE.getMsg(imageType)); } }
Construct CoverField by reading data from audio file @param raw @param imageType @throws UnsupportedEncodingException
Mp4TagCoverField::Mp4TagCoverField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
Apache-2.0
public Mp4TagCoverField(byte[] data) { super(Mp4FieldKey.ARTWORK.getFieldName(), data); //Read signature if (ImageFormats.binaryDataIsPngFormat(data)) { imageType = Mp4FieldType.COVERART_PNG; } else if (ImageFormats.binaryDataIsJpgFormat(data)) { imageType = Mp4FieldType.COVERART_JPEG; } else if (ImageFormats.binaryDataIsGifFormat(data)) { imageType = Mp4FieldType.COVERART_GIF; } else if (ImageFormats.binaryDataIsBmpFormat(data)) { imageType = Mp4FieldType.COVERART_BMP; } else { logger.warning(ErrorMessage.GENERAL_UNIDENITIFED_IMAGE_FORMAT.getMsg()); imageType = Mp4FieldType.COVERART_PNG; } }
Construct new cover art with binarydata provided Identifies the imageType by looking at the data @param data @throws UnsupportedEncodingException
Mp4TagCoverField::Mp4TagCoverField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
Apache-2.0
public Mp4FieldType getFieldType() { return imageType; }
Return field type, for artwork this also identifies the imagetype @return field type
Mp4TagCoverField::getFieldType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
Apache-2.0
public static String getMimeTypeForImageType(Mp4FieldType imageType) { if(imageType==Mp4FieldType.COVERART_PNG) { return ImageFormats.MIME_TYPE_PNG; } else if(imageType==Mp4FieldType.COVERART_JPEG) { return ImageFormats.MIME_TYPE_JPEG; } else if(imageType==Mp4FieldType.COVERART_GIF) { return ImageFormats.MIME_TYPE_GIF; } else if(imageType==Mp4FieldType.COVERART_BMP) { return ImageFormats.MIME_TYPE_BMP; } else { return null; } }
@param imageType @return the corresponding mimetype
Mp4TagCoverField::getMimeTypeForImageType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagCoverField.java
Apache-2.0
public static Mp4FieldType getFieldType(int fieldClassId) { return fileClassIdFiedTypeMap.get(fieldClassId); }
@param fieldClassId @return the Mp4FieldType that this fieldClassId maps to
Mp4FieldType::getFieldType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4FieldType.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4FieldType.java
Apache-2.0
public static boolean isCoverArtType(Mp4FieldType mp4FieldType) { return coverArtTypes.contains(mp4FieldType); }
@param mp4FieldType @return true if this type is for identifying a image format to be used in cover art
Mp4FieldType::isCoverArtType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4FieldType.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4FieldType.java
Apache-2.0
public Mp4DiscNoField(String discValue) throws FieldDataInvalidException { super(Mp4FieldKey.DISCNUMBER.getFieldName(), discValue); numbers = new ArrayList<Short>(); numbers.add(Short.valueOf("0")); String[] values = discValue.split("/"); switch (values.length) { case 1: try { numbers.add(Short.parseShort(values[0])); } catch (NumberFormatException nfe) { throw new FieldDataInvalidException("Value of:" + values[0] + " is invalid for field:" + id); } numbers.add(Short.valueOf("0")); break; case 2: try { numbers.add(Short.parseShort(values[0])); } catch (NumberFormatException nfe) { throw new FieldDataInvalidException("Value of:" + values[0] + " is invalid for field:" + id); } try { numbers.add(Short.parseShort(values[1])); } catch (NumberFormatException nfe) { throw new FieldDataInvalidException("Value of:" + values[1] + " is invalid for field:" + id); } break; default: throw new FieldDataInvalidException("Value is invalid for field:" + id); } }
Create new Disc Field parsing the String for the discno/total @param discValue @throws org.jaudiotagger.tag.FieldDataInvalidException
Mp4DiscNoField::Mp4DiscNoField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
Apache-2.0
public Mp4DiscNoField(int discNo) { super(Mp4FieldKey.DISCNUMBER.getFieldName(), String.valueOf(discNo)); numbers = new ArrayList<Short>(); numbers.add(Short.valueOf("0")); numbers.add((short) discNo); numbers.add(Short.valueOf("0")); }
Create new Disc No field with only discNo @param discNo
Mp4DiscNoField::Mp4DiscNoField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
Apache-2.0
public Mp4DiscNoField(int discNo, int total) { super(Mp4FieldKey.DISCNUMBER.getFieldName(), String.valueOf(discNo)); numbers = new ArrayList<Short>(); numbers.add(Short.valueOf("0")); numbers.add((short) discNo); numbers.add((short) total); }
Create new Disc No Field with Disc No and total number of discs @param discNo @param total
Mp4DiscNoField::Mp4DiscNoField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
Apache-2.0
public void setDiscNo(int discNo) { numbers.set(DISC_NO_INDEX, (short) discNo); }
Set Disc No @param discNo
Mp4DiscNoField::setDiscNo
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
Apache-2.0
public void setDiscTotal(int discTotal) { numbers.set(DISC_TOTAL_INDEX, (short) discTotal); }
Set total number of discs @param discTotal
Mp4DiscNoField::setDiscTotal
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4DiscNoField.java
Apache-2.0
public Mp4TagByteField(Mp4FieldKey id, String value) throws FieldDataInvalidException { this(id, value, 1); }
Create new field Assume length of 1 which is correct for most but not all byte fields @param id @param value is a String representation of a number @throws org.jaudiotagger.tag.FieldDataInvalidException
Mp4TagByteField::Mp4TagByteField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
Apache-2.0
public Mp4TagByteField(Mp4FieldKey id, String value, int realDataLength) throws FieldDataInvalidException { super(id.getFieldName(), value); this.realDataLength = realDataLength; //Check that can actually be stored numercially, otherwise will have big problems //when try and save the field try { Long.parseLong(value); } catch (NumberFormatException nfe) { throw new FieldDataInvalidException("Value of:" + value + " is invalid for field:" + id); } }
Create new field with known length @param id @param value is a String representation of a number @param realDataLength @throws org.jaudiotagger.tag.FieldDataInvalidException
Mp4TagByteField::Mp4TagByteField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
Apache-2.0
public Mp4TagByteField(String id, ByteBuffer raw) throws UnsupportedEncodingException { super(id, raw); }
Construct from rawdata from audio file @param id @param raw @throws UnsupportedEncodingException
Mp4TagByteField::Mp4TagByteField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
Apache-2.0
protected byte[] getDataBytes() throws UnsupportedEncodingException { //Write original data if (bytedata != null) { return bytedata; } //new field, lets hope the realDataLength is correct switch (realDataLength) { case 2: { //Save as two bytes Short shortValue = Short.valueOf(content); byte[] rawData = Utils.getSizeBEInt16(shortValue); return rawData; } case 1: { //Save as 1 bytes Short shortValue = Short.valueOf(content); byte[] rawData = new byte[1]; rawData[0] = shortValue.byteValue(); return rawData; } case 4: { //Assume could be int Integer intValue = Integer.valueOf(content); byte[] rawData = Utils.getSizeBEInt32(intValue); return rawData; } default: { //TODO throw new RuntimeException(id + ":" + realDataLength + ":" + "Dont know how to write byte fields of this length"); } } }
Return raw data bytes TODO this code should be done better so generalised to any length @return @throws UnsupportedEncodingException
Mp4TagByteField::getDataBytes
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagByteField.java
Apache-2.0
public Mp4TrackField(String trackValue) throws FieldDataInvalidException { super(Mp4FieldKey.TRACK.getFieldName(), trackValue); numbers = new ArrayList<Short>(); numbers.add(Short.valueOf("0")); String[] values = trackValue.split("/"); switch (values.length) { case 1: try { numbers.add(Short.parseShort(values[0])); } catch (NumberFormatException nfe) { throw new FieldDataInvalidException("Value of:" + values[0] + " is invalid for field:" + id); } numbers.add(Short.valueOf("0")); numbers.add(Short.valueOf("0")); break; case 2: try { numbers.add(Short.parseShort(values[0])); } catch (NumberFormatException nfe) { throw new FieldDataInvalidException("Value of:" + values[0] + " is invalid for field:" + id); } try { numbers.add(Short.parseShort(values[1])); } catch (NumberFormatException nfe) { throw new FieldDataInvalidException("Value of:" + values[1] + " is invalid for field:" + id); } numbers.add(Short.valueOf("0")); break; default: throw new FieldDataInvalidException("Value is invalid for field:" + id); } }
Create new Track Field parsing the String for the trackno/total @param trackValue @throws org.jaudiotagger.tag.FieldDataInvalidException
Mp4TrackField::Mp4TrackField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
Apache-2.0
public Mp4TrackField(int trackNo) { super(Mp4FieldKey.TRACK.getFieldName(), String.valueOf(trackNo)); numbers = new ArrayList<Short>(); numbers.add(Short.valueOf("0")); numbers.add((short) trackNo); numbers.add(Short.valueOf("0")); numbers.add(Short.valueOf("0")); }
Create new Track Field with only track No @param trackNo
Mp4TrackField::Mp4TrackField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
Apache-2.0
public Mp4TrackField(int trackNo, int total) { super(Mp4FieldKey.TRACK.getFieldName(), String.valueOf(trackNo)); numbers = new ArrayList<Short>(); numbers.add(Short.valueOf("0")); numbers.add((short) trackNo); numbers.add((short) total); numbers.add(Short.valueOf("0")); }
Create new Track Field with track No and total tracks @param trackNo @param total
Mp4TrackField::Mp4TrackField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
Apache-2.0
public Mp4TrackField(String id, ByteBuffer data) throws UnsupportedEncodingException { super(id, data); }
Construct from filedata @param id @param data @throws UnsupportedEncodingException
Mp4TrackField::Mp4TrackField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
Apache-2.0
public void setTrackNo(int trackNo) { numbers.set(TRACK_NO_INDEX, (short) trackNo); }
Set Track No @param trackNo
Mp4TrackField::setTrackNo
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
Apache-2.0
public void setTrackTotal(int trackTotal) { numbers.set(TRACK_TOTAL_INDEX, (short) trackTotal); }
Set total number of tracks @param trackTotal
Mp4TrackField::setTrackTotal
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TrackField.java
Apache-2.0
public Mp4TagRawBinaryField(Mp4BoxHeader header, ByteBuffer raw) throws UnsupportedEncodingException { super(header.getId()); dataSize = header.getDataLength(); build(raw); }
Construct binary field from rawdata of audio file @param header @param raw @throws java.io.UnsupportedEncodingException
Mp4TagRawBinaryField::Mp4TagRawBinaryField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagRawBinaryField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagRawBinaryField.java
Apache-2.0
protected byte[] getDataBytes() throws UnsupportedEncodingException { return dataBytes; }
Used when creating raw content @return @throws java.io.UnsupportedEncodingException
Mp4TagRawBinaryField::getDataBytes
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagRawBinaryField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagRawBinaryField.java
Apache-2.0
protected void build(ByteBuffer raw) { //Read the raw data into byte array this.dataBytes = new byte[dataSize]; for (int i = 0; i < dataBytes.length; i++) { this.dataBytes[i] = raw.get(); } }
Build from data <p>After returning buffers position will be after the end of this atom @param raw
Mp4TagRawBinaryField::build
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagRawBinaryField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagRawBinaryField.java
Apache-2.0
public Mp4TagBinaryField(String id) { super(id); }
Construct an empty Binary Field @param id
Mp4TagBinaryField::Mp4TagBinaryField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagBinaryField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagBinaryField.java
Apache-2.0
public Mp4TagBinaryField(String id, byte[] data) { super(id); this.dataBytes = data; }
Construct new binary field with binarydata provided @param id @param data @throws UnsupportedEncodingException
Mp4TagBinaryField::Mp4TagBinaryField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagBinaryField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagBinaryField.java
Apache-2.0
public Mp4TagBinaryField(String id, ByteBuffer raw) throws UnsupportedEncodingException { super(id, raw); }
Construct binary field from rawdata of audio file @param id @param raw @throws UnsupportedEncodingException
Mp4TagBinaryField::Mp4TagBinaryField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagBinaryField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/field/Mp4TagBinaryField.java
Apache-2.0
public Mp4DataBox(Mp4BoxHeader header, ByteBuffer dataBuffer) { this.header = header; //Double check if (!header.getId().equals(IDENTIFIER)) { throw new RuntimeException("Unable to process data box because identifier is:" + header.getId()); } //Make slice so operations here don't effect position of main buffer this.dataBuffer = dataBuffer.slice(); //Type type = Utils.getIntBE(this.dataBuffer, Mp4DataBox.TYPE_POS, Mp4DataBox.TYPE_POS + Mp4DataBox.TYPE_LENGTH - 1); if (type == Mp4FieldType.TEXT.getFileClassId()) { content = Utils.getString(this.dataBuffer, PRE_DATA_LENGTH, header.getDataLength() - PRE_DATA_LENGTH, header.getEncoding()); } else if (type == Mp4FieldType.IMPLICIT.getFileClassId()) { numbers = new ArrayList<Short>(); for (int i = 0; i < ((header.getDataLength() - PRE_DATA_LENGTH) / NUMBER_LENGTH); i++) { short number = Utils.getShortBE(this.dataBuffer, PRE_DATA_LENGTH + (i * NUMBER_LENGTH), PRE_DATA_LENGTH + (i * NUMBER_LENGTH) + (NUMBER_LENGTH - 1)); numbers.add(number); } //Make String representation (separate values with slash) StringBuffer sb = new StringBuffer(); ListIterator<Short> iterator = numbers.listIterator(); while (iterator.hasNext()) { sb.append(iterator.next()); if (iterator.hasNext()) { sb.append("/"); } } content = sb.toString(); } else if (type == Mp4FieldType.INTEGER.getFileClassId()) { //TODO byte data length seems to be 1 for pgap and cpil but 2 for tmpo ? //Create String representation for display content = Utils.getIntBE(this.dataBuffer, PRE_DATA_LENGTH, header.getDataLength() - 1) + ""; //But store data for safer writing back to file bytedata = new byte[header.getDataLength() - PRE_DATA_LENGTH]; int pos = dataBuffer.position(); dataBuffer.position(pos + PRE_DATA_LENGTH); dataBuffer.get(bytedata); dataBuffer.position(pos); //Songbird uses this type for trkn atom (normally implicit type) is used so just added this code so can be used //by the Mp4TrackField atom numbers = new ArrayList<Short>(); for (int i = 0; i < ((header.getDataLength() - PRE_DATA_LENGTH) / NUMBER_LENGTH); i++) { short number = Utils.getShortBE(this.dataBuffer, PRE_DATA_LENGTH + (i * NUMBER_LENGTH), PRE_DATA_LENGTH + (i * NUMBER_LENGTH) + (NUMBER_LENGTH - 1)); numbers.add(number); } } else if (type == Mp4FieldType.COVERART_JPEG.getFileClassId()) { content = Utils.getString(this.dataBuffer, PRE_DATA_LENGTH, header.getDataLength() - PRE_DATA_LENGTH, header.getEncoding()); } }
@param header parentHeader info @param dataBuffer data of box (doesnt include parentHeader data)
Mp4DataBox::Mp4DataBox
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4DataBox.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4DataBox.java
Apache-2.0
public byte[] getByteData() { return bytedata; }
Return raw byte data only vaid for byte fields @return byte data
Mp4DataBox::getByteData
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4DataBox.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4DataBox.java
Apache-2.0
Mp4ContentTypeValue(String description, int id) { this.description = description; this.id = id; }
@param description of value @param id used internally
Mp4ContentTypeValue::Mp4ContentTypeValue
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4ContentTypeValue.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4ContentTypeValue.java
Apache-2.0
public String getIdAsString() { return String.valueOf(id); }
@return the id as a string (convenience method for use with mp4.createtagField()
Mp4ContentTypeValue::getIdAsString
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4ContentTypeValue.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4ContentTypeValue.java
Apache-2.0
public EnumSet<Tagger> getTaggers() { return taggers; }
List of taggers using this field, concentrates primarily on the original tagger to start using a field. Tagger.XIPH means the field is either part of the Vorbis Standard or a Vorbis proposed extension to the standard @return
VorbisCommentFieldKey::getTaggers
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentFieldKey.java
Apache-2.0
public VorbisCommentTag read(byte[] rawdata, boolean isFramingBit) throws IOException, CannotReadException { VorbisCommentTag tag = new VorbisCommentTag(); byte[] b = new byte[FIELD_VENDOR_LENGTH_LENGTH]; System.arraycopy(rawdata, FIELD_VENDOR_LENGTH_POS, b, FIELD_VENDOR_LENGTH_POS, FIELD_VENDOR_LENGTH_LENGTH); int pos = FIELD_VENDOR_LENGTH_LENGTH; int vendorStringLength = Utils.getIntLE(b); b = new byte[vendorStringLength]; System.arraycopy(rawdata, pos, b, 0, vendorStringLength); pos += vendorStringLength; tag.setVendor(new String(b, StandardCharsets.UTF_8)); logger.config("Vendor is:"+tag.getVendor()); b = new byte[FIELD_USER_COMMENT_LIST_LENGTH]; System.arraycopy(rawdata, pos, b, 0, FIELD_USER_COMMENT_LIST_LENGTH); pos += FIELD_USER_COMMENT_LIST_LENGTH; int userComments = Utils.getIntLE(b); logger.config("Number of user comments:" + userComments); for (int i = 0; i < userComments; i++) { b = new byte[FIELD_COMMENT_LENGTH_LENGTH]; System.arraycopy(rawdata, pos, b, 0, FIELD_COMMENT_LENGTH_LENGTH); pos += FIELD_COMMENT_LENGTH_LENGTH; int commentLength = Utils.getIntLE(b); logger.config("Next Comment Length:" + commentLength); if(commentLength> JAUDIOTAGGER_MAX_COMMENT_LENGTH) { logger.warning(ErrorMessage.VORBIS_COMMENT_LENGTH_TOO_LARGE.getMsg(commentLength)); break; } else if(commentLength>rawdata.length) { logger.warning(ErrorMessage.VORBIS_COMMENT_LENGTH_LARGE_THAN_HEADER.getMsg(commentLength,rawdata.length)); break; } else { b = new byte[commentLength]; System.arraycopy(rawdata, pos, b, 0, commentLength); pos += commentLength; VorbisCommentTagField fieldComment = new VorbisCommentTagField(b); logger.config("Adding:" + fieldComment.getId()); tag.addField(fieldComment); } } //Check framing bit, only exists when vorbisComment used within OggVorbis if (isFramingBit) { if ((rawdata[pos] & 0x01) != 1) { throw new CannotReadException(ErrorMessage.OGG_VORBIS_NO_FRAMING_BIT.getMsg((rawdata[pos] & 0x01))); } } return tag; }
@param rawdata @param isFramingBit @return logical representation of VorbisCommentTag @throws IOException @throws CannotReadException
VorbisCommentReader::read
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentReader.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentReader.java
Apache-2.0
public VorbisCommentTagField(byte[] raw) throws UnsupportedEncodingException { String field = new String(raw, StandardCharsets.UTF_8); int i = field.indexOf("="); if (i == -1) { //Beware that ogg ID, must be capitalized and contain no space.. this.id = ERRONEOUS_ID; this.content = field; } else { this.id = field.substring(0, i).toUpperCase(); if (field.length() > i) { this.content = field.substring(i + 1); } else { //We have "XXXXXX=" with nothing after the "=" this.content = ""; } } checkCommon(); }
Creates an instance. @param raw Raw byte data of the tagfield. @throws UnsupportedEncodingException If the data doesn't conform "UTF-8" specification.
VorbisCommentTagField::VorbisCommentTagField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
Apache-2.0
public VorbisCommentTagField(String fieldId, String fieldContent) { this.id = fieldId.toUpperCase(); this.content = fieldContent; checkCommon(); }
Creates an instance. @param fieldId ID (name) of the field. @param fieldContent Content of the field.
VorbisCommentTagField::VorbisCommentTagField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
Apache-2.0
private void checkCommon() { this.common = id.equals(TITLE.getFieldName()) || id.equals(ALBUM.getFieldName()) || id.equals(ARTIST.getFieldName()) || id.equals(GENRE.getFieldName()) || id.equals(TRACKNUMBER.getFieldName()) || id.equals(DATE.getFieldName()) || id.equals(DESCRIPTION.getFieldName()) || id.equals(COMMENT.getFieldName()); }
This method examines the ID of the current field and modifies {@link #common}in order to reflect if the tag id is a commonly used one. <br>
VorbisCommentTagField::checkCommon
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
Apache-2.0
protected void copy(byte[] src, byte[] dst, int dstOffset) { // for (int i = 0; i < src.length; i++) // dst[i + dstOffset] = src[i]; /* * Heared that this method is optimized and does its job very near of * the system. */ System.arraycopy(src, 0, dst, dstOffset, src.length); }
This method will copy all bytes of <code>src</code> to <code>dst</code> at the specified location. @param src bytes to copy. @param dst where to copy to. @param dstOffset at which position of <code>dst</code> the data should be copied.
VorbisCommentTagField::copy
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTagField.java
Apache-2.0
public VorbisCommentTag() { }
Only used within Package, hidden because it doesnt set Vendor which should be done when created by end user
VorbisCommentTag::VorbisCommentTag
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public static VorbisCommentTag createNewTag() { VorbisCommentTag tag = new VorbisCommentTag(); tag.setVendor(DEFAULT_VENDOR); return tag; }
Use to construct a new tag properly initialized @return
VorbisCommentTag::createNewTag
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public String getVendor() { return getFirst(VENDOR.getFieldName()); }
@return the vendor, generically known as the encoder
VorbisCommentTag::getVendor
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public void setVendor(String vendor) { if (vendor == null) { vendor = DEFAULT_VENDOR; } super.setField(new VorbisCommentTagField(VENDOR.getFieldName(), vendor)); }
Set the vendor, known as the encoder generally We dont want this to be blank, when written to file this field is written to a different location to all other fields but user of library can just reat it as another field @param vendor
VorbisCommentTag::setVendor
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public TagField createField(VorbisCommentFieldKey vorbisCommentFieldKey, String value) throws KeyNotFoundException,FieldDataInvalidException { if (value == null) { throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg()); } if (vorbisCommentFieldKey == null) { throw new KeyNotFoundException(); } return new VorbisCommentTagField(vorbisCommentFieldKey.getFieldName(), value); }
Create Tag Field using ogg key @param vorbisCommentFieldKey @param value @return @throws org.jaudiotagger.tag.KeyNotFoundException @throws org.jaudiotagger.tag.FieldDataInvalidException
VorbisCommentTag::createField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public TagField createField(String vorbisCommentFieldKey, String value) { if (value == null) { throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg()); } return new VorbisCommentTagField(vorbisCommentFieldKey, value); }
Create Tag Field using ogg key This method is provided to allow you to create key of any value because VorbisComment allows arbitary keys. @param vorbisCommentFieldKey @param value @return
VorbisCommentTag::createField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public List<TagField> getFields(FieldKey genericKey) throws KeyNotFoundException { VorbisCommentFieldKey vorbisCommentFieldKey = tagFieldToOggField.get(genericKey); if (vorbisCommentFieldKey == null) { throw new KeyNotFoundException(); } return super.getFields(vorbisCommentFieldKey.getFieldName()); }
Maps the generic key to the ogg key and return the list of values for this field @param genericKey
VorbisCommentTag::getFields
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException { VorbisCommentFieldKey vorbisCommentFieldKey = tagFieldToOggField.get(genericKey); if (vorbisCommentFieldKey == null) { throw new KeyNotFoundException(); } return super.getAll(vorbisCommentFieldKey.getFieldName()); }
Maps the generic key to the ogg key and return the list of values for this field as strings @param genericKey @return @throws KeyNotFoundException
VorbisCommentTag::getAll
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public List<TagField> get(VorbisCommentFieldKey vorbisCommentKey) throws KeyNotFoundException { if (vorbisCommentKey == null) { throw new KeyNotFoundException(); } return super.getFields(vorbisCommentKey.getFieldName()); }
Retrieve the first value that exists for this vorbis comment key @param vorbisCommentKey @return @throws org.jaudiotagger.tag.KeyNotFoundException
VorbisCommentTag::get
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public boolean hasField(VorbisCommentFieldKey vorbisFieldKey) { return getFields(vorbisFieldKey.getFieldName()).size() != 0; }
@param vorbisFieldKey @return
VorbisCommentTag::hasField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public void deleteField(VorbisCommentFieldKey vorbisCommentFieldKey) throws KeyNotFoundException { if (vorbisCommentFieldKey == null) { throw new KeyNotFoundException(); } super.deleteField(vorbisCommentFieldKey.getFieldName()); }
Delete fields with this vorbisCommentFieldKey @param vorbisCommentFieldKey @throws org.jaudiotagger.tag.KeyNotFoundException
VorbisCommentTag::deleteField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public byte[] getArtworkBinaryData() { String base64data = this.getFirst(VorbisCommentFieldKey.COVERART); byte[] rawdata = Base64Coder.decode(base64data.toCharArray()); return rawdata; }
Retrieve artwork raw data when using the deprecated COVERART format @return
VorbisCommentTag::getArtworkBinaryData
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public String getArtworkMimeType() { return this.getFirst(VorbisCommentFieldKey.COVERARTMIME); }
Retrieve artwork mimeType when using deprecated COVERART format @return mimetype
VorbisCommentTag::getArtworkMimeType
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public boolean isEmpty() { return fields.size() <= 1; }
Is this tag empty <p>Overridden because check for size of one because there is always a vendor tag unless just created an empty vorbis tag as part of flac tag in which case size could be zero @see org.jaudiotagger.tag.Tag#isEmpty()
VorbisCommentTag::isEmpty
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public void addField(TagField field) { if (field.getId().equals(VorbisCommentFieldKey.VENDOR.getFieldName())) { super.setField(field); } else { super.addField(field); } }
Add Field <p>Overidden because there can only be one vendor set @param field
VorbisCommentTag::addField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0