2 * audio-session-manager
4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin at samsung.com>, Sangchul Lee <sc11.lee at 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.
29 #include <audio-session-manager-types.h>
31 * @ingroup AUDIO_SESSION_MANAGER
32 * @defgroup AUDIO_SESSION_MANAGER Audio Session Manager
37 * This function register session to ASM server.
39 * @return This function returns @c true on success; @c false otherwise.
40 * @param[in] application_pid set (-1) if this library attached to application process.
41 * or set pid of actual application if this library attached to separated working process
42 * (e.g. client server style framework)
43 * @param[out] asm_handle handle of asm.
44 * @param[in] sound_event sound event of instance to requested register
45 * @param[in] sound_state set sound state ( 0 : None , 1 : Playing )
46 * @param[in] callback This callback function is called when sound status of other sound event is changed
47 * @param[in] cb_data This is data of callback function
48 * @param[in] mm_resource System resources will be used.
49 * @param[out] error_code specifies the error code
53 ASM_register_sound(const int application_pid, int *asm_handle, ASM_sound_events_t sound_event,
54 ASM_sound_states_t sound_state, ASM_sound_cb_t callback, void* cb_data, ASM_resource_t mm_resource, int *error_code);
57 ASM_register_sound_ex (const int application_pid, int *asm_handle, ASM_sound_events_t sound_event,
58 ASM_sound_states_t sound_state, ASM_sound_cb_t callback, void* cb_data, ASM_resource_t mm_resource, int *error_code, int (*func)(void*,void*));
61 * This function unregister sound event to ASM server. If unregistered, sound event is not playing.
63 * @return This function returns @c true on success; @c false otherwise.
64 * @param[in] sound_event sound event of instance to requested unregister
65 * @param[out] error_code specifies the error code
69 ASM_unregister_sound(const int asm_handle, ASM_sound_events_t sound_event, int *error_code);
72 ASM_unregister_sound_ex(const int asm_handle, ASM_sound_events_t sound_event, int *error_code, int (*func)(void*,void*));
76 * This function gets sound status from ASM server
78 * @return This function returns @c true on success; @c false otherwise.
79 * @param[out] all_sound_status Current Sound status of All sound events defined in sound conflict manager
80 * return value defined in ASM_sound_status_t
81 * Each bit is Sound Status Type( 0 : None , 1 : Playing )
82 * @param[out] error_code specifies the error code
86 ASM_get_sound_status(unsigned int *all_sound_status, int *error_code);
90 * This function gets sound state of sound event from ASM server
92 * @return This method returns @c true on success; @c false otherwise.
93 * @param[in] sound_event sound event for want to know sound state
94 * @param[out] sound_state result of sound state
95 * @param[out] error_code specifies the error code
99 ASM_get_sound_state(const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_states_t *sound_state, int *error_code);
102 * This function gets sound state of given process from ASM server
104 * @return This method returns @c true on success; @c false otherwise.
105 * @param[in] asm_handle asm_handle.
106 * @param[out] sound_state result of sound state
107 * @param[out] error_code specifies the error code
111 ASM_get_process_session_state(const int asm_handle, ASM_sound_states_t *sound_state, int *error_code);
114 ASM_attach_callback(ASM_sound_events_t sound_event, ASM_sound_cb_t callback, void *user_data, int *error_code);
117 * This function set sound state to ASM server.
119 * @return This function returns @c true on success; @c false otherwise.
120 * @param[in] sound_event sound event of instance to requested setting
121 * @param[in] sound_state set sound state ( 0(ASM_SND_STATE_NONE) : None , 1(ASM_SND_STATE_PLAYING) : Playing )
122 * @param[in] mm_resource system resources will be used.
123 * @param[out] error_code specifies the error code
124 * @exception #ERR_asm_MSG_QUEUE_SND_ERROR - Is is failed to send to message queue.
127 ASM_set_sound_state(const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_states_t sound_state, ASM_resource_t mm_resource, int *error_code);
130 ASM_set_sound_state_ex (const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_states_t sound_state, ASM_resource_t mm_resource, int *error_code, int (*func)(void*,void*));
133 ASM_change_callback(const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_cb_t callback, void* cb_data, int *error_code);
136 ASM_set_watch_session (const int application_pid, ASM_sound_events_t interest_sound_event, ASM_sound_states_t interest_sound_state, ASM_watch_cb_t callback, void *user_data, int *error_code);
139 ASM_unset_watch_session (ASM_sound_events_t interest_sound_event, ASM_sound_states_t interest_sound_state, int *error_code);
142 ASM_reset_resumption_info(const int asm_handle, int *error_code);
145 ASM_set_subevent (const int asm_handle, ASM_sound_sub_events_t subevent, int *error_code);
148 ASM_get_subevent (const int asm_handle, ASM_sound_sub_events_t *subevent, int *error_code);
151 ASM_set_subsession (const int asm_handle, ASM_sound_sub_sessions_t subsession, int resource, int *error_code);
154 ASM_get_subsession (const int asm_handle, ASM_sound_sub_sessions_t *subsession, int *error_code);