4 * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Sangchul Lee <sc11.lee@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_MGR_FOCUS_H__
23 #define __MM_SOUND_MGR_FOCUS_H__
25 #include "../include/mm_sound.h"
26 #include "../include/mm_sound_focus.h"
27 #include "../include/mm_sound_stream.h"
28 #include "../include/mm_ipc.h"
29 #include "mm_sound_mgr_focus_ipc.h"
33 FOCUS_COMMAND_RELEASE,
34 FOCUS_COMMAND_ACQUIRE,
39 FOCUS_TYPE_PLAYBACK = 1,
46 FOCUS_STATUS_DEACTIVATED,
47 FOCUS_STATUS_ACTIVATED_PLAYBACK,
48 FOCUS_STATUS_ACTIVATED_CAPTURE,
49 FOCUS_STATUS_ACTIVATED_BOTH,
55 char stream_type[MAX_STREAM_TYPE_LEN];
56 char ext_info[MM_SOUND_NAME_NUM];
57 focus_type_e request_type;
63 /* It will be removed when the session concept is completely left out*/
65 } _mm_sound_mgr_focus_param_t;
67 typedef struct _taken_by_id
72 } _focus_taken_by_id_t;
79 char stream_type[MAX_STREAM_TYPE_LEN];
80 char ext_info[NUM_OF_STREAM_IO_TYPE][MM_SOUND_NAME_NUM];
81 int option[NUM_OF_STREAM_IO_TYPE];
82 focus_status_e status;
83 _focus_taken_by_id_t taken_by_id[NUM_OF_STREAM_IO_TYPE];
84 _focus_taken_by_id_t taken_backup[NUM_OF_STREAM_IO_TYPE];
89 /* These will be removed when the session concept is completely left out*/
91 bool reacquisition_with_released_state;
94 int MMSoundMgrFocusInit(void);
95 int MMSoundMgrFocusFini(void);
96 int mm_sound_mgr_focus_create_node (const _mm_sound_mgr_focus_param_t *param);
97 int mm_sound_mgr_focus_destroy_node (const _mm_sound_mgr_focus_param_t *param);
98 int mm_sound_mgr_focus_set_reacquisition (const _mm_sound_mgr_focus_param_t *param);
99 int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, int *option, char **ext_info);
100 int mm_sound_mgr_focus_request_acquire (const _mm_sound_mgr_focus_param_t *param);
101 int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param);
102 int mm_sound_mgr_focus_set_watch_cb (const _mm_sound_mgr_focus_param_t *param);
103 int mm_sound_mgr_focus_unset_watch_cb (const _mm_sound_mgr_focus_param_t *param);
104 int mm_sound_mgr_focus_emergent_exit(const _mm_sound_mgr_focus_param_t *param);
106 #endif /* __MM_SOUND_MGR_FOCUS_H__ */