|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #include <qmobilityglobal.h> |
|
43 #include "qradiotunercontrol.h" |
|
44 #include "qmediacontrol_p.h" |
|
45 |
|
46 QT_BEGIN_NAMESPACE |
|
47 |
|
48 |
|
49 /*! |
|
50 \class QRadioTunerControl |
|
51 \ingroup multimedia |
|
52 |
|
53 \preliminary |
|
54 \brief The QRadioTunerControl class provides access to the radio tuning |
|
55 functionality of a QMediaService. |
|
56 |
|
57 If a QMediaService can tune an analog radio device it will implement |
|
58 QRadioTunerControl. This control provides a means to tune a radio device |
|
59 to a specific \l {setFrequency()}{frequency} as well as search \l |
|
60 {searchForward()}{forwards} and \l {searchBackward()}{backwards} for a |
|
61 signal. |
|
62 |
|
63 The functionality provided by this control is exposed to application code |
|
64 through the QRadioTuner class. |
|
65 |
|
66 The interface name of QRadioTunerControl is \c com.nokia.Qt.QRadioTunerControl/1.0 as |
|
67 defined in QRadioTunerControl_iid. |
|
68 |
|
69 \sa QMediaService::requestControl(), QRadioTuner |
|
70 */ |
|
71 |
|
72 /*! |
|
73 \macro QRadioTunerControl_iid |
|
74 |
|
75 \c com.nokia.Qt.QRadioTunerControl/1.0 |
|
76 |
|
77 Defines the interface name of the QRadioTunerControl class. |
|
78 |
|
79 \relates QRadioTunerControl |
|
80 */ |
|
81 |
|
82 /*! |
|
83 Constructs a radio tuner control with the given \a parent. |
|
84 */ |
|
85 |
|
86 QRadioTunerControl::QRadioTunerControl(QObject *parent): |
|
87 QMediaControl(*new QMediaControlPrivate, parent) |
|
88 { |
|
89 } |
|
90 |
|
91 /*! |
|
92 Destroys a radio tuner control. |
|
93 */ |
|
94 |
|
95 QRadioTunerControl::~QRadioTunerControl() |
|
96 { |
|
97 } |
|
98 |
|
99 /*! |
|
100 \fn bool QRadioTunerControl::isAvailable() const |
|
101 |
|
102 Returns true if the radio service is ready to use. |
|
103 */ |
|
104 |
|
105 /*! |
|
106 \fn QtMultimediaKit::AvailabilityError QRadioTunerControl::availabilityError() const |
|
107 |
|
108 Returns the error state of the radio service. |
|
109 */ |
|
110 |
|
111 /*! |
|
112 \fn QRadioTuner::State QRadioTunerControl::state() const |
|
113 |
|
114 Returns the current radio tuner state. |
|
115 */ |
|
116 |
|
117 /*! |
|
118 \fn QRadioTuner::Band QRadioTunerControl::band() const |
|
119 |
|
120 Returns the frequency band a radio tuner is tuned to. |
|
121 */ |
|
122 |
|
123 /*! |
|
124 \fn void QRadioTunerControl::bandChanged(QRadioTuner::Band band) |
|
125 |
|
126 Signals that the frequency \a band a radio tuner is tuned to has changed. |
|
127 */ |
|
128 |
|
129 /*! |
|
130 \fn void QRadioTunerControl::setBand(QRadioTuner::Band band) |
|
131 |
|
132 Sets the frequecy \a band a radio tuner is tuned to. |
|
133 |
|
134 Changing the frequency band will reset the frequency to the minimum frequency of the new band. |
|
135 */ |
|
136 |
|
137 /*! |
|
138 \fn bool QRadioTunerControl::isBandSupported(QRadioTuner::Band band) const |
|
139 |
|
140 Identifies if a frequency \a band is supported. |
|
141 |
|
142 Returns true if the band is supported, and false if it is not. |
|
143 */ |
|
144 |
|
145 /*! |
|
146 \fn int QRadioTunerControl::frequency() const |
|
147 |
|
148 Returns the frequency a radio tuner is tuned to. |
|
149 */ |
|
150 |
|
151 /*! |
|
152 \fn int QRadioTunerControl::frequencyStep(QRadioTuner::Band band) const |
|
153 |
|
154 Returns the number of Hertz to increment the frequency by when stepping through frequencies |
|
155 within a given \a band. |
|
156 */ |
|
157 |
|
158 /*! |
|
159 \fn QPair<int,int> QRadioTunerControl::frequencyRange(QRadioTuner::Band band) const |
|
160 |
|
161 Returns a frequency \a band's minimum and maximum frequency. |
|
162 */ |
|
163 |
|
164 /*! |
|
165 \fn void QRadioTunerControl::setFrequency(int frequency) |
|
166 |
|
167 Sets the \a frequency a radio tuner is tuned to. |
|
168 */ |
|
169 |
|
170 /*! |
|
171 \fn bool QRadioTunerControl::isStereo() const |
|
172 |
|
173 Identifies if a radio tuner is receiving a stereo signal. |
|
174 |
|
175 Returns true if the tuner is receiving a stereo signal, and false if it is not. |
|
176 */ |
|
177 |
|
178 /*! |
|
179 \fn QRadioTuner::StereoMode QRadioTunerControl::stereoMode() const |
|
180 |
|
181 Returns a radio tuner's stereo mode. |
|
182 |
|
183 \sa QRadioTuner::StereoMode |
|
184 */ |
|
185 |
|
186 /*! |
|
187 \fn void QRadioTunerControl::setStereoMode(QRadioTuner::StereoMode mode) |
|
188 |
|
189 Sets a radio tuner's stereo \a mode. |
|
190 |
|
191 \sa QRadioTuner::StereoMode |
|
192 */ |
|
193 |
|
194 /*! |
|
195 \fn int QRadioTunerControl::signalStrength() const |
|
196 |
|
197 Return a radio tuner's current signal strength as a percentage. |
|
198 */ |
|
199 |
|
200 /*! |
|
201 \fn int QRadioTunerControl::volume() const |
|
202 |
|
203 Returns the volume of a radio tuner's audio output as a percentage. |
|
204 */ |
|
205 |
|
206 /*! |
|
207 \fn void QRadioTunerControl::setVolume(int volume) |
|
208 |
|
209 Sets the percentage \a volume of a radio tuner's audio output. |
|
210 */ |
|
211 |
|
212 /*! |
|
213 \fn bool QRadioTunerControl::isMuted() const |
|
214 |
|
215 Identifies if a radio tuner's audio output is muted. |
|
216 |
|
217 Returns true if the audio is muted, and false if it is not. |
|
218 */ |
|
219 |
|
220 /*! |
|
221 \fn void QRadioTunerControl::setMuted(bool muted) |
|
222 |
|
223 Sets the \a muted state of a radio tuner's audio output. |
|
224 */ |
|
225 |
|
226 /*! |
|
227 \fn bool QRadioTunerControl::isSearching() const |
|
228 |
|
229 Identifies if a radio tuner is currently scanning for signal. |
|
230 |
|
231 Returns true if the tuner is scanning, and false if it is not. |
|
232 */ |
|
233 |
|
234 /*! |
|
235 \fn void QRadioTunerControl::searchForward() |
|
236 |
|
237 Starts a forward scan for a signal, starting from the current \l frequency(). |
|
238 */ |
|
239 |
|
240 /*! |
|
241 \fn void QRadioTunerControl::searchBackward() |
|
242 |
|
243 Starts a backwards scan for a signal, starting from the current \l frequency(). |
|
244 */ |
|
245 |
|
246 /*! |
|
247 \fn void QRadioTunerControl::cancelSearch() |
|
248 |
|
249 Stops scanning for a signal. |
|
250 */ |
|
251 |
|
252 /*! |
|
253 \fn void QRadioTunerControl::start() |
|
254 |
|
255 Activate the radio device. |
|
256 */ |
|
257 |
|
258 /*! |
|
259 \fn QRadioTunerControl::stop() |
|
260 |
|
261 Deactivate the radio device. |
|
262 */ |
|
263 |
|
264 /*! |
|
265 \fn QRadioTuner::Error QRadioTunerControl::error() const |
|
266 |
|
267 Returns the error state of a radio tuner. |
|
268 */ |
|
269 |
|
270 /*! |
|
271 \fn QString QRadioTunerControl::errorString() const |
|
272 |
|
273 Returns a string describing a radio tuner's error state. |
|
274 */ |
|
275 |
|
276 /*! |
|
277 \fn void QRadioTunerControl::stateChanged(QRadioTuner::State state) |
|
278 |
|
279 Signals that the \a state of a radio tuner has changed. |
|
280 */ |
|
281 |
|
282 |
|
283 /*! |
|
284 \fn void QRadioTunerControl::frequencyChanged(int frequency) |
|
285 |
|
286 Signals that the \a frequency a radio tuner is tuned to has changed. |
|
287 */ |
|
288 |
|
289 /*! |
|
290 \fn void QRadioTunerControl::stereoStatusChanged(bool stereo) |
|
291 |
|
292 Signals that the \a stereo state of a radio tuner has changed. |
|
293 */ |
|
294 |
|
295 /*! |
|
296 \fn void QRadioTunerControl::searchingChanged(bool searching) |
|
297 |
|
298 Signals that the \a searching state of a radio tuner has changed. |
|
299 */ |
|
300 |
|
301 /*! |
|
302 \fn void QRadioTunerControl::signalStrengthChanged(int strength) |
|
303 |
|
304 Signals that the percentage \a strength of the signal received by a radio tuner has changed. |
|
305 */ |
|
306 |
|
307 /*! |
|
308 \fn void QRadioTunerControl::volumeChanged(int volume) |
|
309 |
|
310 Signals that the percentage \a volume of radio tuner's audio output has changed. |
|
311 */ |
|
312 |
|
313 /*! |
|
314 \fn void QRadioTunerControl::mutedChanged(bool muted) |
|
315 |
|
316 Signals that the \a muted state of a radio tuner's audio output has changed. |
|
317 */ |
|
318 |
|
319 /*! |
|
320 \fn void QRadioTunerControl::error(QRadioTuner::Error error) |
|
321 |
|
322 Signals that an \a error has occured. |
|
323 */ |
|
324 |
|
325 #include "moc_qradiotunercontrol.cpp" |
|
326 QT_END_NAMESPACE |
|
327 |