Remove useless parameters(route_info, priority) regarding audio path routing since...
[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 #define MM_SOUND_VOLUME_CONFIG_TYPE(vol) (vol & 0x00FF)
50 #define MM_SOUND_VOLUME_CONFIG_GAIN(vol) (vol & 0xFF00)
51
52 typedef struct {
53         const char                      *filename;              /**< filename to play */
54         bool                            skip_session;   /**< skip session control */
55         int                                     volume;                 /**< relative volume level */
56         int                                     loop;                   /**< loop count */
57         mm_sound_stop_callback_func     callback;               /**< callback function when playing is terminated */
58         void                            *data;                  /**< user data to callback */
59         void                            *mem_ptr;               /**< memory buffer to play */
60         int                                     mem_size;               /**< size of memory buffer */
61         int                                     volume_config;  /**< volume type & volume gain */
62 } MMSoundPlayParam;
63
64 /**
65  * This function is to play system sound with specified parameters.
66  *
67  * @param       param           [in] Reference pointer to MMSoundPlayParam structure
68  * @param       handle  [out] Handle of sound play.
69  *
70  * @return      This function returns MM_ERROR_NONE on success, or negative value
71  *                      with error code.
72  * @remark      When the stop callback is set, it will be called when system sound is
73  *                      terminated. If mm_sound_stop_sound() is called apparently before
74  *                      system sound is terminated, stop_callback will not be called.
75  *                      This function can use various sound route path with mm_sound_set_path
76  * @see         mm_sound_stop_sound mm_sound_set_path
77  * @since               R1, 1.0
78  * @limo
79  */
80 int mm_sound_play_sound_ex(MMSoundPlayParam *param, int *handle);
81
82 int mm_sound_play_sound_with_stream_info(const char *filename, char *stream_type, int stream_id, unsigned int loop, mm_sound_stop_callback_func _completed_cb, void *data, int *handle);
83
84 /**
85  * This function is to play key sound.
86  *
87  * @param       filename                [in] keytone filename to play
88  * @param       volume_config   [in] Volume type & volume gain
89  *
90  * @return      This function returns MM_ERROR_NONE on success, or negative value
91  *                      with error code.
92  *
93  * @remark      This function provide low latency sound play (such as dialer keytone)
94  *                      using fixed spec of wave file (44100Hz, mono channel)
95  * @see         volume_type_t volume_gain_t mm_sound_volume_set_value
96  */
97 int mm_sound_play_keysound(const char *filename, int volume_config);
98
99 int mm_sound_boot_ready(int timeout_sec);
100
101 int mm_sound_boot_play_sound(char* path);
102
103 /**
104         @}
105  */
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif  /* __MM_SOUND_H__ */
112