keysound: skip hard frequent request of keysound playback
[platform/core/multimedia/libmm-sound.git] / include / mm_sound_private.h
1 /*
2  * libmm-sound
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seungbae Shin <seungbae.shin@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 /**
23  * @file                mm_sound.h
24  * @brief               Application interface library for sound module.
25  * @date
26  * @version             Release
27  *
28  * Application interface library for sound module.
29  */
30
31 #ifndef __MM_SOUND_PRIVATE_H__
32 #define __MM_SOUND_PRIVATE_H__
33
34 #include <mm_types.h>
35 #include <mm_error.h>
36 #include <mm_sound.h>
37
38 #ifdef __cplusplus
39         extern "C" {
40 #endif
41
42 /**
43         @internal
44         @addtogroup SOUND_PRIVATE
45         @{
46
47 */
48
49 typedef struct {
50         const char *filename;                                   /**< filename to play */
51         int volume;                                                             /**< relative volume level */
52         int loop;                                                               /**< loop count */
53         mm_sound_stop_callback_func callback;   /**< callback function when playing is terminated */
54         void *data;                                                             /**< user data to callback */
55         int volume_config;                                              /**< volume type & volume gain */
56 } MMSoundPlayParam;
57
58 /**
59  * This function is to play key sound.
60  *
61  * @param       filename                [in] keytone filename to play
62  * @param       volume_config   [in] volume type & volume gain
63  *
64  * @return      This function returns MM_ERROR_NONE on success, or negative value
65  *                      with error code.
66  *
67  * @remark      This function provide low latency sound play (such as dialer keytone)
68  *                      using fixed spec of wave file (44100Hz, mono channel)
69  * @see         mm_sound_stop_keysound()
70  * @see         volume_type_t volume_gain_t
71  */
72 int mm_sound_play_keysound(const char *filename, int volume_config);
73
74 /**
75  * This function is to stop key sound.
76  *
77  * @param       filename                [in] keytone filename to stop (can be null if whole exist keytones need stops)
78  *
79  * @return      This function returns MM_ERROR_NONE on success, or negative value
80  *                      with error code.
81  *
82  * @see         mm_sound_play_keysound()
83  */
84 int mm_sound_stop_keysound(const char *filename);
85
86 int mm_sound_boot_ready(int timeout_sec);
87
88 int mm_sound_boot_play_sound(char* path);
89
90 /**
91         @}
92  */
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 #endif  /* __MM_SOUND_H__ */
99