Package com.life.audiotageditor.audio

Examples of com.life.audiotageditor.audio.AudioTag


  public int compare(Viewer viewer, Object e1, Object e2) {
    if (!(e1 instanceof AudioFile) || !(e2 instanceof AudioFile)) {
      return 0;
    }
    AudioTag a1 = ((AudioFileInfo) ((AudioFile) e1).getAudioModelInfo())
        .getAudioTag();
    AudioTag a2 = ((AudioFileInfo) ((AudioFile) e2).getAudioModelInfo())
        .getAudioTag();

    switch (sortType) {
    case TITLE: {
      return a1.getTitle().compareTo(a2.getTitle());
    }
    case -TITLE: {
      return a2.getTitle().compareTo(a1.getTitle());
    }
    case ARTIST: {
      return a1.getArtist().compareTo(a2.getArtist());
    }
    case -ARTIST: {
      return a2.getArtist().compareTo(a1.getArtist());
    }
    case ALBUM: {
      return a1.getAlbum().compareTo(a2.getAlbum());
    }
    case -ALBUM: {
      return a2.getAlbum().compareTo(a1.getAlbum());
    }
    case YEAR: {
      return a1.getYear().compareTo(a2.getYear());
    }
    case -YEAR: {
      return a2.getYear().compareTo(a1.getYear());
    }
    case TRACK: {
      return a1.getTrack().compareTo(a2.getTrack());
    }
    case -TRACK: {
      return a2.getTrack().compareTo(a1.getTrack());
    }
    case COMMENT: {
      return a1.getComment().compareTo(a2.getComment());
    }
    case -COMMENT: {
      return a2.getComment().compareTo(a1.getComment());
    }
    case ALBUM_ARTIST: {
      return a1.getAlbumArtist().compareTo(a2.getAlbumArtist());
    }
    case -ALBUM_ARTIST: {
      return a2.getAlbumArtist().compareTo(a1.getAlbumArtist());
    }
    }
    return 0;
  }
View Full Code Here


  @Override
  public String getColumnText(Object element, int columnIndex) {
    // TODO
    if (element instanceof AudioFile) {
      AudioFile audioFile = (AudioFile) element;
      AudioTag audioTag = ((AudioFileInfo) (audioFile)
          .getAudioModelInfo()).getAudioTag();
      switch (columnIndex) {
      case 0:
        return audioFile.getName();
      case 1:
        return audioTag.getTitle();
      case 2:
        return audioTag.getArtist();
      case 3:
        return audioTag.getAlbum();
      case 4:
        return audioTag.getYear();
      case 5:
        return audioTag.getTrack();
      case 6:
        return audioTag.getGenre();
      case 7:
        return audioTag.getComment();
      case 8:
        return audioTag.getAlbumArtist();
      default:
        break;
      }
    }
    return Constants.STRING_NONE;
View Full Code Here

      return audioModel.getName();
    } else if (id.equals(PATH)) {
      return audioModel.getFullPath();
    }
    if (audioModel instanceof AudioFile) {
      AudioTag audioTag = ((AudioFileInfo) ((AudioFile) audioModel)
          .getAudioModelInfo()).getAudioTag();
      if (id.equals(TAG)) {
        return audioTag.getTag();
      } else if (id.equals(CODEC)) {
        return audioTag.getCodec();
      } else if (id.equals(BIT_RATE)) {
        return audioTag.getBitRate();
      } else if (id.equals(FREQUENCY)) {
        return audioTag.getFrequency();
      } else if (id.equals(LENGTH)) {
        return audioTag.getLength();
      } else if (id.equals(MODIFIED)) {
        return audioTag.getModified();
      }
    }
    return null;
  }
View Full Code Here

    this.path = path;
  }

  public synchronized AudioTag getAudioTag() {
    try {
      return new AudioTag(AudioFileIO.read(new File(path)));
    } catch (CannotReadException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    } catch (TagException e) {
View Full Code Here

    }

    @Override
    public Object getValue(Object element, String property) {
      if (element instanceof AudioFile) {
        AudioTag audioTag = ((AudioFileInfo) ((AudioFile) element)
            .getAudioModelInfo()).getAudioTag();
        return ReflectUtil.getProperty(audioTag, property);
      }
      return Constants.STRING_NONE;
    }
View Full Code Here

      if (null == tableItem) {
        return;
      }
      AudioFile data = (AudioFile) tableItem.getData();
      if (data instanceof AudioFile) {
        AudioTag audioTag = ((AudioFileInfo) (data).getAudioModelInfo())
            .getAudioTag();
        if (value.equals(ReflectUtil.getProperty(audioTag, property))) {
          return;
        }
        ReflectUtil.setProperty(audioTag, property, value.toString());
View Full Code Here

  protected void okPressed() {
    String audioFolderTextValue = audioFolderText.getText();
    String audioTagDetailTextValue = audioTagDetailText.getText();
    if (audioFolderTextValue != null
        && !(audioTagDetailTextValue.isEmpty())) {
      AudioTag audioTag = new AudioTag();
      audioTag.setArtist(artistText.getText());
      audioTag.setAlbum(albumText.getText());
      audioTag.setYear(yearText.getText());
      audioTag.setGenre(genreText.getText());
      audioTag.setComment(commentText.getText());
      audioTag.setAlbumArtist(albumArtistText.getText());
      AudioFileUtil.saveAudioFile(audioFolderTextValue,
          audioTagDetailTextValue, audioTag);

      AudioView audioView = (AudioView) PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage()
View Full Code Here

TOP

Related Classes of com.life.audiotageditor.audio.AudioTag

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.