内容表

上一话题

QRadioDataControl

下一话题

QRadioTunerControl

QRadioTuner

QRadioTuner class provides an interface to the systems analog radio device. 更多

Inheritance diagram of PySide2.QtMultimedia.QRadioTuner

概要

信号

详细描述

You can control the systems analog radio device using this interface, for example:

radio = new QRadioTuner;
connect(radio, SIGNAL(frequencyChanged(int)), this, SLOT(freqChanged(int)));
if (radio->isBandSupported(QRadioTuner::FM)) {
    radio->setBand(QRadioTuner::FM);
    radio->setFrequency(yourRadioStationFrequency);
    radio->setVolume(100);
    radio->start();
}
											

The radio object will emit signals for any changes in state such as: bandChanged() , frequencyChanged() , stereoStatusChanged() , searchingChanged() , signalStrengthChanged() , volumeChanged() , mutedChanged() .

You can change between the frequency bands using setBand() however it is recommended that you check to make sure the band is available first using isBandSupported() .

class QRadioTuner ( [ parent=None ] )
param parent

QObject

Constructs a radio tuner based on a media service allocated by the default media service provider.

parent 会被传递给 QMediaObject .

PySide2.QtMultimedia.QRadioTuner. State

Enumerates radio tuner states.

常量

描述

QRadioTuner.ActiveState

The tuner is started and active.

QRadioTuner.StoppedState

The tuner device is stopped.

PySide2.QtMultimedia.QRadioTuner. Band

Enumerates radio frequency bands.

常量

描述

QRadioTuner.AM

520 to 1610 kHz, 9 or 10kHz channel spacing, extended 1610 to 1710 kHz

QRadioTuner.FM

87.5 to 108.0 MHz, except Japan 76-90 MHz

QRadioTuner.SW

1.711 to 30.0 MHz, divided into 15 bands. 5kHz channel spacing

QRadioTuner.LW

148.5 to 283.5 kHz, 9kHz channel spacing (Europe, Africa, Asia)

QRadioTuner.FM2

range not defined, used when area supports more than one FM range.

PySide2.QtMultimedia.QRadioTuner. Error

Enumerates radio tuner error conditions.

常量

描述

QRadioTuner.NoError

没有发生错误。

QRadioTuner.ResourceError

There is no radio service available.

QRadioTuner.OpenError

Unable to open radio device.

QRadioTuner.OutOfRangeError

An attempt to set a frequency or band that is not supported by radio device.

PySide2.QtMultimedia.QRadioTuner. StereoMode

Enumerates radio tuner policy for receiving stereo signals.

常量

描述

QRadioTuner.ForceStereo

Provide stereo mode, converting if required.

QRadioTuner.ForceMono

Provide mono mode, converting if required.

QRadioTuner.Auto

Uses the stereo mode matching the station.

PySide2.QtMultimedia.QRadioTuner. SearchMode

Enumerates how the radio tuner should search for stations.

常量

描述

QRadioTuner.SearchFast

Use only signal strength when searching.

QRadioTuner.SearchGetStationId

After finding a strong signal, wait for the RDS station id (PI) before continuing.

PySide2.QtMultimedia.QRadioTuner. antennaConnectedChanged ( connectionStatus )
参数

connectionStatus bool

PySide2.QtMultimedia.QRadioTuner. band ( )
返回类型

Band

另请参阅

setBand()

PySide2.QtMultimedia.QRadioTuner. bandChanged ( band )
参数

band Band

PySide2.QtMultimedia.QRadioTuner. cancelSearch ( )

Stops scanning for a signal.

PySide2.QtMultimedia.QRadioTuner. error ( )
返回类型

Error

Returns the error state of a radio tuner.

另请参阅

errorString()

PySide2.QtMultimedia.QRadioTuner. error ( error )
参数

error Error

PySide2.QtMultimedia.QRadioTuner. errorString ( )
返回类型

unicode

Returns a description of a radio tuner’s error state.

另请参阅

error()

PySide2.QtMultimedia.QRadioTuner. frequency ( )
返回类型

int

另请参阅

setFrequency()

PySide2.QtMultimedia.QRadioTuner. frequencyChanged ( frequency )
参数

frequency int

PySide2.QtMultimedia.QRadioTuner. frequencyRange ( band )
参数

band Band

返回类型

Returns a frequency band ‘s minimum and maximum frequency.

PySide2.QtMultimedia.QRadioTuner. frequencyStep ( band )
参数

band Band

返回类型

int

Returns the number of Hertz to increment the frequency by when stepping through frequencies within a given band .

PySide2.QtMultimedia.QRadioTuner. isAntennaConnected ( )
返回类型

bool

PySide2.QtMultimedia.QRadioTuner. isBandSupported ( b )
参数

b Band

返回类型

bool

Identifies if a frequency band is supported by a radio tuner.

Returns true if the band is supported, and false if it is not.

PySide2.QtMultimedia.QRadioTuner. isMuted ( )
返回类型

bool

PySide2.QtMultimedia.QRadioTuner. isSearching ( )
返回类型

bool

PySide2.QtMultimedia.QRadioTuner. isStereo ( )
返回类型

bool

PySide2.QtMultimedia.QRadioTuner. mutedChanged ( muted )
参数

muted bool

PySide2.QtMultimedia.QRadioTuner. radioData ( )
返回类型

QRadioData

PySide2.QtMultimedia.QRadioTuner. searchAllStations ( [ searchMode=QRadioTuner.SearchFast ] )
参数

searchMode SearchMode

Search all stations in current band

Emits stationFound (int, QString ) for every found station. After searching is completed, searchingChanged (bool) is emitted (false). If searchMode is set to SearchGetStationId , searching waits for station id (PI) on each frequency.

PySide2.QtMultimedia.QRadioTuner. searchBackward ( )

Starts a backwards scan for a signal, starting from the current frequency .

另请参阅

searchForward() cancelSearch() searching

PySide2.QtMultimedia.QRadioTuner. searchForward ( )

Starts a forward scan for a signal, starting from the current frequency .

PySide2.QtMultimedia.QRadioTuner. searchingChanged ( searching )
参数

searching bool

PySide2.QtMultimedia.QRadioTuner. setBand ( band )
参数

band Band

Sets a radio tuner’s frequency band .

Changing the band will reset the frequency to the new band’s minimum frequency.

另请参阅

band()

PySide2.QtMultimedia.QRadioTuner. setFrequency ( frequency )
参数

frequency int

Sets a radio tuner’s frequency .

If the tuner is set to a frequency outside the current band , the band will be changed to one occupied by the new frequency.

另请参阅

frequency()

PySide2.QtMultimedia.QRadioTuner. setMuted ( muted )
参数

muted bool

另请参阅

isMuted()

PySide2.QtMultimedia.QRadioTuner. setStereoMode ( mode )
参数

mode StereoMode

另请参阅

stereoMode()

PySide2.QtMultimedia.QRadioTuner. setVolume ( volume )
参数

volume int

另请参阅

volume()

PySide2.QtMultimedia.QRadioTuner. signalStrength ( )
返回类型

int

PySide2.QtMultimedia.QRadioTuner. signalStrengthChanged ( signalStrength )
参数

signalStrength int

PySide2.QtMultimedia.QRadioTuner. start ( )

Activate the radio device.

PySide2.QtMultimedia.QRadioTuner. state ( )
返回类型

State

PySide2.QtMultimedia.QRadioTuner. stateChanged ( state )
参数

state State

PySide2.QtMultimedia.QRadioTuner. stationFound ( frequency , stationId )
参数
  • frequency int

  • stationId – unicode

PySide2.QtMultimedia.QRadioTuner. stereoMode ( )
返回类型

StereoMode

另请参阅

setStereoMode()

PySide2.QtMultimedia.QRadioTuner. stereoStatusChanged ( stereo )
参数

stereo bool

PySide2.QtMultimedia.QRadioTuner. stop ( )

Deactivate the radio device.

PySide2.QtMultimedia.QRadioTuner. volume ( )
返回类型

int

另请参阅

setVolume()

PySide2.QtMultimedia.QRadioTuner. volumeChanged ( volume )
参数

volume int