QRadioData Class
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 } |
属性
|
|
- 1 个属性继承自 QObject
公有函数
QRadioData(QMediaObject *mediaObject, QObject *parent = Q_NULLPTR) | |
~QRadioData() | |
QMultimedia::AvailabilityStatus | availability() const |
Error | error() const |
QString | errorString() const |
bool | isAlternativeFrequenciesEnabled() const |
ProgramType | programType() const |
QString | programTypeName() const |
QString | radioText() const |
QString | stationId() const |
QString | stationName() const |
重新实现的公有函数
virtual QMediaObject * | mediaObject() const override |
- 32 个公有函数继承自 QObject
- 1 个公有函数继承自 QMediaBindableInterface
公有槽函数
void | setAlternativeFrequenciesEnabled(bool enabled) |
- 1 个公有槽函数继承自 QObject
信号
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) |
- 2 个信号继承自 QObject
重新实现的受保护函数
virtual bool | setMediaObject(QMediaObject *mediaObject) override |
- 9 个受保护的函数继承自 QObject
- 1 个受保护的函数继承自 QMediaBindableInterface
其他继承的成员
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 9 个受保护的函数继承自 QObject
- 1 个受保护的函数继承自 QMediaBindableInterface
- 2 个受保护的变量继承自 QObject
详细描述
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 instance.
radio = new QRadioTuner; radioData = radio->radioData();
Alternatively, you can pass an instance of QRadioTuner to the constructor to QRadioData.
参见 Radio Overview.
成员类型
enum QRadioData::Error
Enumerates radio data error conditions.
Constant | Value | Description |
---|---|---|
QRadioData::NoError | 0 | No errors have occurred. |
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. |
enum QRadioData::ProgramType
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.
Constant | Value |
---|---|
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 |
属性
alternativeFrequenciesEnabled : bool
Is Alternative Frequency currently enabled
访问函数:
bool | isAlternativeFrequenciesEnabled() const |
void | setAlternativeFrequenciesEnabled(bool enabled) |
Notifier signal:
void | alternativeFrequenciesEnabledChanged(bool enabled) |
programType : const ProgramType
Current Program Type
访问函数:
ProgramType | programType() const |
Notifier signal:
void | programTypeChanged(QRadioData::ProgramType programType) |
programTypeName : const QString
Current Program Type Name
访问函数:
QString | programTypeName() const |
Notifier signal:
void | programTypeNameChanged(QString programTypeName) |
radioText : const QString
Current Radio Text
访问函数:
QString | radioText() const |
Notifier signal:
void | radioTextChanged(QString radioText) |
stationId : const QString
Current Program Identification
访问函数:
QString | stationId() const |
Notifier signal:
void | stationIdChanged(QString stationId) |
stationName : const QString
Current Program Service
访问函数:
QString | stationName() const |
Notifier signal:
void | stationNameChanged(QString stationName) |
成员函数
QRadioData::QRadioData(QMediaObject *mediaObject, QObject *parent = Q_NULLPTR)
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 using the bind() method.
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.
Note: Notifier signal for property alternativeFrequenciesEnabled.
QMultimedia::AvailabilityStatus QRadioData::availability() const
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.
Error QRadioData::error() const
Returns the error state of a radio data.
参见 errorString().
[signal]
void QRadioData::error(QRadioData::Error error)
Signals that an error occurred.
Note: Signal error is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:
connect(radioData, static_cast<void(QRadioData::*)(QRadioData::Error)>(&QRadioData::error), [=](QRadioData::Error error){ /* ... */ });
QString QRadioData::errorString() const
Returns a description of a radio data's error state.
参见 error().
[override virtual]
QMediaObject *QRadioData::mediaObject() const
Reimplemented from QMediaBindableInterface::mediaObject().
参见 setMediaObject().
[signal]
void QRadioData::programTypeChanged(QRadioData::ProgramType programType)
Signals that the Program Type code has changed to programType
Note: Notifier signal for property programType.
[signal]
void QRadioData::programTypeNameChanged(QString programTypeName)
Signals that the Program Type Name has changed to programTypeName
Note: Notifier signal for property programTypeName.
[signal]
void QRadioData::radioTextChanged(QString radioText)
Signals that the Radio Text property has changed to radioText
Note: Notifier signal for property radioText.
[override virtual protected]
bool QRadioData::setMediaObject(QMediaObject *mediaObject)
Reimplemented from QMediaBindableInterface::setMediaObject().
参见 mediaObject().
[signal]
void QRadioData::stationIdChanged(QString stationId)
Signals that the Program Identification code has changed to stationId
Note: Notifier signal for property stationId.
[signal]
void QRadioData::stationNameChanged(QString stationName)
Signals that the Program Service has changed to stationName
Note: Notifier signal for property stationName.