javax.microedition.media.control
Interface RateControl

All Superinterfaces:
Control
All Known Subinterfaces:
TempoControl

public interface RateControl
extends Control

RateControl controls the playback rate of a Player.

The rate defines the relationship between the Player's media time and its TimeBase. Rates are specified in "milli-percentage".

For example, a rate of 200'000 indicates that media time will pass twice as fast as the TimeBase time once the Player starts. Similiarly, a negative rate indicates that the Player runs in the opposition direction of its TimeBase, i.e. playing in reverse.

All Player must support the default rate 100'000. Players that support only the default rate must not implement this interface. Players that support other rates besides 100'000, should implement this interface and specify the appropriate minimum and maximum playback rates.

For audio, specific implementations may change the playback pitch when changing the playback rate. This may be viewed as an undersirable side-effect. See PitchControl for changing pitch without changing playback rate.

Since:
JDE 4.0.0
See Also:
Player, TempoControl, PitchControl

Method Summary
 int getMaxRate()
          Gets the maximum playback rate supported by the Player.
 int getMinRate()
          Gets the minimum playback rate supported by the Player.
 int getRate()
          Gets the current playback rate.
 int setRate(int millirate)
          Sets the playback rate.
 

Method Detail

getMaxRate

public int getMaxRate()
Gets the maximum playback rate supported by the Player.
Returns:
the maximum rate in "milli-percentage".
Since:
JDE 4.0.0

getMinRate

public int getMinRate()
Gets the minimum playback rate supported by the Player.
Returns:
the minimum rate in "milli-percentage".
Since:
JDE 4.0.0

getRate

public int getRate()
Gets the current playback rate.
Returns:
the current playback rate in "milli-percentage".
Since:
JDE 4.0.0
See Also:
setRate(int)

setRate

public int setRate(int millirate)
Sets the playback rate. The specified rate is 1000 times the percentage of the actual rate. For example, to play back at twice the speed, specify a rate of 200'000.

The setRate method returns the actual rate set by the Player. Player should set their rate as close to the requested value as possible, but are not required to set the rate to the exact value of any argument other than 100'000. A Player is only guaranteed to set its rate exactly to 100'000. If the given rate is less than getMinRate or greater than getMaxRate, the rate will be adjusted to the minimum or maximum supported rate respectively.

If the Player is already started, setRate will immediately take effect.

Parameters:
millirate - The playback rate to set. The rate is given in a "milli-percentage" value.
Returns:
The actual rate set in "milli-percentage".
Since:
JDE 4.0.0
See Also:
getRate()



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.