The QRadioData class provides interfaces to the RDS functionality of the system radio. 更多...
| 頭: | #include <QRadioData> |
| qmake: | QT += multimedia |
| 繼承: | QObject and QMediaBindableInterface |
| enum | Error { NoError, ResourceError, OpenError, OutOfRangeError } |
| enum | ProgramType { Undefined, News, CurrentAffairs, Information, ..., College } |
|
|
| QRadioData (QMediaObject * mediaObject , QObject * parent = nullptr) | |
| virtual | ~QRadioData () |
| QMultimedia::AvailabilityStatus | availability () const |
| QRadioData::Error | error () const |
| QString | errorString () const |
| bool | isAlternativeFrequenciesEnabled () const |
| QRadioData::ProgramType | programType () const |
| QString | programTypeName () const |
| QString | radioText () const |
| QString | stationId () const |
| QString | stationName () const |
| virtual QMediaObject * | mediaObject () const override |
| void | setAlternativeFrequenciesEnabled (bool enabled ) |
| void | alternativeFrequenciesEnabledChanged (bool enabled ) |
| void | error (QRadioData::Error error ) |
| void | programTypeChanged (QRadioData::ProgramType programType ) |
| void | programTypeNameChanged (QString programTypeName ) |
| void | radioTextChanged (QString radioText ) |
| void | stationIdChanged (QString stationId ) |
| void | stationNameChanged (QString stationName ) |
| const QMetaObject | staticMetaObject |
| virtual bool | setMediaObject (QMediaObject * mediaObject ) override |
| QRadioDataPrivate * | d_ptr |
The QRadioData class provides interfaces to the RDS functionality of the system radio.
The radio data object will emit signals for any changes in radio data. You can enable or disable alternative frequency with setAlternativeFrequenciesEnabled ().
You can get a QRadioData instance fromt the radioData property from a QRadioTuner 實例。
radio = new QRadioTuner; radioData = radio->radioData();
Alternatively, you can pass an instance of QRadioTuner to the constructor to QRadioData .
另請參閱 無綫電概述 .
Enumerates radio data error conditions.
| 常量 | 值 | 描述 |
|---|---|---|
QRadioData::NoError
|
0
|
沒有齣現錯誤。 |
QRadioData::ResourceError
|
1
|
There is no radio service available. |
QRadioData::OpenError
|
2
|
Unable to open radio device. |
QRadioData::OutOfRangeError
|
3
|
An attempt to set a frequency or band that is not supported by radio device. |
This property holds the type of the currently playing program as transmitted by the radio station. The value can be any one of the values defined in the table below.
| 常量 | 值 |
|---|---|
QRadioData::Undefined
|
0
|
QRadioData::News
|
1
|
QRadioData::CurrentAffairs
|
2
|
QRadioData::Information
|
3
|
QRadioData::Sport
|
4
|
QRadioData::Education
|
5
|
QRadioData::Drama
|
6
|
QRadioData::Culture
|
7
|
QRadioData::Science
|
8
|
QRadioData::Varied
|
9
|
QRadioData::PopMusic
|
10
|
QRadioData::RockMusic
|
11
|
QRadioData::EasyListening
|
12
|
QRadioData::LightClassical
|
13
|
QRadioData::SeriousClassical
|
14
|
QRadioData::OtherMusic
|
15
|
QRadioData::Weather
|
16
|
QRadioData::Finance
|
17
|
QRadioData::ChildrensProgrammes
|
18
|
QRadioData::SocialAffairs
|
19
|
QRadioData::Religion
|
20
|
QRadioData::PhoneIn
|
21
|
QRadioData::Travel
|
22
|
QRadioData::Leisure
|
23
|
QRadioData::JazzMusic
|
24
|
QRadioData::CountryMusic
|
25
|
QRadioData::NationalMusic
|
26
|
QRadioData::OldiesMusic
|
27
|
QRadioData::FolkMusic
|
28
|
QRadioData::Documentary
|
29
|
QRadioData::AlarmTest
|
30
|
QRadioData::Alarm
|
31
|
QRadioData::Talk
|
32
|
QRadioData::ClassicRock
|
33
|
QRadioData::AdultHits
|
34
|
QRadioData::SoftRock
|
35
|
QRadioData::Top40
|
36
|
QRadioData::Soft
|
37
|
QRadioData::Nostalgia
|
38
|
QRadioData::Classical
|
39
|
QRadioData::RhythmAndBlues
|
40
|
QRadioData::SoftRhythmAndBlues
|
41
|
QRadioData::Language
|
42
|
QRadioData::ReligiousMusic
|
43
|
QRadioData::ReligiousTalk
|
44
|
QRadioData::Personality
|
45
|
QRadioData::Public
|
46
|
QRadioData::College
|
47
|
Is Alternative Frequency currently enabled
訪問函數:
| bool | isAlternativeFrequenciesEnabled () const |
| void | setAlternativeFrequenciesEnabled (bool enabled ) |
通知程序信號:
| void | alternativeFrequenciesEnabledChanged (bool enabled ) |
Current Program Type
訪問函數:
| QRadioData::ProgramType | programType () const |
通知程序信號:
| void | programTypeChanged (QRadioData::ProgramType programType ) |
Current Program Type Name
訪問函數:
| QString | programTypeName () const |
通知程序信號:
| void | programTypeNameChanged (QString programTypeName ) |
Current Radio Text
訪問函數:
| QString | radioText () const |
通知程序信號:
| void | radioTextChanged (QString radioText ) |
Current Program Identification
訪問函數:
| QString | stationId () const |
通知程序信號:
| void | stationIdChanged (QString stationId ) |
Current Program Service
訪問函數:
| QString | stationName () const |
通知程序信號:
| void | stationNameChanged (QString stationName ) |
Constructs a radio data based on a mediaObject and parent .
The mediaObject should be an instance of QRadioTuner . It is preferable to use the radioData property on a QRadioTuner instance to get an instance of QRadioData .
During construction, this class is bound to the mediaObject 使用 bind() 方法。
[虛擬]
QRadioData::
~QRadioData
()
Destroys a radio data.
[signal]
void
QRadioData::
alternativeFrequenciesEnabledChanged
(
bool
enabled
)
Signals that automatically tuning to alternative frequencies has been enabled or disabled according to enabled .
注意: 通知程序信號對於特性 alternativeFrequenciesEnabled .
Returns the availability of the radio data service.
A long as there is a media service which provides radio functionality, then the availability will be that of the radio tuner .
Returns the error state of a radio data.
另請參閱 errorString ().
[signal]
void
QRadioData::
error
(
QRadioData::Error
error
)
發射信號,當 error 齣現。
注意: 信號 error 在此類中被重載。通過使用函數指針句法連接到此信號,Qt 提供用於獲得如此範例展示的函數指針的方便幫助程序:
connect(radioData, QOverload<QRadioData::Error>::of(&QRadioData::error), [=](QRadioData::Error error){ /* ... */ });
Returns a description of a radio data's error state.
另請參閱 error ().
[override virtual]
QMediaObject
*QRadioData::
mediaObject
() const
重實現自 QMediaBindableInterface::mediaObject ().
另請參閱 setMediaObject ().
[signal]
void
QRadioData::
programTypeChanged
(
QRadioData::ProgramType
programType
)
Signals that the Program Type code has changed to programType
注意: 通知程序信號對於特性 programType .
[signal]
void
QRadioData::
programTypeNameChanged
(
QString
programTypeName
)
Signals that the Program Type Name has changed to programTypeName
注意: 通知程序信號對於特性 programTypeName .
[signal]
void
QRadioData::
radioTextChanged
(
QString
radioText
)
Signals that the Radio Text property has changed to radioText
注意: 通知程序信號對於特性 radioText .
[override virtual protected]
bool
QRadioData::
setMediaObject
(
QMediaObject
*
mediaObject
)
重實現自 QMediaBindableInterface::setMediaObject ().
另請參閱 mediaObject ().
[signal]
void
QRadioData::
stationIdChanged
(
QString
stationId
)
Signals that the Program Identification code has changed to stationId
注意: 通知程序信號對於特性 stationId .
[signal]
void
QRadioData::
stationNameChanged
(
QString
stationName
)
Signals that the Program Service has changed to stationName
注意: 通知程序信號對於特性 stationName .