use of org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader in project MusicDNA by harjot-oberai.
the class Mp4TagBinaryField method build.
protected void build(ByteBuffer raw) {
Mp4BoxHeader header = new Mp4BoxHeader(raw);
dataSize = header.getDataLength();
// Skip the version and length fields
raw.position(raw.position() + Mp4DataBox.PRE_DATA_LENGTH);
// Read the raw data into byte array
this.dataBytes = new byte[dataSize - Mp4DataBox.PRE_DATA_LENGTH];
for (int i = 0; i < dataBytes.length; i++) {
this.dataBytes[i] = raw.get();
}
// After returning buffers position will be after the end of this atom
}
use of org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader in project MusicDNA by harjot-oberai.
the class Mp4DiscNoField method build.
protected void build(ByteBuffer data) throws UnsupportedEncodingException {
// Data actually contains a 'Data' Box so process data using this
Mp4BoxHeader header = new Mp4BoxHeader(data);
Mp4DataBox databox = new Mp4DataBox(header, data);
dataSize = header.getDataLength();
numbers = databox.getNumbers();
// Disc number always hold four values, we can discard the first one and last one, the second one is the disc no
// and the third is the total no of discs so only use if not zero
StringBuffer sb = new StringBuffer();
if ((numbers.size() > DISC_NO_INDEX) && (numbers.get(DISC_NO_INDEX) > 0)) {
sb.append(numbers.get(DISC_NO_INDEX));
}
if ((numbers.size() > DISC_TOTAL_INDEX) && (numbers.get(DISC_TOTAL_INDEX) > 0)) {
sb.append("/").append(numbers.get(DISC_TOTAL_INDEX));
}
content = sb.toString();
}
use of org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader in project MusicDNA by harjot-oberai.
the class Mp4TagByteField method build.
protected void build(ByteBuffer data) throws UnsupportedEncodingException {
// Data actually contains a 'Data' Box so process data using this
Mp4BoxHeader header = new Mp4BoxHeader(data);
Mp4DataBox databox = new Mp4DataBox(header, data);
dataSize = header.getDataLength();
// Needed for subsequent write
realDataLength = dataSize - Mp4DataBox.PRE_DATA_LENGTH;
bytedata = databox.getByteData();
content = databox.getContent();
}
use of org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader in project MusicDNA by harjot-oberai.
the class Mp4TagTextField method build.
protected void build(ByteBuffer data) throws UnsupportedEncodingException {
// Data actually contains a 'Data' Box so process data using this
Mp4BoxHeader header = new Mp4BoxHeader(data);
Mp4DataBox databox = new Mp4DataBox(header, data);
dataSize = header.getDataLength();
content = databox.getContent();
}
use of org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader in project MusicDNA by harjot-oberai.
the class Mp4TagTextNumberField method build.
protected void build(ByteBuffer data) throws UnsupportedEncodingException {
// Data actually contains a 'Data' Box so process data using this
Mp4BoxHeader header = new Mp4BoxHeader(data);
Mp4DataBox databox = new Mp4DataBox(header, data);
dataSize = header.getDataLength();
content = databox.getContent();
numbers = databox.getNumbers();
}
Aggregations