use of org.jaudiotagger.tag.mp4.atom.Mp4DataBox 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.tag.mp4.atom.Mp4DataBox 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.tag.mp4.atom.Mp4DataBox 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.tag.mp4.atom.Mp4DataBox 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();
}
use of org.jaudiotagger.tag.mp4.atom.Mp4DataBox in project MusicDNA by harjot-oberai.
the class Mp4TrackField 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();
// Track number always hold three values, we can discard the first one, the second one is the track no
// and the third is the total no of tracks so only use if not zero
StringBuffer sb = new StringBuffer();
if (numbers != null) {
if ((numbers.size() > TRACK_NO_INDEX) && (numbers.get(TRACK_NO_INDEX) > 0)) {
sb.append(numbers.get(TRACK_NO_INDEX));
}
if ((numbers.size() > TRACK_TOTAL_INDEX) && (numbers.get(TRACK_TOTAL_INDEX) > 0)) {
sb.append("/").append(numbers.get(TRACK_TOTAL_INDEX));
}
}
content = sb.toString();
}
Aggregations