public class MediaClock extends Object implements Clock
| Constructor and Description |
|---|
MediaClock()
constructs a MediaClock
|
| Modifier and Type | Method and Description |
|---|---|
long |
getMediaNanoseconds()
Get the current media time in nanoseconds.
|
Time |
getMediaTime()
Return the current media time.
|
float |
getRate()
Get the current presentation speed.
|
protected 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 long |
validateTime(long t)
Check the time and restricted to not go beyond the duration of
the media.
|
public void setTimeBase(TimeBase master) throws IncompatibleTimeBaseException
setTimeBase in interface Clockmaster - the new master time base.IncompatibleTimeBaseException - thrown if clock cannot accept
the given time base.public void syncStart(Time tbt)
public void setStopTime(Time t)
setStopTime in interface Clockt - the preset stop time.public Time getStopTime()
getStopTime in interface Clockpublic void setMediaTime(Time now)
setMediaTime in interface Clockthe - media time to set to.public Time getMediaTime()
getMediaTime in interface Clockpublic long getMediaNanoseconds()
getMediaNanoseconds in interface Clockprotected void setMediaStart(long t)
t - the lower bound of the media time.protected void setMediaLength(long t)
t - the upper bound of the media time.protected long validateTime(long t)
protected int getState()
public Time getSyncTime()
getSyncTime in interface Clockpublic TimeBase getTimeBase()
getTimeBase in interface Clockpublic Time mapToTimeBase(Time t) throws ClockStoppedException
mapToTimeBase in interface Clockt - media timeClockStoppedException - is thrown if this method is invoked
on a stopped clock.public float setRate(float factor)
Copyright © 2012 code4tv.com. All Rights Reserved.