Package org.cmc.music.myid3

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


  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).
      // We'll update those values.
      metadataToWrite = src_set.merged;
    } else
    {
      // The file did not have an ID3v1 or ID3v2 tag, so
      // we need to add new tag(s).
      metadataToWrite = MusicMetadata.createEmptyMetadata();
    }

    // here we set or update the artist field.
    metadataToWrite.setArtist(artist);

    new MyID3().write(srcFile, dstFile, src_set, metadataToWrite);
  }
View Full Code Here


  public HashMap<String, String> parseFile(String Media, String FilePath) {
   
    File File = new File(FilePath);
   
    try {
      IMusicMetadata Tags = new MyID3().read(File).getSimplified();
     
      ParsedData.put("title", Tags.getSongTitle());
      ParsedData.put("artist", Tags.getArtist());
     
    } catch (Exception e) {}
View Full Code Here

     * The listener receives log message as the library parses and writes
     * the mp3 file.
     *
     * It writes them to the console using the Debug class.
     */
    MyID3Listener listener = new MyID3Listener() {
      public void log()
      {
        Debug.debug();
      }

View Full Code Here

  {
    if (listener != null)
      listener.log("reading string with encoding",
          getCharacterEncodingFullName(charEncodingCode));

    UnicodeMetrics unicodeMetrics = UnicodeMetrics
        .getInstance(charEncodingCode);
    int unicodeMetricsEnd = unicodeMetrics.findEndWithoutTerminator(bytes,
        start);
    int unicodeMetricsLength = unicodeMetricsEnd - start;

    String charsetName = getCharacterEncodingName(charEncodingCode);
    return new String(bytes, start, unicodeMetricsLength, charsetName);
View Full Code Here

  }

  private int findStringDataLength(byte bytes[], int start,
      int charEncodingCode) throws IOException
  {
    UnicodeMetrics unicodeMetrics = UnicodeMetrics
        .getInstance(charEncodingCode);
    int unicodeMetricsEnd = unicodeMetrics.findEndWithTerminator(bytes,
        start);
    int unicodeMetricsLength = unicodeMetricsEnd - start;
    return unicodeMetricsLength;
  }
View Full Code Here

      throw new IOException(Debug.getDebug("missing values", values));

    if (listener != null)
      listener.log();

    byte id3v1Tag[] = new MyID3v1().toTag(listener, values, strict);
    if (listener != null)
      listener.log("writing id3v1Tag", id3v1Tag == null ? "null" : ""
          + id3v1Tag.length);

    byte id3v2TailTag[] = new MyID3v2Write().toTag(listener, filter, set,
View Full Code Here

   */
  public void rewriteTags(File src, File dst)
      throws UnsupportedEncodingException, IOException, ID3WriteException
  {
    byte id3v1Tag[] = null;
    ID3Tag tag = new MyID3v1().readID3v1(src, strict);
    if (null != tag)
      id3v1Tag = tag.bytes;

    byte id3v2HeadTag[] = new MyID3v2().readID3v2Head(src, strict);

View Full Code Here

      if (dst.exists())
        throw new IOException(Debug.getDebug("could not delete dst",
            dst));
    }

    boolean hasId3v1 = new MyID3v1().hasID3v1(src);

    long id3v1Length = hasId3v1 ? ID3_V1_TAG_LENGTH : 0;
    long id3v2HeadLength = new MyID3v2().findID3v2HeadLength(src);
    long id3v2TailLength = new MyID3v2().findID3v2TailLength(src, hasId3v1);
View Full Code Here

        return null;

      if (!file.getName().toLowerCase().endsWith(".mp3"))
        return null;

      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());
View Full Code Here

    byte id3v1Tag[] = null;
    ID3Tag tag = new MyID3v1().readID3v1(src, strict);
    if (null != tag)
      id3v1Tag = tag.bytes;

    byte id3v2HeadTag[] = new MyID3v2().readID3v2Head(src, strict);

    boolean hasId3v1 = id3v1Tag != null;
    byte id3v2TailTag[] = new MyID3v2()
        .readID3v2Tail(src, hasId3v1, strict);

    write(src, dst, id3v1Tag, id3v2HeadTag, id3v2TailTag);
  }
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.