Revert manifest to default one
[framework/system/libsvi.git] / SLP_SVI_PG.h
1 /*
2  *  libsvi
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seokkyu Jang <seokkyu.jang@samsung.com>
7  * Contact: Sangil Yoon <si83.yoon@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 /**
24  *
25  * @ingroup     SLP_PG
26  * @defgroup    SVI_PG SVI
27 @{
28
29 @par SVI Programming Guide
30
31 <h1 class="pg">Brief Information</h1>
32 - Sound & Vibration UI
33 - Convenient API
34 - Header File : svi.h
35
36 <h1 class="pg"> Introduction</h1>
37 <h2 class="pg"> Purpose of this document</h2>
38 The purpose of this document is to describe how applications can use Sound and Vibration Interface Library APIs.\n
39 This document gives only programming guidelines to application engineers.
40
41 <h2 class="pg"> Scope</h2>
42 The scope of this document is limited to Samsung platform Sound and Vibration Interface Library API usage.
43
44 <h1 class="pg"> Architecture</h1>
45 <h2 class="pg"> Architecture overview</h2>
46 Sound and Vibration Interface Library (SVI) is responsible for playing simple sound and vibration.\n
47 SVI play sound using mm-sound library and play vibration with device framework.
48
49 @image html svi.png "SVI diagram" 
50
51 <h2 class="pg"> SLP Features</h2>
52 Sound and Vibration Interface Library has the following features:\n
53
54  - Play Sound
55         - It can play simple sound with predefined key.
56
57  - Play Vibration
58         - It can play simple vibration with predefined key.
59
60 <h2 class="pg">API list and description</h2>
61  - int svi_init(int *handle)
62         - Unload sound profile and status, and close haptic device.
63
64  - int svi_fini(int handle)
65         - Finalize audio ui library.
66         - Unload sound profile and status, and close haptic device.
67
68  - int svi_play_sound(int handle, sound_type sound_key)
69         - Play simple sound.
70
71  - int svi_play_vib(int handle, vibration_type vibration_key)
72         - Play simple vibration.
73
74  - int svi_play(int handle, vibration_type vibration_key, sound_type sound_key)
75         - Play simple sound and vibration.
76
77 <h1 class="pg">Programming with Sound & Vibration UI</h1>
78
79 <h2 class="pg">Defines</h2>
80 @code
81 #define SVI_SUCCESS     0
82 #define SVI_ERROR       -1
83 @endcode
84
85 <h2 class="pg">Functions</h2>
86 @code
87 int svi_init(int *handle)
88 int svi_fini(int handle)
89 int svi_play_sound(int handle, sound_type sound_key)
90 int svi_play_vib(int handle, vibration_type vibration_key)
91 int svi_play(int handle, vibration_type vibration_key, sound_type sound_key)
92 @endcode
93
94 <h2 class="pg">Example code</h2>
95 @code
96 #include <svi.h>
97
98 int r = 0;
99 int handle = 0;
100
101 r = svi_init(&handle);
102 if (r != SVI_SUCCESS){
103
104         printf("Cannot initialize svi.\n");     
105
106 } else {
107
108         r = svi_play (handle, SVI_VIB_TOUCH, SVI_SND_TOUCH1);
109         if (r != SVI_SUCCESS) {
110                 printf("Cannot play sound or vibration.\n");
111         }
112
113         r = svi_play_sound (handle, SVI_SND_TOUCH1);
114         if (r != SVI_SUCCESS) {
115                 printf("Cannot play sound.\n");
116         }
117
118         r = svi_play_vib (handle, SVI_VIB_TOUCH);
119         if (r != SVI_SUCCESS) {
120                 printf("Cannot play vibration.\n");
121         }
122
123         r = svi_fini(handle);
124         if (r != SVI_SUCCESS) {
125                 printf("Cannot close svi.\n");  
126         }
127 }
128 @endcode
129
130 <h2 class="pg">Vibration IDs</h2>
131 @code
132         SVI_VIB_TOUCH_TOUCH
133         SVI_VIB_TOUCH_SIP
134         SVI_VIB_TOUCH_HOLD
135         SVI_VIB_TOUCH_MULTI_TAP
136         SVI_VIB_TOUCH_HW_TAP
137         SVI_VIB_TOUCH_HW_HOLD
138         SVI_VIB_TOUCH_KEY00
139         SVI_VIB_TOUCH_KEY01
140         SVI_VIB_TOUCH_KEY02
141         SVI_VIB_TOUCH_KEY03
142         SVI_VIB_TOUCH_KEY04
143         SVI_VIB_TOUCH_KEY05
144         SVI_VIB_TOUCH_KEY06
145         SVI_VIB_TOUCH_KEY07
146         SVI_VIB_TOUCH_KEY08
147         SVI_VIB_TOUCH_KEY09
148         SVI_VIB_TOUCH_KEY_STAR
149         SVI_VIB_TOUCH_KEY_SHARP
150         SVI_VIB_NOTIFICATION_INCOMING_CALL01
151         SVI_VIB_NOTIFICATION_INCOMING_CALL02
152         SVI_VIB_NOTIFICATION_INCOMING_CALL03
153         SVI_VIB_NOTIFICATION_MESSAGE
154         SVI_VIB_NOTIFICATION_EMAIL
155         SVI_VIB_NOTIFICATION_WAKEUP
156         SVI_VIB_NOTIFICATION_SCHEDULE
157         SVI_VIB_NOTIFICATION_TIMER
158         SVI_VIB_NOTIFICATION_GENERAL
159         SVI_VIB_OPERATION_POWER_ON
160         SVI_VIB_OPERATION_POWER_OFF
161         SVI_VIB_OPERATION_CHARGERCONN
162         SVI_VIB_OPERATION_FULLCHARGED
163         SVI_VIB_OPERATION_LOWBATT
164         SVI_VIB_OPERATION_LOCK
165         SVI_VIB_OPERATION_UNLOCK
166         SVI_VIB_OPERATION_CALLCONNECT
167         SVI_VIB_OPERATION_DISCALLCONNECT
168         SVI_VIB_OPERATION_MINUTEMINDER
169         SVI_VIB_OPERATION_VIBRATION
170         SVI_VIB_OPERATION_NEWCHAT
171         SVI_VIB_OPERATION_SENDCHAT
172         SVI_VIB_OPERATION_ONOFFSLIDER
173         SVI_VIB_OPERATION_SHUTTER
174 @endcode
175
176 <h2 class="pg">Sound IDs</h2>
177 @code
178         SVI_SND_TOUCH_TOUCH1
179         SVI_SND_TOUCH_TOUCH2
180         SVI_SND_TOUCH_TOUCH3
181         SVI_SND_TOUCH_SIP
182         SVI_SND_TOUCH_HOLD
183         SVI_SND_TOUCH_MULTI_TAP
184         SVI_SND_TOUCH_HW_TAP
185         SVI_SND_TOUCH_HW_HOLD
186         SVI_SND_TOUCH_KEY00
187         SVI_SND_TOUCH_KEY01
188         SVI_SND_TOUCH_KEY02
189         SVI_SND_TOUCH_KEY03
190         SVI_SND_TOUCH_KEY04
191         SVI_SND_TOUCH_KEY05
192         SVI_SND_TOUCH_KEY06
193         SVI_SND_TOUCH_KEY07
194         SVI_SND_TOUCH_KEY08
195         SVI_SND_TOUCH_KEY09
196         SVI_SND_TOUCH_KEY_STAR
197         SVI_SND_TOUCH_KEY_SHARP
198         SVI_SND_OPERATION_POWERON
199         SVI_SND_OPERATION_POWEROF
200         SVI_SND_OPERATION_CHARGERCONN
201         SVI_SND_OPERATION_FULLCHARGED
202         SVI_SND_OPERATION_LOWBATT
203         SVI_SND_OPERATION_LOCK
204         SVI_SND_OPERATION_UNLOCK
205         SVI_SND_OPERATION_CALLCONN
206         SVI_SND_OPERATION_CALLDISCONN
207         SVI_SND_OPERATION_MINUTE_MINDER
208         SVI_SND_OPERATION_VIBRATION
209         SVI_SND_OPERATION_NEWCHAT
210         SVI_SND_OPERATION_SENTCHAT
211         SVI_SND_OPERATION_ONOFFSLIDER
212         SVI_SND_OPERATION_SCRCAPTURE
213 @endcode
214
215 */
216
217 /**
218 @}
219 */