Get device by id
[platform/core/multimedia/libmm-sound.git] / include / mm_sound_proxy.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_proxy.h
24  * @brief               Client-Side proxy interface for audio module.
25  * @date
26  * @version             Release
27  *
28  * Client-Side proxy interface for audio module.
29  */
30
31 #ifndef __MM_SOUND_PROXY_H__
32 #define __MM_SOUND_PROXY_H__
33
34 #include "mm_sound_private.h"
35 #include "mm_sound_device.h"
36 #ifdef USE_FOCUS
37 #include "mm_sound_focus.h"
38 #endif
39 #include "include/mm_sound_client.h"
40
41 typedef void (*mm_sound_proxy_userdata_free) (void *data);
42
43 int mm_sound_proxy_play_tone(int tone, int repeat, int volume, int volume_config,
44                         int session_type, int session_options, int client_pid,
45                         bool enable_session, int *codechandle, char *stream_type, int stream_index);
46 int mm_sound_proxy_play_tone_with_stream_info(int client_pid, int tone, char *stream_type, int stream_id, int volume, int repeat, int *codechandle);
47 int mm_sound_proxy_play_sound(const char* filename, int tone, int repeat, int volume, int volume_config,
48                         int session_type, int session_options, int client_pid, bool enable_session, int *codechandle, char *stream_type, int stream_index);
49 int mm_sound_proxy_play_sound_with_stream_info(const char* filename, int repeat, int volume,
50                         int client_pid, int *codechandle, char *stream_type, int stream_index);
51 int mm_sound_proxy_stop_sound(int handle);
52 int mm_sound_proxy_clear_focus(int pid); // Not original focus feature, only for cleaning up tone/wav player internal focus usage.
53 int mm_sound_proxy_add_play_sound_end_callback(mm_sound_stop_callback_wrapper_func func, void* userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
54 int mm_sound_proxy_remove_play_sound_end_callback(unsigned subs_id);
55 int mm_sound_proxy_get_current_connected_device_list(int device_flags, GList** device_list);
56 int mm_sound_proxy_get_device_by_id(int device_id, mm_sound_device_t **device);
57 int mm_sound_proxy_add_device_connected_callback(int device_flags, mm_sound_device_connected_wrapper_cb func, void *userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
58 int mm_sound_proxy_remove_device_connected_callback(unsigned subs_id);
59 int mm_sound_proxy_add_device_info_changed_callback(int device_flags, mm_sound_device_info_changed_wrapper_cb func, void* userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
60 int mm_sound_proxy_remove_device_info_changed_callback(unsigned subs_id);
61 int mm_sound_proxy_add_device_state_changed_callback(int device_flags, mm_sound_device_state_changed_wrapper_cb func, void* userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
62 int mm_sound_proxy_remove_device_state_changed_callback(unsigned subs_id);
63 int mm_sound_proxy_is_stream_on_device(int stream_id, int device_id, bool *is_on);
64 int mm_sound_proxy_set_volume_by_type(const char *volume_type, const unsigned volume_level);
65 int mm_sound_proxy_add_volume_changed_callback(mm_sound_volume_changed_wrapper_cb func, void* userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
66 int mm_sound_proxy_remove_volume_changed_callback(unsigned subs_id);
67 int mm_sound_proxy_emergent_exit(int exit_pid);
68 int mm_sound_proxy_set_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group);
69 int mm_sound_proxy_unset_filter_by_type(const char *stream_type);
70 int mm_sound_proxy_control_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_controls);
71
72 #ifdef USE_FOCUS
73 int mm_sound_proxy_get_unique_id(int *id);
74 int mm_sound_proxy_register_focus(int id, int instance, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
75 int mm_sound_proxy_unregister_focus(int instance, int id, bool is_for_session);
76 int mm_sound_proxy_set_focus_reacquisition(int instance, int id, bool reacquisition, bool is_for_session);
77 int mm_sound_proxy_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info);
78 int mm_sound_proxy_acquire_focus(int instance, int id, mm_sound_focus_type_e type, int option, const char *ext_info, bool is_for_session);
79 int mm_sound_proxy_release_focus(int instance, int id, mm_sound_focus_type_e type, int option, const char *ext_info, bool is_for_session);
80 int mm_sound_proxy_update_stream_focus_status(int focus_id, unsigned int status);
81 int mm_sound_proxy_set_focus_watch_callback(int instance, int handle, mm_sound_focus_type_e type, bool is_for_session, bool is_for_monitor, mm_sound_focus_changed_watch_cb callback, void *user_data);
82 int mm_sound_proxy_unset_focus_watch_callback(int focus_tid, int handle, bool is_for_session);
83 #endif
84
85 int mm_sound_proxy_add_test_callback(mm_sound_test_cb func, void *userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
86 int mm_sound_proxy_remove_test_callback(unsigned subs_id);
87 int mm_sound_proxy_test(int a, int b, int* get);
88
89 int mm_sound_proxy_initialize(void);
90 int mm_sound_proxy_finalize(void);
91
92 #endif /* __MM_SOUND_PROXY_H__ */