|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TunerControl
TunerControl
is an interface for controlling the
tuner settings of a Player
.
If no parameters concerning frequency, modulation or stereo mode
were specified when the Player
was created, they are
assigned device-specific default values. The application must then
query and/or change them accordingly.
The presets of TunerControl
are referring to presets
of the native tuner application and its settings. Using and setting of the presets
only read and write the preset data respectively. If some preset has been
taken in to use by usePreset
the settings of the tuner do not
change if the presets are changed after that unless usePreset
is called again.
If no native tuner application or settings
exist then presets of TunerControl
are not usable either
and getNumberOfPresets
returns 0.
Naturally, Java applications can always map and
store frequencies and channel names internally.
The modulations supported by the tuner can be retrieved from system
property tuner.modulations
.
Field Summary | ||
---|---|---|
static int |
AUTO
Automatic stereo mode. |
|
static String |
MODULATION_AM
AM modulation. |
|
static String |
MODULATION_FM
FM modulation. |
|
static int |
MONO
Monaural mode. |
|
static int |
STEREO
Stereo mode. |
Method Summary | ||
---|---|---|
int |
getFrequency()
Gets the frequency which the tuner has been tuned to. |
|
int |
getMaxFreq(String modulation)
Gets the maximum frequency supported by this tuner with the given modulation. |
|
int |
getMinFreq(String modulation)
Gets the minimum frequency supported by this tuner with the given modulation. |
|
String |
getModulation()
Gets the modulation in use. |
|
int |
getNumberOfPresets()
Gets the number of presets. |
|
int |
getPresetFrequency(int preset)
Gets the preset's frequency. |
|
String |
getPresetModulation(int preset)
Gets the preset's modulation. |
|
String |
getPresetName(int preset)
Gets the preset name. |
|
int |
getPresetStereoMode(int preset)
Gets the preset's stereo mode. |
|
int |
getSignalStrength()
Gets the strength of the recepted signal. |
|
boolean |
getSquelch()
Gets the current squelching (muting in frequencies without broadcast) setting. |
|
int |
getStereoMode()
Gets the stereo mode in use. |
|
int |
seek(int startFreq,
String modulation,
boolean upwards)
Seeks for the next broadcast signal. |
|
int |
setFrequency(int freq,
String modulation)
Tunes to the given frequency or to the closest supported frequency. |
|
void |
setPreset(int preset)
Configures the preset using current frequency and modulation (and stereo mode if native presets support storing it). |
|
void |
setPreset(int preset,
int freq,
String mod,
int stereoMode)
Configures the preset using given settings. |
|
void |
setPresetName(int preset,
String name)
Sets the preset name. |
|
void |
setSquelch(boolean squelch)
Sets squelching on or off. |
|
void |
setStereoMode(int mode)
Sets the stereo mode. |
|
void |
usePreset(int preset)
Tunes the tuner by using settings specified in the preset. |
Field Detail |
---|
static final int MONO
static final int STEREO
static final int AUTO
static final String MODULATION_FM
static final String MODULATION_AM
Method Detail |
---|
int getMinFreq(String modulation)
modulation
- the modulation whose supported minimum frequency
is asked
IllegalArgumentException
- if the modulation
is not supported or it is null
int getMaxFreq(String modulation)
modulation
- the modulation whose supported maximum frequency
is asked
IllegalArgumentException
- if the modulation
is not supported or it isnullint setFrequency(int freq, String modulation)
freq
- the frequency in 100 Hertz that will be taken into use.
If that frequency is not supported, the closest supported
frequency will be taken into use.modulation
- the modulation to be used. TunerControl
specifies
predefined constants MODULATION_FM
and MODULATION_AM
but other modulations can be supported as well. Supported modulations can be queried
by System
property tuner.modulations
.
IllegalArgumentException
- if freq
is not inside the frequency band supported
by the device or if the modulation
is not supported or the modulation
is nullint getFrequency()
int seek(int startFreq, String modulation, boolean upwards) throws MediaException
After seeking, the frequency of the Player is the one that was returned or if nothing was found, the original frequency.
startFreq
- the frequency in 100 Hertz wherefrom the scan starts (inclusive)modulation
- the modulation to be used. TunerControl
specifies
predefined constants MODULATION_FM
and MODULATION_AM
but other modulations can be supported as well. Supported modulations can be queried
by System
property tuner.modulations
.upwards
- if true
, the scan proceeds towards higher frequencies,
otherwise towards lower frequencies
IllegalArgumentException
- if startFreq
is not between the supported minimum
and maximum frequencies or if the modulation
is
null
MediaException
- if the seek functionality is not available for the given modulationboolean getSquelch()
true
if squelch is on or false
if squelch is offvoid setSquelch(boolean squelch) throws MediaException
squelch
- true
to turn the squelch on or false
to turn the squelch off
MediaException
- if the given squelch setting is not supportedString getModulation()
int getSignalStrength() throws MediaException
MediaException
- if querying the signal strength is not supportedint getStereoMode()
MONO
,
STEREO
or AUTO
.void setStereoMode(int mode)
mode
- the stereo mode to be used. Stereo mode is one of MONO
,
STEREO
or AUTO
.
IllegalArgumentException
- if the given mode is not supportedint getNumberOfPresets()
void usePreset(int preset)
usePreset
call do not tune the tuner automatically.
preset
- the preset to be used
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presetsvoid setPreset(int preset)
preset
- the preset to be set
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presets
SecurityException
- if setting presets has been prohibitedvoid setPreset(int preset, int freq, String mod, int stereoMode)
IllegalArgumentException
is not thrown.)
preset
- the preset to be configuredfreq
- the frequency of the preset in 100 Hertzmod
- the modulation of the presetstereoMode
- the stereo mode of the preset
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presets
or freq
or modulation
are not available or if
the modulation
is null or if stereoMode
is not
a supported stereo mode
SecurityException
- if setting presets has been prohibitedint getPresetFrequency(int preset)
preset
- the preset whose frequency is to be returned
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presetsString getPresetModulation(int preset)
preset
- the preset whose modulation is to be returned
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presetsint getPresetStereoMode(int preset) throws MediaException
preset
- the preset whose stereo mode is to be returned
MONO
, STEREO
or AUTO
.
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presets
MediaException
- if the presets do not support storing of the stereo modeString getPresetName(int preset)
preset
- the preset whose name is to be returned
String
containing the preset name
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presetsvoid setPresetName(int preset, String name)
preset
- the preset whose name is to be setname
- the name of the preset
IllegalArgumentException
- if preset
is less than 1
or preset
is greater than the number of presets
or if the name
is null
SecurityException
- if setting presets has been prohibited
|
|||||||||
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