FileDocCategorySizeDatePackage
StopTimeControl.javaAPI DocphoneME MR2 API (J2ME)3551Wed May 02 16:47:14 BST 2007javax.microedition.media.control

StopTimeControl

public interface StopTimeControl implements javax.microedition.media.Control
StopTimeControl allows one to specify a preset stop time for a Player.

Fields Summary
long
RESET
Returned by getStopTime if no stop-time is set.

Value Long.MAX_VALUE is assigned to RESET.

Constructors Summary
Methods Summary
public longgetStopTime()
Gets the last value successfully set by setStopTime. Returns the constant RESET if no stop time is set. This is the default.

return
The current stop time in microseconds.
see
#setStopTime

public voidsetStopTime(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 stop time when the stop time is set. If the 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.

param
stopTime The time in microseconds at which you want the Player to stop, in media time.
exception
IllegalStateException Thrown if setStopTime is called on a started Player and the media stop-time has already been set.
see
#getStopTime