|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface FmTunerControl
Provides a superset of the functionality found in
TunerControl.
To use the FmTunerControl, cast the control
interface returned by Player.getControl()
as an FmTunerControl.
Player p = Manager.createPlayer("capture://radio");
p.realize();
FmTunerControl ftc = (FmTunerControl) p.getControl(FmTunerControl.class.getName());
p.prefetch();
// set the frequency to 88.8MHz and set the default minimum RSSI
ftc.setFrequency(88800, ftc.getDefaultMinSignalStrengthInDb());
p.start();
FmRadioLocale| Field Summary | ||
|---|---|---|
static int |
STATE_CLOSED
FM Radio is not ready for use. |
|
static int |
STATE_OPEN
FM Radio is ready for use. |
|
static int |
STATE_SEEKING
FM radio is seeking for a signal. |
|
static int |
STATE_TUNED
FM radio is tuned to a signal. |
|
static int |
STATE_UNKNOWN
FM radio state is unknown. |
|
| Fields inherited from interface javax.microedition.amms.control.tuner.TunerControl |
|---|
AUTO, MODULATION_AM, MODULATION_FM, MONO, STEREO |
| Method Summary | ||
|---|---|---|
void |
deletePreset(int preset)
Deletes a station preset. |
|
int |
getDefaultMinSignalStrengthInDb()
Gets the default minimum Radio Signal Strength Indication (RSSI) value. |
|
int[] |
getFrequencyAndRssi()
Gets the current frequency and Radio Signal Strength Indication (RSSI) (in decibel). |
|
FmRadioLocale |
getLocale()
Gets the FmRadioLocale object. |
|
int |
getRadioState()
Gets the current radio state. |
|
int |
getSignalStrengthInDb()
Gets the current Radio Signal Strength Indication (RSSI) value in decibel. |
|
boolean |
isExternalAntennaConnected()
Gets the external antenna state. |
|
boolean |
isMute()
Indicates whether or not the radio stream is currently muted. |
|
int[] |
seek(int startFreq,
boolean upwards,
int rssi)
Seeks for next available station. |
|
int |
setFrequency(int frequency,
int rssi)
Tunes the radio to the desired frequency if the frequency is inside the range defined by the FmRadioLocale. |
|
void |
setMute(boolean mute)
Mutes the FM radio stream. |
|
void |
setRdsRbdsReceptionEnabled(boolean enable)
Sets the state for RDS/RBDS reception on/off. |
|
void |
stopSeek()
Stops seeking for the next frequency. |
|
| Methods inherited from interface javax.microedition.amms.control.tuner.TunerControl |
|---|
getFrequency, getMaxFreq, getMinFreq, getModulation, getNumberOfPresets, getPresetFrequency, getPresetModulation, getPresetName, getPresetStereoMode, getSignalStrength, getSquelch, getStereoMode, seek, setFrequency, setPreset, setPreset, setPresetName, setSquelch, setStereoMode, usePreset |
| Field Detail |
|---|
static final int STATE_UNKNOWN
static final int STATE_TUNED
static final int STATE_SEEKING
static final int STATE_OPEN
static final int STATE_CLOSED
| Method Detail |
|---|
int[] seek(int startFreq,
boolean upwards,
int rssi)
throws MediaException
Please note that the seek result may return the currently tuned frequency. This may result from the current signal being so strong that the seek returns success immediately. Try specifying an offset to the starting frequency in that case.
startFreq - The starting frequency.upwards - true to seek for a higher frequency; false to seek for a lower frequency.rssi - The Radio Signal Strength Indication (RSSI) in decibel that the new station should at least have.
int array. int[0] is the frequency found and int[1] is the RSSI in decibel.
MediaException - If the player was not prefetched or started.
int setFrequency(int frequency,
int rssi)
throws MediaException
FmRadioLocale.getMinFreq() and
FmRadioLocale.getMaxFreq().
frequency - The desired frequency.rssi - The desired RSSI value. If the signal strength on the frequency is lower the audio will be muted.
MediaException - If the player was not prefetched; If the frequency to set is out of the range specified by the FmRadioLocale object or is not a valid frequency step.
int[] getFrequencyAndRssi()
throws MediaException
int array. int[0] is the current frequency and int[1] is the RSSI in decibel.
MediaException - If the player was not prefetched or the radio was not tuned.
void stopSeek()
throws MediaException
MediaException - If the radio is not currently seeking for a signal.
int getSignalStrengthInDb()
throws MediaException
MediaException - If the player was not prefetched.int getDefaultMinSignalStrengthInDb()
FmRadioLocale getLocale()
FmRadioLocale object.
If the Player is in the Player.UNREALIZED or Player.REALIZED state the locale may represent the last stored value, while
in Player.PREFETCHED or Player.STARTED state the locale has been determined automatically and will be up to date.
FmRadioLocale
int getRadioState()
throws MediaException
STATE_TUNED or
STATE_SEEKING or STATE_OPEN or STATE_CLOSED or STATE_UNKNOWN.
MediaException - If the player was not realized.boolean isExternalAntennaConnected()
PlayerListener interface.
Use the Player.addPlayerListener(PlayerListener) to register your
PlayerListener.
In the method playerUpdate(Player player, String event, Object eventData) you can compare the event to
"com.rim.antennaConnected" or "com.rim.antennaDisconnected" Strings to catch antenna connection/disconnection state changes.
true if connected; false otherwise.void deletePreset(int preset)
preset - Preset id to be deleted.
IllegalArgumentException - If the preset id does not exist.
void setMute(boolean mute)
throws MediaException
setMute(true) succeeds,
the stream is transformed into a stream of zeroes.
The Player must be in the Player.REALIZED, Player.PREFETCHED or Player.STARTED state before
you invoke this method.
MediaException - If the player was not realized.
boolean isMute()
throws MediaException
true is muted; false otherwise.
MediaException - If the player was not realized.
void setRdsRbdsReceptionEnabled(boolean enable)
throws MediaException
MediaException - If the player was not tuned to a frequency first.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal