Package org.cmc.music.myid3

Examples of org.cmc.music.myid3.ID3Tag$V1


      System.out.println("Currently no track played!");
    } else {
      if (track.isFileOrCDTrack()) {
        System.out.println("Content of the ID3Tags for the currently placyed track:");
        try {
          ID3Tag id3 = ((FileOrCDTrack) track).getID3Tag();
          System.out.println("Song Title: " + id3.getSongTitle());
          System.out.println("Artist Name: " + id3.getArtistName());
          System.out.println("Album Name: " + id3.getAlbumTitle());
          System.out.println("Genre: " + id3.getGenreAsString());
        } catch (ID3TagException e) {
          e.printStackTrace();
        }

      } else {
View Full Code Here


  }

  public void persist(String directory) {
    MP3File mp3File = new MP3File(new File(directory + getFull()));
    ID3V1Tag tag1 = null;
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
    }
    if(!"".equals(getTitle())) tag1.setTitle(getTitle());
    tag1.setAlbum(getAlbum());
    tag1.setArtist(getArtist());
    tag1.setComment(getComment());
    try {
      tag1.setGenre(Genre.lookupGenre(getGenre()));
    } catch (ID3Exception e) {
    }
    tag1.setYear(getYear());
    mp3File.setID3Tag(tag1);
    try {
      mp3File.sync();
    } catch (ID3Exception e) {
    }
View Full Code Here

  public String getComment() {
    return guard(tag1.getComment());
  }

  public String getGenre() {
    Genre genre = tag1.getGenre();
    if(genre!=null) return genre.toString();
    return "";
  }
View Full Code Here

    MP3File mp3File = new MP3File(file);
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
    }
  }
View Full Code Here

    MP3File mp3File = new MP3File(new File(directory + getFull()));
    ID3V1Tag tag1 = null;
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
    }
    if(!"".equals(getTitle())) tag1.setTitle(getTitle());
    tag1.setAlbum(getAlbum());
    tag1.setArtist(getArtist());
    tag1.setComment(getComment());
View Full Code Here

      {
        Debug.debug("log: " + s);
      }
    };

    MusicMetadataSet srcSet = new MyID3().read(mp3File, listener);

    Debug.debug("srcSet", srcSet);

    String name = mp3File.getName();
    if (name.toLowerCase().endsWith(".mp3"))
      name = name.substring(0, name.length() - 4);
    name += ".1.mp3";
    File temp = new File(mp3File.getParentFile(), name);

    MyID3v2Write.Filter filter = new MyID3v2Write.Filter() {
      public boolean filter(String frameid)
      {
        /*
         * Only write "song title" and "album name" frames.
         *
         * Discard all others (such as "artist name").
         */
        if (frameid.equals("TIT2"))
          return false;
        if (frameid.equals("TALB"))
          return false;

        return true;
      }
    };

    IMusicMetadata metadata = srcSet.merged;
    new MyID3().write(mp3File, temp, srcSet, metadata, filter, listener);

    MusicMetadataSet temp_set = new MyID3().read(temp, listener);
  }
View Full Code Here

      return;

    Debug.debug();
    Debug.debug("file", mp3File);

    MusicMetadataSet src_set = new MyID3().read(mp3File);

    if (src_set == null)
    {
      Debug.debug("No id3 metadata found.");
      return;
View Full Code Here

      return;

    Debug.debug();
    Debug.debug("file", mp3File);

    MusicMetadataSet src_set = new MyID3().read(mp3File);

    if (src_set == null)
    {
      Debug.debug("No id3 metadata found.");
      return;
View Full Code Here

      return;

    Debug.debug();
    Debug.debug("file", mp3File);

    MusicMetadataSet src_set = new MyID3().read(mp3File);

    if (src_set == null)
    {
      Debug.debug("No id3 metadata found.");
      return;
View Full Code Here

      Debug.debug();
      Debug.debug("file", src);

      File dst = new File(dstFolder, src.getName());

      MusicMetadataSet src_set = new MyID3().read(src);

      if (src_set == null)
      {
        System.out.println("No id3 metadata found.");
        continue;
      }

      Debug.debug("src_set", src_set); // dump all info.
      Debug.debug("src_set", src_set.merged.getArtist());
      Debug.debug("src_set", src_set.merged.getAlbum());
      Debug.debug("src_set", src_set.merged.getSongTitle());

      String id3v1_artist = src_set.id3v1Raw.values.getArtist();
      String id3v2_artist = src_set.id3v2Raw.values.getArtist();

      byte id3v1_tag_bytes[] = src_set.id3v1Raw.bytes; // tag bytes
      byte id3v2_tag_bytes[] = src_set.id3v2Raw.bytes; // tag bytes

      Vector id3v2_frames = src_set.id3v2Raw.frames; //
      if (id3v2_frames.size() > 1)
      {
        MyID3v2Frame first_frame = (MyID3v2Frame) id3v2_frames.get(0);
        String frame_frame_id = first_frame.frameID;
        byte frame_frame_bytes[] = first_frame.dataBytes;
      }

      new MyID3().write(src, dst, src_set, src_set.merged);
      if (dst.exists())
      {
        MusicMetadataSet dst_set = new MyID3().read(dst);
        Debug.debug("dst_set", dst_set);

        String src_s = src_set.merged.toString();
        String dst_s = dst_set.merged.toString();
        if (!src_s.equals(dst_s))
View Full Code Here

TOP

Related Classes of org.cmc.music.myid3.ID3Tag$V1

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.