summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2020-05-31 20:41:43 +0200
committerChristian Strømme <christian.stromme@qt.io>2020-06-10 18:29:22 +0000
commitba2f42c2548a5175126497d2d69eef95c2a849ba (patch)
tree0570570b5c997186b74396ddb6e9cd330209e859
parent3d909ba8ac0f43af6d70830a5c95df3e741f1221 (diff)
Remove Radio support
Fixes: QTBUG-84592 Change-Id: I3b9e51689fd542c35cb57cf6c51a141aec3034df Reviewed-by: Christian Strømme <christian.stromme@qt.io>
-rw-r--r--examples/multimedia/declarative-radio/Button.qml81
-rw-r--r--examples/multimedia/declarative-radio/declarative-radio.pro9
-rw-r--r--examples/multimedia/declarative-radio/declarative-radio.qrc7
-rw-r--r--examples/multimedia/declarative-radio/doc/images/declarative-radio-example.pngbin9809 -> 0 bytes
-rw-r--r--examples/multimedia/declarative-radio/doc/src/declarative-radio.qdoc40
-rw-r--r--examples/multimedia/declarative-radio/main.cpp69
-rw-r--r--examples/multimedia/declarative-radio/view.qml143
-rw-r--r--examples/multimedia/multimedia.pro2
-rw-r--r--examples/multimedia/radio/main.cpp63
-rw-r--r--examples/multimedia/radio/radio.cpp176
-rw-r--r--examples/multimedia/radio/radio.h85
-rw-r--r--examples/multimedia/radio/radio.pro16
-rw-r--r--src/imports/multimedia/multimedia.cpp4
-rw-r--r--src/imports/multimedia/multimedia.pro4
-rw-r--r--src/imports/multimedia/qdeclarativeradio.cpp541
-rw-r--r--src/imports/multimedia/qdeclarativeradio_p.h203
-rw-r--r--src/imports/multimedia/qdeclarativeradiodata.cpp325
-rw-r--r--src/imports/multimedia/qdeclarativeradiodata_p.h190
-rw-r--r--src/multimedia/controls/controls.pri4
-rw-r--r--src/multimedia/controls/qradiodatacontrol.cpp193
-rw-r--r--src/multimedia/controls/qradiodatacontrol.h88
-rw-r--r--src/multimedia/controls/qradiotunercontrol.cpp344
-rw-r--r--src/multimedia/controls/qradiotunercontrol.h119
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/media.cpp26
-rw-r--r--src/multimedia/doc/src/changes.qdoc1
-rw-r--r--src/multimedia/doc/src/multimedia.qdoc11
-rw-r--r--src/multimedia/doc/src/qtmultimedia-cpp.qdoc2
-rw-r--r--src/multimedia/doc/src/qtmultimedia-index.qdoc10
-rw-r--r--src/multimedia/doc/src/qtmultimedia5.qdoc2
-rw-r--r--src/multimedia/doc/src/radiooverview.qdoc89
-rw-r--r--src/multimedia/multimedia.pro1
-rw-r--r--src/multimedia/qmediaserviceproviderplugin.h10
-rw-r--r--src/multimedia/radio/qradiodata.cpp479
-rw-r--r--src/multimedia/radio/qradiodata.h134
-rw-r--r--src/multimedia/radio/qradiotuner.cpp660
-rw-r--r--src/multimedia/radio/qradiotuner.h164
-rw-r--r--src/multimedia/radio/radio.pri9
-rw-r--r--src/multimedia/recording/qmediarecorder.cpp2
-rw-r--r--src/plugins/plugins.pro5
-rw-r--r--src/plugins/v4l/radio/radio.pri9
-rw-r--r--src/plugins/v4l/radio/v4lradiocontrol.cpp536
-rw-r--r--src/plugins/v4l/radio/v4lradiocontrol.h136
-rw-r--r--src/plugins/v4l/radio/v4lradioservice.cpp69
-rw-r--r--src/plugins/v4l/radio/v4lradioservice.h65
-rw-r--r--src/plugins/v4l/v4l.json4
-rw-r--r--src/plugins/v4l/v4l.pro11
-rw-r--r--src/plugins/v4l/v4lserviceplugin.cpp72
-rw-r--r--src/plugins/v4l/v4lserviceplugin.h61
-rw-r--r--tests/auto/unit/multimedia.pro2
-rw-r--r--tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp3
-rw-r--r--tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json2
-rw-r--r--tests/auto/unit/qmultimedia_common/mockradio.pri8
-rw-r--r--tests/auto/unit/qmultimedia_common/mockradiodatacontrol.h135
-rw-r--r--tests/auto/unit/qmultimedia_common/mockradiotunercontrol.h253
-rw-r--r--tests/auto/unit/qradiodata/qradiodata.pro7
-rw-r--r--tests/auto/unit/qradiodata/tst_qradiodata.cpp195
-rw-r--r--tests/auto/unit/qradiotuner/qradiotuner.pro7
-rw-r--r--tests/auto/unit/qradiotuner/tst_qradiotuner.cpp388
58 files changed, 10 insertions, 6264 deletions
diff --git a/examples/multimedia/declarative-radio/Button.qml b/examples/multimedia/declarative-radio/Button.qml
deleted file mode 100644
index c579795e7..000000000
--- a/examples/multimedia/declarative-radio/Button.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: button
- border.color: "black"
- border.width: 1
- radius: 5
-
- property string text
- signal clicked
-
- width: d.buttonWidth
- height: d.buttonHeight
-
- anchors {
- margins: root.margins
- top: parent.top
- }
-
- Text {
- anchors.fill: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- text: button.text
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: button.clicked();
- }
-}
diff --git a/examples/multimedia/declarative-radio/declarative-radio.pro b/examples/multimedia/declarative-radio/declarative-radio.pro
deleted file mode 100644
index 68942fa3f..000000000
--- a/examples/multimedia/declarative-radio/declarative-radio.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-QT += qml quick multimedia
-
-SOURCES += main.cpp
-RESOURCES += declarative-radio.qrc
-
-EXAMPLE_FILES += view.qml
-
-target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/declarative-radio
-INSTALLS += target
diff --git a/examples/multimedia/declarative-radio/declarative-radio.qrc b/examples/multimedia/declarative-radio/declarative-radio.qrc
deleted file mode 100644
index 0f7859d78..000000000
--- a/examples/multimedia/declarative-radio/declarative-radio.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
-<file>view.qml</file>
-<file>Button.qml</file>
-</qresource>
-</RCC>
-
diff --git a/examples/multimedia/declarative-radio/doc/images/declarative-radio-example.png b/examples/multimedia/declarative-radio/doc/images/declarative-radio-example.png
deleted file mode 100644
index 882180b21..000000000
--- a/examples/multimedia/declarative-radio/doc/images/declarative-radio-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/multimedia/declarative-radio/doc/src/declarative-radio.qdoc b/examples/multimedia/declarative-radio/doc/src/declarative-radio.qdoc
deleted file mode 100644
index ea0e33da9..000000000
--- a/examples/multimedia/declarative-radio/doc/src/declarative-radio.qdoc
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example multimedia/declarative-radio
- \title Declarative Radio Example
- \brief Demonstrates using the Radio QML type from Qt Multimedia.
- \ingroup multimedia_examples
-
- This examples uses the \l{Qt Multimedia} \l Radio QML type to list the
- available channels on the FM frequency.
-
- \image declarative-radio-example.png
-
- \include examples-run.qdocinc
-*/
diff --git a/examples/multimedia/declarative-radio/main.cpp b/examples/multimedia/declarative-radio/main.cpp
deleted file mode 100644
index 3ed6f1950..000000000
--- a/examples/multimedia/declarative-radio/main.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
- **
- ** Copyright (C) 2017 The Qt Company Ltd.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the examples of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:BSD$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** BSD License Usage
- ** Alternatively, you may use this file under the terms of the BSD license
- ** as follows:
- **
- ** "Redistribution and use in source and binary forms, with or without
- ** modification, are permitted provided that the following conditions are
- ** met:
- ** * Redistributions of source code must retain the above copyright
- ** notice, this list of conditions and the following disclaimer.
- ** * Redistributions in binary form must reproduce the above copyright
- ** notice, this list of conditions and the following disclaimer in
- ** the documentation and/or other materials provided with the
- ** distribution.
- ** * Neither the name of The Qt Company Ltd nor the names of its
- ** contributors may be used to endorse or promote products derived
- ** from this software without specific prior written permission.
- **
- **
- ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
-
-#include <QGuiApplication>
-
-#include <qqml.h>
-#include <QtQuick/qquickview.h>
-
-
-int main(int argc, char ** argv)
-{
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.setSource(QUrl("qrc:/view.qml"));
- view.setMinimumSize(QSize(400, 100));
- view.show();
-
- return app.exec();
-}
-
diff --git a/examples/multimedia/declarative-radio/view.qml b/examples/multimedia/declarative-radio/view.qml
deleted file mode 100644
index ab173a737..000000000
--- a/examples/multimedia/declarative-radio/view.qml
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
- **
- ** Copyright (C) 2017 The Qt Company Ltd.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the examples of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:BSD$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** BSD License Usage
- ** Alternatively, you may use this file under the terms of the BSD license
- ** as follows:
- **
- ** "Redistribution and use in source and binary forms, with or without
- ** modification, are permitted provided that the following conditions are
- ** met:
- ** * Redistributions of source code must retain the above copyright
- ** notice, this list of conditions and the following disclaimer.
- ** * Redistributions in binary form must reproduce the above copyright
- ** notice, this list of conditions and the following disclaimer in
- ** the documentation and/or other materials provided with the
- ** distribution.
- ** * Neither the name of The Qt Company Ltd nor the names of its
- ** contributors may be used to endorse or promote products derived
- ** from this software without specific prior written permission.
- **
- **
- ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
-
-import QtQuick 2.0
-import QtMultimedia 5.0
-
-Rectangle {
- anchors.fill: parent
- id: root
- property int margins: 5
- property int spacing: 10
-
- QtObject {
- id: d
- property int buttonHeight: root.height > root.width ? root.width / 3 : root.height / 3
- property int buttonWidth: (root.width - spacing * 4) / 4
- }
-
- Radio {
- id: radio
- band: Radio.FM
- }
-
- Column {
- anchors.fill: parent
- anchors.margins: root.margins
-
- Rectangle {
- color: root.color
- width: parent.width
- height: root.height - d.buttonHeight - 40
-
- Text {
- id: freq
- verticalAlignment: Text.AlignVCenter
- text: "" + radio.frequency / 1000 + " kHz"
- anchors {
- bottom: parent.bottom
- margins: root.margins
- }
- }
- Text {
- id: sig
- anchors {
- bottom: parent.bottom
- right: parent.right
- margins: root.margins
-
- }
-
- verticalAlignment: Text.AlignVCenter
- text: (radio.availability == Radio.Available ? "No Signal " : "No Radio Found")
- }
- }
-
- Row {
- spacing: 5
-
- Rectangle {
- width: root.width - 10
- height: 20
- color: "black"
-
- Rectangle {
- width: 5
- height: 20
- color: "red"
-
- y: 0
- x: (parent.width - 5) * ((radio.frequency - radio.minimumFrequency) / (radio.maximumFrequency -
- radio.minimumFrequency))
- }
- }
- }
- Row {
- spacing: root.spacing
- Button {
- text: "Scan Down"
- onClicked: radio.scanDown()
- }
- Button {
- text: "Freq Down"
- onClicked: radio.tuneDown()
- }
- Button {
- text: "Freq Up"
- onClicked: radio.tuneUp()
- }
- Button {
- text: "Scan Up"
- onClicked: radio.scanUp()
- }
- }
- }
-}
-
diff --git a/examples/multimedia/multimedia.pro b/examples/multimedia/multimedia.pro
index 0a01439c4..f49988c31 100644
--- a/examples/multimedia/multimedia.pro
+++ b/examples/multimedia/multimedia.pro
@@ -6,7 +6,6 @@ SUBDIRS += audiodecoder
# These examples all need widgets for now (using creator templates that use widgets)
qtHaveModule(widgets) {
SUBDIRS += \
- radio \
spectrum \
audiorecorder \
audiodevices \
@@ -17,7 +16,6 @@ qtHaveModule(widgets) {
qtHaveModule(quick) {
SUBDIRS += \
declarative-camera \
- declarative-radio \
video
}
diff --git a/examples/multimedia/radio/main.cpp b/examples/multimedia/radio/main.cpp
deleted file mode 100644
index d80ae93e3..000000000
--- a/examples/multimedia/radio/main.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "radio.h"
-
-#include <QtWidgets>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- Radio radio;
- radio.show();
-
- return app.exec();
-};
diff --git a/examples/multimedia/radio/radio.cpp b/examples/multimedia/radio/radio.cpp
deleted file mode 100644
index f4c9f5531..000000000
--- a/examples/multimedia/radio/radio.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "radio.h"
-
-Radio::Radio()
-{
- radio = new QRadioTuner;
- connect(radio, QOverload<QRadioTuner::Error>::of(&QRadioTuner::error),
- this, QOverload<QRadioTuner::Error>::of(&Radio::error));
-
- if (radio->isBandSupported(QRadioTuner::FM))
- radio->setBand(QRadioTuner::FM);
-
- QWidget *window = new QWidget;
- QVBoxLayout *layout = new QVBoxLayout;
- QHBoxLayout *buttonBar = new QHBoxLayout;
- QHBoxLayout *topBar = new QHBoxLayout;
-
- layout->addLayout(topBar);
-
- freq = new QLabel;
- freq->setText(QString("%1 kHz").arg(radio->frequency()/1000));
- topBar->addWidget(freq);
- connect(radio, &QRadioTuner::frequencyChanged,
- this, &Radio::freqChanged);
-
- signal = new QLabel;
- if (radio->isAvailable())
- signal->setText(tr("No Signal"));
- else
- signal->setText(tr("No radio found"));
- topBar->addWidget(signal);
- connect(radio, &QRadioTuner::signalStrengthChanged,
- this, &Radio::signalChanged);
-
- volumeSlider = new QSlider(Qt::Vertical,this);
- volumeSlider->setRange(0, 100);
- volumeSlider->setValue(50);
- connect(volumeSlider, &QSlider::valueChanged,
- this, &Radio::updateVolume);
- topBar->addWidget(volumeSlider);
-
- layout->addLayout(buttonBar);
-
- searchLeft = new QPushButton;
- searchLeft->setText(tr("scan Down"));
- connect(searchLeft, &QPushButton::clicked,
- this, &Radio::searchDown);
- buttonBar->addWidget(searchLeft);
-
- left = new QPushButton;
- left->setText(tr("Freq Down"));
- connect(left, &QPushButton::clicked,
- this, &Radio::freqDown);
- buttonBar->addWidget(left);
-
- right = new QPushButton;
- connect(right, &QPushButton::clicked,
- this, &Radio::freqUp);
- right->setText(tr("Freq Up"));
- buttonBar->addWidget(right);
-
- searchRight = new QPushButton;
- searchRight->setText(tr("scan Up"));
- connect(searchRight, &QPushButton::clicked,
- this, &Radio::searchUp);
- buttonBar->addWidget(searchRight);
-
- window->setLayout(layout);
- setCentralWidget(window);
- window->show();
-
- radio->start();
-}
-
-Radio::~Radio()
-{
-}
-
-void Radio::freqUp()
-{
- int f = radio->frequency();
- f += radio->frequencyStep(QRadioTuner::FM);
- radio->setFrequency(f);
-}
-
-void Radio::freqDown()
-{
- int f = radio->frequency();
- f -= radio->frequencyStep(QRadioTuner::FM);
- radio->setFrequency(f);
-}
-
-void Radio::searchUp()
-{
- radio->searchForward();
-}
-
-void Radio::searchDown()
-{
- radio->searchBackward();
-}
-
-void Radio::freqChanged(int)
-{
- freq->setText(QString("%1 kHz").arg(radio->frequency()/1000));
-}
-
-void Radio::signalChanged(int)
-{
- if(radio->signalStrength() > 25)
- signal->setText(tr("Got Signal"));
- else
- signal->setText(tr("No Signal"));
-}
-
-void Radio::updateVolume(int v)
-{
- radio->setVolume(v);
-}
-
-void Radio::error(QRadioTuner::Error error)
-{
- const QMetaObject *metaObj = radio->metaObject();
- QMetaEnum errorEnum = metaObj->enumerator(metaObj->indexOfEnumerator("Error"));
- qWarning().nospace() << "Warning: Example application received error QRadioTuner::" << errorEnum.valueToKey(error);
-}
-
diff --git a/examples/multimedia/radio/radio.h b/examples/multimedia/radio/radio.h
deleted file mode 100644
index f497e6aa2..000000000
--- a/examples/multimedia/radio/radio.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RADIO_H
-#define RADIO_H
-
-#include <QtWidgets>
-#include <QRadioTuner>
-
-class Radio : public QMainWindow
-{
- Q_OBJECT
-public:
- Radio();
- ~Radio();
-
-public slots:
- void freqUp();
- void freqDown();
- void searchUp();
- void searchDown();
- void freqChanged(int f);
- void signalChanged(int s);
- void updateVolume(int v);
- void error(QRadioTuner::Error error);
-
-private:
- QLabel *freq;
- QLabel *signal;
- QPushButton *left;
- QPushButton *right;
- QPushButton *searchLeft;
- QPushButton *searchRight;
- QSlider *volumeSlider;
- QRadioTuner *radio;
-};
-
-#endif // RADIO_H
diff --git a/examples/multimedia/radio/radio.pro b/examples/multimedia/radio/radio.pro
deleted file mode 100644
index 1b1a35b34..000000000
--- a/examples/multimedia/radio/radio.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-TARGET = radio
-
-QT += multimedia
-
-HEADERS = \
- radio.h
-
-SOURCES = \
- main.cpp \
- radio.cpp
-
-target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/radio
-INSTALLS += target
-
-QT+=widgets
diff --git a/src/imports/multimedia/multimedia.cpp b/src/imports/multimedia/multimedia.cpp
index 45990e4f9..bbc48647a 100644
--- a/src/imports/multimedia/multimedia.cpp
+++ b/src/imports/multimedia/multimedia.cpp
@@ -49,8 +49,6 @@
#include "qdeclarativemultimediaglobal_p.h"
#include "qdeclarativemediametadata_p.h"
#include "qdeclarativeaudio_p.h"
-#include "qdeclarativeradio_p.h"
-#include "qdeclarativeradiodata_p.h"
#include "qdeclarativeplaylist_p.h"
#include "qdeclarativecamera_p.h"
#include "qdeclarativecamerapreviewprovider_p.h"
@@ -88,8 +86,6 @@ public:
qmlRegisterType<QDeclarativeAudio>(uri, 5, 0, "Audio");
qmlRegisterType<QDeclarativeAudio>(uri, 5, 0, "MediaPlayer");
qmlRegisterType<QDeclarativeVideoOutput>(uri, 5, 0, "VideoOutput");
- qmlRegisterType<QDeclarativeRadio>(uri, 5, 0, "Radio");
- qmlRegisterType<QDeclarativeRadioData>(uri, 5, 0, "RadioData");
qmlRegisterType<QDeclarativeCamera>(uri, 5, 0, "Camera");
qmlRegisterType<QDeclarativeTorch>(uri, 5, 0, "Torch");
qmlRegisterUncreatableType<QDeclarativeCameraCapture>(uri, 5, 0, "CameraCapture",
diff --git a/src/imports/multimedia/multimedia.pro b/src/imports/multimedia/multimedia.pro
index 4c35784b9..4fa911d54 100644
--- a/src/imports/multimedia/multimedia.pro
+++ b/src/imports/multimedia/multimedia.pro
@@ -8,8 +8,6 @@ HEADERS += \
qdeclarativeaudio_p.h \
qdeclarativemediametadata_p.h \
qdeclarativeplaylist_p.h \
- qdeclarativeradio_p.h \
- qdeclarativeradiodata_p.h \
qdeclarativecamera_p.h \
qdeclarativecameracapture_p.h \
qdeclarativecamerarecorder_p.h \
@@ -26,8 +24,6 @@ SOURCES += \
multimedia.cpp \
qdeclarativeaudio.cpp \
qdeclarativeplaylist.cpp \
- qdeclarativeradio.cpp \
- qdeclarativeradiodata.cpp \
qdeclarativecamera.cpp \
qdeclarativecameracapture.cpp \
qdeclarativecamerarecorder.cpp \
diff --git a/src/imports/multimedia/qdeclarativeradio.cpp b/src/imports/multimedia/qdeclarativeradio.cpp
deleted file mode 100644
index 655b87ca5..000000000
--- a/src/imports/multimedia/qdeclarativeradio.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativeradio_p.h"
-#include "qdeclarativeradiodata_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype Radio
- \instantiates QDeclarativeRadio
- \inqmlmodule QtMultimedia
- \brief Access radio functionality from a QML application.
- \ingroup multimedia_qml
- \ingroup multimedia_radio_qml
- \inherits Item
- \deprecated
-
- \qml
- Rectangle {
- width: 320
- height: 480
-
- Radio {
- id: radio
- band: Radio.FM
- }
-
- MouseArea {
- x: 0; y: 0
- height: parent.height
- width: parent.width / 2
-
- onClicked: radio.scanDown()
- }
-
- MouseArea {
- x: parent.width / 2; y: 0
- height: parent.height
- width: parent.width / 2
-
- onClicked: radio.scanUp()
- }
- }
- \endqml
-
- You can use \c Radio to tune the radio and get information about the signal.
- You can also use the Radio to get information about tuning, for instance the
- frequency steps supported for tuning.
-
- The corresponding \l RadioData gives RDS information about the
- current radio station. The best way to access the RadioData for
- the current Radio is to use the \c radioData property.
-
- \sa {Radio Overview}
-
-*/
-
-
-QDeclarativeRadio::QDeclarativeRadio(QObject *parent) :
- QObject(parent)
-{
- m_radioTuner = new QRadioTuner(this);
- m_radioData = new QDeclarativeRadioData(m_radioTuner, this);
-
- connect(m_radioTuner, SIGNAL(stateChanged(QRadioTuner::State)), this, SLOT(_q_stateChanged(QRadioTuner::State)));
- connect(m_radioTuner, SIGNAL(bandChanged(QRadioTuner::Band)), this, SLOT(_q_bandChanged(QRadioTuner::Band)));
-
- connect(m_radioTuner, SIGNAL(frequencyChanged(int)), this, SIGNAL(frequencyChanged(int)));
- connect(m_radioTuner, SIGNAL(stereoStatusChanged(bool)), this, SIGNAL(stereoStatusChanged(bool)));
- connect(m_radioTuner, SIGNAL(searchingChanged(bool)), this, SIGNAL(searchingChanged(bool)));
- connect(m_radioTuner, SIGNAL(signalStrengthChanged(int)), this, SIGNAL(signalStrengthChanged(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(stationFound(int,QString)), this, SIGNAL(stationFound(int,QString)));
- connect(m_radioTuner, SIGNAL(antennaConnectedChanged(bool)), this, SIGNAL(antennaConnectedChanged(bool)));
- connect(m_radioTuner, SIGNAL(availabilityChanged(QMultimedia::AvailabilityStatus)), this, SLOT(_q_availabilityChanged(QMultimedia::AvailabilityStatus)));
-
- connect(m_radioTuner, SIGNAL(error(QRadioTuner::Error)), this, SLOT(_q_error(QRadioTuner::Error)));
-}
-
-QDeclarativeRadio::~QDeclarativeRadio()
-{
-}
-
-/*!
- \qmlproperty enumeration QtMultimedia::Radio::state
-
- This property holds the current state of the Radio.
-
- \table
- \header \li Value \li Description
- \row \li ActiveState
- \li The radio is started and active
-
- \row \li StoppedState
- \li The radio is stopped
-
- \endtable
-
- \sa start, stop
-*/
-QDeclarativeRadio::State QDeclarativeRadio::state() const
-{
- return static_cast<QDeclarativeRadio::State>(m_radioTuner->state());
-}
-
-/*!
- \qmlproperty enumeration QtMultimedia::Radio::band
-
- This property holds the frequency band used for the radio, which can be specified as
- any one of the values in the table below.
-
- \table
- \header \li Value \li Description
- \row \li AM
- \li 520 to 1610 kHz, 9 or 10kHz channel spacing, extended 1610 to 1710 kHz
-
- \row \li FM
- \li 87.5 to 108.0 MHz, except Japan 76-90 MHz
-
- \row \li SW
- \li 1.711 to 30.0 MHz, divided into 15 bands. 5kHz channel spacing
-
- \row \li LW
- \li 148.5 to 283.5 kHz, 9kHz channel spacing (Europe, Africa, Asia)
-
- \row \li FM2
- \li range not defined, used when area supports more than one FM range
-
- \endtable
-*/
-QDeclarativeRadio::Band QDeclarativeRadio::band() const
-{
- return static_cast<QDeclarativeRadio::Band>(m_radioTuner->band());
-}
-
-/*!
- \qmlproperty int QtMultimedia::Radio::frequency
-
- Sets the frequency in Hertz that the radio is tuned to. The frequency must be within the frequency
- range for the current band, otherwise it will be changed to be within the frequency range.
-
- \sa maximumFrequency, minimumFrequency
-*/
-int QDeclarativeRadio::frequency() const
-{
- return m_radioTuner->frequency();
-}
-
-/*!
- \qmlproperty enumeration QtMultimedia::Radio::stereoMode
-
- This property holds the stereo mode of the radio, which can be set to any one of the
- values in the table below.
-
- \table
- \header \li Value \li Description
- \row \li Auto
- \li Uses stereo mode matching the station
-
- \row \li ForceStereo
- \li Forces the radio to play the station in stereo, converting the sound signal if necessary
-
- \row \li ForceMono
- \li Forces the radio to play the station in mono, converting the sound signal if necessary
-
- \endtable
-*/
-QDeclarativeRadio::StereoMode QDeclarativeRadio::stereoMode() const
-{
- return static_cast<QDeclarativeRadio::StereoMode>(m_radioTuner->stereoMode());
-}
-
-/*!
- \qmlproperty int QtMultimedia::Radio::volume
-
- Set this property to control the volume of the radio. The valid range of the volume is from 0 to 100.
-*/
-int QDeclarativeRadio::volume() const
-{
- return m_radioTuner->volume();
-}
-
-/*!
- \qmlproperty bool QtMultimedia::Radio::muted
-
- This property reflects whether the radio is muted or not.
-*/
-bool QDeclarativeRadio::muted() const
-{
- return m_radioTuner->isMuted();
-}
-
-/*!
- \qmlproperty bool QtMultimedia::Radio::stereo
-
- This property holds whether the radio is receiving a stereo signal or not. If \l stereoMode is
- set to ForceMono the value will always be false. Likewise, it will always be true if stereoMode
- is set to ForceStereo.
-
- \sa stereoMode
-*/
-bool QDeclarativeRadio::stereo() const
-{
- return m_radioTuner->isStereo();
-}
-
-/*!
- \qmlproperty int QtMultimedia::Radio::signalStrength
-
- The strength of the current radio signal as a percentage where 0% equals no signal, and 100% is a
- very good signal.
-*/
-int QDeclarativeRadio::signalStrength() const
-{
- return m_radioTuner->signalStrength();
-}
-
-/*!
- \qmlproperty bool QtMultimedia::Radio::searching
-
- This property is true if the radio is currently searching for radio stations, for instance using the \l scanUp,
- \l scanDown, and \l searchAllStations methods. Once the search completes, or if it is cancelled using
- \l cancelScan, this property will be false.
-*/
-bool QDeclarativeRadio::searching() const
-{
- return m_radioTuner->isSearching();
-}
-
-/*!
- \qmlproperty int QtMultimedia::Radio::frequencyStep
-
- The number of Hertz for each step when tuning the radio manually. The value is for the current \l band.
- */
-int QDeclarativeRadio::frequencyStep() const
-{
- return m_radioTuner->frequencyStep(m_radioTuner->band());
-}
-
-/*!
- \qmlproperty int QtMultimedia::Radio::minimumFrequency
-
- The minimum frequency for the current \l band.
- */
-int QDeclarativeRadio::minimumFrequency() const
-{
- return m_radioTuner->frequencyRange(m_radioTuner->band()).first;
-}
-
-/*!
- \qmlproperty int QtMultimedia::Radio::maximumFrequency
-
- The maximum frequency for the current \l band.
- */
-int QDeclarativeRadio::maximumFrequency() const
-{
- return m_radioTuner->frequencyRange(m_radioTuner->band()).second;
-}
-
-/*!
- \qmlproperty int QtMultimedia::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();
-}
-
-/*!
- \qmlproperty enumeration QtMultimedia::Radio::availability
-
- Returns the availability state of the radio.
-
- This is one of:
-
- \table
- \header \li Value \li Description
- \row \li Available
- \li The radio is available to use
- \row \li Busy
- \li The radio is usually available to use, but is currently busy.
- This can happen when some other process needs to use the audio
- hardware.
- \row \li Unavailable
- \li The radio is not available to use (there may be no radio
- hardware)
- \row \li ResourceMissing
- \li There is one or more resources missing, so the radio cannot
- be used. It may be possible to try again at a later time. This
- can occur if there is no antenna connected - see the \l antennaConnected
- property as well.
- \endtable
- */
-QDeclarativeRadio::Availability QDeclarativeRadio::availability() const
-{
- return Availability(m_radioTuner->availability());
-}
-
-void QDeclarativeRadio::setBand(QDeclarativeRadio::Band band)
-{
- m_radioTuner->setBand(static_cast<QRadioTuner::Band>(band));
-}
-
-void QDeclarativeRadio::setFrequency(int frequency)
-{
- m_radioTuner->setFrequency(frequency);
-}
-
-void QDeclarativeRadio::setStereoMode(QDeclarativeRadio::StereoMode stereoMode)
-{
- m_radioTuner->setStereoMode(static_cast<QRadioTuner::StereoMode>(stereoMode));
-}
-
-void QDeclarativeRadio::setVolume(int volume)
-{
- m_radioTuner->setVolume(volume);
-}
-
-void QDeclarativeRadio::setMuted(bool muted)
-{
- m_radioTuner->setMuted(muted);
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::cancelScan()
-
- Cancel the current scan. Will also cancel a search started with \l searchAllStations.
- */
-void QDeclarativeRadio::cancelScan()
-{
- m_radioTuner->cancelSearch();
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::scanDown()
-
- Searches backward in the frequency range for the current band.
- */
-void QDeclarativeRadio::scanDown()
-{
- m_radioTuner->searchBackward();
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::scanUp()
-
- Searches forward in the frequency range for the current band.
- */
-void QDeclarativeRadio::scanUp()
-{
- m_radioTuner->searchForward();
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::searchAllStations(enumeration searchMode)
-
- Start searching the complete frequency range for the current band, and save all the
- radio stations found. The \a searchMode can be either of the values described in the
- table below.
-
- \table
- \header \li Value \li Description
- \row \li SearchFast
- \li Stores each radio station for later retrival and tuning
-
- \row \li SearchGetStationId
- \li Does the same as SearchFast, but also emits the station Id with the \l stationFound signal.
-
- \endtable
-
- The snippet below uses \c searchAllStations with \c SearchGetStationId to receive all the radio
- stations in the current band, and store them in a ListView. The station Id is shown to the user
- and if the user presses a station, the radio is tuned to this station.
-
- \qml
- Item {
- width: 640
- height: 360
-
- Radio {
- id: radio
- onStationFound: radioStations.append({"frequency": frequency, "stationId": stationId})
- }
-
- ListModel {
- id: radioStations
- }
-
- ListView {
- model: radioStations
- delegate: Rectangle {
- MouseArea {
- anchors.fill: parent
- onClicked: radio.frequency = frequency
- }
-
- Text {
- anchors.fill: parent
- text: stationId
- }
- }
- }
-
- Rectangle {
- MouseArea {
- anchors.fill: parent
- onClicked: radio.searchAllStations(Radio.SearchGetStationId)
- }
- }
- }
- \endqml
- */
-void QDeclarativeRadio::searchAllStations(QDeclarativeRadio::SearchMode searchMode)
-{
- m_radioTuner->searchAllStations(static_cast<QRadioTuner::SearchMode>(searchMode));
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::tuneDown()
-
- Decrements the frequency by the frequency step for the current band. If the frequency is already set
- to the minimum frequency, calling this function has no effect.
-
- \sa band, frequencyStep, minimumFrequency
- */
-void QDeclarativeRadio::tuneDown()
-{
- int f = frequency();
- f = f - frequencyStep();
- setFrequency(f);
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::tuneUp()
-
- Increments the frequency by the frequency step for the current band. If the frequency is already set
- to the maximum frequency, calling this function has no effect.
-
- \sa band, frequencyStep, maximumFrequency
- */
-void QDeclarativeRadio::tuneUp()
-{
- int f = frequency();
- f = f + frequencyStep();
- setFrequency(f);
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::start()
-
- Starts the radio. If the radio is available, as determined by the \l availability property,
- this will result in the \l state becoming \c ActiveState.
- */
-void QDeclarativeRadio::start()
-{
- m_radioTuner->start();
-}
-
-/*!
- \qmlmethod QtMultimedia::Radio::stop()
-
- Stops the radio. After calling this method the \l state will be \c StoppedState.
- */
-void QDeclarativeRadio::stop()
-{
- m_radioTuner->stop();
-}
-
-void QDeclarativeRadio::_q_stateChanged(QRadioTuner::State state)
-{
- emit stateChanged(static_cast<QDeclarativeRadio::State>(state));
-}
-
-void QDeclarativeRadio::_q_bandChanged(QRadioTuner::Band band)
-{
- emit bandChanged(static_cast<QDeclarativeRadio::Band>(band));
-}
-
-void QDeclarativeRadio::_q_error(QRadioTuner::Error errorCode)
-{
- emit error(static_cast<QDeclarativeRadio::Error>(errorCode));
- emit errorChanged();
-}
-
-void QDeclarativeRadio::_q_availabilityChanged(QMultimedia::AvailabilityStatus availability)
-{
- emit availabilityChanged(Availability(availability));
-}
-
-/*!
- \qmlsignal QtMultimedia::Radio::stationFound(int frequency, string stationId)
-
- This signal is emitted when a new radio station is found. This signal is only emitted
- if \l searchAllStations is called with \c SearchGetStationId.
-
- The \a frequency is returned in Hertz, and the \a stationId corresponds to the station Id
- in the \l RadioData for this radio station.
-
- The corresponding handler is \c onStationFound.
- */
-
-QT_END_NAMESPACE
diff --git a/src/imports/multimedia/qdeclarativeradio_p.h b/src/imports/multimedia/qdeclarativeradio_p.h
deleted file mode 100644
index b1dc4e6d9..000000000
--- a/src/imports/multimedia/qdeclarativeradio_p.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVERADIO_P_H
-#define QDECLARATIVERADIO_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of other Qt classes. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <qradiotuner.h>
-#include <QtQml/qqml.h>
-
-Q_MOC_INCLUDE("qdeclarativeradiodata_p.h")
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeRadioData;
-
-class QDeclarativeRadio : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(State state READ state NOTIFY stateChanged)
- Q_PROPERTY(Band band READ band WRITE setBand NOTIFY bandChanged)
- Q_PROPERTY(int frequency READ frequency WRITE setFrequency NOTIFY frequencyChanged)
- Q_PROPERTY(bool stereo READ stereo NOTIFY stereoStatusChanged)
- Q_PROPERTY(StereoMode stereoMode READ stereoMode WRITE setStereoMode)
- Q_PROPERTY(int signalStrength READ signalStrength NOTIFY signalStrengthChanged)
- Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)
- Q_PROPERTY(bool muted READ muted WRITE setMuted NOTIFY mutedChanged)
- Q_PROPERTY(bool searching READ searching NOTIFY searchingChanged)
- Q_PROPERTY(int frequencyStep READ frequencyStep NOTIFY bandChanged)
- Q_PROPERTY(int minimumFrequency READ minimumFrequency NOTIFY bandChanged)
- Q_PROPERTY(int maximumFrequency READ maximumFrequency NOTIFY bandChanged)
- Q_PROPERTY(bool antennaConnected READ isAntennaConnected NOTIFY antennaConnectedChanged)
- Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged)
- Q_PROPERTY(QDeclarativeRadioData* radioData READ radioData CONSTANT)
- Q_ENUMS(State)
- Q_ENUMS(Band)
- Q_ENUMS(Error)
- Q_ENUMS(StereoMode)
- Q_ENUMS(SearchMode)
- Q_ENUMS(Availability)
-
-public:
- enum State {
- ActiveState = QRadioTuner::ActiveState,
- StoppedState = QRadioTuner::StoppedState
- };
-
- enum Band {
- AM = QRadioTuner::AM,
- FM = QRadioTuner::FM,
- SW = QRadioTuner::SW,
- LW = QRadioTuner::LW,
- FM2 = QRadioTuner::FM2
- };
-
- enum Error {
- NoError = QRadioTuner::NoError,
- ResourceError = QRadioTuner::ResourceError,
- OpenError = QRadioTuner::OpenError,
- OutOfRangeError = QRadioTuner::OutOfRangeError
- };
-
- enum StereoMode {
- ForceStereo = QRadioTuner::ForceStereo,
- ForceMono = QRadioTuner::ForceMono,
- Auto = QRadioTuner::Auto
- };
-
- enum SearchMode {
- SearchFast = QRadioTuner::SearchFast,
- SearchGetStationId = QRadioTuner::SearchGetStationId
- };
-
- enum Availability {
- Available = QMultimedia::Available,
- Busy = QMultimedia::Busy,
- Unavailable = QMultimedia::ServiceMissing,
- ResourceMissing = QMultimedia::ResourceError
- };
-
- QDeclarativeRadio(QObject *parent = 0);
- ~QDeclarativeRadio();
-
- QDeclarativeRadio::State state() const;
- QDeclarativeRadio::Band band() const;
- int frequency() const;
- QDeclarativeRadio::StereoMode stereoMode() const;
- int volume() const;
- bool muted() const;
-
- bool stereo() const;
- int signalStrength() const;
- bool searching() const;
-
- int frequencyStep() const;
- int minimumFrequency() const;
- int maximumFrequency() const;
-
- bool isAntennaConnected() const;
-
- Q_INVOKABLE bool isAvailable() const {return availability() == Available;}
- Availability availability() const;
-
- QDeclarativeRadioData *radioData() { return m_radioData; }
-
-public Q_SLOTS:
- void setBand(QDeclarativeRadio::Band band);
- void setFrequency(int frequency);
- void setStereoMode(QDeclarativeRadio::StereoMode stereoMode);
- void setVolume(int volume);
- void setMuted(bool muted);
-
- void cancelScan();
- void scanDown();
- void scanUp();
- void tuneUp();
- void tuneDown();
- void searchAllStations(QDeclarativeRadio::SearchMode searchMode = QDeclarativeRadio::SearchFast );
-
- void start();
- void stop();
-
-Q_SIGNALS:
- void stateChanged(QDeclarativeRadio::State state);
- void bandChanged(QDeclarativeRadio::Band band);
- void frequencyChanged(int frequency);
- void stereoStatusChanged(bool stereo);
- void searchingChanged(bool searching);
- void signalStrengthChanged(int signalStrength);
- void volumeChanged(int volume);
- void mutedChanged(bool muted);
- void stationFound(int frequency, QString stationId);
- void antennaConnectedChanged(bool connectionStatus);
-
- void availabilityChanged(Availability availability);
-
- void errorChanged();
- void error(QDeclarativeRadio::Error errorCode);
-
-private Q_SLOTS:
- void _q_stateChanged(QRadioTuner::State state);
- void _q_bandChanged(QRadioTuner::Band band);
- void _q_error(QRadioTuner::Error errorCode);
- void _q_availabilityChanged(QMultimedia::AvailabilityStatus);
-
-private:
- Q_DISABLE_COPY(QDeclarativeRadio)
-
- QRadioTuner *m_radioTuner;
- QDeclarativeRadioData *m_radioData;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeRadio))
-
-#endif // QDECLARATIVERADIO_P_H
diff --git a/src/imports/multimedia/qdeclarativeradiodata.cpp b/src/imports/multimedia/qdeclarativeradiodata.cpp
deleted file mode 100644
index 770d6d7c0..000000000
--- a/src/imports/multimedia/qdeclarativeradiodata.cpp
+++ /dev/null
@@ -1,325 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativeradiodata_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype RadioData
- \instantiates QDeclarativeRadioData
- \inqmlmodule QtMultimedia
- \brief Access RDS data from a QML application.
- \ingroup multimedia_qml
- \ingroup multimedia_radio_qml
- \inherits Item
-
- \c RadioData is your gateway to all the data available through RDS. RDS is the Radio Data System
- which allows radio stations to broadcast information like the \l stationId, \l programType, \l programTypeName,
- \l stationName, and \l radioText. This information can be read from the \c RadioData. It also allows
- you to set whether the radio should tune to alternative frequencies if the current signal strength falls too much.
-
- \qml
- Rectangle {
- width: 480
- height: 320
-
- Radio {
- id: radio
- band: Radio.FM
- }
-
- Column {
- Text {
- text: radio.radioData.stationName
- }
-
- Text {
- text: radio.radioData.programTypeName
- }
-
- Text {
- text: radio.radioData.radioText
- }
- }
- }
-
- \endqml
-
- You use \c RadioData together with a \l Radio, either by
- accessing the \c radioData property of the Radio, or
- creating a separate RadioData. The properties of the
- RadioData type will reflect the information broadcast by the
- radio station the Radio is currently tuned to.
-
- \sa {Radio Overview}
-*/
-QDeclarativeRadioData::QDeclarativeRadioData(QObject *parent) :
- QObject(parent)
-{
- m_radioTuner = new QRadioTuner(this);
- m_radioData = m_radioTuner->radioData();
-
- connectSignals();
-}
-
-QDeclarativeRadioData::QDeclarativeRadioData(QRadioTuner *tuner, QObject *parent) :
- QObject(parent)
-{
- m_radioTuner = tuner;
- m_radioData = m_radioTuner->radioData();
-
- connectSignals();
-}
-
-QDeclarativeRadioData::~QDeclarativeRadioData()
-{
-}
-
-/*!
- \qmlproperty enumeration QtMultimedia::RadioData::availability
-
- Returns the availability state of the radio data interface.
-
- This is one of:
-
- \table
- \header \li Value \li Description
- \row \li Available
- \li The radio data interface is available to use
- \row \li Busy
- \li The radio data interface is usually available to use, but is currently busy.
- \row \li Unavailable
- \li The radio data interface is not available to use (there may be no radio
- hardware)
- \row \li ResourceMissing
- \li There is one or more resources missing, so the radio cannot
- be used. It may be possible to try again at a later time.
- \endtable
- */
-QDeclarativeRadioData::Availability QDeclarativeRadioData::availability() const
-{
- if (m_radioData)
- return Availability(m_radioData->availability());
-
- return Unavailable;
-}
-
-
-/*!
- \qmlproperty string QtMultimedia::RadioData::stationId
-
- This property allows you to read the station Id of the currently tuned radio
- station.
- */
-QString QDeclarativeRadioData::stationId() const
-{
- if (m_radioData)
- return m_radioData->stationId();
-
- return QString();
-}
-
-/*!
- \qmlproperty enumeration QtMultimedia::RadioData::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.
-
- \table
- \header \li Value
- \row \li Undefined
- \row \li News
- \row \li CurrentAffairs
- \row \li Information
- \row \li Sport
- \row \li Education
- \row \li Drama
- \row \li Culture
- \row \li Science
- \row \li Varied
- \row \li PopMusic
- \row \li RockMusic
- \row \li EasyListening
- \row \li LightClassical
- \row \li SeriousClassical
- \row \li OtherMusic
- \row \li Weather
- \row \li Finance
- \row \li ChildrensProgrammes
- \row \li SocialAffairs
- \row \li Religion
- \row \li PhoneIn
- \row \li Travel
- \row \li Leisure
- \row \li JazzMusic
- \row \li CountryMusic
- \row \li NationalMusic
- \row \li OldiesMusic
- \row \li FolkMusic
- \row \li Documentary
- \row \li AlarmTest
- \row \li Alarm
- \row \li Talk
- \row \li ClassicRock
- \row \li AdultHits
- \row \li SoftRock
- \row \li Top40
- \row \li Soft
- \row \li Nostalgia
- \row \li Classical
- \row \li RhythmAndBlues
- \row \li SoftRhythmAndBlues
- \row \li Language
- \row \li ReligiousMusic
- \row \li ReligiousTalk
- \row \li Personality
- \row \li Public
- \row \li College
-
- \endtable
- */
-QDeclarativeRadioData::ProgramType QDeclarativeRadioData::programType() const
-{
- if (m_radioData)
- return static_cast<QDeclarativeRadioData::ProgramType>(m_radioData->programType());
-
- return Undefined;
-}
-
-/*!
- \qmlproperty string QtMultimedia::RadioData::programTypeName
-
- This property holds a string representation of the \l programType.
- */
-QString QDeclarativeRadioData::programTypeName() const
-{
- if (m_radioData)
- return m_radioData->programTypeName();
-
- return QString();
-}
-
-/*!
- \qmlproperty string QtMultimedia::RadioData::stationName
-
- This property has the name of the currently tuned radio station.
- */
-QString QDeclarativeRadioData::stationName() const
-{
- if (m_radioData)
- return m_radioData->stationName();
-
- return QString();
-}
-
-/*!
- \qmlproperty string QtMultimedia::RadioData::radioText
-
- This property holds free-text transmitted by the radio station. This is typically used to
- show supporting information for the currently playing content, for instance song title or
- artist name.
- */
-QString QDeclarativeRadioData::radioText() const
-{
- if (m_radioData)
- return m_radioData->radioText();
-
- return QString();
-}
-
-/*!
- \qmlproperty bool QtMultimedia::RadioData::alternativeFrequenciesEnabled
-
- This property allows you to specify whether the radio should try and tune to alternative
- frequencies if the signal strength of the current station becomes too weak. The alternative
- frequencies are emitted over RDS by the radio station, and the tuning happens automatically.
- */
-bool QDeclarativeRadioData::alternativeFrequenciesEnabled() const
-{
- if (m_radioData)
- return m_radioData->isAlternativeFrequenciesEnabled();
-
- return false;
-}
-
-void QDeclarativeRadioData::setAlternativeFrequenciesEnabled(bool enabled)
-{
- if (m_radioData)
- m_radioData->setAlternativeFrequenciesEnabled(enabled);
-}
-
-void QDeclarativeRadioData::_q_programTypeChanged(QRadioData::ProgramType programType)
-{
- emit programTypeChanged(static_cast<QDeclarativeRadioData::ProgramType>(programType));
-}
-
-void QDeclarativeRadioData::_q_error(QRadioData::Error errorCode)
-{
- emit error(static_cast<QDeclarativeRadioData::Error>(errorCode));
- emit errorChanged();
-}
-
-void QDeclarativeRadioData::_q_availabilityChanged(QMultimedia::AvailabilityStatus availability)
-{
- emit availabilityChanged(Availability(availability));
-}
-
-void QDeclarativeRadioData::connectSignals()
-{
- if (!m_radioData)
- return;
-
- connect(m_radioData, SIGNAL(programTypeChanged(QRadioData::ProgramType)), this,
- SLOT(_q_programTypeChanged(QRadioData::ProgramType)));
-
- connect(m_radioData, SIGNAL(stationIdChanged(QString)), this, SIGNAL(stationIdChanged(QString)));
- connect(m_radioData, SIGNAL(programTypeNameChanged(QString)), this, SIGNAL(programTypeNameChanged(QString)));
- connect(m_radioData, SIGNAL(stationNameChanged(QString)), this, SIGNAL(stationNameChanged(QString)));
- connect(m_radioData, SIGNAL(radioTextChanged(QString)), this, SIGNAL(radioTextChanged(QString)));
- connect(m_radioData, SIGNAL(alternativeFrequenciesEnabledChanged(bool)), this,
- SIGNAL(alternativeFrequenciesEnabledChanged(bool)));
- // Since the radio data type depends on the service for the tuner, the availability is also dictated from the tuner
- connect(m_radioTuner, SIGNAL(availabilityChanged(QMultimedia::AvailabilityStatus)), this, SLOT(_q_availabilityChanged(QMultimedia::AvailabilityStatus)));
-
- connect(m_radioData, SIGNAL(error(QRadioData::Error)), this, SLOT(_q_error(QRadioData::Error)));
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/multimedia/qdeclarativeradiodata_p.h b/src/imports/multimedia/qdeclarativeradiodata_p.h
deleted file mode 100644
index df99ff6e0..000000000
--- a/src/imports/multimedia/qdeclarativeradiodata_p.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVERADIODATA_P_H
-#define QDECLARATIVERADIODATA_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of other Qt classes. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <qradiodata.h>
-#include <qradiotuner.h>
-#include <QtQml/qqml.h>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeRadioData : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString stationId READ stationId NOTIFY stationIdChanged)
- Q_PROPERTY(QDeclarativeRadioData::ProgramType programType READ programType NOTIFY programTypeChanged)
- Q_PROPERTY(QString programTypeName READ programTypeName NOTIFY programTypeNameChanged)
- Q_PROPERTY(QString stationName READ stationName NOTIFY stationNameChanged)
- Q_PROPERTY(QString radioText READ radioText NOTIFY radioTextChanged)
- Q_PROPERTY(bool alternativeFrequenciesEnabled READ alternativeFrequenciesEnabled
- WRITE setAlternativeFrequenciesEnabled NOTIFY alternativeFrequenciesEnabledChanged)
- Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged)
- Q_ENUMS(Error)
- Q_ENUMS(ProgramType)
- Q_ENUMS(Availability)
-
-public:
-
- enum Error {
- NoError = QRadioData::NoError,
- ResourceError = QRadioData::ResourceError,
- OpenError = QRadioData::OpenError,
- OutOfRangeError = QRadioData::OutOfRangeError
- };
-
- enum ProgramType {
- Undefined = QRadioData::Undefined,
- News = QRadioData::News,
- CurrentAffairs = QRadioData::CurrentAffairs,
- Information = QRadioData::Information,
- Sport = QRadioData::Sport,
- Education = QRadioData::Education,
- Drama = QRadioData::Drama,
- Culture = QRadioData::Culture,
- Science = QRadioData::Science,
- Varied = QRadioData::Varied,
- PopMusic = QRadioData::PopMusic,
- RockMusic = QRadioData::RockMusic,
- EasyListening = QRadioData::EasyListening,
- LightClassical = QRadioData::LightClassical,
- SeriousClassical = QRadioData::SeriousClassical,
- OtherMusic = QRadioData::OtherMusic,
- Weather = QRadioData::Weather,
- Finance = QRadioData::Finance,
- ChildrensProgrammes = QRadioData::ChildrensProgrammes,
- SocialAffairs = QRadioData::SocialAffairs,
- Religion = QRadioData::Religion,
- PhoneIn = QRadioData::PhoneIn,
- Travel = QRadioData::Travel,
- Leisure = QRadioData::Leisure,
- JazzMusic = QRadioData::JazzMusic,
- CountryMusic = QRadioData::CountryMusic,
- NationalMusic = QRadioData::NationalMusic,
- OldiesMusic = QRadioData::OldiesMusic,
- FolkMusic = QRadioData::FolkMusic,
- Documentary = QRadioData::Documentary,
- AlarmTest = QRadioData::AlarmTest,
- Alarm = QRadioData::Alarm,
- Talk = QRadioData::Talk,
- ClassicRock = QRadioData::ClassicRock,
- AdultHits = QRadioData::AdultHits,
- SoftRock = QRadioData::SoftRock,
- Top40 = QRadioData::Top40,
- Soft = QRadioData::Soft,
- Nostalgia = QRadioData::Nostalgia,
- Classical = QRadioData::Classical,
- RhythmAndBlues = QRadioData::RhythmAndBlues,
- SoftRhythmAndBlues = QRadioData::SoftRhythmAndBlues,
- Language = QRadioData::Language,
- ReligiousMusic = QRadioData::ReligiousMusic,
- ReligiousTalk = QRadioData::ReligiousTalk,
- Personality = QRadioData::Personality,
- Public = QRadioData::Public,
- College = QRadioData::College
- };
-
- enum Availability {
- Available = QMultimedia::Available,
- Busy = QMultimedia::Busy,
- Unavailable = QMultimedia::ServiceMissing,
- ResourceMissing = QMultimedia::ResourceError
- };
-
- QDeclarativeRadioData(QObject *parent = 0);
- QDeclarativeRadioData(QRadioTuner *tuner, QObject *parent = 0);
- ~QDeclarativeRadioData();
-
- QString stationId() const;
- QDeclarativeRadioData::ProgramType programType() const;
- QString programTypeName() const;
- QString stationName() const;
- QString radioText() const;
- bool alternativeFrequenciesEnabled() const;
-
- Q_INVOKABLE bool isAvailable() const {return availability() == Available;}
- Availability availability() const;
-
-public Q_SLOTS:
- void setAlternativeFrequenciesEnabled(bool enabled);
-
-Q_SIGNALS:
- void stationIdChanged(QString stationId);
- void programTypeChanged(QDeclarativeRadioData::ProgramType programType);
- void programTypeNameChanged(QString programTypeName);
- void stationNameChanged(QString stationName);
- void radioTextChanged(QString radioText);
- void alternativeFrequenciesEnabledChanged(bool enabled);
-
- void availabilityChanged(Availability availability);
-
- void errorChanged();
- void error(QDeclarativeRadioData::Error errorCode);
-
-private Q_SLOTS:
- void _q_programTypeChanged(QRadioData::ProgramType programType);
- void _q_error(QRadioData::Error errorCode);
- void _q_availabilityChanged(QMultimedia::AvailabilityStatus);
-
-private:
- void connectSignals();
-
- Q_DISABLE_COPY(QDeclarativeRadioData)
-
- QRadioData *m_radioData;
- QRadioTuner *m_radioTuner;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeRadioData))
-
-#endif // QDECLARATIVERADIODATA_P_H
diff --git a/src/multimedia/controls/controls.pri b/src/multimedia/controls/controls.pri
index a7f943e78..c0eb28936 100644
--- a/src/multimedia/controls/controls.pri
+++ b/src/multimedia/controls/controls.pri
@@ -27,8 +27,6 @@ PUBLIC_HEADERS += \
controls/qmediastreamscontrol.h \
controls/qmetadatareadercontrol.h \
controls/qmetadatawritercontrol.h \
- controls/qradiodatacontrol.h \
- controls/qradiotunercontrol.h \
controls/qvideodeviceselectorcontrol.h \
controls/qvideoencodersettingscontrol.h \
controls/qvideorenderercontrol.h \
@@ -67,8 +65,6 @@ SOURCES += \
controls/qmediastreamscontrol.cpp \
controls/qmetadatareadercontrol.cpp \
controls/qmetadatawritercontrol.cpp \
- controls/qradiodatacontrol.cpp \
- controls/qradiotunercontrol.cpp \
controls/qvideorenderercontrol.cpp \
controls/qvideowindowcontrol.cpp \
controls/qmediaaudioprobecontrol.cpp \
diff --git a/src/multimedia/controls/qradiodatacontrol.cpp b/src/multimedia/controls/qradiodatacontrol.cpp
deleted file mode 100644
index 27e192674..000000000
--- a/src/multimedia/controls/qradiodatacontrol.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qtmultimediaglobal.h>
-#include "qradiodatacontrol.h"
-#include "qmediacontrol_p.h"
-
-QT_BEGIN_NAMESPACE
-
-
-/*!
- \class QRadioDataControl
- \obsolete
- \inmodule QtMultimedia
-
-
- \ingroup multimedia_control
-
-
- \brief The QRadioDataControl class provides access to the RDS functionality of the
- radio in the QMediaService.
-
- The functionality provided by this control is exposed to application code
- through the QRadioData class.
-
- The interface name of QRadioDataControl is \c org.qt-project.qt.radiodatacontrol/5.0 as
- defined in QRadioDataControl_iid.
-
- \sa QMediaService::requestControl(), QRadioData
-*/
-
-/*!
- \macro QRadioDataControl_iid
-
- \c org.qt-project.qt.radiodatacontrol/5.0
-
- Defines the interface name of the QRadioDataControl class.
-
- \relates QRadioDataControl
-*/
-
-/*!
- Constructs a radio data control with the given \a parent.
-*/
-
-QRadioDataControl::QRadioDataControl(QObject *parent):
- QMediaControl(*new QMediaControlPrivate, parent)
-{
-}
-
-/*!
- Destroys a radio data control.
-*/
-
-QRadioDataControl::~QRadioDataControl()
-{
-}
-
-/*!
- \fn QRadioData::Error QRadioDataControl::error() const
-
- Returns the error state of a radio data.
-*/
-
-/*!
- \fn QString QRadioDataControl::errorString() const
-
- Returns a string describing a radio data's error state.
-*/
-
-/*!
- \fn void QRadioDataControl::error(QRadioData::Error error)
-
- Signals that an \a error has occurred.
-*/
-
-/*!
- \fn QString QRadioDataControl::stationId() const
-
- Returns the current Program Identification
-*/
-
-/*!
- \fn QRadioData::ProgramType QRadioDataControl::programType() const
-
- Returns the current Program Type
-*/
-
-/*!
- \fn QString QRadioDataControl::programTypeName() const
-
- Returns the current Program Type Name
-*/
-
-/*!
- \fn QString QRadioDataControl::stationName() const
-
- Returns the current Program Service
-*/
-
-/*!
- \fn QString QRadioDataControl::radioText() const
-
- Returns the current Radio Text
-*/
-
-/*!
- \fn void QRadioDataControl::setAlternativeFrequenciesEnabled(bool enabled)
-
- Sets the Alternative Frequency to \a enabled
-*/
-
-/*!
- \fn bool QRadioDataControl::isAlternativeFrequenciesEnabled() const
-
- Returns true if Alternative Frequency is currently enabled
-*/
-
-/*!
- \fn QRadioDataControl::alternativeFrequenciesEnabledChanged(bool enabled)
-
- Signals that the alternative frequencies setting has changed to the value of \a enabled.
-*/
-
-/*!
- \fn void QRadioDataControl::stationIdChanged(QString stationId)
-
- Signals that the Program Identification \a stationId has changed
-*/
-
-/*!
- \fn void QRadioDataControl::programTypeChanged(QRadioData::ProgramType programType)
-
- Signals that the Program Type \a programType has changed
-*/
-
-/*!
- \fn void QRadioDataControl::programTypeNameChanged(QString programTypeName)
-
- Signals that the Program Type Name \a programTypeName has changed
-*/
-
-/*!
- \fn void QRadioDataControl::stationNameChanged(QString stationName)
-
- Signals that the Program Service \a stationName has changed
-*/
-
-/*!
- \fn void QRadioDataControl::radioTextChanged(QString radioText)
-
- Signals that the Radio Text \a radioText has changed
-*/
-
-QT_END_NAMESPACE
-
-#include "moc_qradiodatacontrol.cpp"
diff --git a/src/multimedia/controls/qradiodatacontrol.h b/src/multimedia/controls/qradiodatacontrol.h
deleted file mode 100644
index 98302b918..000000000
--- a/src/multimedia/controls/qradiodatacontrol.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QRADIODATACONTROL_H
-#define QRADIODATACONTROL_H
-
-#include <QtMultimedia/qmediacontrol.h>
-#include <QtMultimedia/qradiodata.h>
-
-QT_BEGIN_NAMESPACE
-
-// Required for QDoc workaround
-class QString;
-
-class Q_MULTIMEDIA_EXPORT QRadioDataControl : public QMediaControl
-{
- Q_OBJECT
-
-public:
- ~QRadioDataControl();
-
- virtual QString stationId() const = 0;
- virtual QRadioData::ProgramType programType() const = 0;
- virtual QString programTypeName() const = 0;
- virtual QString stationName() const = 0;
- virtual QString radioText() const = 0;
- virtual void setAlternativeFrequenciesEnabled(bool enabled) = 0;
- virtual bool isAlternativeFrequenciesEnabled() const = 0;
-
- virtual QRadioData::Error error() const = 0;
- virtual QString errorString() const = 0;
-
-Q_SIGNALS:
- void stationIdChanged(QString stationId);
- void programTypeChanged(QRadioData::ProgramType programType);
- void programTypeNameChanged(QString programTypeName);
- void stationNameChanged(QString stationName);
- void radioTextChanged(QString radioText);
- void alternativeFrequenciesEnabledChanged(bool enabled);
- void error(QRadioData::Error err);
-
-protected:
- explicit QRadioDataControl(QObject *parent = nullptr);
-};
-
-#define QRadioDataControl_iid "org.qt-project.qt.radiodatacontrol/5.0"
-Q_MEDIA_DECLARE_CONTROL(QRadioDataControl, QRadioDataControl_iid)
-
-QT_END_NAMESPACE
-
-
-#endif // QRADIODATACONTROL_H
diff --git a/src/multimedia/controls/qradiotunercontrol.cpp b/src/multimedia/controls/qradiotunercontrol.cpp
deleted file mode 100644
index 20897150b..000000000
--- a/src/multimedia/controls/qradiotunercontrol.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qtmultimediaglobal.h>
-#include "qradiotunercontrol.h"
-#include "qmediacontrol_p.h"
-
-QT_BEGIN_NAMESPACE
-
-
-/*!
- \class QRadioTunerControl
- \obsolete
- \inmodule QtMultimedia
-
- \ingroup multimedia_control
-
-
- \brief The QRadioTunerControl class provides access to the radio tuning
- functionality of a QMediaService.
-
- If a QMediaService can tune an analog radio device it will implement
- QRadioTunerControl. This control provides a means to tune a radio device
- to a specific \l {setFrequency()}{frequency} as well as search \l
- {searchForward()}{forwards} and \l {searchBackward()}{backwards} for a
- signal.
-
- The functionality provided by this control is exposed to application code
- through the QRadioTuner class.
-
- The interface name of QRadioTunerControl is \c org.qt-project.qt.radiotunercontrol/5.0 as
- defined in QRadioTunerControl_iid.
-
- \sa QMediaService::requestControl(), QRadioTuner
-*/
-
-/*!
- \macro QRadioTunerControl_iid
-
- \c org.qt-project.qt.radiotunercontrol/5.0
-
- Defines the interface name of the QRadioTunerControl class.
-
- \relates QRadioTunerControl
-*/
-
-/*!
- Constructs a radio tuner control with the given \a parent.
-*/
-
-QRadioTunerControl::QRadioTunerControl(QObject *parent):
- QMediaControl(*new QMediaControlPrivate, parent)
-{
-}
-
-/*!
- Destroys a radio tuner control.
-*/
-
-QRadioTunerControl::~QRadioTunerControl()
-{
-}
-
-/*!
- \fn QRadioTuner::State QRadioTunerControl::state() const
-
- Returns the current radio tuner state.
-*/
-
-/*!
- \fn QRadioTuner::Band QRadioTunerControl::band() const
-
- Returns the frequency band a radio tuner is tuned to.
-*/
-
-/*!
- \fn void QRadioTunerControl::bandChanged(QRadioTuner::Band band)
-
- Signals that the frequency \a band a radio tuner is tuned to has changed.
-*/
-
-/*!
- \fn void QRadioTunerControl::setBand(QRadioTuner::Band band)
-
- Sets the frequecy \a band a radio tuner is tuned to.
-
- Changing the frequency band will reset the frequency to the minimum frequency of the new band.
-*/
-
-/*!
- \fn bool QRadioTunerControl::isBandSupported(QRadioTuner::Band band) const
-
- Identifies if a frequency \a band is supported.
-
- Returns true if the band is supported, and false if it is not.
-*/
-
-/*!
- \fn int QRadioTunerControl::frequency() const
-
- Returns the frequency a radio tuner is tuned to.
-*/
-
-/*!
- \fn int QRadioTunerControl::frequencyStep(QRadioTuner::Band band) const
-
- Returns the number of Hertz to increment the frequency by when stepping through frequencies
- within a given \a band.
-*/
-
-/*!
- \fn QPair<int,int> QRadioTunerControl::frequencyRange(QRadioTuner::Band band) const
-
- Returns a frequency \a band's minimum and maximum frequency.
-*/
-
-/*!
- \fn void QRadioTunerControl::setFrequency(int frequency)
-
- Sets the \a frequency a radio tuner is tuned to.
-*/
-
-/*!
- \fn bool QRadioTunerControl::isStereo() const
-
- Identifies if a radio tuner is receiving a stereo signal.
-
- Returns true if the tuner is receiving a stereo signal, and false if it is not.
-*/
-
-/*!
- \fn QRadioTuner::StereoMode QRadioTunerControl::stereoMode() const
-
- Returns a radio tuner's stereo mode.
-
- \sa QRadioTuner::StereoMode
-*/
-
-/*!
- \fn void QRadioTunerControl::setStereoMode(QRadioTuner::StereoMode mode)
-
- Sets a radio tuner's stereo \a mode.
-
- \sa QRadioTuner::StereoMode
-*/
-
-/*!
- \fn int QRadioTunerControl::signalStrength() const
-
- Return a radio tuner's current signal strength as a percentage.
-*/
-
-/*!
- \fn int QRadioTunerControl::volume() const
-
- Returns the volume of a radio tuner's audio output as a percentage.
-*/
-
-/*!
- \fn void QRadioTunerControl::setVolume(int volume)
-
- Sets the percentage \a volume of a radio tuner's audio output.
-*/
-
-/*!
- \fn bool QRadioTunerControl::isMuted() const
-
- Identifies if a radio tuner's audio output is muted.
-
- Returns true if the audio is muted, and false if it is not.
-*/
-
-/*!
- \fn void QRadioTunerControl::setMuted(bool muted)
-
- Sets the \a muted state of a radio tuner's audio output.
-*/
-
-/*!
- \fn bool QRadioTunerControl::isSearching() const
-
- Identifies if a radio tuner is currently scanning for signal.
-
- Returns true if the tuner is scanning, and false if it is not.
-*/
-
-/*!
- \fn bool QRadioTunerControl::isAntennaConnected() 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()
-
- Starts a forward scan for a signal, starting from the current \l frequency().
-*/
-
-/*!
- \fn void QRadioTunerControl::searchBackward()
-
- Starts a backwards scan for a signal, starting from the current \l frequency().
-*/
-
-/*!
- \fn void QRadioTunerControl::searchAllStations(QRadioTuner::SearchMode searchMode)
-
- Starts a scan through the whole frequency band searching all stations with a
- specific \a searchMode.
-*/
-
-/*!
- \fn void QRadioTunerControl::cancelSearch()
-
- Stops scanning for a signal.
-*/
-
-/*!
- \fn void QRadioTunerControl::start()
-
- Activate the radio device.
-*/
-
-/*!
- \fn QRadioTunerControl::stop()
-
- Deactivate the radio device.
-*/
-
-/*!
- \fn QRadioTuner::Error QRadioTunerControl::error() const
-
- Returns the error state of a radio tuner.
-*/
-
-/*!
- \fn QString QRadioTunerControl::errorString() const
-
- Returns a string describing a radio tuner's error state.
-*/
-
-/*!
- \fn void QRadioTunerControl::stateChanged(QRadioTuner::State state)
-
- Signals that the \a state of a radio tuner has changed.
-*/
-
-
-/*!
- \fn void QRadioTunerControl::frequencyChanged(int frequency)
-
- Signals that the \a frequency a radio tuner is tuned to has changed.
-*/
-
-/*!
- \fn void QRadioTunerControl::stereoStatusChanged(bool stereo)
-
- Signals that the \a stereo state of a radio tuner has changed.
-*/
-
-/*!
- \fn void QRadioTunerControl::searchingChanged(bool searching)
-
- Signals that the \a searching state of a radio tuner has changed.
-*/
-
-/*!
- \fn void QRadioTunerControl::signalStrengthChanged(int strength)
-
- Signals that the percentage \a strength of the signal received by a radio tuner has changed.
-*/
-
-/*!
- \fn void QRadioTunerControl::volumeChanged(int volume)
-
- Signals that the percentage \a volume of radio tuner's audio output has changed.
-*/
-
-/*!
- \fn void QRadioTunerControl::mutedChanged(bool muted)
-
- Signals that the \a muted state of a radio tuner's audio output has changed.
-*/
-
-/*!
- \fn void QRadioTunerControl::error(QRadioTuner::Error error)
-
- Signals that an \a error has occurred.
-*/
-
-/*!
- \fn void QRadioTunerControl::stationFound(int frequency, QString stationId)
-
- Signals that new station with \a frequency and \a stationId 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.
-*/
-
-QT_END_NAMESPACE
-
-#include "moc_qradiotunercontrol.cpp"
diff --git a/src/multimedia/controls/qradiotunercontrol.h b/src/multimedia/controls/qradiotunercontrol.h
deleted file mode 100644
index bdf529d42..000000000
--- a/src/multimedia/controls/qradiotunercontrol.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QRADIOTUNERCONTROL_H
-#define QRADIOTUNERCONTROL_H
-
-#include <QtMultimedia/qmediacontrol.h>
-#include <QtMultimedia/qradiotuner.h>
-
-QT_BEGIN_NAMESPACE
-
-// Required for QDoc workaround
-class QString;
-
-class Q_MULTIMEDIA_EXPORT QRadioTunerControl : public QMediaControl
-{
- Q_OBJECT
-
-public:
- ~QRadioTunerControl();
-
- virtual QRadioTuner::State state() const = 0;
-
- virtual QRadioTuner::Band band() const = 0;
- virtual void setBand(QRadioTuner::Band b) = 0;
- virtual bool isBandSupported(QRadioTuner::Band b) const = 0;
-
- virtual int frequency() const = 0;
- virtual int frequencyStep(QRadioTuner::Band b) const = 0;
- virtual QPair<int,int> frequencyRange(QRadioTuner::Band b) const = 0;
- virtual void setFrequency(int frequency) = 0;
-
- virtual bool isStereo() const = 0;
- virtual QRadioTuner::StereoMode stereoMode() const = 0;
- virtual void setStereoMode(QRadioTuner::StereoMode mode) = 0;
-
- virtual int signalStrength() const = 0;
-
- virtual int volume() const = 0;
- virtual void setVolume(int volume) = 0;
-
- virtual bool isMuted() const = 0;
- virtual void setMuted(bool muted) = 0;
-
- virtual bool isSearching() const = 0;
-
- virtual bool isAntennaConnected() const { return true; }
-
- virtual void searchForward() = 0;
- virtual void searchBackward() = 0;
- virtual void searchAllStations(QRadioTuner::SearchMode searchMode = QRadioTuner::SearchFast) = 0;
- virtual void cancelSearch() = 0;
-
- virtual void start() = 0;
- virtual void stop() = 0;
-
- virtual QRadioTuner::Error error() const = 0;
- virtual QString errorString() const = 0;
-
-Q_SIGNALS:
- void stateChanged(QRadioTuner::State state);
- void bandChanged(QRadioTuner::Band band);
- void frequencyChanged(int frequency);
- void stereoStatusChanged(bool stereo);
- void searchingChanged(bool searching);
- void signalStrengthChanged(int signalStrength);
- void volumeChanged(int volume);
- void mutedChanged(bool muted);
- void error(QRadioTuner::Error err);
- void stationFound(int frequency, QString stationId);
- void antennaConnectedChanged(bool connectionStatus);
-
-protected:
- explicit QRadioTunerControl(QObject *parent = nullptr);
-};
-
-#define QRadioTunerControl_iid "org.qt-project.qt.radiotunercontrol/5.0"
-Q_MEDIA_DECLARE_CONTROL(QRadioTunerControl, QRadioTunerControl_iid)
-
-QT_END_NAMESPACE
-
-
-#endif // QRADIOTUNERCONTROL_H
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
index 7fd6259ea..5ba7fcc25 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
@@ -47,8 +47,6 @@
#include "qmediaservice.h"
#include "qmediaplayercontrol.h"
#include "qmediaplayer.h"
-#include "qradiotuner.h"
-#include "qradiodata.h"
#include "qvideowidget.h"
#include "qcameraimagecapture.h"
#include "qcamera.h"
@@ -63,7 +61,6 @@ class MediaExample : public QObject {
void MediaControl();
void MediaPlayer();
- void RadioTuna();
void MediaRecorder();
void AudioRecorder();
void EncoderSettings();
@@ -84,8 +81,6 @@ private:
QCameraViewfinder *viewfinder;
QCameraImageCapture *imageCapture;
QString fileName;
- QRadioTuner *radio;
- QRadioData *radioData;
QAudioRecorder *audioRecorder;
QAudioProbe *audioProbe;
QVideoProbe *videoProbe;
@@ -93,8 +88,6 @@ private:
QMediaContent image1;
QMediaContent image2;
QMediaContent image3;
-
- static const int yourRadioStationFrequency = 11;
};
void MediaExample::MediaControl()
@@ -298,25 +291,6 @@ void MediaExample::AudioRecorder()
//! [Audio recorder inputs]
}
-void MediaExample::RadioTuna()
-{
- //! [Radio tuner]
- 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();
- }
- //! [Radio tuner]
-
- //! [Radio data setup]
- radio = new QRadioTuner;
- radioData = radio->radioData();
- //! [Radio data setup]
-}
-
void MediaExample::AudioProbe()
{
//! [Audio probe]
diff --git a/src/multimedia/doc/src/changes.qdoc b/src/multimedia/doc/src/changes.qdoc
index 65bc88073..fd7188fa3 100644
--- a/src/multimedia/doc/src/changes.qdoc
+++ b/src/multimedia/doc/src/changes.qdoc
@@ -53,7 +53,6 @@ There are a number of new features in Qt Multimedia:
\li More examples and documentation
\li QSound moved from Qt GUI to Qt Multimedia
\li QSoundEffect available to C++ now, as well as QML
-\li FM Radio Data System classes and types now available (\l QRadioData, \l RadioData)
\li Various other API improvements and bugfixes
\endlist
diff --git a/src/multimedia/doc/src/multimedia.qdoc b/src/multimedia/doc/src/multimedia.qdoc
index ad8273612..dcf394c87 100644
--- a/src/multimedia/doc/src/multimedia.qdoc
+++ b/src/multimedia/doc/src/multimedia.qdoc
@@ -28,12 +28,12 @@
/*!
\page multimediaoverview.html
\title Multimedia
-\brief A set of APIs for working with audio, video, radio and camera devices.
+\brief A set of APIs for working with audio, video and camera devices.
Multimedia support in Qt is provided by the \l{Qt Multimedia} module. The Qt
Multimedia module provides a rich feature set that enables you to easily take
advantage of a platform's multimedia capabilities such as media playback and
-the use of camera and radio devices.
+the use of camera devices.
\section1 Features
@@ -44,7 +44,6 @@ Here are some examples of what can be done with Qt Multimedia APIs:
\li Play low latency sound effects
\li Play media files in playlists (such as compressed audio or video files)
\li Record audio and compress it
-\li Tune and listen to radio stations
\li Use a camera, including viewfinder, image capture, and movie recording
\li Play 3D positional audio with \l{Qt Audio Engine QML Types}{Qt Audio Engine}
\li Decode audio media files into memory for processing
@@ -61,7 +60,6 @@ available here:
\li \l {Audio Overview}
\li \l {Video Overview}
\li \l {Camera Overview}
-\li \l {Radio Overview}
\endlist
\section1 Multimedia Recipes
@@ -119,11 +117,6 @@ For some quick recipes, look at the overviews above and consult this table:
\li \l {MediaPlayer}, \l VideoOutput
\li QMediaPlayer, QAbstractVideoSurface, QVideoFrame
\row
- \li Listening to the radio
- \li \l {Declarative Radio Example}{declarative-radio}
- \li \l Radio, \l RadioData
- \li QRadioTuner, QRadioData
- \row
\li Accessing camera viewfinder
\li \l {Camera Example}{camera},
\l {QML Camera Example}{declarative-camera}
diff --git a/src/multimedia/doc/src/qtmultimedia-cpp.qdoc b/src/multimedia/doc/src/qtmultimedia-cpp.qdoc
index 053dd3de7..f75ecbfe2 100644
--- a/src/multimedia/doc/src/qtmultimedia-cpp.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia-cpp.qdoc
@@ -31,7 +31,7 @@
\ingroup modules
\qtvariable multimedia
- \brief The \l {Qt Multimedia} module provides audio, video, radio and camera
+ \brief The \l {Qt Multimedia} module provides audio, video and camera
functionality.
To enable Qt Multimedia in a project, add this directive into the
diff --git a/src/multimedia/doc/src/qtmultimedia-index.qdoc b/src/multimedia/doc/src/qtmultimedia-index.qdoc
index abd6a62cc..13c686978 100644
--- a/src/multimedia/doc/src/qtmultimedia-index.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia-index.qdoc
@@ -28,12 +28,12 @@
/*!
\page qtmultimedia-index.html
\title Qt Multimedia
- \brief The Qt Multimedia module provides APIs for audio, video, radio, and
+ \brief The Qt Multimedia module provides APIs for audio, video and
camera-related functionality.
Qt Multimedia is an essential module that provides a rich set of QML types
and C++ classes to handle multimedia content. It also provides necessary
- APIs to access the camera and radio functionality. The included
+ APIs to access the camera functionality. The included
\l{Qt Audio Engine QML Types}{Qt Audio Engine} provides types for
3D positional audio playback and content management.
@@ -98,9 +98,6 @@
\li Add media playback functionality to a scene. It is same as Audio type,
but can be used for video playback with the VideoOutput type.
\row
- \li \l {QtMultimedia::Radio}{Radio}
- \li Access radio functionality
- \row
\li \l {QtMultimedia::Video}{Video}
\li Add Video playback functionality to a scene. It uses MediaPlayer and
VideoOutput types to provide video playback functionality.
@@ -124,7 +121,7 @@
\li Capture still images with a camera.
\row
\li QMediaRecorder
- \li Record media content from a camera or radio tuner source.
+ \li Record media content from a camera source.
\row
\li QMediaPlayer
\li Playback media from a source.
@@ -153,7 +150,6 @@
\li \l{Audio Overview}
\li \l{Video Overview}
\li \l{Camera Overview}
- \li \l{Radio Overview}
\endlist
\section2 Platform Notes
diff --git a/src/multimedia/doc/src/qtmultimedia5.qdoc b/src/multimedia/doc/src/qtmultimedia5.qdoc
index a2aaa1a80..461cc716f 100644
--- a/src/multimedia/doc/src/qtmultimedia5.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia5.qdoc
@@ -34,7 +34,7 @@
The QML types for \l{Qt Multimedia} support the basic use cases such as:
\list
\li audio and video playback,
- \li access camera and radio functionality,
+ \li access camera functionality,
\li record video,
\li and access camera settings.
\endlist
diff --git a/src/multimedia/doc/src/radiooverview.qdoc b/src/multimedia/doc/src/radiooverview.qdoc
deleted file mode 100644
index 7dcad72d0..000000000
--- a/src/multimedia/doc/src/radiooverview.qdoc
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-
-\page radiooverview.html
-\title Radio Overview
-\brief An API to control system radio tuner
-
-The Qt Multimedia API provides a number of radio related classes for control
-over the radio tuner of the system, and gives access to Radio Data System
-(RDS) information for radio stations that broadcasts it.
-
-\section1 Radio Features
-
-The Radio API consists of two separate components. The radio tuner,
-\l QRadioTuner or the \l Radio QML type, which handles control of
-the radio hardware as well as tuning. The other is the radio data
-component, either \l QRadioData or the \l RadioData QML type, which
-gives access to RDS information.
-
-\section1 Radio Implementation Details
-
-The actual level of support depends on the underlying system support. It should
-be noted that only analog radio is supported, and the properties of the radio
-data component will only be populated if the system radio tuner supports RDS.
-
-\section1 Examples
-
-There are two examples showing the usage of the Radio API. One shows how to use
-the QRadioTuner class from C++. The other shows how to implement a similar
-application using QML and \l Radio.
-
-\section2 Radio Example
-
-This image shows the example using the QRadioTuner API.
-
-\image radio-example.png
-
-The example reads the frequency from the radio tuner, and sets the "Got Signal"
-text based on the signal strength. The buttons allow the user to tune and scan
-up and down the frequency band, while the slider to the side allows volume
-adjustments.
-
-Only the FM frequency band is used in this example.
-
-\section2 Declarative Radio Example
-
-\image declarative-radio-example.png
-
-This example has the same functionality of the regular radio example mentioned
-above, but it includes a nice horizontal dial showing the position of the
-current frequency inside the band.
-
-\section1 Reference documentation
-
-\section2 C++ Classes
-
-\annotatedlist multimedia_radio
-
-\section2 QML Types
-
-\annotatedlist multimedia_radio_qml
-
-*/
diff --git a/src/multimedia/multimedia.pro b/src/multimedia/multimedia.pro
index b783efbe0..55fa9c5c4 100644
--- a/src/multimedia/multimedia.pro
+++ b/src/multimedia/multimedia.pro
@@ -61,7 +61,6 @@ include(audio/audio.pri)
include(camera/camera.pri)
include(controls/controls.pri)
include(playback/playback.pri)
-include(radio/radio.pri)
include(recording/recording.pri)
include(video/video.pri)
diff --git a/src/multimedia/qmediaserviceproviderplugin.h b/src/multimedia/qmediaserviceproviderplugin.h
index 6447e319a..3337b2e72 100644
--- a/src/multimedia/qmediaserviceproviderplugin.h
+++ b/src/multimedia/qmediaserviceproviderplugin.h
@@ -234,16 +234,6 @@ public:
#define Q_MEDIASERVICE_CAMERA "org.qt-project.qt.camera"
/*!
- Service with support for radio tuning.
- Required Controls: QRadioTunerControl
- Recording Controls (Optional, used by QMediaRecorder):
- Required: QMediaRecorderControl
- Recommended: QAudioEncoderSettingsControl
- Optional: QMediaContainerControl
-*/
-#define Q_MEDIASERVICE_RADIO "org.qt-project.qt.radio"
-
-/*!
Service with support for decoding audio.
Required Controls: QAudioDecoderControl
Optional: that streams control
diff --git a/src/multimedia/radio/qradiodata.cpp b/src/multimedia/radio/qradiodata.cpp
deleted file mode 100644
index c795cf389..000000000
--- a/src/multimedia/radio/qradiodata.cpp
+++ /dev/null
@@ -1,479 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qradiodata.h"
-#include "qmediaservice.h"
-#include "qmediaobject_p.h"
-#include "qradiodatacontrol.h"
-#include "qmediaserviceprovider_p.h"
-
-#include <QPair>
-
-
-QT_BEGIN_NAMESPACE
-
-static void qRegisterRadioDataMetaTypes()
-{
- qRegisterMetaType<QRadioData::Error>();
- qRegisterMetaType<QRadioData::ProgramType>();
-}
-
-Q_CONSTRUCTOR_FUNCTION(qRegisterRadioDataMetaTypes)
-
-
-/*!
- \class QRadioData
- \obsolete
- \brief The QRadioData class provides interfaces to the RDS functionality of the system radio.
-
- \inmodule QtMultimedia
- \ingroup multimedia
- \ingroup multimedia_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 \l{QRadioTuner::radioData()}{radioData}
- property from a QRadioTuner instance.
-
- \snippet multimedia-snippets/media.cpp Radio data setup
-
- Alternatively, you can pass an instance of QRadioTuner to the constructor to QRadioData.
-
- \sa {Radio Overview}
-
-*/
-
-
-class QRadioDataPrivate
-{
- Q_DECLARE_NON_CONST_PUBLIC(QRadioData)
-public:
- QRadioDataPrivate();
-
- QMediaObject *mediaObject;
- QRadioDataControl* control;
-
- void _q_serviceDestroyed();
-
- QRadioData *q_ptr;
-};
-
-QRadioDataPrivate::QRadioDataPrivate()
- : mediaObject(nullptr)
- , control(nullptr)
-{}
-
-void QRadioDataPrivate::_q_serviceDestroyed()
-{
- mediaObject = nullptr;
- control = nullptr;
-}
-
-/*!
- Constructs a radio data based on a \a mediaObject and \a parent.
-
- The \a mediaObject should be an instance of \l QRadioTuner. It is preferable to use the
- \l{QRadioTuner::radioData()}{radioData} property on a QRadioTuner instance to get an instance
- of QRadioData.
-
- During construction, this class is bound to the \a mediaObject using the
- \l{QMediaObject::bind()}{bind()} method.
-*/
-
-QRadioData::QRadioData(QMediaObject *mediaObject, QObject *parent)
- : QObject(parent)
- , d_ptr(new QRadioDataPrivate)
-{
- Q_D(QRadioData);
-
- d->q_ptr = this;
-
- if (mediaObject)
- mediaObject->bind(this);
-}
-
-/*!
- Destroys a radio data.
-*/
-
-QRadioData::~QRadioData()
-{
- Q_D(QRadioData);
-
- if (d->mediaObject)
- d->mediaObject->unbind(this);
-
- delete d_ptr;
-}
-
-/*!
- \reimp
-*/
-QMediaObject *QRadioData::mediaObject() const
-{
- return d_func()->mediaObject;
-}
-
-/*!
- \reimp
-*/
-bool QRadioData::setMediaObject(QMediaObject *mediaObject)
-{
- Q_D(QRadioData);
-
- if (d->mediaObject) {
- if (d->control) {
- disconnect(d->control, SIGNAL(stationIdChanged(QString)),
- this, SIGNAL(stationIdChanged(QString)));
- disconnect(d->control, SIGNAL(programTypeChanged(QRadioData::ProgramType)),
- this, SIGNAL(programTypeChanged(QRadioData::ProgramType)));
- disconnect(d->control, SIGNAL(programTypeNameChanged(QString)),
- this, SIGNAL(programTypeNameChanged(QString)));
- disconnect(d->control, SIGNAL(stationNameChanged(QString)),
- this, SIGNAL(stationNameChanged(QString)));
- disconnect(d->control, SIGNAL(radioTextChanged(QString)),
- this, SIGNAL(radioTextChanged(QString)));
- disconnect(d->control, SIGNAL(alternativeFrequenciesEnabledChanged(bool)),
- this, SIGNAL(alternativeFrequenciesEnabledChanged(bool)));
- disconnect(d->control, SIGNAL(error(QRadioData::Error)),
- this, SIGNAL(error(QRadioData::Error)));
-
- QMediaService *service = d->mediaObject->service();
- service->releaseControl(d->control);
- disconnect(service, SIGNAL(destroyed()), this, SLOT(_q_serviceDestroyed()));
- }
- }
-
- d->mediaObject = mediaObject;
-
- if (d->mediaObject) {
- QMediaService *service = mediaObject->service();
- if (service) {
- d->control = qobject_cast<QRadioDataControl*>(service->requestControl(QRadioDataControl_iid));
-
- if (d->control) {
- connect(d->control, SIGNAL(stationIdChanged(QString)),
- this, SIGNAL(stationIdChanged(QString)));
- connect(d->control, SIGNAL(programTypeChanged(QRadioData::ProgramType)),
- this, SIGNAL(programTypeChanged(QRadioData::ProgramType)));
- connect(d->control, SIGNAL(programTypeNameChanged(QString)),
- this, SIGNAL(programTypeNameChanged(QString)));
- connect(d->control, SIGNAL(stationNameChanged(QString)),
- this, SIGNAL(stationNameChanged(QString)));
- connect(d->control, SIGNAL(radioTextChanged(QString)),
- this, SIGNAL(radioTextChanged(QString)));
- connect(d->control, SIGNAL(alternativeFrequenciesEnabledChanged(bool)),
- this, SIGNAL(alternativeFrequenciesEnabledChanged(bool)));
- connect(d->control, SIGNAL(error(QRadioData::Error)),
- this, SIGNAL(error(QRadioData::Error)));
-
- connect(service, SIGNAL(destroyed()), this, SLOT(_q_serviceDestroyed()));
-
- return true;
- }
- }
- }
-
- // without QRadioDataControl discard the media object
- d->mediaObject = nullptr;
- d->control = nullptr;
-
- return false;
-}
-
-/*!
- Returns the availability of the radio data service.
-
- A long as there is a media service which provides radio functionality, then the
- \l{QMultimedia::AvailabilityStatus}{availability} will be that
- of the \l{QRadioTuner::availability()}{radio tuner}.
-*/
-QMultimedia::AvailabilityStatus QRadioData::availability() const
-{
- Q_D(const QRadioData);
-
- if (d->control == nullptr)
- return QMultimedia::ServiceMissing;
-
- return d->mediaObject->availability();
-}
-
-/*!
- \property QRadioData::stationId
- \brief Current Program Identification
-
-*/
-
-QString QRadioData::stationId() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->stationId();
- return QString();
-}
-
-/*!
- \property QRadioData::programType
- \brief Current Program Type
-
-*/
-
-QRadioData::ProgramType QRadioData::programType() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->programType();
-
- return QRadioData::Undefined;
-}
-
-/*!
- \property QRadioData::programTypeName
- \brief Current Program Type Name
-
-*/
-
-QString QRadioData::programTypeName() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->programTypeName();
- return QString();
-}
-
-/*!
- \property QRadioData::stationName
- \brief Current Program Service
-
-*/
-
-QString QRadioData::stationName() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->stationName();
- return QString();
-}
-
-/*!
- \property QRadioData::radioText
- \brief Current Radio Text
-
-*/
-
-QString QRadioData::radioText() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->radioText();
- return QString();
-}
-
-/*!
- \property QRadioData::alternativeFrequenciesEnabled
- \brief Is Alternative Frequency currently enabled
-
-*/
-
-bool QRadioData::isAlternativeFrequenciesEnabled() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->isAlternativeFrequenciesEnabled();
- return false;
-}
-
-void QRadioData::setAlternativeFrequenciesEnabled( bool enabled )
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->setAlternativeFrequenciesEnabled(enabled);
-}
-
-/*!
- Returns the error state of a radio data.
-
- \sa errorString()
-*/
-
-QRadioData::Error QRadioData::error() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->error();
- return QRadioData::ResourceError;
-}
-
-/*!
- Returns a description of a radio data's error state.
-
- \sa error()
-*/
-QString QRadioData::errorString() const
-{
- Q_D(const QRadioData);
-
- if (d->control != nullptr)
- return d->control->errorString();
- return QString();
-}
-
-/*!
- \fn void QRadioData::stationIdChanged(QString stationId)
-
- Signals that the Program Identification code has changed to \a stationId
-*/
-
-/*!
- \fn void QRadioData::programTypeChanged(QRadioData::ProgramType programType)
-
- Signals that the Program Type code has changed to \a programType
-*/
-
-/*!
- \fn void QRadioData::programTypeNameChanged(QString programTypeName)
-
- Signals that the Program Type Name has changed to \a programTypeName
-*/
-
-/*!
- \fn void QRadioData::stationNameChanged(QString stationName)
-
- Signals that the Program Service has changed to \a stationName
-*/
-
-/*!
- \fn void QRadioData::alternativeFrequenciesEnabledChanged(bool enabled)
-
- Signals that automatically tuning to alternative frequencies has been
- enabled or disabled according to \a enabled.
-*/
-
-/*!
- \fn void QRadioData::radioTextChanged(QString radioText)
-
- Signals that the Radio Text property has changed to \a radioText
-*/
-
-/*!
- \fn void QRadioData::error(QRadioData::Error error)
-
- Signals that an \a error occurred.
-*/
-
-/*!
- \enum QRadioData::Error
-
- Enumerates radio data error conditions.
-
- \value NoError No errors have occurred.
- \value ResourceError There is no radio service available.
- \value OpenError Unable to open radio device.
- \value OutOfRangeError 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.
-
- \value Undefined
- \value News
- \value CurrentAffairs
- \value Information
- \value Sport
- \value Education
- \value Drama
- \value Culture
- \value Science
- \value Varied
- \value PopMusic
- \value RockMusic
- \value EasyListening
- \value LightClassical
- \value SeriousClassical
- \value OtherMusic
- \value Weather
- \value Finance
- \value ChildrensProgrammes
- \value SocialAffairs
- \value Religion
- \value PhoneIn
- \value Travel
- \value Leisure
- \value JazzMusic
- \value CountryMusic
- \value NationalMusic
- \value OldiesMusic
- \value FolkMusic
- \value Documentary
- \value AlarmTest
- \value Alarm
- \value Talk
- \value ClassicRock
- \value AdultHits
- \value SoftRock
- \value Top40
- \value Soft
- \value Nostalgia
- \value Classical
- \value RhythmAndBlues
- \value SoftRhythmAndBlues
- \value Language
- \value ReligiousMusic
- \value ReligiousTalk
- \value Personality
- \value Public
- \value College
-*/
-
-QT_END_NAMESPACE
-
-#include "moc_qradiodata.cpp"
diff --git a/src/multimedia/radio/qradiodata.h b/src/multimedia/radio/qradiodata.h
deleted file mode 100644
index ffc8b44ba..000000000
--- a/src/multimedia/radio/qradiodata.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QRADIODATA_H
-#define QRADIODATA_H
-
-#include <QtCore/qobject.h>
-
-#include <QtMultimedia/qmediaobject.h>
-#include <QtMultimedia/qmediabindableinterface.h>
-#include <QtMultimedia/qmediaenumdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-
-class QRadioDataPrivate;
-class Q_MULTIMEDIA_EXPORT QRadioData : public QObject, public QMediaBindableInterface
-{
- Q_OBJECT
- Q_PROPERTY(QString stationId READ stationId NOTIFY stationIdChanged)
- Q_PROPERTY(ProgramType programType READ programType NOTIFY programTypeChanged)
- Q_PROPERTY(QString programTypeName READ programTypeName NOTIFY programTypeNameChanged)
- Q_PROPERTY(QString stationName READ stationName NOTIFY stationNameChanged)
- Q_PROPERTY(QString radioText READ radioText NOTIFY radioTextChanged)
- Q_PROPERTY(bool alternativeFrequenciesEnabled READ isAlternativeFrequenciesEnabled
- WRITE setAlternativeFrequenciesEnabled NOTIFY alternativeFrequenciesEnabledChanged)
- Q_ENUMS(Error)
- Q_ENUMS(ProgramType)
-
- Q_INTERFACES(QMediaBindableInterface)
-
-public:
- enum Error { NoError, ResourceError, OpenError, OutOfRangeError };
-
- enum ProgramType { Undefined = 0, News, CurrentAffairs, Information,
- Sport, Education, Drama, Culture, Science, Varied,
- PopMusic, RockMusic, EasyListening, LightClassical,
- SeriousClassical, OtherMusic, Weather, Finance,
- ChildrensProgrammes, SocialAffairs, Religion,
- PhoneIn, Travel, Leisure, JazzMusic, CountryMusic,
- NationalMusic, OldiesMusic, FolkMusic, Documentary,
- AlarmTest, Alarm, Talk, ClassicRock, AdultHits,
- SoftRock, Top40, Soft, Nostalgia, Classical,
- RhythmAndBlues, SoftRhythmAndBlues, Language,
- ReligiousMusic, ReligiousTalk, Personality, Public,
- College
- };
-
- explicit QRadioData(QMediaObject *mediaObject, QObject *parent = nullptr);
- ~QRadioData();
-
- QMultimedia::AvailabilityStatus availability() const;
-
- QMediaObject *mediaObject() const override;
-
- QString stationId() const;
- ProgramType programType() const;
- QString programTypeName() const;
- QString stationName() const;
- QString radioText() const;
- bool isAlternativeFrequenciesEnabled() const;
-
- Error error() const;
- QString errorString() const;
-
-public Q_SLOTS:
- void setAlternativeFrequenciesEnabled(bool enabled);
-
-Q_SIGNALS:
- void stationIdChanged(QString stationId);
- void programTypeChanged(QRadioData::ProgramType programType);
- void programTypeNameChanged(QString programTypeName);
- void stationNameChanged(QString stationName);
- void radioTextChanged(QString radioText);
- void alternativeFrequenciesEnabledChanged(bool enabled);
-
- void error(QRadioData::Error error);
-
-protected:
- bool setMediaObject(QMediaObject *) override;
-
- QRadioDataPrivate *d_ptr;
-private:
-
- Q_DISABLE_COPY(QRadioData)
- Q_DECLARE_PRIVATE(QRadioData)
- Q_PRIVATE_SLOT(d_func(), void _q_serviceDestroyed())
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QRadioData::Error)
-Q_DECLARE_METATYPE(QRadioData::ProgramType)
-
-Q_MEDIA_ENUM_DEBUG(QRadioData, Error)
-Q_MEDIA_ENUM_DEBUG(QRadioData, ProgramType)
-
-#endif // QRADIOPLAYER_H
diff --git a/src/multimedia/radio/qradiotuner.cpp b/src/multimedia/radio/qradiotuner.cpp
deleted file mode 100644
index ea7fb35f5..000000000
--- a/src/multimedia/radio/qradiotuner.cpp
+++ /dev/null
@@ -1,660 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qradiotuner.h"
-#include "qmediaservice.h"
-#include "qmediaobject_p.h"
-#include "qradiotunercontrol.h"
-#include "qradiodata.h"
-#include "qmediaserviceprovider_p.h"
-
-#include <QPair>
-
-
-QT_BEGIN_NAMESPACE
-
-
-static void qRegisterRadioTunerMetaTypes()
-{
- qRegisterMetaType<QRadioTuner::Band>();
- qRegisterMetaType<QRadioTuner::Error>();
- qRegisterMetaType<QRadioTuner::SearchMode>();
- qRegisterMetaType<QRadioTuner::State>();
- qRegisterMetaType<QRadioTuner::StereoMode>();
-}
-
-Q_CONSTRUCTOR_FUNCTION(qRegisterRadioTunerMetaTypes)
-
-
-/*!
- \class QRadioTuner
- \obsolete
- \brief The QRadioTuner class provides an interface to the systems analog radio device.
-
- \inmodule QtMultimedia
- \ingroup multimedia
- \ingroup multimedia_radio
-
- You can control the systems analog radio device using this interface, for example:
-
- \snippet multimedia-snippets/media.cpp Radio tuner
-
- 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().
-
- \sa QRadioData, {Radio Overview}
-*/
-
-
-class QRadioTunerPrivate : public QMediaObjectPrivate
-{
-public:
- QRadioTunerPrivate():provider(nullptr), control(nullptr), radioData(nullptr) {}
- QMediaServiceProvider *provider;
- QRadioTunerControl* control;
- QRadioData *radioData;
-};
-
-
-
-/*!
- Constructs a radio tuner based on a media service allocated by the default
- media service provider.
-
- The \a parent is passed to QMediaObject.
-*/
-
-QRadioTuner::QRadioTuner(QObject *parent):
- QMediaObject(*new QRadioTunerPrivate,
- parent,
- QMediaServiceProvider::defaultServiceProvider()->requestService(Q_MEDIASERVICE_RADIO))
-{
- Q_D(QRadioTuner);
-
- d->provider = QMediaServiceProvider::defaultServiceProvider();
-
- if (d->service != nullptr) {
- d->control = qobject_cast<QRadioTunerControl*>(d->service->requestControl(QRadioTunerControl_iid));
- if (d->control != nullptr) {
- connect(d->control, SIGNAL(stateChanged(QRadioTuner::State)), SIGNAL(stateChanged(QRadioTuner::State)));
- connect(d->control, SIGNAL(bandChanged(QRadioTuner::Band)), SIGNAL(bandChanged(QRadioTuner::Band)));
- connect(d->control, SIGNAL(frequencyChanged(int)), SIGNAL(frequencyChanged(int)));
- connect(d->control, SIGNAL(stereoStatusChanged(bool)), SIGNAL(stereoStatusChanged(bool)));
- connect(d->control, SIGNAL(searchingChanged(bool)), SIGNAL(searchingChanged(bool)));
- connect(d->control, SIGNAL(signalStrengthChanged(int)), SIGNAL(signalStrengthChanged(int)));
- connect(d->control, SIGNAL(volumeChanged(int)), SIGNAL(volumeChanged(int)));
- connect(d->control, SIGNAL(mutedChanged(bool)), SIGNAL(mutedChanged(bool)));
- 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)));
- }
-
- d->radioData = new QRadioData(this, this);
- }
-}
-
-/*!
- Destroys a radio tuner.
-*/
-
-QRadioTuner::~QRadioTuner()
-{
- Q_D(QRadioTuner);
-
- if (d->radioData)
- delete d->radioData;
-
- if (d->service && d->control)
- d->service->releaseControl(d->control);
-
- d->provider->releaseService(d->service);
-}
-
-/*!
- Returns the availability of the radio tuner.
-*/
-QMultimedia::AvailabilityStatus QRadioTuner::availability() const
-{
- if (d_func()->control == nullptr)
- return QMultimedia::ServiceMissing;
-
- if (!d_func()->control->isAntennaConnected())
- return QMultimedia::ResourceError;
-
- return QMediaObject::availability();
-}
-
-/*!
- \property QRadioTuner::state
- Return the current radio tuner state.
-
- \sa QRadioTuner::State
-*/
-
-QRadioTuner::State QRadioTuner::state() const
-{
- return d_func()->control ?
- d_func()->control->state() : QRadioTuner::StoppedState;
-}
-
-/*!
- \property QRadioTuner::band
- \brief the frequency band a radio tuner is tuned to.
-
- \sa QRadioTuner::Band
-*/
-
-QRadioTuner::Band QRadioTuner::band() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->band();
-
- return QRadioTuner::FM;
-}
-
-/*!
- \property QRadioTuner::frequency
- \brief the frequency in Hertz a radio tuner is tuned to.
-*/
-
-int QRadioTuner::frequency() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->frequency();
-
- return 0;
-}
-
-/*!
- Returns the number of Hertz to increment the frequency by when stepping through frequencies
- within a given \a band.
-*/
-
-int QRadioTuner::frequencyStep(QRadioTuner::Band band) const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->frequencyStep(band);
-
- return 0;
-}
-
-/*!
- Returns a frequency \a band's minimum and maximum frequency.
-*/
-
-QPair<int,int> QRadioTuner::frequencyRange(QRadioTuner::Band band) const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->frequencyRange(band);
-
- return qMakePair<int,int>(0,0);
-}
-
-/*!
- \property QRadioTuner::stereo
- \brief whether a radio tuner is receiving a stereo signal.
-*/
-
-bool QRadioTuner::isStereo() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->isStereo();
-
- return false;
-}
-
-
-/*!
- \property QRadioTuner::stereoMode
- \brief the stereo mode of a radio tuner.
-*/
-
-QRadioTuner::StereoMode QRadioTuner::stereoMode() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->stereoMode();
-
- return QRadioTuner::Auto;
-}
-
-void QRadioTuner::setStereoMode(QRadioTuner::StereoMode mode)
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->setStereoMode(mode);
-}
-
-/*!
- Identifies if a frequency \a band is supported by a radio tuner.
-
- Returns true if the band is supported, and false if it is not.
-*/
-
-bool QRadioTuner::isBandSupported(QRadioTuner::Band band) const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->isBandSupported(band);
-
- return false;
-}
-
-/*!
- Activate the radio device.
-*/
-
-void QRadioTuner::start()
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- d->control->start();
-}
-
-/*!
- Deactivate the radio device.
-*/
-
-void QRadioTuner::stop()
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- d->control->stop();
-}
-
-/*!
- \property QRadioTuner::signalStrength
- \brief the strength of the current radio signal as a percentage.
-*/
-
-int QRadioTuner::signalStrength() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->signalStrength();
-
- return 0;
-}
-
-/*!
- \property QRadioTuner::volume
- \brief the volume of a radio tuner's audio output as a percentage.
-*/
-
-
-int QRadioTuner::volume() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->volume();
-
- return 0;
-}
-
-/*!
- \property QRadioTuner::muted
- \brief whether a radio tuner's audio output is muted.
-*/
-
-bool QRadioTuner::isMuted() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->isMuted();
-
- return false;
-}
-
-/*!
- Sets a radio tuner's frequency \a band.
-
- Changing the band will reset the \l frequency to the new band's minimum frequency.
-*/
-
-void QRadioTuner::setBand(QRadioTuner::Band band)
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- d->control->setBand(band);
-}
-
-/*!
- Sets a radio tuner's \a frequency.
-
- If the tuner is set to a frequency outside the current \l band, the band will be changed to
- one occupied by the new frequency.
-*/
-
-void QRadioTuner::setFrequency(int frequency)
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- d->control->setFrequency(frequency);
-}
-
-void QRadioTuner::setVolume(int volume)
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- d->control->setVolume(volume);
-}
-
-void QRadioTuner::setMuted(bool muted)
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- d->control->setMuted(muted);
-}
-
-/*!
- \property QRadioTuner::searching
- \brief whether a radio tuner is currently scanning for a signal.
-
- \sa searchForward(), searchBackward(), cancelSearch()
-*/
-
-bool QRadioTuner::isSearching() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->isSearching();
-
- return false;
-}
-
-/*!
- \property QRadioTuner::antennaConnected
- \brief whether there is an antenna connected
-*/
-bool QRadioTuner::isAntennaConnected() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->isAntennaConnected();
-
- return false;
-}
-
-/*!
- Starts a forward scan for a signal, starting from the current \l frequency.
-
- \sa searchBackward(), cancelSearch(), searching
-*/
-
-void QRadioTuner::searchForward()
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- d->control->searchForward();
-}
-
-/*!
- Starts a backwards scan for a signal, starting from the current \l frequency.
-
- \sa searchForward(), cancelSearch(), searching
-*/
-
-void QRadioTuner::searchBackward()
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- d->control->searchBackward();
-}
-
-/*!
- \enum QRadioTuner::SearchMode
-
- Enumerates how the radio tuner should search for stations.
-
- \value SearchFast Use only signal strength when searching.
- \value SearchGetStationId After finding a strong signal, wait for the RDS station id (PI) before continuing.
-*/
-
-/*!
- Search all stations in current band
-
- Emits QRadioTuner::stationFound(int, QString) for every found station.
- After searching is completed, QRadioTuner::searchingChanged(bool) is
- emitted (false). If \a searchMode is set to SearchGetStationId, searching
- waits for station id (PI) on each frequency.
-
- \sa searchForward(), searchBackward(), searching
-*/
-
-void QRadioTuner::searchAllStations(QRadioTuner::SearchMode searchMode)
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- d->control->searchAllStations(searchMode);
-}
-
-/*!
- Stops scanning for a signal.
-
- \sa searchForward(), searchBackward(), searching
-*/
-
-void QRadioTuner::cancelSearch()
-{
- Q_D(QRadioTuner);
-
- if (d->control != nullptr)
- d->control->cancelSearch();
-}
-
-/*!
- Returns the error state of a radio tuner.
-
- \sa errorString()
-*/
-
-QRadioTuner::Error QRadioTuner::error() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->error();
-
- return QRadioTuner::ResourceError;
-}
-
-/*!
- Returns a description of a radio tuner's error state.
-
- \sa error()
-*/
-
-QString QRadioTuner::errorString() const
-{
- Q_D(const QRadioTuner);
-
- if (d->control != nullptr)
- return d->control->errorString();
-
- return QString();
-}
-
-/*!
- \property QRadioTuner::radioData
- \brief holds an instance of \l QRadioData
-
- The instance of QRadioData is already bound to this instance of QRadioTuner.
-*/
-QRadioData *QRadioTuner::radioData() const
-{
- return d_func()->radioData;
-}
-
-
-/*!
- \fn void QRadioTuner::bandChanged(QRadioTuner::Band band)
-
- Signals a radio tuner's \a band has changed.
-*/
-
-/*!
- \fn void QRadioTuner::frequencyChanged(int frequency)
-
- Signals that the \a frequency a radio tuner is tuned to has changed.
-*/
-
-/*!
- \fn void QRadioTuner::mutedChanged(bool muted)
-
- Signals that the \a muted state of a radio tuner's audio output has changed.
-*/
-
-/*!
- \fn void QRadioTuner::volumeChanged(int volume)
-
- Signals that the \a volume of a radio tuner's audio output has changed.
-*/
-
-/*!
- \fn void QRadioTuner::searchingChanged(bool searching)
-
- Signals that the \a searching state of a radio tuner has changed.
-*/
-
-/*!
- \fn void QRadioTuner::stereoStatusChanged(bool stereo)
-
- Signals that the \a stereo state of a radio tuner has changed.
-*/
-
-/*!
- \fn void QRadioTuner::signalStrengthChanged(int strength)
-
- Signals that the \a strength of the signal received by a radio tuner has changed.
-*/
-
-/*!
- \fn void QRadioTuner::stationFound(int frequency, QString stationId)
-
- Signals that a station was found in \a frequency with \a stationId Program
- Identification code.
-*/
-
-/*!
- \fn void QRadioTuner::error(QRadioTuner::Error error)
-
- Signals that an \a error occurred.
-*/
-
-/*!
- \enum QRadioTuner::State
-
- Enumerates radio tuner states.
-
- \value ActiveState The tuner is started and active.
- \value StoppedState The tuner device is stopped.
-*/
-
-
-/*!
- \enum QRadioTuner::Band
-
- Enumerates radio frequency bands.
-
- \value AM 520 to 1610 kHz, 9 or 10kHz channel spacing, extended 1610 to 1710 kHz
- \value FM 87.5 to 108.0 MHz, except Japan 76-90 MHz
- \value SW 1.711 to 30.0 MHz, divided into 15 bands. 5kHz channel spacing
- \value LW 148.5 to 283.5 kHz, 9kHz channel spacing (Europe, Africa, Asia)
- \value FM2 range not defined, used when area supports more than one FM range.
-*/
-
-/*!
- \enum QRadioTuner::Error
-
- Enumerates radio tuner error conditions.
-
- \value NoError No errors have occurred.
- \value ResourceError There is no radio service available.
- \value OpenError Unable to open radio device.
- \value OutOfRangeError An attempt to set a frequency or band that is not supported by radio device.
-*/
-
-/*!
- \enum QRadioTuner::StereoMode
-
- Enumerates radio tuner policy for receiving stereo signals.
-
- \value ForceStereo Provide stereo mode, converting if required.
- \value ForceMono Provide mono mode, converting if required.
- \value Auto Uses the stereo mode matching the station.
-*/
-
-/*! \fn void QRadioTuner::stateChanged(QRadioTuner::State state)
- This signal is emitted when the state changes to \a state.
- */
-
-QT_END_NAMESPACE
-
-#include "moc_qradiotuner.cpp"
diff --git a/src/multimedia/radio/qradiotuner.h b/src/multimedia/radio/qradiotuner.h
deleted file mode 100644
index f7fbcf6c1..000000000
--- a/src/multimedia/radio/qradiotuner.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QRADIOTUNER_H
-#define QRADIOTUNER_H
-
-#include <QtCore/qobject.h>
-
-#include <QtMultimedia/qmediaobject.h>
-#include <QtMultimedia/qmediaenumdebug.h>
-
-#include <QtCore/qpair.h>
-
-Q_MOC_INCLUDE("QtMultimedia/qradiodata.h")
-
-QT_BEGIN_NAMESPACE
-
-class QRadioData;
-class QRadioTunerPrivate;
-class Q_MULTIMEDIA_EXPORT QRadioTuner : public QMediaObject
-{
- Q_OBJECT
- Q_PROPERTY(State state READ state NOTIFY stateChanged)
- Q_PROPERTY(Band band READ band WRITE setBand NOTIFY bandChanged)
- Q_PROPERTY(int frequency READ frequency WRITE setFrequency NOTIFY frequencyChanged)
- Q_PROPERTY(bool stereo READ isStereo NOTIFY stereoStatusChanged)
- Q_PROPERTY(StereoMode stereoMode READ stereoMode WRITE setStereoMode)
- Q_PROPERTY(int signalStrength READ signalStrength NOTIFY signalStrengthChanged)
- Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)
- Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
- Q_PROPERTY(bool searching READ isSearching NOTIFY searchingChanged)
- Q_PROPERTY(bool antennaConnected READ isAntennaConnected NOTIFY antennaConnectedChanged)
- Q_PROPERTY(QRadioData *radioData READ radioData CONSTANT)
- Q_ENUMS(State)
- Q_ENUMS(Band)
- Q_ENUMS(Error)
- Q_ENUMS(StereoMode)
- Q_ENUMS(SearchMode)
-
-public:
- enum State { ActiveState, StoppedState };
- enum Band { AM, FM, SW, LW, FM2 };
- enum Error { NoError, ResourceError, OpenError, OutOfRangeError };
- enum StereoMode { ForceStereo, ForceMono, Auto };
- enum SearchMode { SearchFast, SearchGetStationId };
-
- explicit QRadioTuner(QObject *parent = nullptr);
- ~QRadioTuner();
-
- QMultimedia::AvailabilityStatus availability() const override;
-
- State state() const;
-
- Band band() const;
-
- bool isBandSupported(Band b) const;
-
- int frequency() const;
- int frequencyStep(Band band) const;
- QPair<int,int> frequencyRange(Band band) const;
-
- bool isStereo() const;
- void setStereoMode(QRadioTuner::StereoMode mode);
- StereoMode stereoMode() const;
-
- int signalStrength() const;
-
- int volume() const;
- bool isMuted() const;
-
- bool isSearching() const;
-
- bool isAntennaConnected() const;
-
- Error error() const;
- QString errorString() const;
-
- QRadioData *radioData() const;
-
-public Q_SLOTS:
- void searchForward();
- void searchBackward();
- void searchAllStations(QRadioTuner::SearchMode searchMode = QRadioTuner::SearchFast);
- void cancelSearch();
-
- void setBand(Band band);
- void setFrequency(int frequency);
-
- void setVolume(int volume);
- void setMuted(bool muted);
-
- void start();
- void stop();
-
-Q_SIGNALS:
- void stateChanged(QRadioTuner::State state);
- void bandChanged(QRadioTuner::Band band);
- void frequencyChanged(int frequency);
- void stereoStatusChanged(bool stereo);
- void searchingChanged(bool searching);
- void signalStrengthChanged(int signalStrength);
- void volumeChanged(int volume);
- void mutedChanged(bool muted);
- void stationFound(int frequency, QString stationId);
- void antennaConnectedChanged(bool connectionStatus);
-
- void error(QRadioTuner::Error error);
-
-private:
- Q_DISABLE_COPY(QRadioTuner)
- Q_DECLARE_PRIVATE(QRadioTuner)
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QRadioTuner::State)
-Q_DECLARE_METATYPE(QRadioTuner::Band)
-Q_DECLARE_METATYPE(QRadioTuner::Error)
-Q_DECLARE_METATYPE(QRadioTuner::StereoMode)
-Q_DECLARE_METATYPE(QRadioTuner::SearchMode)
-
-Q_MEDIA_ENUM_DEBUG(QRadioTuner, State)
-Q_MEDIA_ENUM_DEBUG(QRadioTuner, Band)
-Q_MEDIA_ENUM_DEBUG(QRadioTuner, Error)
-Q_MEDIA_ENUM_DEBUG(QRadioTuner, StereoMode)
-Q_MEDIA_ENUM_DEBUG(QRadioTuner, SearchMode)
-
-#endif // QRADIOPLAYER_H
diff --git a/src/multimedia/radio/radio.pri b/src/multimedia/radio/radio.pri
deleted file mode 100644
index 41e43faa2..000000000
--- a/src/multimedia/radio/radio.pri
+++ /dev/null
@@ -1,9 +0,0 @@
-INCLUDEPATH += radio
-
-PUBLIC_HEADERS += \
- radio/qradiodata.h \
- radio/qradiotuner.h
-
-SOURCES += \
- radio/qradiodata.cpp \
- radio/qradiotuner.cpp
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp
index 1d562a00e..909cf88bb 100644
--- a/src/multimedia/recording/qmediarecorder.cpp
+++ b/src/multimedia/recording/qmediarecorder.cpp
@@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE
The QMediaRecorder class is a high level media recording class. It's not
intended to be used alone but for accessing the media recording functions
- of other media objects, like QRadioTuner, or QCamera.
+ of other media objects, like QCamera.
\snippet multimedia-snippets/media.cpp Media recorder
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 95c004125..8e67cb599 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -51,11 +51,6 @@ unix:!mac:!android {
qtConfig(pulseaudio): SUBDIRS += pulseaudio
qtConfig(alsa): SUBDIRS += alsa
-
- # v4l is turned off because it is not supported in Qt 5
- # qtConfig(linux_v4l) {
- # SUBDIRS += v4l
- # }
}
darwin:!watchos {
diff --git a/src/plugins/v4l/radio/radio.pri b/src/plugins/v4l/radio/radio.pri
deleted file mode 100644
index b8a9f750c..000000000
--- a/src/plugins/v4l/radio/radio.pri
+++ /dev/null
@@ -1,9 +0,0 @@
-INCLUDEPATH += $$PWD
-
-HEADERS += \
- $$PWD/v4lradiocontrol.h \
- $$PWD/v4lradioservice.h
-
-SOURCES += \
- $$PWD/v4lradiocontrol.cpp \
- $$PWD/v4lradioservice.cpp
diff --git a/src/plugins/v4l/radio/v4lradiocontrol.cpp b/src/plugins/v4l/radio/v4lradiocontrol.cpp
deleted file mode 100644
index 5eba1350d..000000000
--- a/src/plugins/v4l/radio/v4lradiocontrol.cpp
+++ /dev/null
@@ -1,536 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "v4lradiocontrol.h"
-#include "v4lradioservice.h"
-
-#include <QtCore/qdebug.h>
-
-#include <fcntl.h>
-
-#include <sys/ioctl.h>
-#include "linux/videodev2.h"
-
-#include <sys/soundcard.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-V4LRadioControl::V4LRadioControl(QObject *parent)
- :QRadioTunerControl(parent)
-{
- fd = -1;
- initRadio();
- muted = false;
- stereo = false;
- m_error = false;
- sig = 0;
- currentBand = QRadioTuner::FM;
- step = 100000;
- scanning = false;
- playTime.restart();
- timer = new QTimer(this);
- timer->setInterval(200);
- connect(timer,SIGNAL(timeout()),this,SLOT(search()));
- timer->start();
-}
-
-V4LRadioControl::~V4LRadioControl()
-{
- timer->stop();
-
- if(fd > 0)
- ::close(fd);
-}
-
-bool V4LRadioControl::isAvailable() const
-{
- return available;
-}
-
-QMultimedia::AvailabilityStatus V4LRadioControl::availability() const
-{
- if (fd > 0)
- return QMultimedia::Available;
- else
- return QMultimedia::ResourceError;
-}
-
-QRadioTuner::State V4LRadioControl::state() const
-{
- return fd > 0 ? QRadioTuner::ActiveState : QRadioTuner::StoppedState;
-}
-
-QRadioTuner::Band V4LRadioControl::band() const
-{
- return currentBand;
-}
-
-bool V4LRadioControl::isBandSupported(QRadioTuner::Band b) const
-{
- QRadioTuner::Band bnd = (QRadioTuner::Band)b;
- switch(bnd) {
- case QRadioTuner::FM:
- if(freqMin <= 87500000 && freqMax >= 108000000)
- return true;
- break;
- case QRadioTuner::LW:
- if(freqMin <= 148500 && freqMax >= 283500)
- return true;
- case QRadioTuner::AM:
- if(freqMin <= 520000 && freqMax >= 1610000)
- return true;
- default:
- if(freqMin <= 1711000 && freqMax >= 30000000)
- return true;
- }
-
- return false;
-}
-
-void V4LRadioControl::setBand(QRadioTuner::Band b)
-{
- if(freqMin <= 87500000 && freqMax >= 108000000 && b == QRadioTuner::FM) {
- // FM 87.5 to 108.0 MHz, except Japan 76-90 MHz
- currentBand = (QRadioTuner::Band)b;
- step = 100000; // 100kHz steps
- emit bandChanged(currentBand);
-
- } else if(freqMin <= 148500 && freqMax >= 283500 && b == QRadioTuner::LW) {
- // LW 148.5 to 283.5 kHz, 9kHz channel spacing (Europe, Africa, Asia)
- currentBand = (QRadioTuner::Band)b;
- step = 1000; // 1kHz steps
- emit bandChanged(currentBand);
-
- } else if(freqMin <= 520000 && freqMax >= 1610000 && b == QRadioTuner::AM) {
- // AM 520 to 1610 kHz, 9 or 10kHz channel spacing, extended 1610 to 1710 kHz
- currentBand = (QRadioTuner::Band)b;
- step = 1000; // 1kHz steps
- emit bandChanged(currentBand);
-
- } else if(freqMin <= 1711000 && freqMax >= 30000000 && b == QRadioTuner::SW) {
- // SW 1.711 to 30.0 MHz, divided into 15 bands. 5kHz channel spacing
- currentBand = (QRadioTuner::Band)b;
- step = 500; // 500Hz steps
- emit bandChanged(currentBand);
- }
- playTime.restart();
-}
-
-int V4LRadioControl::frequency() const
-{
- return currentFreq;
-}
-
-int V4LRadioControl::frequencyStep(QRadioTuner::Band b) const
-{
- int step = 0;
-
- if(b == QRadioTuner::FM)
- step = 100000; // 100kHz steps
- else if(b == QRadioTuner::LW)
- step = 1000; // 1kHz steps
- else if(b == QRadioTuner::AM)
- step = 1000; // 1kHz steps
- else if(b == QRadioTuner::SW)
- step = 500; // 500Hz steps
-
- return step;
-}
-
-QPair<int,int> V4LRadioControl::frequencyRange(QRadioTuner::Band b) const
-{
- if(b == QRadioTuner::AM)
- return qMakePair<int,int>(520000,1710000);
- else if(b == QRadioTuner::FM)
- return qMakePair<int,int>(87500000,108000000);
- else if(b == QRadioTuner::SW)
- return qMakePair<int,int>(1711111,30000000);
- else if(b == QRadioTuner::LW)
- return qMakePair<int,int>(148500,283500);
-
- return qMakePair<int,int>(0,0);
-}
-
-void V4LRadioControl::setFrequency(int frequency)
-{
- qint64 f = frequency;
-
- v4l2_frequency freq;
-
- if(frequency < freqMin)
- f = freqMax;
- if(frequency > freqMax)
- f = freqMin;
-
- if(fd > 0) {
- memset( &freq, 0, sizeof( freq ) );
- // Use the first tuner
- freq.tuner = 0;
- if ( ioctl( fd, VIDIOC_G_FREQUENCY, &freq ) >= 0 ) {
- if(low) {
- // For low, freq in units of 62.5Hz, so convert from Hz to units.
- freq.frequency = (int)(f/62.5);
- } else {
- // For high, freq in units of 62.5kHz, so convert from Hz to units.
- freq.frequency = (int)(f/62500);
- }
- ioctl( fd, VIDIOC_S_FREQUENCY, &freq );
- currentFreq = f;
- playTime.restart();
- emit frequencyChanged(currentFreq);
- }
- }
- playTime.restart();
-}
-
-bool V4LRadioControl::isStereo() const
-{
- return stereo;
-}
-
-QRadioTuner::StereoMode V4LRadioControl::stereoMode() const
-{
- return QRadioTuner::Auto;
-}
-
-void V4LRadioControl::setStereoMode(QRadioTuner::StereoMode mode)
-{
- bool stereo = true;
-
- if(mode == QRadioTuner::ForceMono)
- stereo = false;
-
- v4l2_tuner tuner;
-
- memset( &tuner, 0, sizeof( tuner ) );
-
- if ( ioctl( fd, VIDIOC_G_TUNER, &tuner ) >= 0 ) {
- if(stereo)
- tuner.audmode = V4L2_TUNER_MODE_STEREO;
- else
- tuner.audmode = V4L2_TUNER_MODE_MONO;
-
- if ( ioctl( fd, VIDIOC_S_TUNER, &tuner ) >= 0 ) {
- emit stereoStatusChanged(stereo);
- }
- }
-}
-
-int V4LRadioControl::signalStrength() const
-{
- v4l2_tuner tuner;
-
- // Return the first tuner founds signal strength.
- for ( int index = 0; index < tuners; ++index ) {
- memset( &tuner, 0, sizeof( tuner ) );
- tuner.index = index;
- if ( ioctl( fd, VIDIOC_G_TUNER, &tuner ) < 0 )
- continue;
- if ( tuner.type != V4L2_TUNER_RADIO )
- continue;
- // percentage signal strength
- return tuner.signal*100/65535;
- }
-
- return 0;
-}
-
-int V4LRadioControl::volume() const
-{
- v4l2_queryctrl queryctrl;
-
- if(fd > 0) {
- memset( &queryctrl, 0, sizeof( queryctrl ) );
- queryctrl.id = V4L2_CID_AUDIO_VOLUME;
- if ( ioctl( fd, VIDIOC_QUERYCTRL, &queryctrl ) >= 0 ) {
- if(queryctrl.maximum == 0) {
- return vol;
- } else {
- // percentage volume returned
- return queryctrl.default_value*100/queryctrl.maximum;
- }
- }
- }
- return 0;
-}
-
-void V4LRadioControl::setVolume(int volume)
-{
- v4l2_queryctrl queryctrl;
-
- if(fd > 0) {
- memset( &queryctrl, 0, sizeof( queryctrl ) );
- queryctrl.id = V4L2_CID_AUDIO_VOLUME;
- if ( ioctl( fd, VIDIOC_QUERYCTRL, &queryctrl ) >= 0 ) {
- v4l2_control control;
-
- if(queryctrl.maximum > 0) {
- memset( &control, 0, sizeof( control ) );
- control.id = V4L2_CID_AUDIO_VOLUME;
- control.value = volume*queryctrl.maximum/100;
- ioctl( fd, VIDIOC_S_CTRL, &control );
- } else {
- setVol(volume);
- }
- emit volumeChanged(volume);
- }
- }
-}
-
-bool V4LRadioControl::isMuted() const
-{
- return muted;
-}
-
-void V4LRadioControl::setMuted(bool muted)
-{
- v4l2_queryctrl queryctrl;
-
- if(fd > 0) {
- memset( &queryctrl, 0, sizeof( queryctrl ) );
- queryctrl.id = V4L2_CID_AUDIO_MUTE;
- if ( ioctl( fd, VIDIOC_QUERYCTRL, &queryctrl ) >= 0 ) {
- v4l2_control control;
- memset( &control, 0, sizeof( control ) );
- control.id = V4L2_CID_AUDIO_MUTE;
- control.value = (muted ? queryctrl.maximum : queryctrl.minimum );
- ioctl( fd, VIDIOC_S_CTRL, &control );
- this->muted = muted;
- emit mutedChanged(muted);
- }
- }
-}
-
-bool V4LRadioControl::isSearching() const
-{
- return scanning;
-}
-
-void V4LRadioControl::cancelSearch()
-{
- scanning = false;
- timer->stop();
-}
-
-void V4LRadioControl::searchForward()
-{
- // Scan up
- if(scanning) {
- cancelSearch();
- return;
- }
- scanning = true;
- forward = true;
- timer->start();
-}
-
-void V4LRadioControl::searchBackward()
-{
- // Scan down
- if(scanning) {
- cancelSearch();
- return;
- }
- scanning = true;
- forward = false;
- timer->start();
-}
-
-void V4LRadioControl::start()
-{
-}
-
-void V4LRadioControl::stop()
-{
-}
-
-QRadioTuner::Error V4LRadioControl::error() const
-{
- if(m_error)
- return QRadioTuner::OpenError;
-
- return QRadioTuner::NoError;
-}
-
-QString V4LRadioControl::errorString() const
-{
- return QString();
-}
-
-void V4LRadioControl::search()
-{
- int signal = signalStrength();
- if(sig != signal) {
- sig = signal;
- emit signalStrengthChanged(sig);
- }
-
- if(!scanning) return;
-
- if (signal > 25) {
- cancelSearch();
- return;
- }
-
- if(forward) {
- setFrequency(currentFreq+step);
- } else {
- setFrequency(currentFreq-step);
- }
-}
-
-bool V4LRadioControl::initRadio()
-{
- v4l2_tuner tuner;
- v4l2_input input;
- v4l2_frequency freq;
- v4l2_capability cap;
-
- low = false;
- available = false;
- freqMin = freqMax = currentFreq = 0;
-
- fd = ::open("/dev/radio0", O_RDWR);
-
- if(fd != -1) {
- // Capabilities
- memset( &cap, 0, sizeof( cap ) );
- if(::ioctl(fd, VIDIOC_QUERYCAP, &cap ) >= 0) {
- if(((cap.capabilities & V4L2_CAP_RADIO) == 0) && ((cap.capabilities & V4L2_CAP_AUDIO) == 0))
- available = true;
- }
-
- // Tuners
- memset( &input, 0, sizeof( input ) );
- tuners = 0;
- for ( ;; ) {
- memset( &input, 0, sizeof( input ) );
- input.index = tuners;
- if ( ioctl( fd, VIDIOC_ENUMINPUT, &input ) < 0 )
- break;
- ++tuners;
- }
-
- // Freq bands
- for ( int index = 0; index < tuners; ++index ) {
- memset( &tuner, 0, sizeof( tuner ) );
- tuner.index = index;
- if ( ioctl( fd, VIDIOC_G_TUNER, &tuner ) < 0 )
- continue;
- if ( tuner.type != V4L2_TUNER_RADIO )
- continue;
- if ( ( tuner.capability & V4L2_TUNER_CAP_LOW ) != 0 ) {
- // Units are 1/16th of a kHz.
- low = true;
- }
- if(low) {
- freqMin = tuner.rangelow * 62.5;
- freqMax = tuner.rangehigh * 62.5;
- } else {
- freqMin = tuner.rangelow * 62500;
- freqMax = tuner.rangehigh * 62500;
- }
- }
-
- // frequency
- memset( &freq, 0, sizeof( freq ) );
- if(::ioctl(fd, VIDIOC_G_FREQUENCY, &freq ) >= 0) {
- if ( ((int)freq.frequency) != -1 ) { // -1 means not set.
- if(low)
- currentFreq = freq.frequency * 62.5;
- else
- currentFreq = freq.frequency * 62500;
- }
- }
-
- // stereo
- bool stereo = false;
- memset( &tuner, 0, sizeof( tuner ) );
- if ( ioctl( fd, VIDIOC_G_TUNER, &tuner ) >= 0 ) {
- if((tuner.rxsubchans & V4L2_TUNER_SUB_STEREO) != 0)
- stereo = true;
- }
-
- vol = getVol();
-
- return true;
- }
- m_error = true;
- emit error();
-
- return false;
-}
-
-void V4LRadioControl::setVol(int v)
-{
- int fd = ::open( "/dev/mixer", O_RDWR, 0 );
- if ( fd < 0 )
- return;
- int volume = v;
- if ( volume < 0 )
- volume = 0;
- else if ( volume > 100 )
- volume = 100;
- vol = volume;
- volume += volume << 8;
- ::ioctl( fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &volume );
- ::close( fd );
-}
-
-int V4LRadioControl::getVol()
-{
- int fd = ::open( "/dev/mixer", O_RDWR, 0 );
- if ( fd >= 0 ) {
- int volume = 0;
- ::ioctl( fd, MIXER_READ(SOUND_MIXER_VOLUME), &volume );
- int left = ( volume & 0xFF );
- int right = ( ( volume >> 8 ) & 0xFF );
- if ( left > right )
- vol = left;
- else
- vol = right;
- ::close( fd );
- return vol;
- }
- return 0;
-}
-
diff --git a/src/plugins/v4l/radio/v4lradiocontrol.h b/src/plugins/v4l/radio/v4lradiocontrol.h
deleted file mode 100644
index ce68ebeec..000000000
--- a/src/plugins/v4l/radio/v4lradiocontrol.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef V4LRADIOCONTROL_H
-#define V4LRADIOCONTROL_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qtimer.h>
-#include <QtCore/qdatetime.h>
-
-#include <qradiotunercontrol.h>
-
-#if defined(Q_OS_FREEBSD)
-#include <sys/types.h>
-#else
-#include <linux/types.h>
-#endif
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <linux/videodev2.h>
-
-QT_USE_NAMESPACE
-
-class V4LRadioService;
-
-class V4LRadioControl : public QRadioTunerControl
-{
- Q_OBJECT
-public:
- V4LRadioControl(QObject *parent = 0);
- ~V4LRadioControl();
-
- bool isAvailable() const;
- QMultimedia::AvailabilityStatus availability() const;
-
- QRadioTuner::State state() const;
-
- QRadioTuner::Band band() const;
- void setBand(QRadioTuner::Band b);
- bool isBandSupported(QRadioTuner::Band b) const;
-
- int frequency() const;
- int frequencyStep(QRadioTuner::Band b) const;
- QPair<int,int> frequencyRange(QRadioTuner::Band b) const;
- void setFrequency(int frequency);
-
- bool isStereo() const;
- QRadioTuner::StereoMode stereoMode() const;
- void setStereoMode(QRadioTuner::StereoMode mode);
-
- int signalStrength() const;
-
- int volume() const;
- void setVolume(int volume);
-
- bool isMuted() const;
- void setMuted(bool muted);
-
- bool isSearching() const;
- void cancelSearch();
-
- void searchForward();
- void searchBackward();
-
- void start();
- void stop();
-
- QRadioTuner::Error error() const;
- QString errorString() const;
-
-private slots:
- void search();
-
-private:
- bool initRadio();
- void setVol(int v);
- int getVol();
-
- int fd;
-
- bool m_error;
- bool muted;
- bool stereo;
- bool low;
- bool available;
- int tuners;
- int step;
- int vol;
- int sig;
- bool scanning;
- bool forward;
- QTimer* timer;
- QRadioTuner::Band currentBand;
- qint64 freqMin;
- qint64 freqMax;
- qint64 currentFreq;
- QTime playTime;
-};
-
-#endif
diff --git a/src/plugins/v4l/radio/v4lradioservice.cpp b/src/plugins/v4l/radio/v4lradioservice.cpp
deleted file mode 100644
index 60356abb7..000000000
--- a/src/plugins/v4l/radio/v4lradioservice.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qvariant.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qfile.h>
-#include <QtWidgets/qwidget.h>
-
-#include "v4lradioservice.h"
-#include "v4lradiocontrol.h"
-
-V4LRadioService::V4LRadioService(QObject *parent):
- QMediaService(parent)
-{
- m_control = new V4LRadioControl(this);
-}
-
-V4LRadioService::~V4LRadioService()
-{
-}
-
-QMediaControl *V4LRadioService::requestControl(const char* name)
-{
- if (qstrcmp(name,QRadioTunerControl_iid) == 0)
- return m_control;
-
- return 0;
-}
-
-
-void V4LRadioService::releaseControl(QMediaControl *)
-{
-}
diff --git a/src/plugins/v4l/radio/v4lradioservice.h b/src/plugins/v4l/radio/v4lradioservice.h
deleted file mode 100644
index adf4e3ae3..000000000
--- a/src/plugins/v4l/radio/v4lradioservice.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef V4LRADIOSERVICE_H
-#define V4LRADIOSERVICE_H
-
-#include <QtCore/qobject.h>
-
-#include <qmediaservice.h>
-QT_USE_NAMESPACE
-
-class V4LRadioControl;
-
-class V4LRadioService : public QMediaService
-{
- Q_OBJECT
-
-public:
- V4LRadioService(QObject *parent = 0);
- ~V4LRadioService();
-
- QMediaControl *requestControl(const char* name);
- void releaseControl(QMediaControl *);
-
-private:
- V4LRadioControl *m_control;
-};
-
-#endif
diff --git a/src/plugins/v4l/v4l.json b/src/plugins/v4l/v4l.json
deleted file mode 100644
index 467fd526f..000000000
--- a/src/plugins/v4l/v4l.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "Keys": ["v4l"],
- "Services": ["org.qt-project.qt.radio"]
-}
diff --git a/src/plugins/v4l/v4l.pro b/src/plugins/v4l/v4l.pro
deleted file mode 100644
index 28d89e3e9..000000000
--- a/src/plugins/v4l/v4l.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = qtmedia_v4lengine
-QT += multimedia-private
-
-HEADERS += v4lserviceplugin.h
-SOURCES += v4lserviceplugin.cpp
-
-include(radio/radio.pri)
-
-PLUGIN_TYPE = mediaservice
-PLUGIN_CLASS_NAME = V4LServicePlugin
-load(qt_plugin)
diff --git a/src/plugins/v4l/v4lserviceplugin.cpp b/src/plugins/v4l/v4lserviceplugin.cpp
deleted file mode 100644
index 3a71709c6..000000000
--- a/src/plugins/v4l/v4lserviceplugin.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qstring.h>
-#include <QtCore/qfile.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qdir.h>
-
-#include "v4lserviceplugin.h"
-#include "v4lradioservice.h"
-
-#include <qmediaserviceprovider.h>
-
-
-QMediaService* V4LServicePlugin::create(QString const& key)
-{
- if (key == QLatin1String(Q_MEDIASERVICE_RADIO))
- return new V4LRadioService;
-
- return 0;
-}
-
-void V4LServicePlugin::release(QMediaService *service)
-{
- delete service;
-}
-
-QList<QByteArray> V4LServicePlugin::devices(const QByteArray &service) const
-{
- return QList<QByteArray>();
-}
-
-QString V4LServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device)
-{
- return QString();
-}
diff --git a/src/plugins/v4l/v4lserviceplugin.h b/src/plugins/v4l/v4lserviceplugin.h
deleted file mode 100644
index b1347b407..000000000
--- a/src/plugins/v4l/v4lserviceplugin.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef V4LSERVICEPLUGIN_H
-#define V4LSERVICEPLUGIN_H
-
-#include <qmediaserviceproviderplugin.h>
-
-QT_USE_NAMESPACE
-
-class V4LServicePlugin : public QMediaServiceProviderPlugin, public QMediaServiceSupportedDevicesInterface
-{
- Q_OBJECT
- Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
- Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "v4l.json")
-public:
- QMediaService* create(QString const& key);
- void release(QMediaService *service);
-
- QList<QByteArray> devices(const QByteArray &service) const;
- QString deviceDescription(const QByteArray &service, const QByteArray &device);
-};
-
-#endif // V4LSERVICEPLUGIN_H
diff --git a/tests/auto/unit/multimedia.pro b/tests/auto/unit/multimedia.pro
index 94a6dba89..3e0311a66 100644
--- a/tests/auto/unit/multimedia.pro
+++ b/tests/auto/unit/multimedia.pro
@@ -23,8 +23,6 @@ SUBDIRS += \
qmediatimerange \
qmetadatareadercontrol \
qmetadatawritercontrol \
- qradiodata \
- qradiotuner \
qvideoencodersettingscontrol \
qvideoframe \
qvideosurfaceformat \
diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp
index 4167b18ea..b44c704f4 100644
--- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp
+++ b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp
@@ -41,8 +41,7 @@ class MockServicePlugin2 : public QMediaServiceProviderPlugin,
public:
QStringList keys() const
{
- return QStringList() << QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)
- << QLatin1String(Q_MEDIASERVICE_RADIO);
+ return QStringList() << QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER);
}
QMediaService* create(QString const& key)
diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json
index 15d8ed505..07f9cae7a 100644
--- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json
+++ b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json
@@ -1,4 +1,4 @@
{
"Keys": ["mockserviceplugin2"],
- "Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.radio"]
+ "Services": ["org.qt-project.qt.mediaplayer"]
}
diff --git a/tests/auto/unit/qmultimedia_common/mockradio.pri b/tests/auto/unit/qmultimedia_common/mockradio.pri
deleted file mode 100644
index 0f7f84a2f..000000000
--- a/tests/auto/unit/qmultimedia_common/mockradio.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-
-# Radio related mock backend files
-
-INCLUDEPATH += .
-
-HEADERS += \
- ../qmultimedia_common/mockradiotunercontrol.h \
- ../qmultimedia_common/mockradiodatacontrol.h
diff --git a/tests/auto/unit/qmultimedia_common/mockradiodatacontrol.h b/tests/auto/unit/qmultimedia_common/mockradiodatacontrol.h
deleted file mode 100644
index c51bafc30..000000000
--- a/tests/auto/unit/qmultimedia_common/mockradiodatacontrol.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MOCKRADIODATACONTROL_H
-#define MOCKRADIODATACONTROL_H
-
-#include "qradiodatacontrol.h"
-
-class MockRadioDataControl : public QRadioDataControl
-{
- Q_OBJECT
-
-public:
- MockRadioDataControl(QObject *parent):
- QRadioDataControl(parent), m_err(QRadioData::NoError),
- m_errstr("")
- {
- }
-
- using QRadioDataControl::error;
-
- QRadioData::Error error() const
- {
- return m_err;
- }
-
- QString errorString() const
- {
- return m_errstr;
- }
-
- QString stationId() const
- {
- return m_stationId;
- }
-
- QRadioData::ProgramType programType() const
- {
- return m_programType;
- }
-
- QString programTypeName() const
- {
- return m_programTypeName;
- }
-
- QString stationName() const
- {
- return m_stationName;
- }
-
- QString radioText() const
- {
- return m_radioText;
- }
-
- void setAlternativeFrequenciesEnabled(bool enabled)
- {
- m_alternativeFrequenciesEnabled = enabled;
- emit alternativeFrequenciesEnabledChanged(m_alternativeFrequenciesEnabled);
- }
-
- bool isAlternativeFrequenciesEnabled() const
- {
- return m_alternativeFrequenciesEnabled;
- }
-
- void forceRT( QString text )
- {
- m_radioText = text;
- emit radioTextChanged(m_radioText);
- }
-
- void forceProgramType( int pty )
- {
- m_programType = static_cast<QRadioData::ProgramType>(pty);
- emit programTypeChanged(m_programType);
- }
-
- void forcePTYN( QString ptyn )
- {
- m_programTypeName = ptyn;
- emit programTypeNameChanged(m_programTypeName);
- }
-
- void forcePI( QString pi )
- {
- m_stationId = pi;
- emit stationIdChanged(m_stationId);
- }
-
- void forcePS( QString ps )
- {
- m_stationName = ps;
- emit stationNameChanged(m_stationName);
- }
-
-public:
- QString m_radioText;
- QRadioData::ProgramType m_programType;
- QString m_programTypeName;
- QString m_stationId;
- QString m_stationName;
- bool m_alternativeFrequenciesEnabled;
-
- QRadioData::Error m_err;
- QString m_errstr;
-};
-
-#endif // MOCKRADIODATACONTROL_H
diff --git a/tests/auto/unit/qmultimedia_common/mockradiotunercontrol.h b/tests/auto/unit/qmultimedia_common/mockradiotunercontrol.h
deleted file mode 100644
index 254d0f3d5..000000000
--- a/tests/auto/unit/qmultimedia_common/mockradiotunercontrol.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MOCKRADIOTUNERCONTROL_H
-#define MOCKRADIOTUNERCONTROL_H
-
-#include "qradiotunercontrol.h"
-
-class MockRadioTunerControl : public QRadioTunerControl
-{
- Q_OBJECT
-
-public:
- MockRadioTunerControl(QObject *parent):
- QRadioTunerControl(parent),
- m_active(false),
- m_searching(false),m_muted(false),m_stereo(true),
- m_volume(100),m_signal(0),m_frequency(0),
- m_band(QRadioTuner::FM),m_err(QRadioTuner::NoError),
- m_errstr("")
- {
- }
-
- using QRadioTunerControl::error;
-
- QRadioTuner::State state() const
- {
- return m_active ? QRadioTuner::ActiveState : QRadioTuner::StoppedState;
- }
-
- QRadioTuner::Band band() const
- {
- return m_band;
- }
-
- void setBand(QRadioTuner::Band b)
- {
- if (b == QRadioTuner::FM2 || b == QRadioTuner::LW) {
- m_err = QRadioTuner::OutOfRangeError;
- m_errstr.clear();
- m_errstr = QString("band and range not supported");
- } else {
- m_err = QRadioTuner::NoError;
- m_errstr.clear();
- m_band = b;
- emit bandChanged(m_band);
- }
- emit error(m_err);
-
- }
-
- bool isBandSupported(QRadioTuner::Band b) const
- {
- if (b == QRadioTuner::FM || b == QRadioTuner::AM)
- return true;
-
- return false;
- }
-
- int frequency() const
- {
- return m_frequency;
- }
-
- QPair<int,int> frequencyRange(QRadioTuner::Band) const
- {
- return qMakePair<int,int>(1,2);
- }
-
- int frequencyStep(QRadioTuner::Band) const
- {
- return 1;
- }
-
- void setFrequency(int frequency)
- {
- if (frequency >= 148500000) {
- m_err = QRadioTuner::OutOfRangeError;
- m_errstr.clear();
- m_errstr = QString("band and range not supported");
- } else {
- m_err = QRadioTuner::NoError;
- m_errstr.clear();
- m_frequency = frequency;
- emit frequencyChanged(m_frequency);
- }
-
- emit error(m_err);
- }
-
- bool isStereo() const
- {
- return m_stereo;
- }
-
- void setStereo(bool stereo)
- {
- emit stereoStatusChanged(m_stereo = stereo);
- }
-
-
- QRadioTuner::StereoMode stereoMode() const
- {
- return m_stereoMode;
- }
-
- void setStereoMode(QRadioTuner::StereoMode mode)
- {
- m_stereoMode = mode;
- }
-
- QRadioTuner::Error error() const
- {
- return m_err;
- }
-
- QString errorString() const
- {
- return m_errstr;
- }
-
- int signalStrength() const
- {
- return m_signal;
- }
-
- int volume() const
- {
- return m_volume;
- }
-
- void setVolume(int volume)
- {
- m_volume = volume;
- emit volumeChanged(m_volume);
- }
-
- bool isMuted() const
- {
- return m_muted;
- }
-
- void setMuted(bool muted)
- {
- m_muted = muted;
- emit mutedChanged(m_muted);
- }
-
- bool isSearching() const
- {
- return m_searching;
- }
-
- void searchForward()
- {
- m_searching = true;
- emit searchingChanged(m_searching);
- }
-
- void searchBackward()
- {
- m_searching = true;
- emit searchingChanged(m_searching);
- }
-
- void cancelSearch()
- {
- m_searching = false;
- emit searchingChanged(m_searching);
- }
-
- void findNewStation( int frequency, QString stationId )
- {
- setFrequency(frequency);
- emit stationFound( frequency, stationId );
- }
-
- void searchAllStations(QRadioTuner::SearchMode searchMode = QRadioTuner::SearchFast)
- {
- QString programmeIdentifiers[3] = { "", "", "" };
-
- if ( searchMode == QRadioTuner::SearchGetStationId ) {
- programmeIdentifiers[0] = QString("MockProgramPI1");
- programmeIdentifiers[1] = QString("MockProgramPI2");
- programmeIdentifiers[2] = QString("MockProgramPI3");
- }
- m_searching = true;
- emit searchingChanged(m_searching);
-
- findNewStation(88300000, programmeIdentifiers[0]);
- findNewStation(95100000, programmeIdentifiers[1]);
- findNewStation(103100000, programmeIdentifiers[2]);
-
- m_searching = false;
- emit searchingChanged(m_searching);
- }
-
- void start()
- {
- if (!m_active) {
- m_active = true;
- emit stateChanged(state());
- }
- }
-
- void stop()
- {
- if (m_active) {
- m_active = false;
- emit stateChanged(state());
- }
- }
-
-public:
- bool m_active;
- bool m_searching;
- bool m_muted;
- bool m_stereo;
- int m_volume;
- int m_signal;
- int m_frequency;
- QRadioTuner::StereoMode m_stereoMode;
- QRadioTuner::Band m_band;
- QRadioTuner::Error m_err;
- QString m_errstr;
-};
-
-#endif // MOCKRADIOTUNERCONTROL_H
diff --git a/tests/auto/unit/qradiodata/qradiodata.pro b/tests/auto/unit/qradiodata/qradiodata.pro
deleted file mode 100644
index b08262d70..000000000
--- a/tests/auto/unit/qradiodata/qradiodata.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qradiodata
-QT += multimedia-private testlib
-SOURCES += tst_qradiodata.cpp
-
-include (../qmultimedia_common/mock.pri)
-include (../qmultimedia_common/mockradio.pri)
diff --git a/tests/auto/unit/qradiodata/tst_qradiodata.cpp b/tests/auto/unit/qradiodata/tst_qradiodata.cpp
deleted file mode 100644
index afc19113e..000000000
--- a/tests/auto/unit/qradiodata/tst_qradiodata.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//TESTED_COMPONENT=src/multimedia
-
-#include <QtTest/QtTest>
-#include <QDebug>
-#include <QTimer>
-#include <QtCore/QMap>
-
-#include <qmediaobject.h>
-#include <qmediacontrol.h>
-#include <qmediaservice.h>
-#include <qradiodatacontrol.h>
-#include <qradiodata.h>
-#include <qradiotuner.h>
-
-#include "mockmediaserviceprovider.h"
-#include "mockmediaservice.h"
-#include "mockavailabilitycontrol.h"
-#include "mockradiotunercontrol.h"
-#include "mockradiodatacontrol.h"
-
-QT_USE_NAMESPACE
-
-class tst_QRadioData: public QObject
-{
- Q_OBJECT
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
-
-private slots:
- void testNullService();
- void testNullControl();
- void testAlternativeFrequencies();
- void testRadioDataUpdates();
-
-private:
- MockAvailabilityControl *mockAvailability;
- MockRadioTunerControl *mockTuner;
- MockRadioDataControl *mockData;
- MockMediaService *service;
- MockMediaServiceProvider *provider;
- QRadioTuner * radio;
- QRadioData *radioData;
-};
-
-void tst_QRadioData::initTestCase()
-{
- qRegisterMetaType<QRadioData::ProgramType>("QRadioData::ProgramType");
-
- mockAvailability = new MockAvailabilityControl(QMultimedia::Available);
- mockTuner = new MockRadioTunerControl(this);
- mockData = new MockRadioDataControl(this);
-
- QMap<QString, QMediaControl *> map;
- map.insert(QRadioTunerControl_iid, mockTuner);
- map.insert(QRadioDataControl_iid, mockData);
- map.insert(QMediaAvailabilityControl_iid, mockAvailability);
-
- service = new MockMediaService(this, map);
- provider = new MockMediaServiceProvider(service);
- QMediaServiceProvider::setDefaultServiceProvider(provider);
-
- radio = new QRadioTuner;
- radioData = radio->radioData();
-
- QVERIFY(radioData->availability() == QMultimedia::Available);
-}
-
-void tst_QRadioData::cleanupTestCase()
-{
- QVERIFY(radioData->error() == QRadioData::NoError);
- QVERIFY(radioData->errorString().isEmpty());
-
- delete radio;
- delete service;
- delete provider;
- delete mockAvailability;
-}
-
-void tst_QRadioData::testNullService()
-{
- const QPair<int, int> nullRange(0, 0);
-
- MockMediaServiceProvider nullProvider(0);
- QMediaServiceProvider::setDefaultServiceProvider(&nullProvider);
- QRadioTuner radio;
- QRadioData *nullRadioData = radio.radioData();
-
- QVERIFY(nullRadioData == 0);
-
- QRadioData radioData(&radio);
-
- QCOMPARE(radioData.error(), QRadioData::ResourceError);
- QCOMPARE(radioData.errorString(), QString());
- QCOMPARE(radioData.stationId(), QString());
- QCOMPARE(radioData.programType(), QRadioData::Undefined);
- QCOMPARE(radioData.programTypeName(), QString());
- QCOMPARE(radioData.stationName(), QString());
- QCOMPARE(radioData.radioText(), QString());
- QCOMPARE(radioData.isAlternativeFrequenciesEnabled(), false);
-
-}
-
-void tst_QRadioData::testNullControl()
-{
- const QPair<int, int> nullRange(0, 0);
-
- MockMediaService service(0, 0);
- MockMediaServiceProvider provider(&service);
- QMediaServiceProvider::setDefaultServiceProvider(&provider);
- QRadioTuner radio;
- QRadioData *radioData = radio.radioData();
- QCOMPARE(radioData->error(), QRadioData::ResourceError);
- QCOMPARE(radioData->errorString(), QString());
-
- QCOMPARE(radioData->stationId(), QString());
- QCOMPARE(radioData->programType(), QRadioData::Undefined);
- QCOMPARE(radioData->programTypeName(), QString());
- QCOMPARE(radioData->stationName(), QString());
- QCOMPARE(radioData->radioText(), QString());
- QCOMPARE(radioData->isAlternativeFrequenciesEnabled(), false);
- {
- QSignalSpy spy(radioData, SIGNAL(alternativeFrequenciesEnabledChanged(bool)));
-
- radioData->setAlternativeFrequenciesEnabled(true);
- QCOMPARE(radioData->isAlternativeFrequenciesEnabled(), false);
- QCOMPARE(spy.count(), 0);
- }
-}
-
-void tst_QRadioData::testAlternativeFrequencies()
-{
- QSignalSpy readSignal(radioData, SIGNAL(alternativeFrequenciesEnabledChanged(bool)));
- radioData->setAlternativeFrequenciesEnabled(true);
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(radioData->isAlternativeFrequenciesEnabled() == true);
- QVERIFY(readSignal.count() == 1);
-}
-
-void tst_QRadioData::testRadioDataUpdates()
-{
- QSignalSpy rtSpy(radioData, SIGNAL(radioTextChanged(QString)));
- QSignalSpy ptyPTYSpy(radioData, SIGNAL(programTypeChanged(QRadioData::ProgramType)));
- QSignalSpy ptynSpy(radioData, SIGNAL(programTypeNameChanged(QString)));
- QSignalSpy piSpy(radioData, SIGNAL(stationIdChanged(QString)));
- QSignalSpy psSpy(radioData, SIGNAL(stationNameChanged(QString)));
- mockData->forceRT("Mock Radio Text");
- mockData->forceProgramType(static_cast<int>(QRadioData::Sport));
- mockData->forcePTYN("Mock Programme Type Name");
- mockData->forcePI("Mock Programme Identification");
- mockData->forcePS("Mock Programme Service");
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(rtSpy.count() == 1);
- QVERIFY(ptyPTYSpy.count() == 1);
- QVERIFY(ptynSpy.count() == 1);
- QVERIFY(piSpy.count() == 1);
- QVERIFY(psSpy.count() == 1);
- QCOMPARE(radioData->radioText(), QString("Mock Radio Text"));
- QCOMPARE(radioData->programType(), QRadioData::Sport);
- QCOMPARE(radioData->programTypeName(), QString("Mock Programme Type Name"));
- QCOMPARE(radioData->stationId(), QString("Mock Programme Identification"));
- QCOMPARE(radioData->stationName(), QString("Mock Programme Service"));
-}
-
-QTEST_GUILESS_MAIN(tst_QRadioData)
-#include "tst_qradiodata.moc"
diff --git a/tests/auto/unit/qradiotuner/qradiotuner.pro b/tests/auto/unit/qradiotuner/qradiotuner.pro
deleted file mode 100644
index d15c4c6a2..000000000
--- a/tests/auto/unit/qradiotuner/qradiotuner.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qradiotuner
-QT += multimedia-private testlib
-SOURCES += tst_qradiotuner.cpp
-
-include (../qmultimedia_common/mock.pri)
-include (../qmultimedia_common/mockradio.pri)
diff --git a/tests/auto/unit/qradiotuner/tst_qradiotuner.cpp b/tests/auto/unit/qradiotuner/tst_qradiotuner.cpp
deleted file mode 100644
index 02e4ef6e9..000000000
--- a/tests/auto/unit/qradiotuner/tst_qradiotuner.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//TESTED_COMPONENT=src/multimedia
-
-#include <QtTest/QtTest>
-#include <QDebug>
-#include <QTimer>
-#include <QtCore/QMap>
-
-#include <qmediaobject.h>
-#include <qmediacontrol.h>
-#include <qmediaservice.h>
-#include <qradiotunercontrol.h>
-#include <qradiotuner.h>
-
-#include "mockmediaserviceprovider.h"
-#include "mockmediaservice.h"
-#include "mockradiotunercontrol.h"
-#include "mockavailabilitycontrol.h"
-
-QT_USE_NAMESPACE
-
-class tst_QRadioTuner: public QObject
-{
- Q_OBJECT
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
-
-private slots:
- void testNullService();
- void testNullControl();
- void testBand();
- void testFrequency();
- void testMute();
- void testSearch();
- void testVolume();
- void testSignal();
- void testStereo();
- void testSearchAllStations();
- void errorSignal();
-
-private:
- MockRadioTunerControl *mock;
- MockAvailabilityControl *mockAvailability;
- MockMediaService *service;
- MockMediaServiceProvider *provider;
- QRadioTuner *radio;
-};
-
-void tst_QRadioTuner::initTestCase()
-{
- qRegisterMetaType<QRadioTuner::State>("QRadioTuner::State");
- qRegisterMetaType<QRadioTuner::Band>("QRadioTuner::Band");
-
- mock = new MockRadioTunerControl(this);
- mockAvailability = new MockAvailabilityControl(QMultimedia::Available);
-
- QMap<QString, QMediaControl *> map;
- map.insert(QRadioTunerControl_iid, mock);
- map.insert(QMediaAvailabilityControl_iid, mockAvailability);
-
- service = new MockMediaService(this, map);
- provider = new MockMediaServiceProvider(service);
- QMediaServiceProvider::setDefaultServiceProvider(provider);
-
- radio = new QRadioTuner;
- QVERIFY(radio->service() != 0);
- QVERIFY(radio->isAvailable());
- QVERIFY(radio->availability() == QMultimedia::Available);
-
- QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
-
- QCOMPARE(radio->state(), QRadioTuner::StoppedState);
- radio->start();
- QVERIFY(radio->availability() == QMultimedia::Available);
- QCOMPARE(radio->state(), QRadioTuner::ActiveState);
-
- QCOMPARE(stateSpy.count(), 1);
- QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::ActiveState);
-}
-
-void tst_QRadioTuner::cleanupTestCase()
-{
- QVERIFY(radio->error() == QRadioTuner::NoError);
- QVERIFY(radio->errorString().isEmpty());
-
- QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
-
- radio->stop();
- QVERIFY(radio->availability() == QMultimedia::Available);
- QCOMPARE(radio->state(), QRadioTuner::StoppedState);
- QCOMPARE(stateSpy.count(), 1);
-
- QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::StoppedState);
-
- delete radio;
- delete service;
- delete provider;
- delete mockAvailability;
-}
-
-void tst_QRadioTuner::init()
-{
- QMediaServiceProvider::setDefaultServiceProvider(provider);
-}
-
-void tst_QRadioTuner::testNullService()
-{
- const QPair<int, int> nullRange(0, 0);
-
- MockMediaServiceProvider provider(0);
- QMediaServiceProvider::setDefaultServiceProvider(&provider);
-
- QRadioTuner radio;
- QVERIFY(!radio.isAvailable());
- radio.start();
- QCOMPARE(radio.error(), QRadioTuner::ResourceError);
- QCOMPARE(radio.errorString(), QString());
- QCOMPARE(radio.band(), QRadioTuner::FM);
- QCOMPARE(radio.isBandSupported(QRadioTuner::AM), false);
- QCOMPARE(radio.isBandSupported(QRadioTuner::FM), false);
- QCOMPARE(radio.frequency(), 0);
- QCOMPARE(radio.frequencyStep(QRadioTuner::AM), 0);
- QCOMPARE(radio.frequencyStep(QRadioTuner::FM), 0);
- QCOMPARE(radio.frequencyRange(QRadioTuner::AM), nullRange);
- QCOMPARE(radio.frequencyRange(QRadioTuner::FM), nullRange);
- QCOMPARE(radio.isStereo(), false);
- QCOMPARE(radio.stereoMode(), QRadioTuner::Auto);
- QCOMPARE(radio.signalStrength(), 0);
- QCOMPARE(radio.volume(), 0);
- QCOMPARE(radio.isMuted(), false);
- QCOMPARE(radio.isSearching(), false);
- radio.stop();
-}
-
-void tst_QRadioTuner::testNullControl()
-{
- const QPair<int, int> nullRange(0, 0);
-
- MockMediaService service(0, 0);
- MockMediaServiceProvider provider(&service);
- QMediaServiceProvider::setDefaultServiceProvider(&provider);
- QRadioTuner radio;
- QVERIFY(!radio.isAvailable());
- radio.start();
-
- QCOMPARE(radio.error(), QRadioTuner::ResourceError);
- QCOMPARE(radio.errorString(), QString());
-
- QCOMPARE(radio.band(), QRadioTuner::FM);
- QCOMPARE(radio.isBandSupported(QRadioTuner::AM), false);
- QCOMPARE(radio.isBandSupported(QRadioTuner::FM), false);
- QCOMPARE(radio.frequency(), 0);
- QCOMPARE(radio.frequencyStep(QRadioTuner::AM), 0);
- QCOMPARE(radio.frequencyStep(QRadioTuner::FM), 0);
- QCOMPARE(radio.frequencyRange(QRadioTuner::AM), nullRange);
- QCOMPARE(radio.frequencyRange(QRadioTuner::FM), nullRange);
- {
- QSignalSpy bandSpy(&radio, SIGNAL(bandChanged(QRadioTuner::Band)));
- QSignalSpy frequencySpy(&radio, SIGNAL(frequencyChanged(int)));
-
- radio.setFrequency(107500);
- QCOMPARE(radio.band(), QRadioTuner::FM);
- QCOMPARE(radio.frequency(), 0);
- QCOMPARE(bandSpy.count(), 0);
- QCOMPARE(frequencySpy.count(), 0);
-
- radio.setBand(QRadioTuner::AM);
- QCOMPARE(radio.band(), QRadioTuner::FM);
- QCOMPARE(radio.frequency(), 0);
- QCOMPARE(bandSpy.count(), 0);
- QCOMPARE(frequencySpy.count(), 0);
- }
- QCOMPARE(radio.isStereo(), false);
- QCOMPARE(radio.stereoMode(), QRadioTuner::Auto);
-
- radio.setStereoMode(QRadioTuner::ForceStereo);
- QCOMPARE(radio.stereoMode(), QRadioTuner::Auto);
-
- QCOMPARE(radio.signalStrength(), 0);
-
- QCOMPARE(radio.volume(), 0);
- QCOMPARE(radio.isMuted(), false);
- {
- QSignalSpy volumeSpy(&radio, SIGNAL(volumeChanged(int)));
- QSignalSpy muteSpy(&radio, SIGNAL(mutedChanged(bool)));
-
- radio.setVolume(76);
- QCOMPARE(radio.volume(), 0);
- QCOMPARE(volumeSpy.count(), 0);
-
- radio.setMuted(true);
- QCOMPARE(radio.isMuted(), false);
- QCOMPARE(muteSpy.count(), 0);
- }
- QCOMPARE(radio.isSearching(), false);
- {
- QSignalSpy spy(&radio, SIGNAL(searchingChanged(bool)));
-
- radio.searchBackward();
- QCOMPARE(radio.isSearching(), false);
- QCOMPARE(spy.count(), 0);
-
- radio.searchForward();
- QCOMPARE(radio.isSearching(), false);
- QCOMPARE(spy.count(), 0);
-
- radio.searchAllStations();
- QCOMPARE(radio.isSearching(), false);
- QCOMPARE(spy.count(), 0);
-
- radio.cancelSearch();
- QCOMPARE(radio.isSearching(), false);
- QCOMPARE(spy.count(), 0);
- }
-
- radio.stop();
-}
-
-void tst_QRadioTuner::testBand()
-{
- QVERIFY(radio->isBandSupported(QRadioTuner::FM));
- QVERIFY(!radio->isBandSupported(QRadioTuner::SW));
-
- if(radio->isBandSupported(QRadioTuner::AM)) {
- QSignalSpy readSignal(radio, SIGNAL(bandChanged(QRadioTuner::Band)));
- radio->setBand(QRadioTuner::AM);
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(radio->band() == QRadioTuner::AM);
- QVERIFY(readSignal.count() == 1);
- }
-}
-
-void tst_QRadioTuner::testFrequency()
-{
- QSignalSpy readSignal(radio, SIGNAL(frequencyChanged(int)));
- radio->setFrequency(104500000);
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(radio->frequency() == 104500000);
- QVERIFY(readSignal.count() == 1);
-
- QVERIFY(radio->frequencyStep(QRadioTuner::FM) == 1);
- QPair<int,int> test = radio->frequencyRange(QRadioTuner::FM);
- QVERIFY(test.first == 1);
- QVERIFY(test.second == 2);
-}
-
-void tst_QRadioTuner::testMute()
-{
- QSignalSpy readSignal(radio, SIGNAL(mutedChanged(bool)));
- radio->setMuted(true);
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(radio->isMuted());
- QVERIFY(readSignal.count() == 1);
-}
-
-void tst_QRadioTuner::testSearch()
-{
- QSignalSpy readSignal(radio, SIGNAL(searchingChanged(bool)));
- QVERIFY(!radio->isSearching());
-
- radio->searchForward();
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(radio->isSearching());
- QVERIFY(readSignal.count() == 1);
-
- radio->cancelSearch();
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(!radio->isSearching());
- QVERIFY(readSignal.count() == 2);
-
- radio->searchBackward();
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(radio->isSearching());
- QVERIFY(readSignal.count() == 3);
-
- radio->cancelSearch();
- QVERIFY(!radio->isSearching());
-}
-
-void tst_QRadioTuner::testVolume()
-{
- QVERIFY(radio->volume() == 100);
- QSignalSpy readSignal(radio, SIGNAL(volumeChanged(int)));
- radio->setVolume(50);
- QTestEventLoop::instance().enterLoop(1);
- QVERIFY(radio->volume() == 50);
- QVERIFY(readSignal.count() == 1);
-}
-
-void tst_QRadioTuner::testSignal()
-{
- QVERIFY(radio->signalStrength() == 0);
- // There is no set of this only a get, do nothing else.
-}
-
-void tst_QRadioTuner::testStereo()
-{
- /* no set function to toggle stereo status;
- cannot emit stereoStatusChanged() signal */
-
- QVERIFY(radio->isStereo());
- radio->setStereoMode(QRadioTuner::ForceMono);
- QVERIFY(radio->stereoMode() == QRadioTuner::ForceMono);
-}
-
-void tst_QRadioTuner::testSearchAllStations()
-{
- QSignalSpy foundSpy(radio, SIGNAL(stationFound(int,QString)));
- QSignalSpy completeSpy(radio, SIGNAL(searchingChanged(bool)));
- radio->searchAllStations(QRadioTuner::SearchGetStationId);
- QTestEventLoop::instance().enterLoop(1);
- QCOMPARE(radio->frequency(), 103100000 );
- QCOMPARE(foundSpy.count(), 3);
- QVERIFY(qvariant_cast<int>(foundSpy.at(2).at(0)) == 103100000 );
- QVERIFY(qvariant_cast<QString>(foundSpy.at(2).at(1)) == QString("MockProgramPI3") );
- QCOMPARE(completeSpy.count(), 2);
-}
-
-// QRadioTuner's errorsignal
-void tst_QRadioTuner::errorSignal()
-{
- qRegisterMetaType<QRadioTuner::Error>("QRadioTuner::Error");
- QObject obj;
- MockRadioTunerControl dctrl(&obj);
- MockMediaService service(&obj, &dctrl);
- MockMediaServiceProvider provider(&service);
- QMediaServiceProvider::setDefaultServiceProvider(&provider);
- QRadioTuner radio;
- QSignalSpy spy(&radio, SIGNAL(error(QRadioTuner::Error)));
- QVERIFY(radio.service() != 0);
- QVERIFY(radio.isAvailable());
- radio.start();
- radio.setBand(QRadioTuner::FM);
- QVERIFY(spy.count() == 1);
- QVERIFY(qvariant_cast<QRadioTuner::Error>(spy.at(0).at(0)) == QRadioTuner::NoError);
- QVERIFY(radio.error() == QRadioTuner::NoError);
- QVERIFY(radio.error() != QRadioTuner::OpenError);
- QVERIFY(radio.errorString().isEmpty());
- spy.clear();
-
- /* emits QRadioTuner::OutOfRangeError if band is set to FM2 or LW
- and frequency set to >= 148500000 */
-
- radio.setBand(QRadioTuner::LW);
- radio.setBand(QRadioTuner::FM2);
- radio.setFrequency(148500000);
- QVERIFY(spy.count() == 3);
- QVERIFY(qvariant_cast<QRadioTuner::Error>(spy.at(0).at(0)) == QRadioTuner::OutOfRangeError);
- QVERIFY(qvariant_cast<QRadioTuner::Error>(spy.at(1).at(0)) == QRadioTuner::OutOfRangeError);
- QVERIFY(qvariant_cast<QRadioTuner::Error>(spy.at(2).at(0)) == QRadioTuner::OutOfRangeError);
- QVERIFY(radio.error() == QRadioTuner::OutOfRangeError);
- QVERIFY2(!radio.errorString().isEmpty(), "band and range not supported");
- spy.clear();
- radio.stop();
-}
-
-QTEST_GUILESS_MAIN(tst_QRadioTuner)
-#include "tst_qradiotuner.moc"