javax.microedition.media.control
Interface StopTimeControl

All Superinterfaces:
Control

public interface StopTimeControl
extends Control

StopTimeControl allows one to specify a preset stop time for a Player.

Since:
JDE 4.0.0

Field Summary
static long RESET
          Returned by getStopTime if not stop-time is set.
 
Method Summary
 long getStopTime()
          Gets the last value successfully set by setStopTime.
 void setStopTime(long stopTime)
          Sets the media time at which you want the Player to stop.
 

Field Detail

RESET

public static final long RESET
Returned by getStopTime if not stop-time is set.

Value Long.MAX_VALUE is assigned to RESET.

Since:
JDE 4.0.0
Method Detail

getStopTime

public long getStopTime()
Gets the last value successfully set by setStopTime. Returns the constant RESET if no stop time is set. This is the default.
Returns:
The current stop time in microseconds.
Since:
JDE 4.0.0
See Also:
setStopTime(long)

setStopTime

public void setStopTime(long stopTime)
Sets the media time at which you want the Player to stop. The Player will stop when its media time reaches the stop-time. A STOPPED_AT_TIME< event will be delivered through the PlayerListener.

The Player is guaranteed to stop within one second past the preset stop-time (i.e. stop-time <= current-media-time <= stop-time +1 sec.); unless the current media time is already passed the preset sto ptime when the stop time is set. If hte current media time is already past the stop time set, the Player will stop immediately. A STOPPED_AT_TIME event will be delivered. After the Player stops due to the stop-time set, the previously set stop-time will be cleared automatically. Alternatively, the stop time can be explicitly removed by setting it to: RESET.

You can always call setStopTime on a stopped Player. To avoid a potential race condition, it is illegal to call setStopTime on a started Player if a media stop-time has already been set.

Parameters:
stopTime - The time in microseconds at which you want the Player to stop, in media time.
Throws:
IllegalStateException - Thrown if setStopTime is called on a started Player and the media stop-time has already been set.
Since:
JDE 4.0.0
See Also:
getStopTime()



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.