Remove unused headers and functions
[platform/core/multimedia/libmm-sound.git] / focus_server / include / mm_sound_mgr_focus.h
1 /*
2  * libmm-sound
3  *
4  * Copyright (c) 2000 - 2015 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 #ifndef __MM_SOUND_MGR_FOCUS_H__
23 #define __MM_SOUND_MGR_FOCUS_H__
24
25 #include "../include/mm_sound.h"
26 #include "../include/mm_sound_focus.h"
27 #include "../include/mm_sound_stream.h"
28 #include "mm_sound_mgr_focus_ipc.h"
29
30 typedef enum
31 {
32         FOCUS_COMMAND_RELEASE,
33         FOCUS_COMMAND_ACQUIRE,
34 } focus_command_e;
35
36 typedef enum
37 {
38         FOCUS_TYPE_PLAYBACK = 1,
39         FOCUS_TYPE_CAPTURE,
40         FOCUS_TYPE_BOTH,
41 } focus_type_e;
42
43 typedef enum
44 {
45         FOCUS_STATUS_DEACTIVATED,
46         FOCUS_STATUS_ACTIVATED_PLAYBACK,
47         FOCUS_STATUS_ACTIVATED_CAPTURE,
48         FOCUS_STATUS_ACTIVATED_BOTH,
49 } focus_status_e;
50
51 typedef struct {
52         int pid;
53         int handle_id;
54         char stream_type[MAX_STREAM_TYPE_LEN];
55         char ext_info[MM_SOUND_NAME_NUM];
56         focus_type_e request_type;
57         int option;
58         void *callback;
59         void *cbdata;
60         bool reacquisition;
61
62         /* It will be removed when the session concept is completely left out*/
63         bool is_for_session;
64 } _mm_sound_mgr_focus_param_t;
65
66 typedef struct _taken_by_id
67 {
68         int pid;
69         int handle_id;
70         bool by_session;
71 } _focus_taken_by_id_t;
72
73 typedef struct {
74         int pid;
75         int handle_id;
76         int priority;
77         bool is_for_watch;
78         char stream_type[MAX_STREAM_TYPE_LEN];
79         char ext_info[NUM_OF_STREAM_IO_TYPE][MM_SOUND_NAME_NUM];
80         int option[NUM_OF_STREAM_IO_TYPE];
81         focus_status_e status;
82         _focus_taken_by_id_t taken_by_id[NUM_OF_STREAM_IO_TYPE];
83         _focus_taken_by_id_t taken_backup[NUM_OF_STREAM_IO_TYPE];
84         void *callback;
85         void *cbdata;
86         bool reacquisition;
87
88         /* These will be removed when the session concept is completely left out*/
89         bool is_for_session;
90         bool reacquisition_with_released_state;
91 } focus_node_t;
92
93 int MMSoundMgrFocusInit(void);
94 int MMSoundMgrFocusFini(void);
95 int mm_sound_mgr_focus_create_node (const _mm_sound_mgr_focus_param_t *param);
96 int mm_sound_mgr_focus_destroy_node (const _mm_sound_mgr_focus_param_t *param);
97 int mm_sound_mgr_focus_set_reacquisition (const _mm_sound_mgr_focus_param_t *param);
98 int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, int *option, char **ext_info);
99 int mm_sound_mgr_focus_request_acquire (const _mm_sound_mgr_focus_param_t *param);
100 int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param);
101 int mm_sound_mgr_focus_set_watch_cb (const _mm_sound_mgr_focus_param_t *param);
102 int mm_sound_mgr_focus_unset_watch_cb (const _mm_sound_mgr_focus_param_t *param);
103 int mm_sound_mgr_focus_emergent_exit(const _mm_sound_mgr_focus_param_t *param);
104
105 #endif /* __MM_SOUND_MGR_FOCUS_H__ */
106