Merge branch 'tizen_3.0' into tizen
[platform/core/api/radio.git] / include / radio.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef __TIZEN_MEDIA_RADIO_H__
18 #define __TIZEN_MEDIA_RADIO_H__
19
20 #include <tizen.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * @file radio.h
28  * @brief This file contains the radio API.
29  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
30  */
31
32 /**
33  * @addtogroup CAPI_MEDIA_RADIO_MODULE
34  * @{
35  */
36
37 /**
38  * @brief Radio type handle.
39  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
40  */
41 typedef struct radio_s *radio_h;
42
43 /**
44  * @brief Enumeration of radio state.
45  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
46  */
47 typedef enum {
48         RADIO_STATE_READY,                      /**< Ready to play or scan */
49         RADIO_STATE_PLAYING,            /**< Playing the audio from the tuner */
50         RADIO_STATE_SCANNING,           /**< Scanning/Searching for the next station signal that starts from a given starting frequency */
51 } radio_state_e;
52
53 /**
54  * @brief Enumeration of error codes for the radio.
55  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
56  */
57 typedef enum {
58         RADIO_ERROR_NONE                        = TIZEN_ERROR_NONE,                                                             /**< Successful */
59         RADIO_ERROR_OUT_OF_MEMORY           = TIZEN_ERROR_OUT_OF_MEMORY,                                /**< Out of memory */
60         RADIO_ERROR_INVALID_PARAMETER  = TIZEN_ERROR_INVALID_PARAMETER,                 /**< Invalid parameter */
61         RADIO_ERROR_INVALID_OPERATION   = TIZEN_ERROR_INVALID_OPERATION,                        /**< Invalid operation */
62         RADIO_ERROR_INVALID_STATE           = TIZEN_ERROR_RADIO | 0x01  ,                                       /**< Invalid state */
63         RADIO_ERROR_SOUND_POLICY            = TIZEN_ERROR_RADIO | 0x02  ,                                       /**< Sound policy error */
64         RADIO_ERROR_NO_ANTENNA                  = TIZEN_ERROR_RADIO | 0x03 ,                             /**< No Antenna error (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
65         RADIO_ERROR_PERMISSION_DENIED   = TIZEN_ERROR_PERMISSION_DENIED,                        /**< Permission denied */
66         RADIO_ERROR_NOT_SUPPORTED   = TIZEN_ERROR_NOT_SUPPORTED,                                        /**< Not supported */
67 } radio_error_e;
68
69 /**
70  * @brief Enumeration of radio interrupted type.
71  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
72  */
73 typedef enum {
74         RADIO_INTERRUPTED_COMPLETED = 0,                        /**< Interrupt completed (Deprecated since 3.0)*/
75         RADIO_INTERRUPTED_BY_MEDIA,                                     /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/
76         RADIO_INTERRUPTED_BY_CALL,                                      /**< Interrupted by an incoming call (Deprecated since 3.0)*/
77         RADIO_INTERRUPTED_BY_EARJACK_UNPLUG,            /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/
78         RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT,         /**< Interrupted by a resource conflict */
79         RADIO_INTERRUPTED_BY_ALARM,                                     /**< Interrupted by an alarm (Deprecated since 3.0)*/
80         RADIO_INTERRUPTED_BY_EMERGENCY,                         /**< Interrupted by an emergency (Deprecated since 3.0)*/
81         RADIO_INTERRUPTED_BY_RESUMABLE_MEDIA,           /**< Interrupted by a resumable media application (Deprecated since 3.0)*/
82         RADIO_INTERRUPTED_BY_NOTIFICATION,                      /**< Interrupted by a notification (Deprecated since 3.0)*/
83 } radio_interrupted_code_e;
84
85 /**
86  * @brief  Called when the scan information is updated.
87  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
88  * @param[in] frequency The tuned radio frequency [87500 ~ 108000] (kHz)
89  * @param[in] user_data  The user data passed from the callback registration function
90  * @pre It will be invoked by radio_scan_start().
91  * @see radio_scan_start()
92  */
93 typedef void (*radio_scan_updated_cb)(int frequency, void *user_data);
94
95 /**
96  * @brief  Called when the radio scan is stopped.
97  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
98  * @param[in] user_data  The user data passed from the callback registration function
99  * @pre It will be invoked when the scan is stopped by radio_scan_stop().
100  * @see radio_scan_stop()
101  */
102 typedef void (*radio_scan_stopped_cb)(void *user_data);
103
104 /**
105  * @brief  Called when the radio scan is completed.
106  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
107  * @param[in] user_data  The user data passed from the callback registration function
108  * @pre It will be invoked when the scan is completed by registering this callback using radio_set_scan_completed_cb().
109  * @see radio_scan_start()
110  * @see radio_set_scan_completed_cb()
111  * @see radio_unset_scan_completed_cb()
112  */
113 typedef void (*radio_scan_completed_cb)(void *user_data);
114
115 /**
116  * @brief  Called when the radio seek is completed.
117  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
118  * @param[in] frequency The current frequency [87500 ~ 108000] (kHz)
119  * @param[in] user_data  The user data passed from the callback registration function
120  * @pre It will be invoked when the radio seek is completed by registering this callback using radio_seek_up() or radio_seek_down().
121  * @see radio_seek_up()
122  * @see radio_seek_down()
123  */
124 typedef void (*radio_seek_completed_cb)(int frequency, void *user_data);
125
126 /**
127  * @brief  Called when the radio is interrupted.
128  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
129  * @param[in]   error_code      The interrupted error code
130  * @param[in]   user_data       The user data passed from the callback registration function
131  * @see radio_set_interrupted_cb()
132  * @see radio_unset_interrupted_cb()
133  */
134 typedef void (*radio_interrupted_cb)(radio_interrupted_code_e code, void *user_data);
135
136 /**
137  * @brief Creates a radio handle.
138  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
139  * @remarks You must release @a radio using radio_destroy().
140  * @param[out]  radio  A new handle to radio
141  * @retval #RADIO_ERROR_NONE Successful
142  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
143  * @retval #RADIO_ERROR_OUT_OF_MEMORY Out of memory
144  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
145  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
146  * @see radio_destroy()
147  */
148 int radio_create(radio_h *radio);
149
150 /**
151  * @brief Destroys the radio handle and releases all its resources.
152  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
153  * @remarks To completely shutdown the radio operation, call this function with a valid radio handle.
154  *
155  * @param[in]           radio The handle to radio to be destroyed
156  * @return @c 0 on success,
157  *         otherwise a negative error value
158  * @retval #RADIO_ERROR_NONE Successful
159  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
160  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
161  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
162  * @see radio_create()
163  */
164 int radio_destroy(radio_h radio);
165
166 /**
167  * @brief Gets the radio's current state.
168  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
169  * @param[in]   radio   The handle to radio
170  * @param[out]  state   The current state of the radio
171  * @return @c 0 on success,
172  *         otherwise a negative error value
173  * @retval #RADIO_ERROR_NONE Successful
174  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
175  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
176  */
177 int  radio_get_state(radio_h radio, radio_state_e *state);
178
179 /**
180  * @brief Starts playing the radio.
181  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
182  * @param[in]   radio The handle to radio
183  * @return @c 0 on success,
184  *         otherwise a negative error value
185  * @retval #RADIO_ERROR_NONE Successful
186  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
187  * @retval #RADIO_ERROR_INVALID_STATE Invalid radio state
188  * @retval #RADIO_ERROR_SOUND_POLICY Sound policy error
189  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
190  * @retval #RADIO_ERROR_NO_ANTENNA No Antenna error
191  * @pre The radio state must be set to #RADIO_STATE_READY by calling radio_create().
192  * @post The radio state will be #RADIO_STATE_PLAYING.
193  * @see radio_stop()
194  */
195 int radio_start(radio_h radio);
196
197 /**
198  * @brief Stops playing the radio.
199  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
200  * @param[in]   radio The handle to radio
201  * @return @c 0 on success,
202  *         otherwise a negative error value
203  * @retval #RADIO_ERROR_NONE Successful
204  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid state
205  * @retval #RADIO_ERROR_INVALID_STATE Invalid radio state
206  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
207  * @pre The radio state must be set to #RADIO_STATE_PLAYING by calling radio_start().
208  * @post The radio state will be #RADIO_STATE_READY.
209  * @see radio_start()
210  * @see radio_scan_start()
211  */
212 int radio_stop(radio_h radio);
213
214 /**
215  * @brief Seeks up the effective frequency of the radio, asynchronously.
216  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
217  * @param[in]   radio The handle to radio
218  * @param[in] callback  The callback function to register
219  * @param[in] user_data The user data to be passed to the callback function
220  * @return @c 0 on success,
221  *         otherwise a negative error value
222  * @retval #RADIO_ERROR_NONE Successful
223  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
224  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
225  * @retval #RADIO_ERROR_INVALID_STATE Invalid radio state
226  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
227  * @pre The radio state must be set to #RADIO_STATE_PLAYING by calling radio_start().
228  * @post It invokes radio_seek_completed_cb() when the seek completes.
229  * @see radio_seek_down()
230  */
231 int radio_seek_up(radio_h radio, radio_seek_completed_cb callback, void *user_data);
232
233 /**
234  * @brief Seeks down the effective frequency of the radio, asynchronously.
235  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
236  * @param[in]   radio The handle to radio
237  * @param[in] callback  The callback function to register
238  * @param[in] user_data The user data to be passed to the callback function
239  * @return @c 0 on success,
240  *         otherwise a negative error value
241  * @retval #RADIO_ERROR_NONE Successful
242  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
243  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
244  * @retval #RADIO_ERROR_INVALID_STATE Invalid radio state
245  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
246  * @pre The radio state must be set to #RADIO_STATE_PLAYING by calling radio_start().
247  * @post It invokes radio_seek_completed_cb() when the seek completes.
248  * @see radio_seek_up()
249  */
250 int radio_seek_down(radio_h radio, radio_seek_completed_cb callback, void *user_data);
251
252 /**
253  * @brief Sets the radio frequency.
254  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
255  * @param[in]   radio The handle to radio
256  * @param[in]   frequency The frequency to set [87500 ~ 108000] (kHz)
257  * @return @c 0 on success,
258  *         otherwise a negative error value
259  * @retval #RADIO_ERROR_NONE Successful
260  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
261  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
262  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
263  * @see radio_get_frequency()
264  */
265 int radio_set_frequency(radio_h radio, int frequency);
266
267 /**
268  * @brief Gets the current frequency of the radio.
269  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
270  * @param[in]   radio The handle to radio
271  * @param[out]  frequency The current frequency [87500 ~ 108000] (kHz)
272  * @return @c 0 on success,
273  *         otherwise a negative error value
274  * @retval #RADIO_ERROR_NONE Successful
275  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
276  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
277  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
278  * @see radio_set_frequency()
279  */
280 int radio_get_frequency(radio_h radio, int *frequency);
281
282 /**
283  * @brief Gets the current signal strength of the radio.
284  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
285  * @param[in]   radio The handle to radio
286  * @param[out]  strength The current signal strength [-128 ~ 128] (dBm)
287  * @return @c 0 on success,
288  *         otherwise a negative error value
289  * @retval #RADIO_ERROR_NONE Successful
290  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
291  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
292  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
293  */
294 int radio_get_signal_strength(radio_h radio, int *strength);
295
296 /**
297  * @brief Starts scanning radio signals, asynchronously
298  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
299  * @param[in]   radio The handle to radio
300  * @param[in] callback  The callback function to register
301  * @param[in] user_data The user data to be passed to the callback function
302  * @return @c 0 on success,
303  *         otherwise a negative error value
304  * @retval #RADIO_ERROR_NONE Successful
305  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
306  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
307  * @retval #RADIO_ERROR_INVALID_STATE Invalid radio state
308  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
309  * @pre The radio state must be set to #RADIO_STATE_READY or #RADIO_STATE_PLAYING.
310  * @post The radio state will be #RADIO_STATE_SCANNING during a search. After the scan is completed, the radio state will be set back to the state from before the function call(#RADIO_STATE_READY or #RADIO_STATE_PLAYING).
311  * @post It invokes radio_scan_updated_cb() when the scan information updates.
312  * @post It invokes radio_scan_completed_cb() when the scan completes, if you set a callback with radio_set_scan_completed_cb().
313  * @see radio_scan_stop()
314  * @see radio_set_scan_completed_cb()
315  * @see radio_scan_completed_cb()
316  */
317 int radio_scan_start(radio_h radio, radio_scan_updated_cb callback, void *user_data);
318
319 /**
320  * @brief Stops scanning radio signals, asynchronously.
321  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
322  * @param[in]   radio The handle to radio
323  * @param[in] callback  The callback function to register
324  * @param[in] user_data The user data to be passed to the callback function
325  * @return @c 0 on success,
326  *         otherwise a negative error value
327  * @retval #RADIO_ERROR_NONE Successful
328  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid state
329  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
330  * @retval #RADIO_ERROR_INVALID_STATE Invalid radio state
331  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
332  * @pre The radio state must be set to #RADIO_STATE_SCANNING by calling radio_scan_start().
333  * @post It invokes radio_scan_stopped_cb() when the scan stops.
334  * @post After the scan stopped, the radio state will be set back to the state from before the radio_scan_start() function call(#RADIO_STATE_READY or #RADIO_STATE_PLAYING).
335  * @see radio_scan_start()
336  */
337 int radio_scan_stop(radio_h radio, radio_scan_stopped_cb callback, void *user_data);
338
339 /**
340  * @brief Sets the radio's mute status.
341  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
342  * @details  If the mute status is @c true, no sounds will be played. If @c false, sounds will be played. Until this function is called, by default the radio is not muted.
343  * @param[in]   radio The handle to radio
344  * @param[in]   muted The new mute status: (@c true = mute, @c false = not muted)
345  * @return @c 0 on success,
346  *         otherwise a negative error value
347  * @retval #RADIO_ERROR_NONE Successful
348  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
349  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
350  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
351  * @see radio_is_muted()
352  */
353 int radio_set_mute(radio_h radio, bool muted);
354
355 /**
356  * @brief Gets the radio's mute status.
357  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
358  * @details If the mute status is @c true, no sounds are played. If @c false, sounds are played.
359  * @param[in]   radio The handle to radio
360  * @param[out]  muted  The current mute status: (@c true = mute, @c false = not muted)
361  * @return @c 0 on success,
362  *         otherwise a negative error value
363  * @retval #RADIO_ERROR_NONE Successful
364  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
365  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
366  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
367  * @see radio_set_mute()
368  */
369 int radio_is_muted(radio_h radio, bool *muted);
370
371 /**
372  * @brief Registers a callback function to be invoked when the scan finishes.
373  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
374  * @param[in] radio     The handle to radio
375  * @param[in] callback  The callback function to register
376  * @param[in] user_data The user data to be passed to the callback function
377  * @return @c 0 on success,
378  *         otherwise a negative error value
379  * @retval #RADIO_ERROR_NONE Successful
380  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
381  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
382  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
383  * @post radio_scan_completed_cb() will be invoked.
384  * @see radio_unset_scan_completed_cb()
385  * @see radio_scan_completed_cb()
386  */
387 int radio_set_scan_completed_cb(radio_h radio, radio_scan_completed_cb callback, void *user_data);
388
389 /**
390  * @brief       Unregisters the callback function.
391  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
392  * @param[in] radio The handle to radio
393  * @return @c 0 on success,
394  *         otherwise a negative error value
395  * @retval #RADIO_ERROR_NONE Successful
396  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
397  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
398  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
399  * @see radio_set_scan_completed_cb()
400  */
401 int radio_unset_scan_completed_cb(radio_h radio);
402
403 /**
404  * @brief Registers a callback function to be invoked when the radio is interrupted.
405  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
406  * @param[in] radio     The handle to radio
407  * @param[in] callback  The callback function to register
408  * @param[in] user_data The user data to be passed to the callback function
409  * @return @c 0 on success,
410  *         otherwise a negative error value
411  * @retval #RADIO_ERROR_NONE Successful
412  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
413  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
414  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
415  * @post  radio_interrupted_cb() will be invoked.
416  * @see radio_unset_interrupted_cb()
417  * @see #radio_interrupted_code_e
418  * @see radio_interrupted_cb()
419  */
420 int radio_set_interrupted_cb(radio_h radio, radio_interrupted_cb callback, void *user_data);
421
422 /**
423  * @brief Unregisters the callback function.
424  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
425  * @param[in] radio The handle to radio
426  * @return @c 0 on success,
427  *         otherwise a negative error value
428  * @retval #RADIO_ERROR_NONE Successful
429  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
430  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
431  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
432  * @see radio_set_interrupted_cb()
433  */
434 int radio_unset_interrupted_cb(radio_h radio);
435
436 /**
437  * @brief Gets the min, max frequency of the region.
438  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
439  * @param[in]   radio The handle to radio
440  * @param[out]  min_freq The min frequency [87500 ~ 108000] (kHz)
441  * @param[out]  max_freq The max frequency [87500 ~ 108000] (kHz)
442  * @return @c 0 on success,
443  *         otherwise a negative error value
444  * @retval #RADIO_ERROR_NONE Successful
445  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
446  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
447  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
448  */
449 int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq);
450
451 /**
452  * @brief Gets channel spacing.
453  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
454  * @param[in]   radio The handle to radio
455  * @param[out]  channel_spacing The channel spacing value
456  * @return @c 0 on success,
457  *         otherwise a negative error value
458  * @retval #RADIO_ERROR_NONE Successful
459  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
460  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
461  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
462  */
463 int radio_get_channel_spacing(radio_h radio, int *channel_spacing);
464
465 /**
466  * @brief Sets the radio's volume.
467  * @details  Setting this volume adjusts the radio's instance volume, not the system volume.
468  *           The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0.
469  *           To change system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
470  *           Finally, it does not support to set other value into each channel currently.
471  * @since_tizen 3.0
472  * @param[in]   radio The handle to radio
473  * @param[in]   volume The volume to set [0.0 ~ 1.0](1.0 = 100%)
474  * @return @c 0 on success,
475  *         otherwise a negative error value
476  * @retval #RADIO_ERROR_NONE Successful
477  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
478  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
479  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
480  * @see radio_get_volume()
481  */
482 int radio_set_volume(radio_h radio, float volume);
483
484 /**
485  * @brief Gets the radio's current volume.
486  * @details The range of @a volume is from @c 0 to @c 1.0, inclusive (1.0 = 100%).
487  *          This function gets the radio volume, not the system volume.
488  *          To get the system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
489  * @since_tizen 3.0
490  * @param[in]   radio The handle to radio
491  * @param[out]  volume The current volume [0.0 ~ 1.0](1.0 = 100%)
492  * @return @c 0 on success,
493  *         otherwise a negative error value
494  * @retval #RADIO_ERROR_NONE Successful
495  * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
496  * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
497  * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
498  * @see radio_set_volume()
499  */
500 int radio_get_volume(radio_h radio, float *volume);
501
502 /**
503  * @}
504  */
505
506 #ifdef __cplusplus
507 }
508 #endif
509
510 #endif /* __TIZEN_MEDIA_RADIO_H__ */