1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:LGPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU Lesser General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
19 | ** General Public License version 3 as published by the Free Software |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
21 | ** packaging of this file. Please review the following information to |
22 | ** ensure the GNU Lesser General Public License version 3 requirements |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
24 | ** |
25 | ** GNU General Public License Usage |
26 | ** Alternatively, this file may be used under the terms of the GNU |
27 | ** General Public License version 2.0 or (at your option) the GNU General |
28 | ** Public license version 3 or any later version approved by the KDE Free |
29 | ** Qt Foundation. The licenses are as published by the Free Software |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
31 | ** included in the packaging of this file. Please review the following |
32 | ** information to ensure the GNU General Public License requirements will |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
35 | ** |
36 | ** $QT_END_LICENSE$ |
37 | ** |
38 | ****************************************************************************/ |
39 | |
40 | #ifndef QRADIOTUNERCONTROL_H |
41 | #define QRADIOTUNERCONTROL_H |
42 | |
43 | #include <QtMultimedia/qmediacontrol.h> |
44 | #include <QtMultimedia/qradiotuner.h> |
45 | |
46 | QT_BEGIN_NAMESPACE |
47 | |
48 | // Required for QDoc workaround |
49 | class QString; |
50 | |
51 | class Q_MULTIMEDIA_EXPORT QRadioTunerControl : public QMediaControl |
52 | { |
53 | Q_OBJECT |
54 | |
55 | public: |
56 | ~QRadioTunerControl(); |
57 | |
58 | virtual QRadioTuner::State state() const = 0; |
59 | |
60 | virtual QRadioTuner::Band band() const = 0; |
61 | virtual void setBand(QRadioTuner::Band b) = 0; |
62 | virtual bool isBandSupported(QRadioTuner::Band b) const = 0; |
63 | |
64 | virtual int frequency() const = 0; |
65 | virtual int frequencyStep(QRadioTuner::Band b) const = 0; |
66 | virtual QPair<int,int> frequencyRange(QRadioTuner::Band b) const = 0; |
67 | virtual void setFrequency(int frequency) = 0; |
68 | |
69 | virtual bool isStereo() const = 0; |
70 | virtual QRadioTuner::StereoMode stereoMode() const = 0; |
71 | virtual void setStereoMode(QRadioTuner::StereoMode mode) = 0; |
72 | |
73 | virtual int signalStrength() const = 0; |
74 | |
75 | virtual int volume() const = 0; |
76 | virtual void setVolume(int volume) = 0; |
77 | |
78 | virtual bool isMuted() const = 0; |
79 | virtual void setMuted(bool muted) = 0; |
80 | |
81 | virtual bool isSearching() const = 0; |
82 | |
83 | virtual bool isAntennaConnected() const { return true; } |
84 | |
85 | virtual void searchForward() = 0; |
86 | virtual void searchBackward() = 0; |
87 | virtual void searchAllStations(QRadioTuner::SearchMode searchMode = QRadioTuner::SearchFast) = 0; |
88 | virtual void cancelSearch() = 0; |
89 | |
90 | virtual void start() = 0; |
91 | virtual void stop() = 0; |
92 | |
93 | virtual QRadioTuner::Error error() const = 0; |
94 | virtual QString errorString() const = 0; |
95 | |
96 | Q_SIGNALS: |
97 | void stateChanged(QRadioTuner::State state); |
98 | void bandChanged(QRadioTuner::Band band); |
99 | void frequencyChanged(int frequency); |
100 | void stereoStatusChanged(bool stereo); |
101 | void searchingChanged(bool searching); |
102 | void signalStrengthChanged(int signalStrength); |
103 | void volumeChanged(int volume); |
104 | void mutedChanged(bool muted); |
105 | void error(QRadioTuner::Error err); |
106 | void stationFound(int frequency, QString stationId); |
107 | void antennaConnectedChanged(bool connectionStatus); |
108 | |
109 | protected: |
110 | explicit QRadioTunerControl(QObject *parent = nullptr); |
111 | }; |
112 | |
113 | #define QRadioTunerControl_iid "org.qt-project.qt.radiotunercontrol/5.0" |
114 | Q_MEDIA_DECLARE_CONTROL(QRadioTunerControl, QRadioTunerControl_iid) |
115 | |
116 | QT_END_NAMESPACE |
117 | |
118 | |
119 | #endif // QRADIOTUNERCONTROL_H |
120 | |