4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seokkyu Jang <seokkyu.jang@samsung.com>
7 * Contact: Sangil Yoon <si83.yoon@samsung.com>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
26 * @defgroup SVI_PG SVI
29 @par SVI Programming Guide
31 <h1 class="pg">Brief Information</h1>
32 - Sound & Vibration UI
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.
41 <h2 class="pg"> Scope</h2>
42 The scope of this document is limited to Samsung platform Sound and Vibration Interface Library API usage.
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.
49 @image html svi.png "SVI diagram"
51 <h2 class="pg"> SLP Features</h2>
52 Sound and Vibration Interface Library has the following features:\n
55 - It can play simple sound with predefined key.
58 - It can play simple vibration with predefined key.
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.
64 - int svi_fini(int handle)
65 - Finalize audio ui library.
66 - Unload sound profile and status, and close haptic device.
68 - int svi_play_sound(int handle, sound_type sound_key)
71 - int svi_play_vib(int handle, vibration_type vibration_key)
72 - Play simple vibration.
74 - int svi_play(int handle, vibration_type vibration_key, sound_type sound_key)
75 - Play simple sound and vibration.
77 <h1 class="pg">Programming with Sound & Vibration UI</h1>
79 <h2 class="pg">Defines</h2>
85 <h2 class="pg">Functions</h2>
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)
94 <h2 class="pg">Example code</h2>
101 r = svi_init(&handle);
102 if (r != SVI_SUCCESS){
104 printf("Cannot initialize svi.\n");
108 r = svi_play (handle, SVI_VIB_TOUCH, SVI_SND_TOUCH1);
109 if (r != SVI_SUCCESS) {
110 printf("Cannot play sound or vibration.\n");
113 r = svi_play_sound (handle, SVI_SND_TOUCH1);
114 if (r != SVI_SUCCESS) {
115 printf("Cannot play sound.\n");
118 r = svi_play_vib (handle, SVI_VIB_TOUCH);
119 if (r != SVI_SUCCESS) {
120 printf("Cannot play vibration.\n");
123 r = svi_fini(handle);
124 if (r != SVI_SUCCESS) {
125 printf("Cannot close svi.\n");
130 <h2 class="pg">Vibration IDs</h2>
135 SVI_VIB_TOUCH_MULTI_TAP
137 SVI_VIB_TOUCH_HW_HOLD
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
176 <h2 class="pg">Sound IDs</h2>
183 SVI_SND_TOUCH_MULTI_TAP
185 SVI_SND_TOUCH_HW_HOLD
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