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 "mm_sound_mgr_focus_ipc.h"
32 FOCUS_COMMAND_RELEASE,
33 FOCUS_COMMAND_ACQUIRE,
38 FOCUS_TYPE_PLAYBACK = 1,
45 FOCUS_STATUS_DEACTIVATED,
46 FOCUS_STATUS_ACTIVATED_PLAYBACK,
47 FOCUS_STATUS_ACTIVATED_CAPTURE,
48 FOCUS_STATUS_ACTIVATED_BOTH,
54 char stream_type[MAX_STREAM_TYPE_LEN];
55 char ext_info[MM_SOUND_NAME_NUM];
56 focus_type_e request_type;
62 /* It will be removed when the session concept is completely left out*/
64 } _mm_sound_mgr_focus_param_t;
66 typedef struct _taken_by_id
71 } _focus_taken_by_id_t;
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];
88 /* These will be removed when the session concept is completely left out*/
90 bool reacquisition_with_released_state;
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);
105 #endif /* __MM_SOUND_MGR_FOCUS_H__ */