tizen 2.3 release
[apps/home/settings.git] / setting-common / include / setting-common-sound.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@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 #ifndef __SETTING_COMMON_SOUND__
22 #define __SETTING_COMMON_SOUND__
23
24 /**
25  * @brief Initialize function for tap sound playing
26  *
27  * @return #0 on success, else on failed
28  */
29 int  effect_playsound_init();
30 /**
31  * @brief Check whether system is in mute mode
32  *
33  * @return #1 on non-mute, 0 on mute
34  */
35 int effect_playsound_is_activated();
36
37 /**
38  * @brief Deinitialize function for tap sound playing
39  *
40  */
41 void effect_playsound_close();
42
43 /**
44  * @brief Play tap sound
45  *
46  * This function is used to play system tap sound.
47  * You may customized some edc for special layouts,
48  * sometimes, you can insert tap sound effect code in the edc,
49  * but it was complex and you should supply tap sound resource which is
50  * wholely same as the system tap sound,this has potential issues,
51  * that is when system sound is changed, you should change your edc
52  * resource too,it's not smart.
53  *
54  * The another known problem is if you add sound effect code in your edc,
55  * the the life of playing is limited by the life of layout.
56  * eg, you have a popup which has 2 customized icons in its content, the icon
57  * should be clickable. The following requirements was demaned too:
58  *   1.view will be changed to another if you click any icon of the popup
59  *   2.the popup will be disappeared after you click any icon of the popup
60  * if you add the sound code in edc, the normally case is the tap sound is not
61  * played in time before the popup was destroyed, and once popup was destroyed,
62  * the edc sound code won't work because the layout was destoryed in that time
63  *
64  * Use effect_playsound_play() will block the cpu until tap Sound was played,
65  * Only after that the cpu can do popup destoryed
66  *
67  */
68 void effect_playsound_play();
69
70 #endif /*__SETTING_COMMON_SOUND__ */
71