API
DESCRIPTION
# pyFMRadio
# Module for controlling the tea5761 FM radio chip in the Nokia N800.
# Copyright (C) 2007 Martin Grimme
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
CLASSES
__builtin__.object
FMRadio
exceptions.StandardError(exceptions.Exception)
FMRadioUnavailableError
class FMRadio(__builtin__.object)
| Class for controlling the radio.
|
| Methods defined here:
|
| __init__(self)
|
| close(self)
| Closes the radio.
|
| get_frequency(self)
| Returns the current frequency value.
|
| get_frequency_range(self)
|
| get_signal_strength(self)
| Returns the current signal strength as a value between 0 and 100.
|
| get_volume(self)
| Returns the current volume value as left channel, right channel.
|
| is_signal_good(self)
| Returns whether the current signal strength is good enough.
|
| scan(self, cb=None)
| Scans for stations and returns a list of the frequencies of the
| stations found.
| If you pass a callback function, it will be called at every step.
| The signature of the callback must be: f(freq, is_station)
|
| set_frequency(self, freq)
| Sets the frequency to the given value.
|
| set_mute(self, value)
| Mutes or unmutes the radio. This does not affect the volume settings.
|
| set_volume(self, left, right=-1)
| Sets the current volume for left and right channels. Omit the value
| for the right channel to set both channels to the same value.
class FMRadioUnavailableError(exceptions.StandardError)
| Exception to throw if the radio is unavailable.