Examples of AudioFile


Examples of entagged.audioformats.AudioFile

    try {
      if (verbose) {
        System.out.print("Reading file \"" + file + "\"...");
      }

      AudioFile audioFile = AudioFileIO.read(file);

      lister.addFile(audioFile, pathPrefix);
      if (verbose)
        System.out.println("OK");
    } catch (CannotReadException cre) {
View Full Code Here

Examples of entagged.audioformats.AudioFile

      } catch (CannotReadException e) {
        System.err.println(e.getMessage());
        tag = new GenericTag();
      }
   
      return new AudioFile(f, info, tag);
     
    } catch ( Exception e ) {
      throw new CannotReadException("\""+f+"\" :"+e,e);
    }
    finally {
View Full Code Here

Examples of entagged.audioformats.AudioFile

    for(int i = 0; i<args.length; i++) {
        File file = new File(args[i]);
       
      System.out.println("Tag content: "+file);
      try {
        AudioFile af = AudioFileIO.read(file);
        System.out.println(af);
       
        List l = af.getTag().get("APIC");
        if(l == null)
            continue;
       
        Iterator it = l.iterator();
        while(it.hasNext()) {
View Full Code Here

Examples of entagged.audioformats.AudioFile

  public File getFileAt(int row) {
    synchronized (files) {
      File f = (File)files.elementAt(row);
      if (!f.isDirectory() && !(f instanceof AudioFile)) {
        try {
          AudioFile audioFile = AudioFileIO.read(f);
          files.set(row, audioFile);
          f = audioFile;
        }
        catch (Exception e) {} // Do Nothing
      }
View Full Code Here

Examples of entagged.audioformats.AudioFile

        return false;
    }
    else if (f.isDirectory() || !(f instanceof AudioFile))
      return "";
    else {
      AudioFile af = (AudioFile) f;
      Tag tag = af.getTag();

      switch (column) {
      case 2:
        return tag.getFirstArtist();
      case 3:
        return tag.getFirstAlbum();
      case 4:
        String ret = tag.getFirstTrack();
        try {
          if (Integer.parseInt(ret) == 0)
            return "";
        }
        catch (Exception e) {} /* return normally */
        return ret;
      case 5:
        return tag.getFirstTitle();
      case 6:
        return getLength(af.getLength());
      case 7:
        return tag.getFirstGenre();
      default:
        return "";
      }
View Full Code Here

Examples of entagged.audioformats.AudioFile

      Iterator it = new ArrayList(ManualFreedbPanel.this.audioFiles
          .getAudioFiles()).iterator();
      int i = 0;
      while (it.hasNext()) {
        AudioFile f = (AudioFile) it.next();

        Tag tag = f.getTag();
        tag.setTitle(fdbrr.getTrackTitle(i).trim());
        tag.setAlbum(ManualFreedbPanel.this.album.getText());
        tag.setGenre(ManualFreedbPanel.this.genre.getTextField()
            .getText());
        tag.setArtist(ManualFreedbPanel.this.artist.getText());
View Full Code Here

Examples of entagged.audioformats.AudioFile

      Iterator it = new ArrayList(FreedbPanel.this.audioFiles
          .getAudioFiles()).iterator();
      int i = 0;
      while (it.hasNext()) {
        AudioFile f = (AudioFile) it.next();

        Tag tag = f.getTag();
        tag.setTitle(fdbrr.getTrackTitle(i).trim());
        tag.setAlbum(FreedbPanel.this.album.getText());
        tag.setGenre(FreedbPanel.this.genre.getTextField().getText());
        tag.setArtist(FreedbPanel.this.artist.getText());
        tag.setYear(FreedbPanel.this.year.getText());
View Full Code Here

Examples of entagged.audioformats.AudioFile

      FreedbReadResult fdbrr = fdbresults[fdbresults.length - 1];

      it = files.iterator();
      i = 0;
      while (it.hasNext()) {
        AudioFile af = (AudioFile) it.next();

        Tag tag = af.getTag();
        tag.setTitle(fdbrr.getTrackTitle(i).trim());
        tag.setAlbum(fdbrr.getAlbum().trim());
        tag.setGenre(fdbrr.getGenre().trim());
        tag.setArtist(fdbrr.getArtist().trim());
        tag.setYear(fdbrr.getYear().trim());
View Full Code Here

Examples of entagged.audioformats.AudioFile

    for(int i = 0 ; i < fichierPhysique.size() ; i++) {
      try {
        String path = (String)fichierPhysique.get(i)[0];
        String fichier = (String)fichierPhysique.get(i)[1];
        File f = new File(path + File.separator + fichier);
        AudioFile music = AudioFileIO.read(f);
        music.getTag().setArtist(newArtist);
        AudioFileIO.write(music);
      }
      catch(CannotReadException e) {
        e.printStackTrace();
      }
View Full Code Here

Examples of entagged.audioformats.AudioFile

     * @see junit.framework.TestCase#runTest()
     */
    protected void runTest() throws Throwable {
        File[] files = parent.copyDir.listFiles(new AudioFileFilter());
        for (int i = 0; i < files.length; i++) {
            AudioFile file = AudioFileIO.read(files[i]);
            file.getTag().setTrack("do not modify");
            AudioFileIO.write(file);
        }
        TrackEnumerator te = new TrackEnumerator();
        te.getSettings().setSaveRun(true);
        te.getSettings().setFiles(new File[] {parent.copyDir});
        File cantwork = new File(parent.copyDir, "CantWork.ogg");
        assertTrue(cantwork.createNewFile());
        int processed = te.process(false);
        assertTrue(processed < 0);
        for (int i = 0; i < files.length; i++) {
            AudioFile file = AudioFileIO.read(files[i]);
            assertTrue("Tag written despite errornous file.", file.getTag()
                    .getFirstTrack().equals("do not modify"));
        }
        assertTrue(cantwork.delete());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.