Package quicktime.std.clocks

Examples of quicktime.std.clocks.TimeRecord


  {
    logger.info("Handler.doPlayerSetMediaTime (sec): " + t.getSeconds());
   
    try
    {
      m.setTime(new TimeRecord(m.getTimeScale(), (long) (t.getSeconds() * m.getTimeScale())));
    } catch (StdQTException e)
    {
      // TODO handle
      logger.log(Level.WARNING, "" + e, e);
    } catch (QTException e)
View Full Code Here


      else return 0;
  }

  void setTime (long t) throws QTException {
     if (mc != null)
       mc.goToTime(new TimeRecord (mc.getTimeScale(),t));
  }
View Full Code Here

    
     // need code to close and open another movie;
  void openFromPath (String url, long startTime) throws QTException {
     if (currentURL != null) {
       if (currentURL.equals(url)) {
         mc.goToTime(new TimeRecord (mc.getTimeScale(), startTime))// set start-time
         return;
       }
       System.out.println("Falling through url check");
     }
    saveMovie sc = (saveMovie) drawers.get(url);
    if (sc != null) {
      if (currentComponent != null) {
        remove (currentComponent.asComponent());
      }
      mc = sc.mc;
      QTComponent qtc = QTFactory.makeQTComponent(mc);
      currentComponent = qtc;
      mc.goToTime(new TimeRecord (mc.getTimeScale(), startTime));
      add (currentComponent.asComponent(),
         BorderLayout.CENTER);
      //mc.validate();
      //validate();
      currentURL = url;
      currentMovie = sc.movie;
                             
            //invalidate();
            //repaint();
      System.out.println("fetching from cache");
    }
    else
   
       try {
            QTFile qtf = new QTFile (url);
            OpenMovieFile omf = OpenMovieFile.asRead (qtf);
            currentMovie = Movie.fromFile (omf);
            mc = new MovieController (currentMovie);
            mc.enableEditing(false);
      mc.goToTime(new TimeRecord (mc.getTimeScale(), startTime));
            if (currentComponent != null)
                remove (currentComponent.asComponent());
            currentComponent = QTFactory.makeQTComponent(mc);
            add (currentComponent.asComponent(),
                              BorderLayout.CENTER);
View Full Code Here

        // xp = (int) (Math.pow((double)xp,1.414214) * r);
         xp = (int) (Math.pow((double)xp,1.414214) * r);
         if (t-xp < 0) xp= (int) t;
         MovieController mc = getMovieController();
         if (mc != null) {
          TimeRecord ts = new TimeRecord(mc.getTimeScale(),t-xp);
          TimeRecord te = new TimeRecord(mc.getTimeScale(),mc.getCurrentTime()-(t-xp));
          mc.setSelectionBegin(ts);
          mc.setSelectionDuration(te);
          mc.setPlaySelection(true);
         }
         myPresenter.setTime(t-xp);
View Full Code Here

     try {
      movieURL = (String) attributes.get("movie");
      int scale = Integer.parseInt((String) attributes.get("scale"));
      long selectionTime = Long.parseLong((String) attributes.get("selectionTime"));
      long dur = Long.parseLong((String) attributes.get("duration"));
      selection = new TimeRecord(scale,selectionTime);
      duration = new TimeRecord(scale,dur);
     } catch (Exception e) {
      System.out.println("Error reading MovieSelection arguments");
      e.printStackTrace();
     }
    }
View Full Code Here

    }
    if (mc == null) {
     System.out.println("Can't create a moviecontroller for "+movieURL+" in MovieSelection.playMovieSelection()");
    }
    try {
      TimeRecord ts = mc.getSelectionBegin();
      TimeRecord td = mc.getSelectionDuration();
      ts.setValue(selection.getValue());
      ts.setScale(selection.getScale());
      td.setValue(duration.getValue());
      td.setScale(duration.getScale());
     mc.setSelectionBegin(ts);
     mc.setSelectionDuration(td);
     System.out.println("Duration in setMovieSelection: "+td+duration+(td.getValue()-winbase));
    } catch (Exception e) {
     System.out.println("Could not set selection "+selection.toString()+" "+duration.toString()+" in MovieSelection.setMovieSelection()");
    }
   }
View Full Code Here

      JSlider source = (JSlider) event.getSource();

      // set the time in the movie to the new time indicated by the slider
      try
      {
        this.movie.setTime(new TimeRecord(this.movie.getTimeScale(),
          source.getValue() * this.interval));
      } // try
      catch (Exception e)
      {
        e.printStackTrace();
View Full Code Here

      // if no visual track, make something up to avoid exceptions
      if (visualTrack == null)
      {
        return 10;
      } // if (visualTrack == null)
      mov.setTime(new TimeRecord(mov.getTimeScale(), 0));

      // get the distance to the next interesting time
      time = visualTrack.getNextInterestingTime(
        StdQTConstants.nextTimeMediaSample, mov.getTime(), 1);
    } // try
View Full Code Here

      Pict oldPic = mov.getPict(begin);
      this.cache = chopFrame(oldPic);
      Track visualTrack = mov.getIndTrackType(1,
        StdQTConstants.visualMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      mov.setTime(new TimeRecord(timeScale, (int) begin));
      Boolean go = true;
      int lastTime = 0;
      while (go)
      {
        // user terminated execution
        if (Thread.interrupted())
        {
          throw new SchemeException(new Pair(), null, null);
        } // if (Thread.interrupted())

        // find the next frame
        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
        {
          // advance to the next frame
          mov.setTime(new TimeRecord(timeScale, ti.time));
          Pict newPic = mov.getPict(mov.getTime());
          float score = this.frameDifference(newPic);
          if ((score > threshold)
              && (mov.getTime() - lastCut > blockRange * mov.getTimeScale()))
          {
View Full Code Here

      // get the first visual 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;
      while (go)
      {
        // user terminated execution
        if (Thread.interrupted())
        {
          throw new SchemeException(new Pair(), null, null);
        } // if (Thread.interrupted())

        // find next frame
        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
        {
          mov.setTime(new TimeRecord(timeScale, ti.time));
          Pict newPic = mov.getPict(mov.getTime());
          float score = frameDifference(newPic);
          if ((score > this.threshold)
              && (mov.getTime() - this.lastCut
                  > this.blockRange * mov.getTimeScale()))
 
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.