All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ocap.media.MediaTimer.html Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version






MediaTimer














org.ocap.media
Class MediaTimer

java.lang.Object
  extended by org.ocap.media.MediaTimer

public class MediaTimer
extends java.lang.Object

This is a timer class that counts time based on a media time of a specified Player. A media time is specified by the JMF specification. An application can specify a range between a first time and a last time. When a current media time exceeds this range, this timer fires and calls a MediaTimerListener.notify() method. I.e., when a current media time passes the last time, this timer fires and calls the notify() method with MEDIA_WENTOFF_LAST event. On the other hand, when a current media time passes the first time in a reverse playback or a skip playback, this timer fires and calls the notify() method with MEDIA_WENTOFF_FIRST event.


Constructor Summary
MediaTimer(javax.media.Player p, MediaTimerListener listener)
          Constructor to make a MediaTimer object that counts time based on the media time line of the specified Player.
 
Method Summary
 javax.media.Time getFirstTime()
          Get a first time that was set to this MediaTimer object.
 javax.media.Time getLastTime()
          Get a last time that was set to this MediaTimer object.
 javax.media.Player getPlayer()
          Get a Player that was tied to this MediaTimer object by a constructor.
 void setFirstTime(javax.media.Time time)
          Set a first time of a time range.
 void setLastTime(javax.media.Time time)
          Set a last time of a time range.
 void start()
          Start this MediaTimer object.
 void stop()
          Stop this MediaTimer object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaTimer

public MediaTimer(javax.media.Player p,
                  MediaTimerListener listener)
Constructor to make a MediaTimer object that counts time based on the media time line of the specified Player.

Parameters:
p - a JMF Player.
Method Detail

setFirstTime

public void setFirstTime(javax.media.Time time)
Set a first time of a time range. This MediaTimer object shall go off when a current time passes the specified first time in a reverse playback or a skip playback. A first time value specified in the past will be cleared, when a new first time is set by this method.

Parameters:
time - a time to go off.

setLastTime

public void setLastTime(javax.media.Time time)
Set a last time of a time range. This MediaTimer object shall go off when a current time passes the specified last time in a normal playback or a skip playback. A last time value specified in the past will be cleared, when a new last time is set by this method.

Parameters:
time - a time to go off.

getFirstTime

public javax.media.Time getFirstTime()
Get a first time that was set to this MediaTimer object.

Returns:
a time to go off.

getLastTime

public javax.media.Time getLastTime()
Get a last time that was set to this MediaTimer object.

Returns:
a time to go off.

start

public void start()
Start this MediaTimer object. A MediaTimerListener is called with TIMER_START event value by the OCAP implementation.


stop

public void stop()
Stop this MediaTimer object. A MediaTimerListener is called with TIMER_STOP event value by the OCAP implementation.


getPlayer

public javax.media.Player getPlayer()
Get a Player that was tied to this MediaTimer object by a constructor.

Returns:
a Player that was tied to this MediaTimer object.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy