Add internal APIs for USB devices
[platform/core/api/sound-manager.git] / include / sound_manager_internal_tv.h
1 /*
2 * Copyright (c) 2015 - 2018 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_SOUND_MANAGER_INTERNAL_H__
18 #define __TIZEN_MEDIA_SOUND_MANAGER_INTERNAL_H__
19
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24
25 /**
26  * @file sound_manager_internal.h
27  * @brief This file contains the Sound Manager Internal API.
28  */
29
30 /**
31  * @addtogroup CAPI_MEDIA_SOUND_MANAGER_MODULE
32  * @{
33  */
34
35 #define SOUND_TYPE_NUM                SOUND_TYPE_VOICE + 1
36
37 /**
38  * @internal
39  * @brief Virtual sound stream handle.
40  * @since_tizen 3.0
41  */
42 typedef struct virtual_sound_stream_s* virtual_sound_stream_h;
43
44 /**
45  * @internal
46  * @brief Enumeration for Native API.
47  * @since_tizen 3.0
48  */
49 typedef enum {
50         NATIVE_API_SOUND_MANAGER,   /**< Sound-manager Native API */
51         NATIVE_API_PLAYER,          /**< Player Native API */
52         NATIVE_API_WAV_PLAYER,      /**< Wav-player Native API */
53         NATIVE_API_TONE_PLAYER,     /**< Tone-player Native API */
54         NATIVE_API_AUDIO_IO,        /**< Audio-io Native API */
55         NATIVE_API_RECORDER,        /**< Recorder Native API */
56 } native_api_e;
57
58 /**
59  * @internal
60  * @brief Enumeration for sound stream type for internal.
61  * @since_tizen 3.0
62  */
63 typedef enum {
64         SOUND_STREAM_TYPE_RINGTONE_CALL = 100,        /**< Sound stream type for ringtone for call */
65         SOUND_STREAM_TYPE_RINGBACKTONE_CALL,          /**< Sound stream type for ringback tone for call */
66         SOUND_STREAM_TYPE_VOICE_CALL,                 /**< Sound stream type for voice-call */
67         SOUND_STREAM_TYPE_VIDEO_CALL,                 /**< Sound stream type for video-call */
68         SOUND_STREAM_TYPE_RADIO,                      /**< Sound stream type for radio */
69         SOUND_STREAM_TYPE_LOOPBACK,                   /**< Sound stream type for loopback */
70         SOUND_STREAM_TYPE_LOOPBACK_MIRRORING,         /**< Sound stream type for loopback-mirroring */
71         SOUND_STREAM_TYPE_SOLO,                       /**< Sound stream type for solo */
72         SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE,  /**< Sound stream type for voice recognition by service (Since 4.0) */
73         SOUND_STREAM_TYPE_MEDIA_COMPRESSED,           /**< Sound stream type for compressed media (Since 4.0) */
74 } sound_stream_type_internal_e;
75
76 /**
77  * @internal
78  * @brief Enumeration for sound filters.
79  * @since_tizen 4.0
80  */
81 typedef enum {
82         SOUND_FILTER_LOW_PASS = 0,
83         SOUND_FILTER_HIGH_PASS,
84         SOUND_FILTER_DELAY,
85         SOUND_FILTER_SOUNDALIVE,
86 } sound_filter_e;
87
88 /**
89  * @internal
90  * @brief Enumeration for filter preset.
91  * @since_tizen 4.0
92  */
93 typedef enum {
94         SOUND_FILTER_PRESET_LOW_PASS_NONE = 0,       /**< Filter preset for SOUND_FILTER_LOW_PASS none */
95         SOUND_FILTER_PRESET_LOW_PASS_UNDER_240HZ,    /**< Filter preset for SOUND_FILTER_LOW_PASS under 240hz */
96         SOUND_FILTER_PRESET_LOW_PASS_UNDER_480HZ,    /**< Filter preset for SOUND_FILTER_LOW_PASS under 480hz */
97         SOUND_FILTER_PRESET_HIGH_PASS_NONE,          /**< Filter preset for SOUND_FILTER_HIGH_PASS none */
98         SOUND_FILTER_PRESET_HIGH_PASS_OVER_240HZ,    /**< Filter preset for SOUND_FILTER_HIGH_PASS over 240hz */
99         SOUND_FILTER_PRESET_HIGH_PASS_OVER_480HZ,    /**< Filter preset for SOUND_FILTER_HIGH_PASS over 480hz */
100         SOUND_FILTER_PRESET_DELAY_NONE,              /**< Filter preset for SOUND_FILTER_DELAY none */
101         SOUND_FILTER_PRESET_DELAY_1SEC,              /**< Filter preset for SOUND_FILTER_DELAY 1 second */
102         SOUND_FILTER_PRESET_DELAY_2SEC,              /**< Filter preset for SOUND_FILTER_DELAY 2 seconds */
103         SOUND_FILTER_PRESET_SOUNDALIVE_NORMAL,       /**< Filter preset for SOUND_FILTER_SOUNDALIVE normal */
104         SOUND_FILTER_PRESET_SOUNDALIVE_TUBE,         /**< Filter preset for SOUND_FILTER_SOUNDALIVE tube */
105         SOUND_FILTER_PRESET_SOUNDALIVE_VIRT71,       /**< Filter preset for SOUND_FILTER_SOUNDALIVE virtual7.1 */
106         SOUND_FILTER_PRESET_SOUNDALIVE_STUDIO,       /**< Filter preset for SOUND_FILTER_SOUNDALIVE studio */
107         SOUND_FILTER_PRESET_SOUNDALIVE_CLUB,         /**< Filter preset for SOUND_FILTER_SOUNDALIVE club */
108         SOUND_FILTER_PRESET_SOUNDALIVE_CONCERT_HALL, /**< Filter preset for SOUND_FILTER_SOUNDALIVE concert hall */
109 } sound_filter_preset_e;
110
111 /**
112  * @internal
113  * @brief Creates a handle for stream information.
114  * @since_tizen 3.0
115  *
116  * @remarks     Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
117  *      otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
118  *      To apply the stream policy according to this stream information, this handle should be passed to other APIs\n
119  *      related to playback or recording.(e.g. player, wav-player, audio-io, etc.)
120  *
121  * @param[in]   stream_type     The type of stream for internal usage
122  * @param[in]   callback        The focus state change callback function
123  * @param[in]   user_data       The user data to be passed to the callback function
124  * @param[out]  stream_info     The handle of stream information
125  * @return @c 0 on success,
126  *         otherwise a negative error value
127  * @retval #SOUND_MANAGER_ERROR_NONE Success
128  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
129  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
130  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
131  * @see sound_manager_destroy_stream_information()
132  * @see sound_manager_add_device_for_stream_routing()
133  * @see sound_manager_remove_device_for_stream_routing()
134  * @see sound_manager_remove_all_devices_for_stream_routing()
135  * @see sound_manager_apply_stream_routing()
136  * @see sound_manager_acquire_focus()
137  * @see sound_manager_destroy_focus()
138  * @see sound_manager_get_focus_state()
139  */
140 int sound_manager_create_stream_information_internal(sound_stream_type_internal_e stream_type, sound_stream_focus_state_changed_cb callback, void *user_data, sound_stream_info_h *stream_info);
141
142 /**
143  * @internal
144  * @brief Sets the stream routing option.
145  * @since_tizen 3.0
146  *
147  * @remarks     If the stream has not been made yet, this setting will be applied when the stream starts to play.
148  *
149  * @param[in]   stream_info     The handle of stream information
150  * @param[in]   name    The name of option
151  * @param[in]   value   The value of option
152  * @return @c 0 on success,
153  *         otherwise a negative error value
154  * @retval #SOUND_MANAGER_ERROR_NONE Success
155  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
156  * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
157  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
158  * @pre Call sound_manager_create_stream_information() before calling this function.
159  * @see sound_manager_create_stream_information()
160  * @see sound_manager_create_stream_information_internal()
161  * @see sound_manager_destroy_stream_information()
162  */
163 int sound_manager_set_stream_routing_option(sound_stream_info_h stream_info, const char *name, int value);
164
165 /**
166  * @internal
167  * @brief Queries if this stream information handle is available for the API.
168  * @since_tizen 3.0
169  * @param[in]   stream_info     The handle of stream information
170  * @param[in]   api_name        The native API name
171  * @param[out]  is_available    If @c true the api_name is available, @c false the api_name is not available for this strema_info
172  * @return @c 0 on success,
173  *         otherwise a negative error value
174  * @retval #SOUND_MANAGER_ERROR_NONE Success
175  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
176  * @see sound_manager_create_stream_information()
177  * @see sound_manager_destroy_stream_information()
178  */
179 int sound_manager_is_available_stream_information(sound_stream_info_h stream_info, native_api_e api_name, bool *is_available);
180
181 /**
182  * @internal
183  * @brief Gets stream type from the stream information handle.
184  * @since_tizen 3.0
185  * @param[in]   stream_info     The handle of stream information
186  * @param[out]  type    The stream type
187  * @return @c 0 on success,
188  *         otherwise a negative error value
189  * @retval #SOUND_MANAGER_ERROR_NONE Success
190  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
191  * @see sound_manager_create_stream_information()
192  * @see sound_manager_destroy_stream_information()
193  */
194 int sound_manager_get_type_from_stream_information(sound_stream_info_h stream_info, char **type);
195
196 /**
197  * @internal
198  * @brief Gets the index of the stream information handle.
199  * @since_tizen 3.0
200  * @param[in]   stream_info     The handle of stream information
201  * @param[out]  index   The unique index
202  *
203  * @return @c 0 on success,
204  *         otherwise a negative error value
205  * @retval #SOUND_MANAGER_ERROR_NONE Success
206  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
207  * @see sound_manager_create_stream_information()
208  * @see sound_manager_destroy_stream_information()
209  */
210 int sound_manager_get_index_from_stream_information(sound_stream_info_h stream_info, int *index);
211
212 /**
213  * @internal
214  * @brief Adds the device id to the stream information for the stream routing.
215  * @since_tizen 4.0
216  *
217  * @remarks     Use sound_manager_get_device_list(), sound_manager_get_next_device() and sound_manager_get_device_id()\n
218  *      to get the device id.\n
219  *      #SOUND_MANAGER_ERROR_POLICY could be returned according to the stream type of the @a stream_info.\n
220  *      The available types of the @a stream_info for this function are #SOUND_STREAM_TYPE_VOIP and #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY.
221  *
222  * @param[in]   stream_info     The handle of stream information
223  * @param[in]   device_id       The device id
224  * @return @c 0 on success,
225  *         otherwise a negative error value
226  * @retval #SOUND_MANAGER_ERROR_NONE Success
227  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
228  * @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
229  * @pre Call sound_manager_create_stream_information() before calling this function.
230  * @post You can apply this setting by calling sound_manager_apply_stream_routing().
231  * @see sound_manager_create_stream_information()
232  * @see sound_manager_destroy_stream_information()
233  * @see sound_manager_remove_device_id_for_stream_routing()
234  * @see sound_manager_remove_all_devices_for_stream_routing()
235  * @see sound_manager_apply_stream_routing()
236  */
237 int sound_manager_add_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
238
239 /**
240  * @internal
241  * @brief Removes the device id to the stream information for the stream routing.
242  * @since_tizen 4.0
243  *
244  * @remarks     Use sound_manager_get_device_list(), sound_manager_get_next_device() and sound_manager_get_device_id()\n
245  *      to get the device id.\n
246  *
247  * @param[in]   stream_info     The handle of stream information
248  * @param[in]   device          The device id
249  * @return @c 0 on success,
250  *         otherwise a negative error value
251  * @retval #SOUND_MANAGER_ERROR_NONE Success
252  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
253  * @pre Call sound_manager_create_stream_information() and sound_manager_add_device_for_stream_routing() before calling this function.
254  * @post You can apply this setting by calling sound_manager_apply_stream_routing().
255  * @see sound_manager_create_stream_information()
256  * @see sound_manager_destroy_stream_information()
257  * @see sound_manager_add_device_id_for_stream_routing()
258  * @see sound_manager_remove_all_devices_for_stream_routing()
259  * @see sound_manager_apply_stream_routing()
260  */
261 int sound_manager_remove_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
262
263 /**
264  * @internal
265  * @brief Gets the state of the device by id.
266  * @since_tizen 4.0
267  * @param[in]   device_id       The device id
268  * @param[out]  state   The state of the device
269  * @return @c 0 on success,
270  *         otherwise a negative error value
271  * @retval #SOUND_MANAGER_ERROR_NONE Success
272  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
273  * @see sound_manager_get_device_list()
274  * @see sound_manager_get_next_device()
275  * @see sound_manager_get_prev_device()
276  * @see sound_manager_get_device_id()
277  * @see sound_manager_free_device_list()
278  */
279 int sound_manager_get_device_state_by_id(int device_id, sound_device_state_e *state);
280
281 /**
282  * @internal
283  * @brief Checks if the device is running.
284  * @since_tizen 5.0
285  * @param[in]   device_id       The device id
286  * @param[out]  is_running      Whether the device is running or not: (@c true = running, @c false = not running)
287  * @return @c 0 on success,
288  *         otherwise a negative error value
289  * @retval #SOUND_MANAGER_ERROR_NONE Success
290  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
291  * @see sound_manager_get_device_list()
292  * @see sound_manager_get_next_device()
293  * @see sound_manager_get_prev_device()
294  * @see sound_manager_get_device_id()
295  * @see sound_manager_free_device_list()
296  */
297 int sound_manager_is_device_running_by_id(int device_id, bool *is_running);
298
299 /**
300  * @internal
301  * @brief Gets the device's supported sample formats.
302  * @since_tizen 5.0
303  *
304  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
305  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
306  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
307  *      The @a formats should be released using free().
308  *
309  * @param[in]   device_id       The device id
310  * @param[out]  formats The supported sample format list
311  * @param[out]  num_of_elems    The number of elements in the sample format list
312  * @return @c 0 on success,
313  *         otherwise a negative error value
314  * @retval #SOUND_MANAGER_ERROR_NONE Success
315  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
316  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
317  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
318  * @see sound_manager_set_sample_format_by_id()
319  * @see sound_manager_get_sample_format_by_id()
320  */
321 int sound_manager_get_supported_sample_formats_by_id(int device_id, sound_sample_format_e **formats, unsigned int *num_of_elems);
322
323 /**
324  * @internal
325  * @brief Sets the device's sample format.
326  * @since_tizen 5.0
327  *
328  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n
329  *      @a format should be one of the values received from sound_manager_get_supported_sample_formats_by_id(),\n
330  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
331  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.
332  *
333  * @param[in]   device_id       The device id
334  * @param[in]   format  The sample format
335  * @return @c 0 on success,
336  *         otherwise a negative error value
337  * @retval #SOUND_MANAGER_ERROR_NONE Success
338  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
339  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
340  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
341  * @see sound_manager_get_supported_sample_formats_by_id()
342  * @see sound_manager_get_sample_format_by_id()
343  */
344 int sound_manager_set_sample_format_by_id(int device_id, sound_sample_format_e format);
345
346 /**
347  * @internal
348  * @brief Gets the device's sample format.
349  * @since_tizen 5.0
350  *
351  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
352  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
353  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.
354  *
355  * @param[in]   device_id       The device id
356  * @param[out]  format  The sample format
357  * @return @c 0 on success,
358  *         otherwise a negative error value
359  * @retval #SOUND_MANAGER_ERROR_NONE Success
360  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
361  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
362  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
363  * @see sound_manager_get_supported_sample_formats_by_id()
364  * @see sound_manager_set_sample_format_by_id()
365  */
366 int sound_manager_get_sample_format_by_id(int device_id, sound_sample_format_e *format);
367
368 /**
369  * @internal
370  * @brief Gets the device's supported sample rates.
371  * @since_tizen 5.0
372  *
373  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
374  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
375  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
376  *      The @a rates should be released using free().
377  *
378  * @param[in]   device_id       The device id
379  * @param[out]  rates   The supported sample rate list
380  * @param[out]  num_of_elems    The number of elements in the sample rate list
381  * @return @c 0 on success,
382  *         otherwise a negative error value
383  * @retval #SOUND_MANAGER_ERROR_NONE Success
384  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
385  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
386  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
387  * @see sound_manager_set_sample_rate_by_id()
388  * @see sound_manager_get_sample_rate_by_id()
389  */
390 int sound_manager_get_supported_sample_rates_by_id(int device_id, sound_sample_rate_e **rates, unsigned int *num_of_elems);
391
392 /**
393  * @internal
394  * @brief Sets the device's sample rate.
395  * @since_tizen 5.0
396  *
397  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n
398  *      @a rate should be one of the values received from sound_manager_get_supported_sample_rates(),\n
399  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
400  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.
401  *
402  * @param[in]   device_id       The device id
403  * @param[in]   rate    The sample rate
404  * @return @c 0 on success,
405  *         otherwise a negative error value
406  * @retval #SOUND_MANAGER_ERROR_NONE Success
407  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
408  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
409  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
410  * @see sound_manager_get_supported_sample_rates_by_id()
411  * @see sound_manager_get_sample_rate_by_id()
412  */
413 int sound_manager_set_sample_rate_by_id(int device_id, sound_sample_rate_e rate);
414
415 /**
416  * @internal
417  * @brief Gets the device's sample rate.
418  * @since_tizen 5.0
419  *
420  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
421  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
422  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.
423  *
424  * @param[in]   device_id       The device id
425  * @param[out]  rate    The sample rate
426  * @return @c 0 on success,
427  *         otherwise a negative error value
428  * @retval #SOUND_MANAGER_ERROR_NONE Success
429  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
430  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
431  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
432  * @see sound_manager_get_supported_sample_rates_by_id()
433  * @see sound_manager_set_sample_rate_by_id()
434  */
435 int sound_manager_get_sample_rate_by_id(int device_id, sound_sample_rate_e *rate);
436
437 /**
438  * @internal
439  * @brief Sets the device's 'avoid resampling' property.
440  * @since_tizen 5.0
441  *
442  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
443  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
444  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
445  *      The 'avoid resampling' property is not enabled as default. With this enabled, the device will\n
446  *      use the first stream's original sample format and rate without resampling if supported.
447  *
448  * @param[in]   device_id       The device id
449  * @param[in]   enable  The 'avoid resampling' property value to set: (@c true = enable, @c false = disable)
450  * @return @c 0 on success,
451  *         otherwise a negative error value
452  * @retval #SOUND_MANAGER_ERROR_NONE Success
453  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
454  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
455  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
456  * @see sound_manager_get_avoid_resampling_by_id()
457  */
458 int sound_manager_set_avoid_resampling_by_id(int device_id, bool enable);
459
460 /**
461  * @internal
462  * @brief Gets the device's 'avoid resampling' property.
463  * @since_tizen 5.0
464  *
465  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
466  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
467  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
468  *      The default value of 'avoid resampling' is false.
469  *
470  * @param[in]   device_id       The device id
471  * @param[in]   enabled The value of 'avoid resampling' property: (@c true = enabled, @c false = disabled)
472  * @return @c 0 on success,
473  *         otherwise a negative error value
474  * @retval #SOUND_MANAGER_ERROR_NONE Success
475  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
476  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
477  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
478  * @see sound_manager_set_avoid_resampling_by_id()
479  */
480 int sound_manager_get_avoid_resampling_by_id(int device_id, bool *enabled);
481
482 /**
483  * @internal
484  * @brief Sets the restriction of stream type only for media.
485  * @since_tizen 5.0
486  *
487  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
488  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
489  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
490  *      This property is not enabled as default. With this enabled, no other stream types\n
491  *      except #SOUND_STREAM_TYPE_MEDIA is not allowed to @a device.
492  *
493  * @param[in]   device_id       The device id
494  * @param[in]   enable  The 'media stream only' property value to set: (@c true = enable, @c false = disable)
495  * @return @c 0 on success,
496  *         otherwise a negative error value
497  * @retval #SOUND_MANAGER_ERROR_NONE Success
498  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
499  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
500  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
501  * @see sound_manager_get_media_stream_only_by_id()
502  */
503 int sound_manager_set_media_stream_only_by_id(int device_id, bool enable);
504
505 /**
506  * @internal
507  * @brief Gets the restriction of stream type only for media.
508  * @since_tizen 5.0
509  *
510  * @remarks     @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
511  *      otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
512  *      Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
513  *      The property is not enabled as default.
514  *
515  * @param[in]   device_id       The device id
516  * @param[out]  enabled The value of 'media stream only' property: (@c true = enabled, @c false = disabled)
517  * @return @c 0 on success,
518  *         otherwise a negative error value
519  * @retval #SOUND_MANAGER_ERROR_NONE Success
520  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
521  * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
522  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
523  * @see sound_manager_set_media_stream_only_by_id()
524  */
525 int sound_manager_get_media_stream_only_by_id(int device_id, bool *enabled);
526
527 /**
528  * @internal
529  * @brief Creates a virtual stream handle.
530  * @since_tizen 3.0
531  * @param[in]   stream_info     The handle of stream information
532  * @param[out]  virtual_stream  The handle of virtual stream
533  * @return @c 0 on success,
534  *         otherwise a negative error value
535  * @retval #SOUND_MANAGER_ERROR_NONE Success
536  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
537  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
538  * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
539  * @see sound_manager_create_stream_information()
540  * @see sound_manager_destroy_stream_information()
541  * @see sound_manager_destroy_virtual_stream()
542  * @see sound_manager_start_virtual_stream()
543  * @see sound_manager_stop_virtual_stream()
544  */
545 int sound_manager_create_virtual_stream(sound_stream_info_h stream_info, virtual_sound_stream_h *virtual_stream);
546
547 /**
548  * @internal
549  * @brief Destroys the virtual stream handle.
550  * @since_tizen 3.0
551  * @param[in]   virtual_stream  The handle of virtual stream
552  * @return @c 0 on success,
553  *         otherwise a negative error value
554  * @retval #SOUND_MANAGER_ERROR_NONE Success
555  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
556  * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
557  * @see sound_manager_create_virtual_stream()
558  * @see sound_manager_start_virtual_stream()
559  * @see sound_manager_stop_virtual_stream()
560  */
561 int sound_manager_destroy_virtual_stream(virtual_sound_stream_h virtual_stream);
562
563 /**
564  * @internal
565  * @brief Starts the virtual stream.
566  * @since_tizen 3.0
567  * @param[in]   virtual_stream  The handle of virtual stream
568  * @return @c 0 on success,
569  *         otherwise a negative error value
570  * @retval #SOUND_MANAGER_ERROR_NONE Success
571  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
572  * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
573  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
574  * @see sound_manager_create_virtual_stream()
575  * @see sound_manager_destroy_virtual_stream()
576  * @see sound_manager_stop_virtual_stream()
577  */
578 int sound_manager_start_virtual_stream(virtual_sound_stream_h virtual_stream);
579
580 /**
581  * @internal
582  * @brief Stops the virtual stream.
583  * @since_tizen 3.0
584  * @param[in]   virtual_stream  The handle of virtual stream
585  * @return @c 0 on success,
586  *         otherwise a negative error value
587  * @retval #SOUND_MANAGER_ERROR_NONE Success
588  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
589  * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
590  * @see sound_manager_create_virtual_stream()
591  * @see sound_manager_destroy_virtual_stream()
592  * @see sound_manager_start_virtual_stream()
593  */
594 int sound_manager_stop_virtual_stream(virtual_sound_stream_h virtual_stream);
595
596 /**
597  * @internal
598  * @brief Set sound filter and apply to audio streams given selected stream type.
599  * @since_tizen 4.0
600  * @param[in]   stream_type             stream type to apply
601  * @param[in]   filter                  sound filter to apply
602  * @return @c 0 on success,
603  *         otherwise a negative error value
604  * @retval #SOUND_MANAGER_ERROR_NONE Success
605  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
606  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
607  * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
608  * @see sound_manager_unset_filter()
609  */
610 int sound_manager_set_filter(sound_stream_type_e stream_type, sound_filter_e filter);
611
612 /**
613  * @internal
614  * @brief Unset sound filter and remove from audio streams given selected stream type.
615  * @since_tizen 4.0
616  * @param[in]   stream_type             stream type to remove
617  * @return @c 0 on success,
618  *         otherwise a negative error value
619  * @retval #SOUND_MANAGER_ERROR_NONE Success
620  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
621  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
622  * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
623  * @see sound_manager_set_filter()
624  */
625 int sound_manager_unset_filter(sound_stream_type_e stream_type);
626
627 /**
628  * @internal
629  * @brief Apply preset configuration to the filter according to selected stream type.
630  * @since_tizen 4.0
631  * @param[in]   stream_type             given stream type
632  * @param[in]   filter                  given sound filter
633  * @param[in]   preset                  filter preset to apply
634  * @return @c 0 on success,
635  *         otherwise a negative error value
636  * @retval #SOUND_MANAGER_ERROR_NONE Success
637  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
638  * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
639  * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
640  * @see sound_manager_set_filter()
641  */
642 int sound_manager_set_filter_preset(sound_stream_type_e stream_type, sound_filter_e filter, sound_filter_preset_e preset);
643
644 /**
645  * @internal
646  * @brief Gets the vendor id of the device.
647  * @since_tizen 4.0
648  *
649  * @remarks     It works only with USB audio device. Otherwise, #SOUND_MANAGER_ERROR_NOT_SUPPORTED will be returned.\n
650  *
651  * @param[in]   device  The device item
652  * @param[out]  vendor_id       The vendor id of the device
653  * @return @c 0 on success,
654  *         otherwise a negative error value
655  * @retval #SOUND_MANAGER_ERROR_NONE Success
656  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
657  * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
658  * @see sound_manager_get_device_list()
659  * @see sound_manager_get_next_device()
660  * @see sound_manager_get_prev_device()
661  * @see sound_manager_get_device_type()
662  * @see sound_manager_get_device_io_direction()
663  * @see sound_manager_get_device_name()
664  * @see sound_manager_get_device_state()
665  * @see sound_manager_get_device_id()
666  * @see sound_manager_get_device_product_id()
667  * @see sound_manager_free_device_list()
668  */
669 int sound_manager_get_device_vendor_id(sound_device_h device, int *vendor_id);
670
671 /**
672  * @internal
673  * @brief Gets the product id of the device.
674  * @since_tizen 4.0
675  *
676  * @remarks     It works only with USB audio device. Otherwise, #SOUND_MANAGER_ERROR_NOT_SUPPORTED will be returned.\n
677  *
678  * @param[in]   device  The device item
679  * @param[out]  product_id      The product id of the device
680  * @return @c 0 on success,
681  *         otherwise a negative error value
682  * @retval #SOUND_MANAGER_ERROR_NONE Success
683  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
684  * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
685  * @see sound_manager_get_device_list()
686  * @see sound_manager_get_next_device()
687  * @see sound_manager_get_prev_device()
688  * @see sound_manager_get_device_type()
689  * @see sound_manager_get_device_io_direction()
690  * @see sound_manager_get_device_name()
691  * @see sound_manager_get_device_state()
692  * @see sound_manager_get_device_id()
693  * @see sound_manager_get_device_vendor_id()
694  * @see sound_manager_free_device_list()
695  */
696 int sound_manager_get_device_product_id(sound_device_h device, int *product_id);
697
698 /**
699  * @}
700  */
701
702 #ifdef __cplusplus
703 }
704 #endif
705
706 #endif /* __TIZEN_MEDIA_SOUND_MANAGER_INTERNAL_H__ */