Adapt session interrupt callback to focus callback
[platform/core/multimedia/libmm-sound.git] / include / mm_sound_focus.h
1 /*
2  * libmm-sound
3  *
4  * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Sangchul Lee <sc11.lee@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_focus.h
24  * @brief               Application interface library for sound module.
25  * @date
26  *
27  * Application interface library for sound module.
28  */
29
30 #ifndef __MM_SOUND_FOCUS_H__
31 #define __MM_SOUND_FOCUS_H__
32
33 #ifdef __cplusplus
34         extern "C" {
35 #endif
36
37 typedef enum {
38         FOCUS_IS_RELEASED,
39         FOCUS_IS_ACQUIRED,
40 } mm_sound_focus_state_e;
41
42 typedef enum {
43         FOCUS_FOR_PLAYBACK = 1,
44         FOCUS_FOR_CAPTURE,
45         FOCUS_FOR_BOTH,
46 } mm_sound_focus_type_e;
47
48 int mm_sound_focus_get_id(int *id);
49
50 typedef void (*mm_sound_focus_changed_cb) (int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data);
51 int mm_sound_register_focus(int id, const char *stream_type, mm_sound_focus_changed_cb callback, void *user_data);
52 int mm_sound_unregister_focus(int id);
53 int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info);
54 int mm_sound_release_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info);
55
56 typedef void (*mm_sound_focus_changed_watch_cb) (int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data);
57 int mm_sound_set_focus_watch_callback(mm_sound_focus_type_e focus_type, mm_sound_focus_changed_watch_cb callback, void *user_data, int *id);
58 int mm_sound_unset_focus_watch_callback(int id);
59
60 typedef void (*mm_sound_focus_session_interrupt_cb) (mm_sound_focus_state_e state, const char *reason_for_change, bool is_wcb, void *user_data);
61 int mm_sound_focus_set_session_interrupt_callback(mm_sound_focus_session_interrupt_cb callback, void *user_data);
62 int mm_sound_focus_unset_session_interrupt_callback(void);
63
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif  /* __MM_SOUND_FOCUS_H__ */
70