Package entagged.audioformats.mp3.util

Examples of entagged.audioformats.mp3.util.Mp3InfoReader


            tag.setAlbum(dataset.getAlbum());
            tag.setGenre(dataset.getGenre());
            tag.setComment(dataset.getComment());
            tag.setYear(dataset.getYear());

            new Id3v1TagWriter().write(tag, raf);
            return true;
        } catch (Exception e) {
            logger.warn("Couldn't write ID3V1 tag", e);
            return false;
        } finally {
View Full Code Here


        }

        RandomAccessFile raf = null;
        try {
            raf = new RandomAccessFile(file, "r");
            Id3v2Tag tag = new Id3v2TagReader().read(raf);
            if (tag != null) {
                if (dataset.getAlbum().equals("") || dataset.getAlbum().length() < tag.getFirstAlbum().length()) {
                    dataset.setAlbum(tag.getFirstAlbum());
                }
                if (dataset.getArtist().equals("") || dataset.getArtist().length() < tag.getFirstArtist().length()) {
View Full Code Here

            tag.set(createTextFrame("TCMP", dataset.isPartOfCompilation() ? "1" : "0"));
            tag.set(createTextFrame("TPOS", dataset.getPartOfSet()));

            File tempFile = File.createTempFile("jmp3renamer_mp3", "tmp");
            tempRaf = new RandomAccessFile(tempFile, "rw");
            new Id3v2TagWriter().write(tag, raf, tempRaf);
            return true;
        } catch (Exception e) {
            logger.warn("Couldn't write ID3V2 tag", e);
            return false;
        } finally {
View Full Code Here

      return new CommId3Frame(data, version);
    // Universal file id
    else if (field.startsWith("UFID"))
      return new UfidId3Frame(data, version);
    else if (field.startsWith("APIC"))
      return new ApicId3Frame(data, version);
    // Any other frame
    else
      return new GenericId3Frame(field, data, version);
  }
View Full Code Here

            continue;
       
        Iterator it = l.iterator();
        while(it.hasNext()) {
            TagField f = (TagField) it.next();
            ApicId3Frame pic = (ApicId3Frame) f;
            byte[] data = pic.getData();
              Image img = ImageIO.read(new ByteArrayInputStream(data));
              System.out.println(img);
             
              JFrame frame = new JFrame("Image viewer");
              frame.getContentPane().add(new JLabel(new ImageIcon(img)));
View Full Code Here

      }
      return new TextId3Frame(field, data, version);
    }
    // Comment
    else if (field.startsWith("COMM"))
      return new CommId3Frame(data, version);
    // Universal file id
    else if (field.startsWith("UFID"))
      return new UfidId3Frame(data, version);
    else if (field.startsWith("APIC"))
      return new ApicId3Frame(data, version);
View Full Code Here

   * (overridden)
   *
   * @see entagged.audioformats.generic.AbstractTag#createCommentField(java.lang.String)
   */
  protected TagField createCommentField(String content) {
    return new CommId3Frame(content);
  }
View Full Code Here

   * @see entagged.audioformats.generic.AbstractTag#getComment()
   */
  public List getComment() {
    List comments = super.getComment();
    String currIso = Locale.getDefault().getISO3Language();
    CommId3Frame top = null;
    for (int i = 0; i < comments.size(); i++) {
      if (comments.get(i) instanceof CommId3Frame) {
        top = (CommId3Frame) comments.get(i);
        if (!top.getLangage().equals(currIso)) {
          top = null;
        } else {
          comments.remove(i);
          break;
        }
View Full Code Here

      return new UfidId3Frame(data, version);
    else if (field.startsWith("APIC"))
      return new ApicId3Frame(data, version);
    // Any other frame
    else
      return new GenericId3Frame(field, data, version);
  }
View Full Code Here

      // Read the complete frame into the byte array.
      data.get(b);

      // Check the frame name once more
      if (!"".equals(field)) {
        Id3Frame f = null;
        /*
         * Now catch possible errors occuring in the data
         * interpretation. Even if a frame is not valid regarding the
         * spec, the rest of the tag could be read.
         */
 
View Full Code Here

TOP

Related Classes of entagged.audioformats.mp3.util.Mp3InfoReader

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.