MediaTimer

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ocap.media
Class MediaTimer

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

    public class MediaTimer

extends 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(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
`Time` | `getFirstTime()` Get a first time that was set to this MediaTimer object.
`Time` | `getLastTime()` Get a last time that was set to this MediaTimer object.
`Player` | `getPlayer()` Get a Player that was tied to this MediaTimer object by a constructor.
`void` | `setFirstTime(Time time)` Set a first time of a time range.
`void` | `setLastTime(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
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MediaTimer

    public MediaTimer(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(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(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 Time getFirstTime()

  Get a first time that was set to this MediaTimer object.

  Returns:
    a time to go off.

### getLastTime

    public 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 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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD