コード例 #1
0
ファイル: DvdAnalyzer.java プロジェクト: thedarkman/feinrip
  /** Gets a description of all {@link Track} of the DVD. */
  public Track[] getTracks() {
    Track[] result = new Track[info.getTitles().size()];

    for (int ix = 0; ix < result.length; ix++) {
      DvdTitle title = info.getTitle(ix);
      DvdTitleSet vts = title.getTitleSet();

      Track track = new Track();
      track.setTrack(title.getTitle());
      track.setAngles(title.getAngles());
      track.setChapters(title.getChapters());
      track.setDimension(new Dimension(vts.getWidth(), vts.getHeight()));

      long lengthSec = title.getTotalTimeMs() / 1000L;
      track.setLength(String.format("%d:%02d", (int) (lengthSec / 60), (int) (lengthSec % 60)));
      track.setAspect(AspectRatio.valueOf(vts.getAspect().name()));

      result[ix] = track;
    }

    return result;
  }