Package quicktime.std.clocks

Examples of quicktime.std.clocks.TimeRecord


    // get the video track from mov
    Track visualTrack = mov.getIndTrackType(1,
      StdQTConstants.visualMediaCharacteristic,
      StdQTConstants.movieTrackCharacteristic);
    mov.setTime(new TimeRecord(timeScale, (int) begin));
    Boolean go = true;
    int lastTime = 0;
    do
    {
      TimeInfo ti = visualTrack.getNextInterestingTime(
        StdQTConstants.nextTimeMediaSample, mov.getTime(), 1);

      // if looped to earlier frame or finished selected section
      if ((lastTime > ti.time) || (ti.time >= finish))
      {
        go = false;
      } // if ((lastTime > ti.time) || (ti.time >= finish))
      else
      {
        lastTime = ti.time;
        mov.setTime(new TimeRecord(mov.getTimeScale(), ti.time));
        ++count;
      } // else
    } // do
    while (go);
    return count;
View Full Code Here


      // get the video track from mov
      Track visualTrack = mov.getIndTrackType(1,
        StdQTConstants.visualMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      mov.setTime(new TimeRecord(timeScale, (int)begin));
      Boolean go = true;
      int lastTime = 0;
      do
      {
        if (Thread.interrupted())
        {
          throw new SchemeException(new Pair(), null, null);
        } // if (Thread.interrupted())
        TimeInfo ti = visualTrack.getNextInterestingTime(
          StdQTConstants.nextTimeMediaSample, mov.getTime(), 1);

        // if looped to earlier frame or finished selected section
        if ((lastTime > ti.time) || (ti.time >= finish))
        {
          go = false;
        } // if ((lastTime > ti.time) || (ti.time >= finish))
        else
        {
          // set time to next available frame and get Pict from that time
          mov.setTime(new TimeRecord(mov.getTimeScale(), ti.time));
          frame = mov.getPict(mov.getTime());
          pics.add(frame);
        } // else
      } // do
      while (go);
View Full Code Here

     startSelection.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
       try {
           MovieController mc = getMovieController();
           if (mc != null) {
         TimeRecord ts = mc.getSelectionBegin();
      TimeRecord td = mc.getSelectionDuration();
      System.out.println("Begin ts="+ts);
      System.out.println("Begin td="+td);
         long diff = mc.getCurrentTime();
         System.out.println("Begin current="+diff);
        
         ts.setValue(diff);
         ts = new TimeRecord(ts.getScale(),diff);
         td = new TimeRecord(td.getScale(),0L);
         long winbase=34359738368L;
         // td.setValue(10000L);
         /*
         diff -= ts.getValue();
         if (diff > 0) {
             if (diff > td.getValue()) {
           td.setValue(0);
             } else {
           td.setValue(td.getValue()-diff);
             }
         } else {
             td.setValue(td.getValue()-diff);
         }
         
         ts.setValue( mc.getCurrentTime());
          */
         mc.setSelectionBegin(ts);
         mc.setSelectionDuration(td);
         gd.setRate(1.0);
         gd.requestFocus();
           }
       } catch (QTException e) {
           // if (e.errorCode() != Errors.userCanceledErr)
         e.printStackTrace();
       }
      
         }
     });
     Button endSelection = new Button("End");
     endSelection.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
       try {
           MovieController mc = getMovieController();
           if (mc != null) {
         gd.setRate(0);
         TimeRecord ts = mc.getSelectionBegin();
         TimeRecord td = mc.getSelectionDuration();
         long diff = mc.getCurrentTime();
         System.out.println("End ts="+ts);
         System.out.println("End td="+td);
         System.out.println("End diff="+diff);
        
         long tsx = ts.getValue();
         if (tsx >= winbase) tsx -= winbase;
        
         if (diff < tsx) {
             ts.setValue(diff);
             td.setValue(tsx - diff);
         } else {
             td.setValue(diff-tsx);
         }
         /*
          ts.setValue(diff);
         td.setValue(0L);
        
         diff -= ts.getValue();
         if (diff > 0) {
             td.setValue(diff);
         } else {
             td.setValue(10);
             ts.setValue(mc.getCurrentTime());
         }
         */
         mc.setSelectionBegin(ts); // clears selection and sets start point
         mc.setSelectionDuration(td);
         if (true) {
            // transcript.addItem(mc, ts, td); // mc to set icon
             transcript.addItem(ts, td); // mc to set icon
             transcript.lastComponentVisible();
         }
        
         gd.requestFocus();
           }
       } catch (QTException e) {
           if (e.errorCode() != Errors.userCanceledErr)
         e.printStackTrace();
       }
      
         }
     });

     Button noSelection = new Button("Clear Selection");
     noSelection.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
       try {
           MovieController mc = getMovieController();
           if (mc != null) {
         TimeRecord ts = mc.getSelectionBegin();
         TimeRecord td = mc.getSelectionDuration();
         ts.setValue(mc.getCurrentTime());
         td.setValue(0);
         mc.setSelectionBegin(ts);
         mc.setSelectionDuration(td);
         gd.requestFocus();

           }
View Full Code Here

/*      */   }
/*      */
/*      */   public TimeRecord getTRTime()
/*      */     throws QTException
/*      */   {
/* 1287 */     TimeRecord localTimeRecord = new TimeRecord();
/* 1288 */     int i = GetMovieTime(_ID(), QTObject.ID(localTimeRecord));
/* 1289 */     StdQTException.checkError(GetMoviesError());
/*      */
/* 1291 */     return localTimeRecord;
/*      */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public TimeRecord getCurrentMoviePropertyTime()
/*     */     throws QTException
/*     */   {
/*  60 */     TimeRecord localTimeRecord = new TimeRecord();
/*  61 */     int i = MovieMediaGetCurrentMovieProperty(_ID(), 1953066358, QTObject.ID(localTimeRecord));
/*  62 */     StdQTException.checkError(i);
/*  63 */     return localTimeRecord;
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public TimeRecord getStartTime()
/*     */     throws QTException
/*     */   {
/* 274 */     return new TimeRecord(getIntAt(86), getLongAt(78));
/*     */   }
View Full Code Here

/* 115 */     if (this.m != null) {
/* 116 */       this.theTimeBase = this.m.getTimeBase();
/* 117 */       this.isTimerTicking = (this.theTimeBase.getEffectiveRate() != 0.0F);
/*     */     } else {
/* 119 */       this.theTimeBase = new TimeBase();
/* 120 */       this.theTimeBase.setStartTime(new TimeRecord());
/* 121 */       TimeRecord localTimeRecord = new TimeRecord();
/* 122 */       localTimeRecord.setValue(86400L);
/* 123 */       localTimeRecord.setScale(1);
/* 124 */       this.theTimeBase.setStopTime(localTimeRecord);
/* 125 */       this.theTimeBase.setFlags(1);
/*     */     }
/* 127 */     this.tc = new TC(this.theTimeBase, paramInt1, Math.abs(paramInt2), 0);
/* 128 */     this.tj = new TJ(this.theTimeBase);
View Full Code Here

/*      */   }
/*      */
/*      */   public final TimeRecord getSelectionBegin()
/*      */     throws QTException
/*      */   {
/*  903 */     TimeRecord localTimeRecord = new TimeRecord();
/*  904 */     doAction((short)53, QTObject.ID(localTimeRecord));
/*  905 */     return localTimeRecord;
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public final TimeRecord getSelectionDuration()
/*      */     throws QTException
/*      */   {
/*  914 */     TimeRecord localTimeRecord = new TimeRecord();
/*  915 */     doAction((short)54, QTObject.ID(localTimeRecord));
/*  916 */     return localTimeRecord;
/*      */   }
View Full Code Here

TOP

Related Classes of quicktime.std.clocks.TimeRecord

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.