4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef __MM_SOUND_CLIENT_H__
23 #define __MM_SOUND_CLIENT_H__
25 #include "mm_sound_private.h"
26 #include "mm_sound_device.h"
28 #include "mm_sound_focus.h"
30 IDLE_EVENT_TYPE_UNSET_FOCUS_WATCH_CB,
31 IDLE_EVENT_TYPE_UNREGISTER_FOCUS,
33 } focus_idle_event_type_e;
35 //#define MEMTYPE_TRANS_PER_MAX (1024 * 1024) /* 1MB */
37 int mm_sound_client_initialize(void);
38 int mm_sound_client_finalize(void);
39 int mm_sound_client_set_volume_by_type(volume_type_t type, const unsigned int level);
40 int mm_sound_client_get_volume_by_type(volume_type_t type, unsigned int *level);
41 int mm_sound_client_add_volume_changed_callback(mm_sound_volume_changed_cb func, void* user_data, unsigned int *subs_id);
42 int mm_sound_client_add_volume_changed_callback_internal(mm_sound_volume_changed_cb_internal func, void* user_data, unsigned int *subs_id);
43 int mm_sound_client_remove_volume_changed_callback(unsigned int subs_id);
44 int mm_sound_client_set_mute_by_type(volume_type_t type, bool mute);
45 int mm_sound_client_get_mute_by_type(volume_type_t type, bool *muted);
46 int mm_sound_client_set_volume_by_internal_type(volume_type_internal_t type, const unsigned int level);
47 int mm_sound_client_get_volume_by_internal_type(volume_type_internal_t type, unsigned int *level);
48 int mm_sound_client_set_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group);
49 int mm_sound_client_unset_filter_by_type(const char *stream_type);
50 int mm_sound_client_control_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_controls);
51 int mm_sound_client_get_current_connected_device_list(int device_flags, mm_sound_device_list_t *device_list);
52 int mm_sound_client_get_device_by_id(int device_id, mm_sound_device_t **device);
53 int mm_sound_client_add_device_connected_callback(int device_flags, mm_sound_device_connected_cb func, void* user_data, unsigned int *subs_id);
54 int mm_sound_client_remove_device_connected_callback(unsigned int subs_id);
55 int mm_sound_client_add_device_info_changed_callback(int device_flags, mm_sound_device_info_changed_cb func, void* user_data, unsigned int *subs_id);
56 int mm_sound_client_remove_device_info_changed_callback(unsigned int subs_id);
57 int mm_sound_client_add_device_state_changed_callback(int device_flags, mm_sound_device_state_changed_cb func, void *userdata, unsigned int *id);
58 int mm_sound_client_remove_device_state_changed_callback(unsigned int id);
59 int mm_sound_client_add_device_running_changed_callback(int device_flags, mm_sound_device_running_changed_cb func, void *userdata, unsigned int *id);
60 int mm_sound_client_remove_device_running_changed_callback(unsigned int id);
61 int mm_sound_client_is_stream_on_device(int stream_id, int device_id, bool *is_on);
62 int mm_sound_client_is_focus_cb_thread(GThread *mine, bool *result, bool *is_for_watching);
63 int mm_sound_client_register_focus(int pid, const char *stream_type, mm_sound_focus_changed_cb callback, void* user_data, int *id);
64 int mm_sound_client_unregister_focus(int id);
65 int mm_sound_client_set_focus_reacquisition(int id, bool reacquisition);
66 int mm_sound_client_get_focus_reacquisition(int id, bool *reacquisition);
67 int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info);
68 int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info);
69 int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info);
70 int mm_sound_client_update_stream_focus_status(int id, unsigned int status);
71 int mm_sound_client_deliver_focus(int src_id, int dst_id, mm_sound_focus_type_e focus_type);
72 int mm_sound_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, void* user_data, int *id);
73 int mm_sound_client_unset_focus_watch_callback(int id);
74 int mm_sound_client_request_unset_focus_watch_callback(int id);
75 int mm_sound_client_execute_focus_func_in_main_context(focus_idle_event_type_e type, int data);
76 int mm_sound_client_add_ducking_state_changed_callback(mm_sound_ducking_state_changed_cb func, void* user_data, unsigned int *subs_id);
77 int mm_sound_client_remove_ducking_state_changed_callback(unsigned int subs_id);
79 typedef void (*mm_sound_volume_changed_wrapper_cb)(const char *direction, const char *volume_type_str, int volume_level, void *userdata);
80 typedef void (*mm_sound_device_connected_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
81 const char *name, int vendor_id, int product_id, bool is_running, int *stream_id, int stream_num, bool is_connected, void *userdata);
82 typedef void (*mm_sound_device_info_changed_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
83 const char *name, int vendor_id, int product_id, bool is_running, int *stream_id, int stream_num, int changed_device_info_type, void *userdata);
84 typedef void (*mm_sound_device_state_changed_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
85 const char *name, int vendor_id, int product_id, bool is_running, int *stream_id, int stream_num, void *userdata);
86 typedef void (*mm_sound_device_running_changed_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
87 const char *name, int vendor_id, int product_id, bool is_running, int *stream_id, int stream_num, void *userdata);
88 typedef void (*mm_sound_stop_callback_wrapper_func)(int id, void *userdata);
89 typedef void (*mm_sound_ducking_state_changed_wrapper_cb)(int idx, bool is_ducked, void *userdata);
91 #endif /* __MM_SOUND_CLIENT_H__ */