[Release version 0.10.29]
[platform/core/multimedia/libmm-camcorder.git] / src / include / mm_camcorder_sound.h
1 /*
2  * libmm-camcorder
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jeongmo Yang <jm80.yang@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_CAMCORDER_SOUND_H__
23 #define __MM_CAMCORDER_SOUND_H__
24
25 /*=======================================================================================
26 | INCLUDE FILES                                                                         |
27 ========================================================================================*/
28
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /*=======================================================================================
35 | GLOBAL DEFINITIONS AND DECLARATIONS FOR CAMCORDER                                     |
36 ========================================================================================*/
37
38
39 /*=======================================================================================
40 | MACRO DEFINITIONS                                                                     |
41 ========================================================================================*/
42 #define _MMCAMCORDER_SAMPLE_SOUND_NAME_CAPTURE01 "camera-shutter-01"
43 #define _MMCAMCORDER_SAMPLE_SOUND_NAME_CAPTURE02 "camera-shutter-02"
44 #define _MMCAMCORDER_SAMPLE_SOUND_NAME_REC_START "recording-start"
45 #define _MMCAMCORDER_SAMPLE_SOUND_NAME_REC_STOP  "recording-stop"
46
47 /*=======================================================================================
48 | ENUM DEFINITIONS                                                                      |
49 ========================================================================================*/
50 typedef enum {
51         _MMCAMCORDER_SOUND_STATE_NONE,
52         _MMCAMCORDER_SOUND_STATE_INIT,
53         _MMCAMCORDER_SOUND_STATE_PLAYING,
54 } _MMCamcorderSoundState;
55
56 /*=======================================================================================
57 | STRUCTURE DEFINITIONS                                                                 |
58 ========================================================================================*/
59 /**
60  * Structure of sound info
61  */
62 typedef struct _SOUND_INFO {
63         /* mutex and cond */
64         GMutex play_mutex;
65         GCond play_cond;
66         GMutex open_mutex;
67         GCond open_cond;
68
69         /* state */
70         _MMCamcorderSoundState state;
71 } SOUND_INFO;
72
73 /*=======================================================================================
74 | CONSTANT DEFINITIONS                                                                  |
75 ========================================================================================*/
76
77
78 /*=======================================================================================
79 | GLOBAL FUNCTION PROTOTYPES                                                            |
80 ========================================================================================*/
81 gboolean _mmcamcorder_sound_init(MMHandleType handle);
82 gboolean _mmcamcorder_sound_play(MMHandleType handle, const char *sample_name, gboolean sync_play);
83 gboolean _mmcamcorder_sound_finalize(MMHandleType handle);
84
85 int _mmcamcorder_sound_solo_play(MMHandleType handle, const char *sample_name, gboolean sync_play);
86 void _mmcamcorder_sound_solo_play_wait(MMHandleType handle);
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92 #endif /* __MM_CAMCORDER_SOUND_H__ */