|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITuner
A tuner is a kind of radio that allows the user to adjust the current frequency up or down or to seek the next station with an adequate signal strength. It also has memory presets so the user can quickly return to a remembered station.
Each tuner object is for a different band -- AM, FM, ShortWave, etc. Each band has a minimum and a maximum frequency. For the AM band, the range is 530 - 1710. For the FM band it is 87.5 to 107.9. AM tuners typically increment the frequecy in steps of 10; FM tuners typically increment the frequency in steps of .1 or .2.
Classes that implement the ITuner
interface will
often extend Radio
, a class that provides the most basic
functionality for a radio: set and get the current frequency and a
measure of the signal strength being received at the current frequency.
Please see the package description for a more in-depth discussion of using this class.
Field Summary | |
---|---|
static int |
NUM_PRESETS
The number of preset frequencies provided by the tuner. |
Method Summary | |
---|---|
void |
addView(IView aView)
Add a view (graphical user interface) to the tuner. |
double |
getFrequency()
Get this tuner's current frequency. |
double |
getSignalStrength()
Get the strength of the signal currently being received. |
void |
recallFrequency(int button)
Recall the frequency associated with a given preset button by a previous call to rememberFrequency(int) . |
void |
rememberFrequency(int button)
Remember the current frequency so that it can be later recalled with recallFrequency(int) . |
void |
seekDown()
Move the frequency down until a station is found with a signal strength of at least 0.5. |
void |
seekUp()
Move the frequency up until a station is found with a signal strength of at least 0.5. |
void |
tuneDown()
Move the frequency one step down, unless the frequency is already at the lowest value for this band. |
void |
tuneUp()
Move the frequency one step up, unless the frequency is already at the highest value for this band. |
Field Detail |
---|
static final int NUM_PRESETS
Method Detail |
---|
void tuneUp()
void tuneDown()
void seekUp()
void seekDown()
void rememberFrequency(int button)
recallFrequency(int)
. There are a possible NUM_PRESETS
remembered frequencies, each assigned to a button in the user interface.
button
- The number of a preset frequency button. Between 1 and
NUM_PRESETS, inclusive.void recallFrequency(int button)
rememberFrequency(int)
. Set the recalled frequency
to be the current frequency. There are a possible NUM_PRESETS
remembered frequencies, each assigned to a button in the user interface.
button
- The number of a preset frequency button. Between 1 and
NUM_PRESETS, inclusive.double getSignalStrength()
double getFrequency()
void addView(IView aView)
updateView
method must be called each time the tuner's state changes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |