Added antennaConnected property to QRadioTuner and radio qml element
Change-Id: I5af8487277e0444629c710c6a0a4e890a8d35c6f Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
@@ -109,6 +109,7 @@ QDeclarativeRadio::QDeclarativeRadio(QObject *parent) :
|
|||||||
connect(m_radioTuner, SIGNAL(volumeChanged(int)), this, SIGNAL(volumeChanged(int)));
|
connect(m_radioTuner, SIGNAL(volumeChanged(int)), this, SIGNAL(volumeChanged(int)));
|
||||||
connect(m_radioTuner, SIGNAL(mutedChanged(bool)), this, SIGNAL(mutedChanged(bool)));
|
connect(m_radioTuner, SIGNAL(mutedChanged(bool)), this, SIGNAL(mutedChanged(bool)));
|
||||||
connect(m_radioTuner, SIGNAL(stationFound(int, QString)), this, SIGNAL(stationFound(int, QString)));
|
connect(m_radioTuner, SIGNAL(stationFound(int, QString)), this, SIGNAL(stationFound(int, QString)));
|
||||||
|
connect(m_radioTuner, SIGNAL(antennaConnectedChanged(bool)), this, SIGNAL(antennaConnectedChanged(bool)));
|
||||||
|
|
||||||
connect(m_radioTuner, SIGNAL(error(QRadioTuner::Error)), this, SLOT(_q_error(QRadioTuner::Error)));
|
connect(m_radioTuner, SIGNAL(error(QRadioTuner::Error)), this, SLOT(_q_error(QRadioTuner::Error)));
|
||||||
}
|
}
|
||||||
@@ -293,6 +294,16 @@ int QDeclarativeRadio::maximumFrequency() const
|
|||||||
return m_radioTuner->frequencyRange(m_radioTuner->band()).second;
|
return m_radioTuner->frequencyRange(m_radioTuner->band()).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\qmlproperty int Radio::antennaConnected
|
||||||
|
|
||||||
|
This property is true if there is an antenna connected. Otherwise it will be false.
|
||||||
|
*/
|
||||||
|
bool QDeclarativeRadio::isAntennaConnected() const
|
||||||
|
{
|
||||||
|
return m_radioTuner->isAntennaConnected();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\qmlmethod bool Radio::isAvailable()
|
\qmlmethod bool Radio::isAvailable()
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class QDeclarativeRadio : public QObject
|
|||||||
Q_PROPERTY(int frequencyStep READ frequencyStep NOTIFY bandChanged)
|
Q_PROPERTY(int frequencyStep READ frequencyStep NOTIFY bandChanged)
|
||||||
Q_PROPERTY(int minimumFrequency READ minimumFrequency NOTIFY bandChanged)
|
Q_PROPERTY(int minimumFrequency READ minimumFrequency NOTIFY bandChanged)
|
||||||
Q_PROPERTY(int maximumFrequency READ maximumFrequency NOTIFY bandChanged)
|
Q_PROPERTY(int maximumFrequency READ maximumFrequency NOTIFY bandChanged)
|
||||||
|
Q_PROPERTY(bool antennaConnected READ isAntennaConnected NOTIFY antennaConnectedChanged)
|
||||||
Q_ENUMS(State)
|
Q_ENUMS(State)
|
||||||
Q_ENUMS(Band)
|
Q_ENUMS(Band)
|
||||||
Q_ENUMS(Error)
|
Q_ENUMS(Error)
|
||||||
@@ -131,6 +132,8 @@ public:
|
|||||||
int minimumFrequency() const;
|
int minimumFrequency() const;
|
||||||
int maximumFrequency() const;
|
int maximumFrequency() const;
|
||||||
|
|
||||||
|
bool isAntennaConnected() const;
|
||||||
|
|
||||||
Q_INVOKABLE bool isAvailable() const;
|
Q_INVOKABLE bool isAvailable() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
@@ -160,6 +163,7 @@ Q_SIGNALS:
|
|||||||
void volumeChanged(int volume);
|
void volumeChanged(int volume);
|
||||||
void mutedChanged(bool muted);
|
void mutedChanged(bool muted);
|
||||||
void stationFound(int frequency, QString stationId);
|
void stationFound(int frequency, QString stationId);
|
||||||
|
void antennaConnectedChanged(bool connectionStatus);
|
||||||
|
|
||||||
void errorChanged();
|
void errorChanged();
|
||||||
void error(QDeclarativeRadio::Error errorCode);
|
void error(QDeclarativeRadio::Error errorCode);
|
||||||
|
|||||||
@@ -234,6 +234,14 @@ QRadioTunerControl::~QRadioTunerControl()
|
|||||||
Returns true if the tuner is scanning, and false if it is not.
|
Returns true if the tuner is scanning, and false if it is not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool QRadioTunerControl::antennaConnected() const
|
||||||
|
|
||||||
|
Identifies if there is an antenna connected to the device.
|
||||||
|
|
||||||
|
Returns true if there is a connected antenna, and false otherwise.
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QRadioTunerControl::searchForward()
|
\fn void QRadioTunerControl::searchForward()
|
||||||
|
|
||||||
@@ -337,6 +345,13 @@ QRadioTunerControl::~QRadioTunerControl()
|
|||||||
Signals that new station with \a frequency was found when scanning
|
Signals that new station with \a frequency was found when scanning
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void QRadioTunerControl::antennaConnectedChanged(bool connectionStatus)
|
||||||
|
|
||||||
|
Signals that the antenna has either been connected or disconnected as
|
||||||
|
reflected with the \a connectionStatus.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "moc_qradiotunercontrol.cpp"
|
#include "moc_qradiotunercontrol.cpp"
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ public:
|
|||||||
|
|
||||||
virtual bool isSearching() const = 0;
|
virtual bool isSearching() const = 0;
|
||||||
|
|
||||||
|
virtual bool isAntennaConnected() const { return true; }
|
||||||
|
|
||||||
virtual void searchForward() = 0;
|
virtual void searchForward() = 0;
|
||||||
virtual void searchBackward() = 0;
|
virtual void searchBackward() = 0;
|
||||||
virtual void searchAllStations(QRadioTuner::SearchMode searchMode = QRadioTuner::SearchFast) = 0;
|
virtual void searchAllStations(QRadioTuner::SearchMode searchMode = QRadioTuner::SearchFast) = 0;
|
||||||
@@ -109,6 +111,7 @@ Q_SIGNALS:
|
|||||||
void mutedChanged(bool muted);
|
void mutedChanged(bool muted);
|
||||||
void error(QRadioTuner::Error err);
|
void error(QRadioTuner::Error err);
|
||||||
void stationFound(int frequency, QString stationId);
|
void stationFound(int frequency, QString stationId);
|
||||||
|
void antennaConnectedChanged(bool connectionStatus);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QRadioTunerControl(QObject *parent = 0);
|
QRadioTunerControl(QObject *parent = 0);
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ QRadioTuner::QRadioTuner(QObject *parent):
|
|||||||
connect(d->control, SIGNAL(volumeChanged(int)), SIGNAL(volumeChanged(int)));
|
connect(d->control, SIGNAL(volumeChanged(int)), SIGNAL(volumeChanged(int)));
|
||||||
connect(d->control, SIGNAL(mutedChanged(bool)), SIGNAL(mutedChanged(bool)));
|
connect(d->control, SIGNAL(mutedChanged(bool)), SIGNAL(mutedChanged(bool)));
|
||||||
connect(d->control, SIGNAL(stationFound(int,QString)), SIGNAL(stationFound(int,QString)));
|
connect(d->control, SIGNAL(stationFound(int,QString)), SIGNAL(stationFound(int,QString)));
|
||||||
|
connect(d->control, SIGNAL(antennaConnectedChanged(bool)), SIGNAL(antennaConnectedChanged(bool)));
|
||||||
connect(d->control, SIGNAL(error(QRadioTuner::Error)), SIGNAL(error(QRadioTuner::Error)));
|
connect(d->control, SIGNAL(error(QRadioTuner::Error)), SIGNAL(error(QRadioTuner::Error)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -430,6 +431,20 @@ bool QRadioTuner::isSearching() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\property QRadioTuner::antennaConnected
|
||||||
|
\brief whether there is an antenna connected
|
||||||
|
*/
|
||||||
|
bool QRadioTuner::isAntennaConnected() const
|
||||||
|
{
|
||||||
|
Q_D(const QRadioTuner);
|
||||||
|
|
||||||
|
if (d->control != 0)
|
||||||
|
return d->control->isAntennaConnected();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Starts a forward scan for a signal, starting from the current \l frequency.
|
Starts a forward scan for a signal, starting from the current \l frequency.
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class Q_MULTIMEDIA_EXPORT QRadioTuner : public QMediaObject
|
|||||||
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)
|
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)
|
||||||
Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
|
Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
|
||||||
Q_PROPERTY(bool searching READ isSearching NOTIFY searchingChanged)
|
Q_PROPERTY(bool searching READ isSearching NOTIFY searchingChanged)
|
||||||
|
Q_PROPERTY(bool antennaConnected READ isAntennaConnected NOTIFY antennaConnectedChanged)
|
||||||
Q_ENUMS(State)
|
Q_ENUMS(State)
|
||||||
Q_ENUMS(Band)
|
Q_ENUMS(Band)
|
||||||
Q_ENUMS(Error)
|
Q_ENUMS(Error)
|
||||||
@@ -109,6 +110,8 @@ public:
|
|||||||
|
|
||||||
bool isSearching() const;
|
bool isSearching() const;
|
||||||
|
|
||||||
|
bool isAntennaConnected() const;
|
||||||
|
|
||||||
Error error() const;
|
Error error() const;
|
||||||
QString errorString() const;
|
QString errorString() const;
|
||||||
|
|
||||||
@@ -137,6 +140,7 @@ Q_SIGNALS:
|
|||||||
void volumeChanged(int volume);
|
void volumeChanged(int volume);
|
||||||
void mutedChanged(bool muted);
|
void mutedChanged(bool muted);
|
||||||
void stationFound(int frequency, QString stationId);
|
void stationFound(int frequency, QString stationId);
|
||||||
|
void antennaConnectedChanged(bool connectionStatus);
|
||||||
|
|
||||||
void error(QRadioTuner::Error error);
|
void error(QRadioTuner::Error error);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user