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
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 String getIssuer() { return issuer; }
@return the issuer
Mp4TagReverseDnsField::getIssuer
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 String getDescriptor() { return descriptor; }
@return the descriptor
Mp4TagReverseDnsField::getDescriptor
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 Short getDiscNo() { return numbers.get(DISC_NO_INDEX); }
@return
Mp4DiscNoField::getDiscNo
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 Short getDiscTotal() { if(numbers.size()<=DISC_TOTAL_INDEX) { return 0; } return numbers.get(DISC_TOTAL_INDEX); }
@return
Mp4DiscNoField::getDiscTotal
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 Short getTrackNo() { return numbers.get(TRACK_NO_INDEX); }
@return
Mp4TrackField::getTrackNo
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 Short getTrackTotal() { if(numbers.size()<=TRACK_TOTAL_INDEX) { return 0; } return numbers.get(TRACK_TOTAL_INDEX); }
@return
Mp4TrackField::getTrackTotal
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
protected byte[] getDataBytes() throws UnsupportedEncodingException { return dataBytes; }
Used when creating raw content @return @throws UnsupportedEncodingException
Mp4TagBinaryField::getDataBytes
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 int getId() { return id; }
Return id used in the file @return id
Mp4ContentTypeValue::getId
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 String getDescription() { return description; }
This is the value of the fieldname that is actually used to write mp4 @return
Mp4ContentTypeValue::getDescription
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 Mp4MeanBox(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(); //issuer this.issuer = 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)
Mp4MeanBox::Mp4MeanBox
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4MeanBox.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4MeanBox.java
Apache-2.0
Mp4RatingValue(String description, int id) { this.description = description; this.id = id; }
@param description of value @param id used internally
Mp4RatingValue::Mp4RatingValue
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4RatingValue.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4RatingValue.java
Apache-2.0
public int getId() { return id; }
Return id used in the file @return id
Mp4RatingValue::getId
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4RatingValue.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4RatingValue.java
Apache-2.0
public String getDescription() { return description; }
This is the value of the fieldname that is actually used to write mp4 @return
Mp4RatingValue::getDescription
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4RatingValue.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4RatingValue.java
Apache-2.0
public Mp4NameBox(Mp4BoxHeader header, ByteBuffer dataBuffer) { this.header = header; //Double check if (!header.getId().equals(IDENTIFIER)) { throw new RuntimeException("Unable to process name box because identifier is:" + header.getId()); } //Make slice so operations here don't effect position of main buffer this.dataBuffer = dataBuffer.slice(); //issuer this.name = 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)
Mp4NameBox::Mp4NameBox
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4NameBox.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/mp4/atom/Mp4NameBox.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 String getFirst(VorbisCommentFieldKey vorbisCommentKey) throws KeyNotFoundException { if (vorbisCommentKey == null) { throw new KeyNotFoundException(); } return super.getFirst(vorbisCommentKey.getFieldName()); }
Retrieve the first value that exists for this vorbis comment key @param vorbisCommentKey @return @throws org.jaudiotagger.tag.KeyNotFoundException
VorbisCommentTag::getFirst
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(FieldKey genericKey) { VorbisCommentFieldKey vorbisFieldKey = tagFieldToOggField.get(genericKey); return getFields(vorbisFieldKey.getFieldName()).size() != 0; }
@param genericKey @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 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(FieldKey genericKey) throws KeyNotFoundException { if (genericKey == null) { throw new KeyNotFoundException(); } if(genericKey==FieldKey.ALBUM_ARTIST) { switch(TagOptionSingleton.getInstance().getVorbisAlbumArtistSaveOptions()) { case WRITE_ALBUMARTIST: case WRITE_ALBUMARTIST_AND_DELETE_JRIVER_ALBUMARTIST: { VorbisCommentFieldKey vorbisCommentFieldKey = tagFieldToOggField.get(genericKey); deleteField(vorbisCommentFieldKey); return; } case WRITE_JRIVER_ALBUMARTIST: case WRITE_JRIVER_ALBUMARTIST_AND_DELETE_ALBUMARTIST: { deleteField(VorbisCommentFieldKey.ALBUMARTIST_JRIVER); return; } case WRITE_BOTH: { VorbisCommentFieldKey vorbisCommentFieldKey = tagFieldToOggField.get(genericKey); deleteField(vorbisCommentFieldKey); deleteField(VorbisCommentFieldKey.ALBUMARTIST_JRIVER); } } } else { VorbisCommentFieldKey vorbisCommentFieldKey = tagFieldToOggField.get(genericKey); deleteField(vorbisCommentFieldKey); } }
Delete fields with this generic key @param genericKey
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 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
public List<Artwork> getArtworkList() { List<Artwork> artworkList = new ArrayList<Artwork>(1); //Read Old Format if(getArtworkBinaryData()!=null & getArtworkBinaryData().length>0) { Artwork artwork= ArtworkFactory.getNew(); artwork.setMimeType(getArtworkMimeType()); artwork.setBinaryData(getArtworkBinaryData()); artworkList.add(artwork); } //New Format (Supports Multiple Images) List<TagField> metadataBlockPics = this.get(VorbisCommentFieldKey.METADATA_BLOCK_PICTURE); for(TagField tagField:metadataBlockPics) { try { byte[] imageBinaryData = Base64Coder.decode(((TagTextField)tagField).getContent()); MetadataBlockDataPicture coverArt = new MetadataBlockDataPicture(ByteBuffer.wrap(imageBinaryData)); Artwork artwork=ArtworkFactory.createArtworkFromMetadataBlockDataPicture(coverArt); artworkList.add(artwork); } catch(IOException ioe) { throw new RuntimeException(ioe); } catch(InvalidFrameException ife) { throw new RuntimeException(ife); } } return artworkList; }
@return list of artwork images
VorbisCommentTag::getArtworkList
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
private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException { if(artwork.isLinked()) { return new MetadataBlockDataPicture( artwork.getImageUrl().getBytes(StandardCharsets.ISO_8859_1), artwork.getPictureType(), MetadataBlockDataPicture.IMAGE_IS_URL, "", 0, 0, 0, 0); } else { if(!artwork.setImageFromData()) { throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered"); } return new MetadataBlockDataPicture(artwork.getBinaryData(), artwork.getPictureType(), artwork.getMimeType(), artwork.getDescription(), artwork.getWidth(), artwork.getHeight(), 0, 0); } }
Create MetadataBlockPicture field, this is the preferred way of storing artwork in VorbisComment tag now but has to be base encoded to be stored in VorbisComment @return MetadataBlockDataPicture
VorbisCommentTag::createMetadataBlockDataPicture
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(Artwork artwork) throws FieldDataInvalidException { try { char[] testdata = Base64Coder.encode(createMetadataBlockDataPicture(artwork).getRawContent()); String base64image = new String(testdata); TagField imageTagField = createField(VorbisCommentFieldKey.METADATA_BLOCK_PICTURE, base64image); return imageTagField; } catch(UnsupportedEncodingException uee) { throw new RuntimeException(uee); } }
Create Artwork field @param artwork @return @throws 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 void addField(Artwork artwork) throws FieldDataInvalidException { this.addField(createField(artwork)); }
Add artwork field @param artwork @throws FieldDataInvalidException
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
public void setField(String vorbisCommentKey, String value) throws KeyNotFoundException, FieldDataInvalidException { TagField tagfield = createField(vorbisCommentKey,value); setField(tagfield); }
Create and set field with name of vorbisCommentkey @param vorbisCommentKey @param value @throws KeyNotFoundException @throws FieldDataInvalidException
VorbisCommentTag::setField
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(String vorbisCommentKey, String value) throws KeyNotFoundException, FieldDataInvalidException { TagField tagfield = createField(vorbisCommentKey,value); addField(tagfield); }
Create and add field with name of vorbisCommentkey @param vorbisCommentKey @param value @throws KeyNotFoundException @throws FieldDataInvalidException
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
public void deleteArtworkField() throws KeyNotFoundException { //New Method this.deleteField(VorbisCommentFieldKey.METADATA_BLOCK_PICTURE); //Old Method this.deleteField(VorbisCommentFieldKey.COVERART); this.deleteField(VorbisCommentFieldKey.COVERARTMIME); }
Delete all instance of artwork Field @throws KeyNotFoundException
VorbisCommentTag::deleteArtworkField
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 String encode(final String s) { return new String(encode(s.getBytes(StandardCharsets.ISO_8859_1))); }
Encodes a string into Base64 format. No blanks or line breaks are inserted. @param s a String to be encoded. @return A String with the Base64 encoded data.
Base64Coder::encode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public static char[] encode(final byte[] in) { final int iLen = in.length; final int oDataLen = (iLen * 4 + 2) / 3; // output length without padding final int oLen = ((iLen + 2) / 3) * 4; // output length including padding final char[] out = new char[oLen]; int ip = 0; int op = 0; while (ip < iLen) { final int i0 = in[ip++] & 0xff; final int i1 = ip < iLen ? in[ip++] & 0xff : 0; final int i2 = ip < iLen ? in[ip++] & 0xff : 0; final int o0 = i0 >>> 2; final int o1 = ((i0 & 3) << 4) | (i1 >>> 4); final int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6); final int o3 = i2 & 0x3F; out[op++] = map1[o0]; out[op++] = map1[o1]; out[op] = op < oDataLen ? map1[o2] : '='; op++; out[op] = op < oDataLen ? map1[o3] : '='; op++; } return out; }
Encodes a byte array into Base64 format. No blanks or line breaks are inserted. @param in an array containing the data bytes to be encoded. @return A character array with the Base64 encoded data.
Base64Coder::encode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public static byte[] decode(final String s) { return decode(s.toCharArray()); }
Decodes a Base64 string. @param s a Base64 String to be decoded. @return An array containing the decoded data bytes. @throws IllegalArgumentException if the input is not valid Base64 encoded data.
Base64Coder::decode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public static byte[] decode(final char[] in) { int iLen = in.length; if (iLen % 4 != 0) { throw new IllegalArgumentException("Length of Base64 encoded input string is not a multiple of 4."); } while (iLen > 0 && in[iLen - 1] == '=') { iLen--; } final int oLen = (iLen * 3) / 4; final byte[] out = new byte[oLen]; int ip = 0; int op = 0; while (ip < iLen) { final int i0 = in[ip++]; final int i1 = in[ip++]; if(i0==13 && i1==10) continue; final int i2 = ip < iLen ? in[ip++] : 'A'; final int i3 = ip < iLen ? in[ip++] : 'A'; if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) { throw new IllegalArgumentException("Illegal character in Base64 encoded data."); } final int b0 = map2[i0]; final int b1 = map2[i1]; final int b2 = map2[i2]; final int b3 = map2[i3]; if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) { throw new IllegalArgumentException("Illegal character in Base64 encoded data."); } final int o0 = (b0 << 2) | (b1 >>> 4); final int o1 = ((b1 & 0xf) << 4) | (b2 >>> 2); final int o2 = ((b2 & 3) << 6) | b3; out[op++] = (byte) o0; if (op < oLen) { out[op++] = (byte) o1; } if (op < oLen) { out[op++] = (byte) o2; } } return out; }
Decodes Base64 data. @param in a character array containing the Base64 encoded data. @return An array containing the decoded data bytes. @throws IllegalArgumentException if the input is not valid Base64 encoded data.
Base64Coder::decode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public AsfTagCoverField(final byte[] imageData, final int pictureType, final String description, final String mimeType) { super(new MetadataDescriptor(AsfFieldKey.COVER_ART.getFieldName(), MetadataDescriptor.TYPE_BINARY)); this.getDescriptor() .setBinaryValue( createRawContent(imageData, pictureType, description, mimeType)); }
Create New Image Field @param imageData @param pictureType @param description @param mimeType
AsfTagCoverField::AsfTagCoverField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
Apache-2.0
public AsfTagCoverField(final MetadataDescriptor source) { super(source); if (!source.getName().equals(AsfFieldKey.COVER_ART.getFieldName())) { throw new IllegalArgumentException( "Descriptor description must be WM/Picture"); } if (source.getType() != MetadataDescriptor.TYPE_BINARY) { throw new IllegalArgumentException("Descriptor type must be binary"); } try { processRawContent(); } catch (final UnsupportedEncodingException uee) { // Should never happen throw new RuntimeException(uee); // NOPMD by Christian Laireiter on 5/9/09 5:45 PM } }
Creates an instance from a metadata descriptor @param source The metadata descriptor, whose content is published.<br>
AsfTagCoverField::AsfTagCoverField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
Apache-2.0
public AbstractAsfTagImageField(final AsfFieldKey field) { super(field); }
Creates a image tag field. @param field the ASF field that should be represented.
AbstractAsfTagImageField::AbstractAsfTagImageField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
Apache-2.0