Package org.jaudiotagger.tag.mp4.atom

Examples of org.jaudiotagger.tag.mp4.atom.Mp4MeanBox


    }

    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();

        int genreId = numbers.get(0);
        //Get value, we have to adjust index by one because iTunes labels from one instead of zero
        content = GenreTypes.getInstanceOf().getValueForId(genreId - 1);
View Full Code Here


    }

    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();

    }
View Full Code Here

    }

    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();
        sb.append(numbers.get(DISC_NO_INDEX));
View Full Code Here

        }
        //Usual Case
        else {
            //Read data box, identify the data
            Mp4BoxHeader dataBoxHeader = new Mp4BoxHeader(data);
            Mp4DataBox dataBox = new Mp4DataBox(dataBoxHeader, data);
            setContent(dataBox.getContent());
            data.position(data.position() + dataBoxHeader.getDataLength());

            //Now calculate the id which in order to be unique needs to use all htree values
            id = IDENTIFIER + ":" + issuer + ":" + descriptor;
        }
View Full Code Here

    }

    protected void build(ByteBuffer data) throws UnsupportedEncodingException {
        //Read mean box, set the issuer and skip over data
        Mp4BoxHeader meanBoxHeader = new Mp4BoxHeader(data);
        Mp4MeanBox meanBox = new Mp4MeanBox(meanBoxHeader, data);
        setIssuer(meanBox.getIssuer());
        data.position(data.position() + meanBoxHeader.getDataLength());

        //Read name box, identify what type of field it is
        Mp4BoxHeader nameBoxHeader = new Mp4BoxHeader(data);
        Mp4NameBox nameBox = new Mp4NameBox(nameBoxHeader, data);
View Full Code Here

        setIssuer(meanBox.getIssuer());
        data.position(data.position() + meanBoxHeader.getDataLength());

        //Read name box, identify what type of field it is
        Mp4BoxHeader nameBoxHeader = new Mp4BoxHeader(data);
        Mp4NameBox nameBox = new Mp4NameBox(nameBoxHeader, data);
        setDescriptor(nameBox.getName());
        data.position(data.position() + nameBoxHeader.getDataLength());

        //Issue 198:There is not actually a data atom there cannot cant be because no room for one
        if (parentHeader.getDataLength() == meanBoxHeader.getLength() + nameBoxHeader.getLength()) {
            id = IDENTIFIER + ":" + issuer + ":" + descriptor;
View Full Code Here

            if (trackField.getTrackTotal() != null) {
                trackData.addTrackTotal(trackField.getTrackTotal().intValue());
            }
        }

        Mp4DiscNoField discField = (Mp4DiscNoField) mp4Tag.getFirstField(Mp4FieldKey.DISCNUMBER);
        if (discField != null) {
            if (discField.getDiscNo() != null) {
                trackData.addDisc(discField.getDiscNo().intValue());
            }
            if (discField.getDiscTotal() != null) {
                trackData.addDiscTotal(discField.getDiscTotal().intValue());
            }
        }

        List<TagField> genreFields = new ArrayList<TagField>();
        genreFields.addAll(mp4Tag.get(Mp4FieldKey.GENRE_CUSTOM));
View Full Code Here

        if (!discFieldUpdated) {
            tag.deleteField(FieldKey.DISC_NO);
          tag.addField(tag.createField(FieldKey.DISC_NO, "0"));
        }

        Mp4DiscNoField discField = (Mp4DiscNoField) tag.getFirstField(FieldKey.DISC_TOTAL);
        discField.setDiscTotal(Integer.valueOf(trackData.getDiscTotal()));

        discFieldUpdated = true;
      }
      if (!discFieldUpdated) {
        tag.deleteField(FieldKey.DISC_NO);
View Full Code Here

    @Override
    protected void copySpecificTagFields(Tag tag, Track track) {
        Mp4Tag mp4Tag = (Mp4Tag) tag;
        TrackData trackData = track.getTrackData();

        Mp4TrackField trackField = (Mp4TrackField) mp4Tag.getFirstField(Mp4FieldKey.TRACK);
        if (trackField != null) {
            if (trackField.getTrackNo() != null) {
                trackData.addTrack(trackField.getTrackNo().intValue());
            }
            if (trackField.getTrackTotal() != null) {
                trackData.addTrackTotal(trackField.getTrackTotal().intValue());
            }
        }

        Mp4DiscNoField discField = (Mp4DiscNoField) mp4Tag.getFirstField(Mp4FieldKey.DISCNUMBER);
        if (discField != null) {
View Full Code Here

        if (!trackFieldUpdated) {
            tag.deleteField(FieldKey.TRACK);
          tag.addField(tag.createField(FieldKey.TRACK, "0"));
        }

        Mp4TrackField trackField = (Mp4TrackField) tag.getFirstField(FieldKey.TRACK_TOTAL);
        trackField.setTrackTotal(Integer.valueOf(trackData.getTrackTotal()));

      trackFieldUpdated = true;
      }
      if (!trackFieldUpdated) {
        tag.deleteField(FieldKey.TRACK);
View Full Code Here

TOP

Related Classes of org.jaudiotagger.tag.mp4.atom.Mp4MeanBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.