Added tune up and down methods, and changed name of scan methods.

Instead of requiring developers using the radio API to read the
frequency step, adding it to the current frequency and setting the
new frequency, there has been added tuneUp and tuneDown methods.
Also, the searchBackward and searchForward methods have been renamed
to scanDown and scanUp which seem more logical. And cancelSearch
has become cancelScan.

Change-Id: Ib9ff61c0f58163039f41f045037cb9a11b37a59e
Reviewed-on: http://codereview.qt.nokia.com/4013
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: derick hawcroft <derick.hawcroft@nokia.com>
This commit is contained in:
Jonas Rabbe
2011-09-01 07:44:46 +10:00
committed by Qt by Nokia
parent 6781063df6
commit a6e2cbb83c
3 changed files with 26 additions and 18 deletions

View File

@@ -120,7 +120,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: radio.searchBackward();
onClicked: radio.scanDown();
}
}
Rectangle {
@@ -141,11 +141,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: {
var f = radio.frequency;
f = f - radio.frequencyStep;
radio.setFrequency(f);
}
onClicked: radio.tuneDown();
}
}
Rectangle {
@@ -166,11 +162,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: {
var f = radio.frequency;
f = f + radio.frequencyStep;
radio.setFrequency(f);
}
onClicked: radio.tuneUp();
}
}
Rectangle {
@@ -191,7 +183,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: radio.searchForward();
onClicked: radio.scanUp();
}
}
}

View File

@@ -156,21 +156,35 @@ void QDeclarativeRadio::setMuted(bool muted)
m_radioTuner->setMuted(muted);
}
void QDeclarativeRadio::cancelSearch()
void QDeclarativeRadio::cancelScan()
{
m_radioTuner->cancelSearch();
}
void QDeclarativeRadio::searchBackward()
void QDeclarativeRadio::scanDown()
{
m_radioTuner->searchBackward();
}
void QDeclarativeRadio::searchForward()
void QDeclarativeRadio::scanUp()
{
m_radioTuner->searchForward();
}
void QDeclarativeRadio::tuneDown()
{
int f = frequency();
f = f - frequencyStep();
setFrequency(f);
}
void QDeclarativeRadio::tuneUp()
{
int f = frequency();
f = f + frequencyStep();
setFrequency(f);
}
void QDeclarativeRadio::start()
{
m_radioTuner->start();

View File

@@ -134,9 +134,11 @@ public Q_SLOTS:
void setVolume(int volume);
void setMuted(bool muted);
void cancelSearch();
void searchBackward();
void searchForward();
void cancelScan();
void scanDown();
void scanUp();
void tuneUp();
void tuneDown();
void start();
void stop();