Package javax.media

Examples of javax.media.Time


  }

  public Time getSyncTime()
  {
    if (player == null)
      return new Time(Long.MAX_VALUE);

    return player.getSyncTime();
  }
View Full Code Here


  }

  public Time mapToTimeBase(Time t) throws ClockStoppedException
  {
    if (player == null)
      return new Time(Long.MAX_VALUE);

    return player.mapToTimeBase(t);
  }
View Full Code Here

     * realizing or prefetching the media.
     *
     * @return     A Time of zero nanoseconds.
     */
    public Time getPlayerStartLatency() {
        return new Time(0);
    }
View Full Code Here

     * stop time.  If we are woken up by an event, then
     * recalculate and begin again.  Otherwise, stop the
     * controller when we wake up.
     */
    private synchronized void monitorStopTime() {
        Time stopTime;
        long waittime;

        while(true) {
            //  Wait until the controller is started and the
            //  stop time has been set
View Full Code Here

        if( getState() < Realized ) {
            return DURATION_UNKNOWN;
        } else

        if( getState() < Prefetched ) {
            return new Time(duration);
        } else
       
        return new Time( mic.getDuration() );
    }
View Full Code Here

     *                 the media event
     */
    public void controllerUpdate(ControllerEvent event) {
        if (event instanceof EndOfMediaEvent) {
            // End of the media -- rewind
            player.setMediaTime(new Time(0));
        }
    }
View Full Code Here

        playingTime = -1;
  } else {
      playingTime = player.getDuration().getSeconds();
  }

  Time lat = player.getStartLatency();
  if (lat == Controller.LATENCY_UNKNOWN) {
      latency = 0;
  } else {
      latency = lat.getNanoseconds();
  }

  setAvailable(false);
    }
View Full Code Here

     * realizing or prefetching the media.
     *
     * @return     A Time of zero nanoseconds.
     */
    public Time getPlayerStartLatency() {
        return new Time(0);
    }
View Full Code Here

    assertTrue(Time.ONE_SECOND == 1000000000);
    assertTrue(Time.TIME_UNKNOWN.getNanoseconds() == 9223372036854775806L);
    assertTrue(Time.TIME_UNKNOWN.getNanoseconds() == Long.MAX_VALUE - 1);
   
   
    assertTrue(new Time(1.0).getNanoseconds() == Time.ONE_SECOND);
  }
View Full Code Here

        {
  //      if( getState() < Prefetched ) {
         
          // code borrowed from AbstractPlayer.  TODO: once each track has its own controller, there will be no need for this to be calculated here.
          Time duration = null;
          //Time d = getSource().getDuration(); 
        //if (duration != null && duration.getNanoseconds() != Duration.DURATION_UNKNOWN.getNanoseconds()
         
        final Track[] tracks = filterGraph.getTracks();
        for (int i = 0; i < tracks.length; ++i)
        {
          try
          {
            if (!tracks[i].isEnabled())
              continue;
           Time d = tracks[i].getDuration();
           logger.fine("Track " + i + " has duration of " + toString(d));

           if (duration == null)
           {
             duration = d;
             continue;
           }
                 if (d == DURATION_UNKNOWN ) {
                     duration = d;
                     break;
                 }

                 if( duration != DURATION_UNBOUNDED &&
                     ( d == DURATION_UNBOUNDED ||
                       d.getNanoseconds() >
                       duration.getNanoseconds() ) )
                 {
                     duration = d;
                 }
          }
View Full Code Here

TOP

Related Classes of javax.media.Time

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.