Package org.cmc.music.metadata

Examples of org.cmc.music.metadata.MusicMetadataSet


      ID3Tag.V1 id3v1 = new MyID3v1().readID3v1(listener, file, strict);
      ID3Tag.V2 id3v2 = new MyID3v2().readID3v2(listener, file,
          id3v1 != null, strict);

      MusicMetadataSet result = MusicMetadataSet.factoryMethod(id3v1,
          id3v2, file.getName(), file.getParentFile().getName());

      return result;
    } catch (Error e)
    {
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

  public static void setFieldExample(File srcFile, File dstFile, String artist)
      throws Exception
  {
    // Since this is an example, I do no checking of parameters.

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

    IMusicMetadata metadataToWrite;
    if (src_set != null)
    {
      // The source file DID have an ID3v1 or ID3v2 tag (or both).
View Full Code Here

TOP

Related Classes of org.cmc.music.metadata.MusicMetadataSet

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.