|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AudioOutputControl
is an interface for setting application
audio output mode.
The AudioOutputControl is a Global Control and will effect all players.
When the MIDlet which set the audio routing is finished with the audio change then it must set it back to DEFAULT.
Example:
import javax.microedition.amms.*;
AudioOutputControl iAudioOutputControl = (AudioOutputControl) GlobalManager
.getControl("com.nokia.mid.media.AudioOutputControl");
iAudioOutputControl.setOutputMode(AudioOutputControl.PRIVATE);
AudioOutput
audioOutput = iAudioOutputControl.getCurrent();
int mode = audioOutput.getActiveOutputMode();
Field Summary | |
static int |
ALL
The ALL audio output mode. |
static int |
DEFAULT
The DEFAULT audio output mode. |
static int |
NONE
The NONE audio output mode. |
static int |
PRIVATE
The PRIVATE audio output mode. |
static int |
PUBLIC
The PUBLIC audio output mode. |
Method Summary | |
int[] |
getAvailableOutputModes()
Get all supported audio output modes |
AudioOutput |
getCurrent()
Get an AudioOutput object which consists device type and the actual mode of the audio output. |
int |
getOutputMode()
Get the currently set audio output mode. |
int |
setOutputMode(int mode)
Sets the preferred audio output mode. |
Field Detail |
public static final int DEFAULT
No Preference. The audio routing is restored to the default value.
Value 0 is assigned to DEFAULT
.
public static final int ALL
Audio is routed to one public and one private output at the same time.
The primary output method within public and private outputs is selected
by the device and can change dynamically when external peripherals are
connected or disconnected by the user (see PUBLIC
and PRIVATE
for
their priorities).
Value 1 is assigned to ALL
.
public static final int NONE
Audio is not routed to any output.
Value 2 is assigned to NONE
.
public static final int PRIVATE
Audio is routed to earpiece or wired / wireless(BT) headset if connected. If there are several private output methods available at the same time audio is routed to only one of those selected with following priority order 1) wired headset 2) wireless headset 3) earpiece.
Value 3 is assigned to PRIVATE
.
public static final int PUBLIC
Audio is routed to loudspeaker, wireless(BT) speakers or TV output. If there are several public output methods available at the same time audio is routed to only one of those selected with following priority order: to be defined.
Value 4 is assigned to PUBLIC
.
Method Detail |
public int[] getAvailableOutputModes()
public int getOutputMode()
DEFAULT
if none has been set.
This does not return the actual audio output mode of the device. The AudioOutput can be used to provide the actual audio output mode.
public AudioOutput getCurrent()
Get an AudioOutput object which consists device type and the actual mode of the audio output.
public int setOutputMode(int mode)
This will effect all players.
mode
- one of the supported input modes
java.lang.IllegalArgumentException
- with message "audio output mode is
not valid" when the audio output mode is not valid
java.lang.IllegalStateException
- with message "Accessory connected" if
unable to change the audio routing due to an accessory connected
java.lang.SecurityException
- with message "Permission denied" if the
called does not have permission to control the audio routing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |