diff options
Diffstat (limited to 'src/multimedia')
20 files changed, 8 insertions, 2340 deletions
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 |