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;
36 //#define MEMTYPE_TRANS_PER_MAX (1024 * 1024) /* 1MB */
38 int mm_sound_client_initialize(void);
39 int mm_sound_client_finalize(void);
40 int mm_sound_client_play_tone(int number, int volume_config, double volume, int time, int *handle, bool enable_session);
41 int mm_sound_client_play_tone_with_stream_info(int tone, char *stream_type, int stream_id, double volume, int duration, int *handle);
42 int mm_sound_client_play_sound(MMSoundPlayParam *param, int tone, int *handle);
43 int mm_sound_client_play_sound_with_stream_info(MMSoundPlayParam *param, int *handle, char* stream_type, int stream_id);
44 int mm_sound_client_stop_sound(int handle);
45 int mm_sound_client_set_volume_by_type(const int volume_type, const unsigned int volume_level);
46 int mm_sound_client_add_volume_changed_callback(mm_sound_volume_changed_cb func, void* user_data, unsigned int *subs_id);
47 int mm_sound_client_remove_volume_changed_callback(unsigned int subs_id);
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_flgas, 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_is_stream_on_device(int stream_id, int device_id, bool *is_on);
61 int mm_sound_client_set_session_interrupt_callback(mm_sound_focus_session_interrupt_cb callback, void* user_data);
62 int mm_sound_client_unset_session_interrupt_callback(void);
63 int mm_sound_client_get_unique_id(int *id);
64 int mm_sound_client_is_focus_cb_thread(GThread *mine, bool *result);
65 int mm_sound_client_register_focus(int id, int pid, const char *stream_type, bool is_for_session, mm_sound_focus_changed_cb callback, void* user_data);
66 int mm_sound_client_unregister_focus(int id);
67 int mm_sound_client_set_focus_reacquisition(int id, bool reacquisition, bool is_for_session);
68 int mm_sound_client_get_focus_reacquisition(int id, bool *reacquisition);
69 int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info);
70 int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info);
71 int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info);
72 int mm_sound_client_update_stream_focus_status(int id, unsigned int status);
73 int mm_sound_client_deliver_focus(int pid, int src_id, int dst_id, mm_sound_focus_type_e focus_type);
74 int mm_sound_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e type, bool is_for_session, bool is_for_monitor, mm_sound_focus_changed_watch_cb callback, void* user_data, int *id);
75 int mm_sound_client_unset_focus_watch_callback(int id);
76 int mm_sound_client_request_unset_focus_watch_callback(int id);
77 int mm_sound_client_execute_focus_func_in_main_context(focus_idle_event_type_e type, int data);
80 int mm_sound_client_add_test_callback(mm_sound_test_cb func, void* user_data, unsigned int *subs_id);
81 int mm_sound_client_remove_test_callback(unsigned int subs_id);
82 int mm_sound_client_test(int a, int b, int* get);
84 typedef void (*mm_sound_volume_changed_wrapper_cb)(const char *direction, const char *volume_type_str, int volume_level, void *userdata);
85 typedef void (*mm_sound_device_connected_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
86 const char *name, int *vendor_id, int *product_id, int *stream_id, int stream_num, gboolean is_connected, void *userdata);
87 typedef void (*mm_sound_device_info_changed_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
88 const char *name, int *vendor_id, int *product_id, int *stream_id, int stream_num, int changed_device_info_type, void *userdata);
89 typedef void (*mm_sound_device_state_changed_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
90 const char *name, int *vendor_id, int *product_id, int *stream_id, int stream_num, void *userdata);
91 typedef void (*mm_sound_stop_callback_wrapper_func)(int id, void *userdata);
93 #endif /* __MM_SOUND_CLIENT_H__ */