keysound: skip hard frequent request of keysound playback
[platform/core/multimedia/libmm-sound.git] / include / mm_sound.h
1 /*
2  * libmm-sound
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seungbae Shin <seungbae.shin@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 /**
23  * @file                mm_sound.h
24  * @brief               Application interface library for sound module.
25  * @date
26  * @version             Release
27  *
28  * Application interface library for sound module.
29  */
30
31 #ifndef __MM_SOUND_H__
32 #define __MM_SOUND_H__
33
34 #include <mm_types.h>
35 #include <mm_error.h>
36 #include <mm_message.h>
37
38 #ifdef __cplusplus
39         extern "C" {
40 #endif
41
42 /**
43         @addtogroup SOUND
44         @{
45         @par
46         This part is describes the sound module of multimedia framework. Sound
47         module provides APIs to implement play wav file with simple api, to handle volume information,
48         to handle audio route policy.
49
50         @par
51         There is six different volume type for normal usage. application should set proper volume type to multimedia playback APIs.
52         <div> <table>
53         <tr>
54         <td><B>Type</B></td>
55         <td><B>Description</B></td>
56         </tr>
57         <tr>
58         <td>VOLUME_TYPE_SYSTEM</td>
59         <td>volume for normal system sound (e.g. keysound, camera shutter)</td>
60         </tr>
61         <tr>
62         <td>VOLUME_TYPE_NOTIFICATION</td>
63         <td>volume for notification (e.g. message, email notification)</td>
64         </tr>
65         <tr>
66         <td>VOLUME_TYPE_RINGTONE</td>
67         <td>volume for incoming call ring</td>
68         </tr>
69         <tr>
70         <td>VOLUME_TYPE_MEDIA</td>
71         <td>volume for media playback (e.g. music, video playback)</td>
72         </tr>
73         <tr>
74         <td>VOLUME_TYPE_CALL</td>
75         <td>volume for call</td>
76         </tr>
77         </table> </div>
78
79         @par
80         application can change audio route policy with mm-sound API.
81         Audio route is input and output of audio stream.
82
83         @par
84         @image html             audio_device.png        "Figure1. Audio Devices of mobile phone"        width=12cm
85         @image latex    audio_device.png        "Figure1. Audio Devices of mobile phone"        width=12cm
86
87         @par
88         Default audio route policy is like follows
89         @par
90         for playback
91         <div><table>
92         <tr>
93         <td><B>Bluetooth headset</B></td>
94         <td><B>Wired headset</B></td>
95         <td><B>Playback Device</B></td>
96         </tr>
97         <tr>
98         <td>connected</td>
99         <td>plugged</td>
100         <td>Bluetooth headset</td>
101         </tr>
102         <tr>
103         <td>connected</td>
104         <td>unplugged</td>
105         <td>Bluetooth headset</td>
106         </tr>
107         <tr>
108         <td>disconnected</td>
109         <td>plugged</td>
110         <td>Wired headset</td>
111         </tr>
112         <tr>
113         <td>disconnected</td>
114         <td>unplugged</td>
115         <td>Loud speaker</td>
116         </tr>
117         </table></div>
118
119         @par
120         for capture (bluetooth headset mic used only in call mode)
121         <div><table>
122         <tr>
123         <td><B>Bluetooth headset mic</B></td>
124         <td><B>Wired headset mic</B></td>
125         <td><B>Capture Device</B></td>
126         </tr>
127         <tr>
128         <td>connected</td>
129         <td>plugged</td>
130         <td>Wired headset mic</td>
131         </tr>
132         <tr>
133         <td>connected</td>
134         <td>unplugged</td>
135         <td>microphone</td>
136         </tr>
137         <tr>
138         <td>disconnected</td>
139         <td>plugged</td>
140         <td>Wired headset mic</td>
141         </tr>
142         <tr>
143         <td>disconnected</td>
144         <td>unplugged</td>
145         <td>Wired headset mic</td>
146         </tr>
147         </table></div>
148
149         @par
150         If application changes routing policy to SYSTEM_AUDIO_ROUTE_POLICY_IGNORE_A2DP with mm_sound_route_set_system_policy
151         audio routing policy has changed to ignore bluetooth headset connection.
152         @par
153         for playback
154         <div><table>
155         <tr>
156         <td><B>Bluetooth headset</B></td>
157         <td><B>Wired headset</B></td>
158         <td><B>Playback Device</B></td>
159         </tr>
160         <tr>
161         <td>connected</td>
162         <td>plugged</td>
163         <td>Wired headset</td>
164         </tr>
165         <tr>
166         <td>connected</td>
167         <td>unplugged</td>
168         <td>Loud speaker</td>
169         </tr>
170         <tr>
171         <td>disconnected</td>
172         <td>plugged</td>
173         <td>Wired headset</td>
174         </tr>
175         <tr>
176         <td>disconnected</td>
177         <td>unplugged</td>
178         <td>Loud speaker</td>
179         </tr>
180         </table></div>
181
182         @par
183         for capture (bluetooth headset mic used only in call mode)
184         <div><table>
185         <tr>
186         <td><B>Bluetooth headset mic</B></td>
187         <td><B>Wired headset mic</B></td>
188         <td><B>Capture Device</B></td>
189         </tr>
190         <tr>
191         <td>connected</td>
192         <td>plugged</td>
193         <td>Wired headset mic</td>
194         </tr>
195         <tr>
196         <td>connected</td>
197         <td>unplugged</td>
198         <td>microphone</td>
199         </tr>
200         <tr>
201         <td>disconnected</td>
202         <td>plugged</td>
203         <td>Wired headset mic</td>
204         </tr>
205         <tr>
206         <td>disconnected</td>
207         <td>unplugged</td>
208         <td>Wired headset mic</td>
209         </tr>
210         </table></div>
211
212         @par
213         If application changes routing policy to SYSTEM_AUDIO_ROUTE_POLICY_HANDSET_ONLY with mm_sound_route_set_system_policy
214         audio routing policy has changed to use only loud speaker and microphone.
215         @par
216         for playback
217         <div><table>
218         <tr>
219         <td><B>Bluetooth headset</B></td>
220         <td><B>Wired headset</B></td>
221         <td><B>Playback Device</B></td>
222         </tr>
223         <tr>
224         <td>connected</td>
225         <td>plugged</td>
226         <td>Loud speaker</td>
227         </tr>
228         <tr>
229         <td>connected</td>
230         <td>unplugged</td>
231         <td>Loud speaker</td>
232         </tr>
233         <tr>
234         <td>disconnected</td>
235         <td>plugged</td>
236         <td>Loud speaker</td>
237         </tr>
238         <tr>
239         <td>disconnected</td>
240         <td>unplugged</td>
241         <td>Loud speaker</td>
242         </tr>
243         </table></div>
244
245         @par
246         for capture (bluetooth headset mic used only in call mode)
247         <div><table>
248         <tr>
249         <td><B>Bluetooth headset mic</B></td>
250         <td><B>Wired headset mic</B></td>
251         <td><B>Capture Device</B></td>
252         </tr>
253         <tr>
254         <td>connected</td>
255         <td>plugged</td>
256         <td>microphone</td>
257         </tr>
258         <tr>
259         <td>connected</td>
260         <td>unplugged</td>
261         <td>microphone</td>
262         </tr>
263         <tr>
264         <td>disconnected</td>
265         <td>plugged</td>
266         <td>microphone</td>
267         </tr>
268         <tr>
269         <td>disconnected</td>
270         <td>unplugged</td>
271         <td>microphone</td>
272         </tr>
273         </table></div>
274
275  */
276
277 /*
278  * MMSound Volume APIs
279  */
280
281 /**
282  * Enumerations of Volume type.
283  */
284
285 typedef enum {
286         VOLUME_TYPE_SYSTEM,                             /**< System volume type */
287         VOLUME_TYPE_NOTIFICATION,               /**< Notification volume type */
288         VOLUME_TYPE_ALARM,                              /**< Alarm volume type */
289         VOLUME_TYPE_RINGTONE,                   /**< Ringtone volume type */
290         VOLUME_TYPE_MEDIA,                              /**< Media volume type */
291         VOLUME_TYPE_CALL,                               /**< Call volume type */
292         VOLUME_TYPE_VOIP,                               /**< VOIP volume type */
293         VOLUME_TYPE_VOICE,                              /**< VOICE volume type */
294         VOLUME_TYPE_FIXED,                              /**< Volume type for fixed acoustic level */
295         VOLUME_TYPE_MAX,                                /**< Volume type count */
296 } volume_type_t;
297
298 typedef enum {
299         VOLUME_TYPE_BIXBY,                              /**< Bixby volume type */
300 } volume_type_internal_t;
301
302 typedef enum {
303         VOLUME_GAIN_DEFAULT             = 0,
304         VOLUME_GAIN_DIALER              = 1<<8,
305         VOLUME_GAIN_TOUCH               = 2<<8,
306         VOLUME_GAIN_AF                  = 3<<8,
307         VOLUME_GAIN_SHUTTER1    = 4<<8,
308         VOLUME_GAIN_SHUTTER2    = 5<<8,
309         VOLUME_GAIN_CAMCORDING  = 6<<8,
310         VOLUME_GAIN_MIDI                = 7<<8,
311         VOLUME_GAIN_BOOTING             = 8<<8,
312         VOLUME_GAIN_VIDEO               = 9<<8,
313         VOLUME_GAIN_TTS                 = 10<<8,
314 } volume_gain_t;
315
316 /**
317  * @brief Enumerations of supporting source_type
318  */
319 typedef enum {
320         SUPPORT_SOURCE_TYPE_DEFAULT,
321         SUPPORT_SOURCE_TYPE_MIRRORING,
322         SUPPORT_SOURCE_TYPE_VOICECONTROL,
323         SUPPORT_SOURCE_TYPE_SVR,
324         SUPPORT_SOURCE_TYPE_VIDEOCALL,
325         SUPPORT_SOURCE_TYPE_VOICERECORDING,
326         SUPPORT_SOURCE_TYPE_VOIP, /* Supporting VoIP source*/
327         SUPPORT_SOURCE_TYPE_CALL_FORWARDING,
328         SUPPORT_SOURCE_TYPE_FMRADIO,
329         SUPPORT_SOURCE_TYPE_LOOPBACK,
330 } mm_sound_source_type_e;
331
332 /**
333  * Volume change callback function prototype.
334  *
335  * @param       type                    [in]    The type of changed volume
336  * @param       volume                  [in]    The new volume value
337  * @param       user_data               [in]    Argument passed when callback has called
338  *
339  * @return      No return value
340  * @remark      None.
341  * @see         mm_sound_add_volume_changed_callback mm_sound_remove_volume_changed_callback
342  */
343 typedef void (*mm_sound_volume_changed_cb) (volume_type_t type, unsigned int volume, void *user_data);
344
345 int mm_sound_add_volume_changed_callback(mm_sound_volume_changed_cb func, void* user_data, unsigned int *id);
346
347 /**
348  * This function is to remove volume change callback.
349  *
350  * @return      This function returns MM_ERROR_NONE on success, or negative value
351  *                      with error code.
352  **/
353 int mm_sound_remove_volume_changed_callback(unsigned int id);
354
355 /**
356  * This function is to set volume level of certain volume type.
357  *
358  * @param       type                    [in]    volume type to set value.
359  * @param       value                   [in]    volume value.
360  *
361  * @return      This function returns MM_ERROR_NONE on success, or negative value
362  *                      with error code.
363  * @remark      value should be 0 ~ MAX
364  * @see         mm_sound_volume_get_value volume_type_t
365  * @pre         None.
366  * @post        Volume value will be changed to given value for given volume type.
367  * @par Example
368  */
369 int mm_sound_volume_set_value(volume_type_t type, const unsigned int value);
370
371 /**
372  * This function is to get volume level of certain volume type.
373  *
374  * @param       type                    [in]    volume type to get value.
375  * @param       value                   [out]   volume value.
376  *
377  * @return      This function returns MM_ERROR_NONE on success, or negative value
378  *                      with error code.
379  * @remark      None.
380  * @pre         None.
381  * @post        None.
382  * @see         volume_type_t mm_sound_volume_set_value
383  * @par Example
384  * @code
385 int value = 0;
386 int ret = 0;
387
388 ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &value);
389 if(ret < 0)
390 {
391         printf("Can not get volume\n");
392 }
393 else
394 {
395         printf("System type volume is %d\n", value);
396 }
397  * @endcode
398  * @see         mm_sound_volume_set_value
399  */
400 int mm_sound_volume_get_value(volume_type_t type, unsigned int *value);
401
402 int mm_sound_set_mute(volume_type_t type, bool mute);
403 int mm_sound_get_mute(volume_type_t type, bool *muted);
404
405
406 typedef void (*mm_sound_volume_changed_cb_internal) (volume_type_internal_t type, unsigned int volume, void *user_data);
407 int mm_sound_add_volume_changed_callback_internal(mm_sound_volume_changed_cb_internal func, void* user_data, unsigned int *id);
408 int mm_sound_remove_volume_changed_callback_internal(unsigned int id);
409 int mm_sound_volume_set_value_internal(volume_type_internal_t type, const unsigned int value);
410 int mm_sound_volume_get_value_internal(volume_type_internal_t type, unsigned int *value);
411
412 /**
413  * This function is to set sound filter and apply to selected stream type.
414  *
415  * @param       stream_type                     [in]    stream type to apply
416  * @param       filter_name                     [in]    name of filter module to apply
417  * @param       filter_parameters       [in]    extra filter parameters(optional)
418  * @param       filter_group            [in]    extra filter group(optional)
419  *
420  * @return      This function returns MM_ERROR_NONE on success, or negative value
421  *                      with error code.
422  * @remark      None
423  * @pre         None
424  * @post        None
425  * @see         None
426  */
427 int mm_sound_set_filter(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group);
428
429 /**
430  * This function is to unset sound filter and remove from selected stream type.
431  *
432  * @param       stream_type                     [in]    stream type to remove
433  *
434  * @return      This function returns MM_ERROR_NONE on success, or negative value
435  *                      with error code.
436  * @remark      None
437  * @pre         None
438  * @post        None
439  * @see         None
440  */
441 int mm_sound_unset_filter(const char *stream_type);
442
443 /**
444  * This function is to control filter configurations to selected stream type.
445  *
446  * @param       stream_type                     [in]    stream type to apply
447  * @param       filter_name                     [in]    specify filter module to apply
448  * @param       filter_controls         [in]    filter control parameters(e.g, "0.0, 0.1, 3.0")
449  *
450  * @return      This function returns MM_ERROR_NONE on success, or negative value
451  *                      with error code.
452  * @remark      None
453  * @pre         None
454  * @post        None
455  * @see         None
456  */
457 int mm_sound_control_filter(const char *stream_type, const char *filter_name, const char *filter_controls);
458
459 /**
460  * Terminate callback function type.
461  *
462  * @param       data            [in]    Argument passed when callback was set
463  * @param       id                      [in]    handle which has completed playing
464  *
465  * @return      No return value
466  * @remark      It is not allowed to call MMSound API recursively or do time-consuming
467  *                      task in this callback because this callback is called synchronously.
468  * @see         mm_sound_play_sound
469  */
470 typedef void (*mm_sound_stop_callback_func) (void *data, int id);
471
472 /*
473  * Enumerations of device & route
474  */
475
476 typedef enum {
477         MM_SOUND_DIRECTION_NONE,
478         MM_SOUND_DIRECTION_IN,                                                  /**< Capture */
479         MM_SOUND_DIRECTION_OUT,                                                 /**< Playback */
480 } mm_sound_direction;
481
482 typedef enum {
483         MM_SOUND_DEVICE_IN_NONE                         = 0x00,
484         MM_SOUND_DEVICE_IN_MIC                          = 0x01,         /**< Device builtin microphone */
485         MM_SOUND_DEVICE_IN_WIRED_ACCESSORY      = 0x02,         /**< Wired input devices */
486         MM_SOUND_DEVICE_IN_BT_SCO       = 0x08,         /**< Bluetooth SCO device */
487 } mm_sound_device_in;
488
489 typedef enum {
490         MM_SOUND_DEVICE_OUT_NONE                        = 0x000,
491         MM_SOUND_DEVICE_OUT_SPEAKER             = 0x001<<8,     /**< Device builtin speaker */
492         MM_SOUND_DEVICE_OUT_RECEIVER            = 0x002<<8,     /**< Device builtin receiver */
493         MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY     = 0x004<<8,     /**< Wired output devices such as headphone, headset, and so on. */
494         MM_SOUND_DEVICE_OUT_BT_SCO                      = 0x008<<8,     /**< Bluetooth SCO device */
495         MM_SOUND_DEVICE_OUT_BT_A2DP             = 0x010<<8,     /**< Bluetooth A2DP device */
496         MM_SOUND_DEVICE_OUT_DOCK                        = 0x020<<8,     /**< DOCK device */
497         MM_SOUND_DEVICE_OUT_HDMI                        = 0x040<<8,     /**< HDMI device */
498         MM_SOUND_DEVICE_OUT_MIRRORING           = 0x080<<8,     /**< MIRRORING device */
499         MM_SOUND_DEVICE_OUT_USB_AUDIO           = 0x100<<8,     /**< USB Audio device */
500         MM_SOUND_DEVICE_OUT_MULTIMEDIA_DOCK     = 0x200<<8,     /**< Multimedia DOCK device */
501 } mm_sound_device_out;
502
503 typedef enum {
504         MM_SOUND_VOLUME_DEVICE_OUT_SPEAKER,                             /**< Device builtin speaker */
505         MM_SOUND_VOLUME_DEVICE_OUT_RECEIVER,                    /**< Device builtin receiver */
506         MM_SOUND_VOLUME_DEVICE_OUT_WIRED_ACCESSORY,             /**< Wired output devices such as headphone, headset, and so on. */
507         MM_SOUND_VOLUME_DEVICE_OUT_BT_SCO,                              /**< Bluetooth SCO device */
508         MM_SOUND_VOLUME_DEVICE_OUT_BT_A2DP,                             /**< Bluetooth A2DP device */
509         MM_SOUND_VOLUME_DEVICE_OUT_DOCK,                                /**< DOCK device */
510         MM_SOUND_VOLUME_DEVICE_OUT_HDMI,                                /**< HDMI device */
511         MM_SOUND_VOLUME_DEVICE_OUT_MIRRORING,                   /**< MIRRORING device */
512         MM_SOUND_VOLUME_DEVICE_OUT_USB_AUDIO,                   /**< USB Audio device */
513         MM_SOUND_VOLUME_DEVICE_OUT_MULTIMEDIA_DOCK,             /**< Multimedia DOCK device */
514 } mm_sound_volume_device_out_t;
515
516 /*
517  * MMSound Device APIs
518  */
519
520 typedef enum {
521         MM_SOUND_DEVICE_IO_DIRECTION_IN_FLAG      = 0x0001,  /**< Flag for input devices */
522         MM_SOUND_DEVICE_IO_DIRECTION_OUT_FLAG     = 0x0002,  /**< Flag for output devices */
523         MM_SOUND_DEVICE_IO_DIRECTION_BOTH_FLAG    = 0x0004,  /**< Flag for input/output devices (both directions are available) */
524         MM_SOUND_DEVICE_TYPE_INTERNAL_FLAG        = 0x0010,  /**< Flag for built-in devices */
525         MM_SOUND_DEVICE_TYPE_EXTERNAL_FLAG        = 0x0020,  /**< Flag for external devices */
526         MM_SOUND_DEVICE_STATE_DEACTIVATED_FLAG    = 0x1000,  /**< Flag for deactivated devices */
527         MM_SOUND_DEVICE_STATE_ACTIVATED_FLAG      = 0x2000,  /**< Flag for activated devices */
528         MM_SOUND_DEVICE_ALL_FLAG                  = 0xFFFF,  /**< Flag for all devices */
529 } mm_sound_device_flags_e;
530
531 typedef enum {
532         MM_SOUND_DEVICE_IO_DIRECTION_IN           = 0x1,
533         MM_SOUND_DEVICE_IO_DIRECTION_OUT          = 0x2,
534         MM_SOUND_DEVICE_IO_DIRECTION_BOTH         = MM_SOUND_DEVICE_IO_DIRECTION_IN | MM_SOUND_DEVICE_IO_DIRECTION_OUT,
535 } mm_sound_device_io_direction_e;
536
537 typedef enum {
538         MM_SOUND_DEVICE_STATE_DEACTIVATED,
539         MM_SOUND_DEVICE_STATE_ACTIVATED,
540 } mm_sound_device_state_e;
541
542 typedef enum {
543         MM_SOUND_DEVICE_TYPE_BUILTIN_SPEAKER,   /**< Built-in speaker */
544         MM_SOUND_DEVICE_TYPE_BUILTIN_RECEIVER,  /**< Built-in receiver */
545         MM_SOUND_DEVICE_TYPE_BUILTIN_MIC,       /**< Built-in microphone */
546         MM_SOUND_DEVICE_TYPE_AUDIOJACK,         /**< Audio jack such as headphone, headset, and so on */
547         MM_SOUND_DEVICE_TYPE_BLUETOOTH,         /**< Bluetooth */
548         MM_SOUND_DEVICE_TYPE_BLUETOOTH_A2DP = MM_SOUND_DEVICE_TYPE_BLUETOOTH,    /**< Bluetooth A2DP */
549         MM_SOUND_DEVICE_TYPE_HDMI,              /**< HDMI */
550         MM_SOUND_DEVICE_TYPE_MIRRORING,         /**< MIRRORING */
551         MM_SOUND_DEVICE_TYPE_USB_AUDIO,         /**< USB Audio */
552         MM_SOUND_DEVICE_TYPE_BLUETOOTH_SCO,     /**< Bluetooth SCO */
553         MM_SOUND_DEVICE_TYPE_NETWORK            /**< Network */
554 } mm_sound_device_type_e;
555
556 typedef void *MMSoundDevice_t;          /**< MMsound Device handle */
557 typedef void *MMSoundDeviceList_t;      /**< MMsound Device list handle */
558 typedef void (*mm_sound_device_connected_cb) (MMSoundDevice_t device_h, bool is_connected, void *user_data);
559 typedef void (*mm_sound_device_info_changed_cb) (MMSoundDevice_t device_h, int changed_info_type, void *user_data);
560 typedef void (*mm_sound_device_state_changed_cb) (MMSoundDevice_t device_h, mm_sound_device_state_e state, void *user_data);
561 typedef void (*mm_sound_device_running_changed_cb) (MMSoundDevice_t device_h, bool is_running, void *user_data);
562
563 int mm_sound_add_device_connected_callback(int flags, mm_sound_device_connected_cb func, void *user_data, unsigned int *id);
564 int mm_sound_remove_device_connected_callback(unsigned int id);
565 int mm_sound_add_device_information_changed_callback(int flags, mm_sound_device_info_changed_cb func, void *user_data, unsigned int *id);
566 int mm_sound_remove_device_information_changed_callback(unsigned int id);
567 int mm_sound_add_device_state_changed_callback(int flags, mm_sound_device_state_changed_cb func, void *user_data, unsigned int *id);
568 int mm_sound_remove_device_state_changed_callback(unsigned int id);
569 int mm_sound_add_device_running_changed_callback(int flags, mm_sound_device_running_changed_cb func, void *user_data, unsigned int *id);
570 int mm_sound_remove_device_running_changed_callback(unsigned int id);
571
572 int mm_sound_get_current_device_list(mm_sound_device_flags_e device_mask, MMSoundDeviceList_t *device_list);
573 int mm_sound_get_device_list(int device_mask, MMSoundDeviceList_t *device_list);
574 /* Free this device handle with mm_sound_free_device */
575 int mm_sound_get_device_by_id(int device_id, MMSoundDevice_t *device);
576 int mm_sound_free_device_list(MMSoundDeviceList_t device_list);
577 /* Use this only for the device handle which got from mm_sound_get_device_by_id */
578 int mm_sound_free_device(MMSoundDevice_t device_h);
579 int mm_sound_get_next_device(MMSoundDeviceList_t device_list, MMSoundDevice_t *device);
580 int mm_sound_get_prev_device(MMSoundDeviceList_t device_list, MMSoundDevice_t *device);
581 int mm_sound_get_device_type(MMSoundDevice_t device_h, mm_sound_device_type_e *type);
582 int mm_sound_get_device_io_direction(MMSoundDevice_t device_h, mm_sound_device_io_direction_e *io_direction);
583 int mm_sound_get_device_id(MMSoundDevice_t device_h, int *id);
584 int mm_sound_get_device_state(MMSoundDevice_t device_h, mm_sound_device_state_e *state);
585 int mm_sound_get_device_name(MMSoundDevice_t device_h, char **name);
586 int mm_sound_get_device_vendor_id(MMSoundDevice_t device_h, int *vendor_id);
587 int mm_sound_get_device_product_id(MMSoundDevice_t device_h, int *product_id);
588
589 int mm_sound_get_device_sample_format(MMSoundDevice_t device_h, int *format);
590 int mm_sound_get_device_sample_rate(MMSoundDevice_t device_h, int *samplerate);
591 int mm_sound_get_device_channels(MMSoundDevice_t device_h, int *channels);
592
593 /* Ducking */
594 typedef void (*mm_sound_ducking_state_changed_cb) (int idx, bool is_ducked, void *user_data);
595 int mm_sound_add_ducking_state_changed_callback(mm_sound_ducking_state_changed_cb func, void *user_data, unsigned int *subs_id);
596 int mm_sound_remove_ducking_state_changed_callback(unsigned int subs_id);
597
598 /**
599  * Active device changed callback function type.
600  *
601  * @param       user_data               [in]    Argument passed when callback has called
602  *
603  * @return      No return value
604  * @remark      None.
605  * @see         mm_sound_add_active_device_changed_callback mm_sound_remove_active_device_changed_callback
606  */
607 typedef void (*mm_sound_active_device_changed_cb) (mm_sound_device_in device_in, mm_sound_device_out device_out, void *user_data);
608
609 typedef void (*mm_sound_test_cb) (int a, void *user_data);
610 int mm_sound_test(int a, int b, int* get);
611 int mm_sound_add_test_callback(mm_sound_test_cb func, void *user_data, unsigned int *id);
612 int mm_sound_remove_test_callback(unsigned int sub_id);
613
614 void mm_sound_convert_volume_type_to_stream_type(int volume_type, char *stream_type);
615
616 int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *is_on);
617 int mm_sound_is_stream_on_device_by_id(int stream_id, int device_id, bool *is_on);
618 int mm_sound_is_device_running(MMSoundDevice_t device_h, bool *is_running);
619
620 #ifdef TIZEN_TV
621 void mm_sound_dotnet_cleanup(int signo);
622 #endif
623
624 /**
625         @}
626  */
627
628 #ifdef __cplusplus
629 }
630 #endif
631
632 #endif  /* __MM_SOUND_H__ */
633