c4c6e1663daccb914aa13096422b0e1b1cb0a76e
[platform/core/multimedia/libmm-sound.git] / include / mm_sound_focus_socket.h
1 /*
2  * libmm-sound
3  *
4  * Copyright (c) 2017 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_FOCUS_SOCKET_H__
23 #define __MM_SOUND_FOCUS_SOCKET_H__
24
25 #ifdef __cplusplus
26         extern "C" {
27 #endif
28
29 #include "include/mm_sound.h"
30 #include "include/mm_sound_focus.h"
31
32 #define FOCUS_SERVER_SOCK "/tmp/.focus_server.socket"
33 #define MAX_ERROR_LEN 64
34
35 typedef struct {
36         char func_name[MM_SOUND_NAME_NUM];
37         int pid;
38         int handle_id;
39         mm_sound_focus_type_e focus_type;
40         int option;
41         char ext_info[MM_SOUND_NAME_NUM];
42         bool is_in_thread;                 /* Called within focus callback thread */
43         bool is_for_session;               /* will be removed when the session concept is completely left out*/
44 } _mm_sound_mgr_focus_socket_param_t;
45
46 /* Function names */
47 #define FOCUS_FUNC_NAME_ACQUIRE          "AcquireFocus"
48 #define FOCUS_FUNC_NAME_RELEASE          "ReleaseFocus"
49
50 /* Error defines */
51 #define FOCUS_ERROR_NONE                 "error_none"
52 #define FOCUS_ERROR_INVALID_PARAMETER    "error_invalid_parameter"
53 #define FOCUS_ERROR_POLICY               "error_policy"
54 #define FOCUS_ERROR_INTERNAL             "error_internal"
55 #define FOCUS_ERROR_INVALID_STATE        "error_invalid_state"
56
57 int mm_sound_focus_socket_acquire(int instance, int id, mm_sound_focus_type_e focus_type, int option, const char *ext_info, bool is_in_thread, bool is_for_session);
58 int mm_sound_focus_socket_release(int instance, int id, mm_sound_focus_type_e focus_type, int option, const char *ext_info, bool is_in_thread, bool is_for_session);
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64 #endif  /* __MM_SOUND_FOCUS_SOCKET_H__ */
65