Package entagged.audioformats.generic

Examples of entagged.audioformats.generic.GenericTag$GenericTagTextField


   *@param  info  the encoding infos over this file
   */
  public AudioFile(File f, EncodingInfo info) {
    super(f.getAbsolutePath());
    this.info = info;
    this.tag = new GenericTag();
  }
View Full Code Here


   *  <p>If the file does not contain any tag, a new empty tag is returned</p>
   *
   *@return  Returns the tag contained in this AudioFile, or a new one if file hasn't any tag.
   */
  public Tag getTag() {
    return (tag == null) ? new GenericTag() : tag;
  }
View Full Code Here

      v1 = null;
      error += "("+e.getMessage()+")";
    }

    if(v1 == null && v2 == null)
      return new GenericTag();
           
   
    if(v2 == null) {
      return v1;
    }
View Full Code Here

  protected EncodingInfo getEncodingInfo( RandomAccessFile raf throws CannotReadException, IOException {
    return ir.read(raf);
  }
 
  protected Tag getTag( RandomAccessFile raf throws CannotReadException {
    return new GenericTag();
  }
View Full Code Here

            if (header == null) {
                throw new NullPointerException(
                        "Header is null, so file couldn't be read properly. "
                                + "(Interpretation of data, not file access rights.)");
            }
            createModifiedCopy(new GenericTag(), header, raf, tempRaf, true);
        } catch (IOException ioe) {
            throw ioe;
        } catch (Exception cre) {
            throw new CannotWriteException(
                    "Cannot modify tag because exception occured:\n   "
View Full Code Here

public class FileRenamerTest extends TestCase {
  public  FileRenamerTest(String name){
    super(name);
  }
  public void testTransformations() throws Throwable {
    GenericTag gt = new GenericTag();
    TransformSet transformSet = new TransformSet(new TransformOperation[] {
        new CapitalizeOp(),
        new StripNonUsASCIIOp()
    });

    String tst1="Hi this (is) the xiii ��";
    String tstr1="Hi This (Is) The Xiii An";
    gt.setComment(tst1);
   
    transformSet.transformFirstCommons(gt);
   
    System.out.println(gt.getFirstComment());
   
    assertEquals(tstr1,gt.getFirstComment());
  }
View Full Code Here

   * @param source
   *            The asf header which contains the information. <br>
   * @return A Tag with all its values.
   */
  public static Tag createTagOf(AsfHeader source) {
    GenericTag result = new GenericTag();
    /*
     * It is possible that the file contains no content description, since
     * that some informations aren't available.
     */
    if (source.getContentDescription() != null) {
      result.setArtist(source.getContentDescription().getAuthor());
      result.setComment(source.getContentDescription().getComment());
      result.setTitle(source.getContentDescription().getTitle());
      AsfCopyrightField cpField = new AsfCopyrightField();
      /*
       * I know I said use the setString() method. However, the value is
       * already a "UTF-16LE" string within is bounds. So Nothing could
       * happen.
       */
      cpField.setContent(source.getContentDescription().getCopyRight());
      result.set(cpField);
    }
    /*
     * It is possible that the file contains no extended content
     * description. In that case some informations cannot be provided.
     */
    if (source.getExtendedContentDescription() != null) {
      result.setTrack(source.getExtendedContentDescription().getTrack());
      result.setYear(source.getExtendedContentDescription().getYear());
      result.setGenre(source.getExtendedContentDescription().getGenre());
      result.setAlbum(source.getExtendedContentDescription().getAlbum());

      /*
       * Now any properties, which don't belong to the common section of
       * entagged.
       */
      ExtendedContentDescription extDesc = source
          .getExtendedContentDescription();
      Iterator it = extDesc.getDescriptors().iterator();
      while (it.hasNext()) {
        ContentDescriptor current = (ContentDescriptor) it.next();
        // If common, it has been added to the result some lines upward.
        if (!current.isCommon()) {
          result.add(new ContentDescriptorTagField(current));
        }
      }
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of entagged.audioformats.generic.GenericTag$GenericTagTextField

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.