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);
71 bool ASM_unregister_sound_ex(const int asm_handle, ASM_sound_events_t sound_event, int *error_code, int (*func)(void*,void*));
75 * This function gets sound status from ASM server
77 * @return This function returns @c true on success; @c false otherwise.
78 * @param[out] all_sound_status Current Sound status of All sound events defined in sound conflict manager
79 * return value defined in ASM_sound_status_t
80 * Each bit is Sound Status Type( 0 : None , 1 : Playing )
81 * @param[out] error_code specifies the error code
85 ASM_get_sound_status(unsigned int *all_sound_status, int *error_code);
89 * This function gets sound state of sound event from ASM server
91 * @return This method returns @c true on success; @c false otherwise.
92 * @param[in] sound_event sound event for want to know sound state
93 * @param[out] sound_state result of sound state
94 * @param[out] error_code specifies the error code
98 ASM_get_sound_state(const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_states_t *sound_state, int *error_code);
101 * This function gets sound state of given process from ASM server
103 * @return This method returns @c true on success; @c false otherwise.
104 * @param[in] asm_handle asm_handle.
105 * @param[out] sound_state result of sound state
106 * @param[out] error_code specifies the error code
110 ASM_get_process_session_state(const int asm_handle, ASM_sound_states_t *sound_state, int *error_code);
113 * This function set sound state to ASM server.
115 * @return This function returns @c true on success; @c false otherwise.
116 * @param[in] sound_event sound event of instance to requested setting
117 * @param[in] sound_state set sound state ( 0(ASM_SND_STATE_NONE) : None , 1(ASM_SND_STATE_PLAYING) : Playing )
118 * @param[in] mm_resource system resources will be used.
119 * @param[out] error_code specifies the error code
120 * @exception #ERR_asm_MSG_QUEUE_SND_ERROR - Is is failed to send to message queue.
123 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);
125 bool 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*));
128 * This function ask sound policy to ASM server.
130 * @return No return value
131 * @param[in] playing_sound playing sound event
132 * @param[in] request_sound request sound event
133 * @param[out] sound_policy Return sound case between playing sound and request sound
136 ASM_ask_sound_policy(ASM_sound_events_t playing_sound, ASM_sound_events_t request_sound, ASM_sound_cases_t *sound_policy) __attribute__((deprecated)) ;
139 ASM_change_callback(const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_cb_t callback, void* cb_data, int *error_code);