Search in sources :

Example 1 with Mp4DataBox

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();
}
Also used : Mp4DataBox(org.jaudiotagger.tag.mp4.atom.Mp4DataBox) Mp4BoxHeader(org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader)

Example 2 with Mp4DataBox

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();
}
Also used : Mp4DataBox(org.jaudiotagger.tag.mp4.atom.Mp4DataBox) Mp4BoxHeader(org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader)

Example 3 with Mp4DataBox

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();
}
Also used : Mp4DataBox(org.jaudiotagger.tag.mp4.atom.Mp4DataBox) Mp4BoxHeader(org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader)

Example 4 with Mp4DataBox

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();
}
Also used : Mp4DataBox(org.jaudiotagger.tag.mp4.atom.Mp4DataBox) Mp4BoxHeader(org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader)

Example 5 with Mp4DataBox

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();
}
Also used : Mp4DataBox(org.jaudiotagger.tag.mp4.atom.Mp4DataBox) Mp4BoxHeader(org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader)

Aggregations

Mp4BoxHeader (org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader)7 Mp4DataBox (org.jaudiotagger.tag.mp4.atom.Mp4DataBox)7 Mp4MeanBox (org.jaudiotagger.tag.mp4.atom.Mp4MeanBox)1 Mp4NameBox (org.jaudiotagger.tag.mp4.atom.Mp4NameBox)1