Esempio n. 1
0
 /** Updates the timecode to the current time in the movie */
 public void updateTimecode() {
   try {
     if (timeSource == TimeSource.RUNTIME) {
       TimeUtil.queryRuntime(movie, timecode);
     } else {
       ((QTTimecode) timecode).updateTimecode();
     }
   } catch (QTException ex) {
     log.error("QTException occured", ex);
   }
 }
Esempio n. 2
0
  private void initTimecode(final Movie movie, TimeSource timeSource)
      throws QTException, QT4JException {

    // If AUTO, use a TimeCodeTrack if found. Otherwise use runtime
    if (timeSource == TimeSource.AUTO) {
      if (TimeUtil.hasTimeCodeTrack(movie)) {
        timeSource = TimeSource.TIMECODETRACK;
      } else {
        timeSource = TimeSource.RUNTIME;
      }
    }

    // Create a timecode using the selected TimeSource
    if (timeSource == TimeSource.RUNTIME) {
      timecode = new Timecode();
      timecode.setFrameRate(TimeUtil.estimateFrameRate(movie));
    } else {
      timecode = new QTTimecode(movie);
    }

    this.timeSource = timeSource;
    timecode.addObserver(new Observer());
  }