com.sun.media
类 BasicClock

java.lang.Object
  继承者 com.sun.media.BasicClock
所有已实现的接口:
Clock

public class BasicClock
extends java.lang.Object
implements Clock

BasicClock implements javax.media.Clock. This is not a running thread that implements the clock ticks. It just implements the math and maintains the correct states to perform the computations from media-time to time-base-time.


字段摘要
static int STARTED
           
static int STOPPED
           
 
从接口 javax.media.Clock 继承的字段
RESET
 
构造方法摘要
BasicClock()
           
 
方法摘要
 long getMediaNanoseconds()
          Get the current media time in nanoseconds.
 Time getMediaTime()
          Return the current media time.
 float getRate()
          Get the current presentation speed.
 int getState()
          Return the current state of the clock in either started or stopped state.
 Time getStopTime()
          Return the preset stop time.
 Time getSyncTime()
          Return the Sync Time.
 TimeBase getTimeBase()
          Get the Time Base that the clock is currently using.
 Time mapToTimeBase(Time t)
          Map the the given media-time to time-base-time.
protected  void setMediaLength(long t)
          Set the upper bound of the media time.
protected  void setMediaStart(long t)
          Set the lower bound of the media time.
 void setMediaTime(Time now)
          Set the media time.
 float setRate(float factor)
          Set the rate of presentation: 1.0: normal, 2.0: twice the speed
 void setStopTime(Time t)
          Preset a stop time in media time.
 void setTimeBase(TimeBase master)
          Set a time base on the clock.
 void stop()
          Stop the clock immediately.
 void syncStart(Time tbt)
          Start the clock with the given time-base-time
protected  void throwError(java.lang.Error e)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

STOPPED

public static final int STOPPED
另请参见:
常量字段值

STARTED

public static final int STARTED
另请参见:
常量字段值
构造方法详细信息

BasicClock

public BasicClock()
方法详细信息

setTimeBase

public void setTimeBase(TimeBase master)
                 throws IncompatibleTimeBaseException
Set a time base on the clock. All media-time to time-base-time will be computed with the given time base.

指定者:
接口 Clock 中的 setTimeBase
参数:
master - the new master time base.
抛出:
IncompatibleTimeBaseException - thrown if clock cannot accept the given time base.

syncStart

public void syncStart(Time tbt)
Start the clock with the given time-base-time

指定者:
接口 Clock 中的 syncStart
参数:
the - time base time to start the clock.

stop

public void stop()
Stop the clock immediately.

指定者:
接口 Clock 中的 stop

setStopTime

public void setStopTime(Time t)
Preset a stop time in media time.

指定者:
接口 Clock 中的 setStopTime
参数:
t - the preset stop time.

getStopTime

public Time getStopTime()
Return the preset stop time.

指定者:
接口 Clock 中的 getStopTime
返回:
the preset stop time.

setMediaTime

public void setMediaTime(Time now)
Set the media time. This will be the media presented at the clock's start time.

指定者:
接口 Clock 中的 setMediaTime
参数:
the - media time to set to.

getMediaTime

public Time getMediaTime()
Return the current media time.

指定者:
接口 Clock 中的 getMediaTime
返回:
the current media time.

getMediaNanoseconds

public long getMediaNanoseconds()
Get the current media time in nanoseconds.

指定者:
接口 Clock 中的 getMediaNanoseconds
返回:
the current media time in nanoseconds.

setMediaStart

protected void setMediaStart(long t)
Set the lower bound of the media time.

参数:
t - the lower bound of the media time.

setMediaLength

protected void setMediaLength(long t)
Set the upper bound of the media time.

参数:
t - the upper bound of the media time.

getState

public int getState()
Return the current state of the clock in either started or stopped state.

返回:
the current clock state.

getSyncTime

public Time getSyncTime()
Return the Sync Time. Not yet implementated.

指定者:
接口 Clock 中的 getSyncTime

getTimeBase

public TimeBase getTimeBase()
Get the Time Base that the clock is currently using.

指定者:
接口 Clock 中的 getTimeBase
返回:
the Time Base that the clock is currently using.

mapToTimeBase

public Time mapToTimeBase(Time t)
                   throws ClockStoppedException
Map the the given media-time to time-base-time.

指定者:
接口 Clock 中的 mapToTimeBase
参数:
t - media time
返回:
time base time.
抛出:
ClockStoppedException - is thrown if this method is invoked on a stopped clock.

setRate

public float setRate(float factor)
Set the rate of presentation: 1.0: normal, 2.0: twice the speed. -2.0: twice the speed in reverse.

指定者:
接口 Clock 中的 setRate
参数:
the - speed factor.
返回:
the actual rate the clock is set to.

getRate

public float getRate()
Get the current presentation speed.

指定者:
接口 Clock 中的 getRate
返回:
the current presentation speed.

throwError

protected void throwError(java.lang.Error e)