Search in sources :

Example 1 with Mp4BoxHeader

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

Example 2 with Mp4BoxHeader

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

Example 3 with Mp4BoxHeader

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

Example 4 with Mp4BoxHeader

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

Example 5 with Mp4BoxHeader

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

Aggregations

Mp4BoxHeader (org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader)13 Mp4DataBox (org.jaudiotagger.tag.mp4.atom.Mp4DataBox)7 DefaultMutableTreeNode (org.jaudiotagger.utils.tree.DefaultMutableTreeNode)3 ByteBuffer (java.nio.ByteBuffer)2 CannotReadException (org.jaudiotagger.audio.exceptions.CannotReadException)2 NullBoxIdException (org.jaudiotagger.audio.exceptions.NullBoxIdException)2 Mp4MetaBox (org.jaudiotagger.audio.mp4.atom.Mp4MetaBox)2 NullPadding (org.jaudiotagger.audio.mp4.atom.NullPadding)2 FileChannel (java.nio.channels.FileChannel)1 Mp4StcoBox (org.jaudiotagger.audio.mp4.atom.Mp4StcoBox)1 Mp4Tag (org.jaudiotagger.tag.mp4.Mp4Tag)1 Mp4MeanBox (org.jaudiotagger.tag.mp4.atom.Mp4MeanBox)1 Mp4NameBox (org.jaudiotagger.tag.mp4.atom.Mp4NameBox)1 DefaultTreeModel (org.jaudiotagger.utils.tree.DefaultTreeModel)1