summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--LICENSE (renamed from LICENSE.APLv2)0
-rw-r--r--include/feedback-file.h141
-rw-r--r--include/feedback-str.h84
-rw-r--r--include/feedback.h22
-rw-r--r--include/xmlparser.h44
-rw-r--r--packaging/libfeedback.spec73
-rw-r--r--packaging/svi-data-sdk.manifest8
-rw-r--r--src/feedback-internal.c247
-rw-r--r--src/feedback.c38
-rwxr-xr-x[-rw-r--r--]src/svi.c0
-rw-r--r--src/xmlparser.c160
-rwxr-xr-x[-rw-r--r--]svi.pc.in0
-rwxr-xr-xsvidata/svi/haptic/default/Basic_call.thtbin0 -> 106 bytes
-rwxr-xr-xsvidata/svi/haptic/touch/touch.thtbin0 -> 38 bytes
-rwxr-xr-xsvidata/svi/sound/operation/call_connect.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/call_disconnect.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/charger_connection.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/fully_charged.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/list_reorder.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/lock.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/low_battery.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/minute_minder.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/power_on.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/shutter.wavbin0 -> 149108 bytes
-rwxr-xr-xsvidata/svi/sound/operation/slider_sweep.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/unlock.wavbin0 -> 27644 bytes
-rwxr-xr-xsvidata/svi/sound/operation/volume_control.wavbin0 -> 7974 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key0.wavbin0 -> 9064 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key1.wavbin0 -> 9000 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key2.wavbin0 -> 8968 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key3.wavbin0 -> 9000 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key4.wavbin0 -> 8976 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key5.wavbin0 -> 8936 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key6.wavbin0 -> 8976 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key7.wavbin0 -> 8964 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key8.wavbin0 -> 9000 bytes
-rwxr-xr-xsvidata/svi/sound/touch/key9.wavbin0 -> 8968 bytes
-rwxr-xr-xsvidata/svi/sound/touch/keyasterisk.wavbin0 -> 9000 bytes
-rwxr-xr-xsvidata/svi/sound/touch/keysharp.wavbin0 -> 9000 bytes
-rwxr-xr-xsvidata/svi/sound/touch/sip.wavbin0 -> 8832 bytes
-rwxr-xr-xsvidata/svi/sound/touch/sip_backspace.wavbin0 -> 8832 bytes
-rwxr-xr-xsvidata/svi/sound/touch/touch.wavbin0 -> 7974 bytes
-rw-r--r--svidata/svi/vibration.xml205
44 files changed, 866 insertions, 168 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce62db9..ab3a37b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,9 +7,13 @@ SET(LIBDIR "\${prefix}/lib")
SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
SET(VERSION 0.1.4)
+SET(SVI_DATA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/svidata)
+SET(SVI_DATA_DIRS ${SVI_DATA_PATH}/svi)
+
SET(SRCS
src/feedback.c
- src/feedback-internal.c)
+ src/feedback-internal.c
+ src/xmlparser.c)
SET(HEADERS
SLP_FEEDBACK_PG.h
@@ -25,7 +29,7 @@ SET(SVI_HEADERS
SET(SVI_SRCS
src/svi.c)
-SET(DEPENDENTS "vconf haptic mm-keysound dlog")
+SET(DEPENDENTS "vconf haptic mm-keysound dlog libxml-2.0 glib-2.0")
SET(PC_DEPENDENTS "capi-base-common")
SET(PC_NAME ${PROJECT_NAME})
@@ -68,6 +72,10 @@ FOREACH(hfile ${SVI_HEADERS})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${SVI_NAME})
ENDFOREACH(hfile)
+FOREACH(svidatadir ${SVI_DATA_DIRS})
+ INSTALL(DIRECTORY ${svidatadir} DESTINATION share)
+ENDFOREACH(svidatadir)
+
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
INSTALL(TARGETS ${SVI_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
diff --git a/LICENSE.APLv2 b/LICENSE
index a06208b..a06208b 100644
--- a/LICENSE.APLv2
+++ b/LICENSE
diff --git a/include/feedback-file.h b/include/feedback-file.h
index b86b28d..a6dba6b 100644
--- a/include/feedback-file.h
+++ b/include/feedback-file.h
@@ -19,39 +19,39 @@
#ifndef __FEEDBACK_FILE_H__
#define __FEEDBACK_FILE_H__
-#define FEEDBACK_DATA_DIR "/opt/share/svi/"
-#define FEEDBACK_ORIGIN_DATA_DIR "/usr/share/svi/"
+#define FEEDBACK_DATA_DIR "/opt/share/svi"
+#define FEEDBACK_ORIGIN_DATA_DIR "/usr/share/svi"
-#define FEEDBACK_SOUND_DIR FEEDBACK_DATA_DIR"sound/"
-#define FEEDBACK_SOUND_TOUCH_DIR FEEDBACK_SOUND_DIR"touch/"
-#define FEEDBACK_SOUND_OPER_DIR FEEDBACK_SOUND_DIR"operation/"
+#define FEEDBACK_SOUND_DIR FEEDBACK_DATA_DIR"/sound"
+#define FEEDBACK_SOUND_TOUCH_DIR FEEDBACK_SOUND_DIR"/touch"
+#define FEEDBACK_SOUND_OPER_DIR FEEDBACK_SOUND_DIR"/operation"
-#define FEEDBACK_HAPTIC_DIR FEEDBACK_DATA_DIR"haptic/"
-#define FEEDBACK_HAPTIC_TOUCH_DIR FEEDBACK_HAPTIC_DIR"touch/"
-#define FEEDBACK_HAPTIC_OPER_DIR FEEDBACK_HAPTIC_DIR"operation/"
-#define FEEDBACK_HAPTIC_NOTI_DIR FEEDBACK_HAPTIC_DIR"notification/"
-#define FEEDBACK_HAPTIC_DEFAULT_DIR FEEDBACK_HAPTIC_DIR"default/"
+#define FEEDBACK_HAPTIC_DIR FEEDBACK_DATA_DIR"/haptic"
+#define FEEDBACK_HAPTIC_TOUCH_DIR FEEDBACK_HAPTIC_DIR"/touch"
+#define FEEDBACK_HAPTIC_OPER_DIR FEEDBACK_HAPTIC_DIR"/operation"
+#define FEEDBACK_HAPTIC_NOTI_DIR FEEDBACK_HAPTIC_DIR"/notification"
+#define FEEDBACK_HAPTIC_DEFAULT_DIR FEEDBACK_HAPTIC_DIR"/default"
const char* snd_file[] = {
/* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */
- FEEDBACK_SOUND_TOUCH_DIR"touch.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/touch.wav",
/* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */
- FEEDBACK_SOUND_TOUCH_DIR"sip.wav",
- FEEDBACK_SOUND_TOUCH_DIR"sip_backspace.wav",
- FEEDBACK_SOUND_TOUCH_DIR"sip.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/sip.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/sip_backspace.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/sip.wav",
/* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */
- FEEDBACK_SOUND_TOUCH_DIR"key0.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key1.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key2.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key3.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key4.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key5.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key6.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key7.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key8.wav",
- FEEDBACK_SOUND_TOUCH_DIR"key9.wav",
- FEEDBACK_SOUND_TOUCH_DIR"keyasterisk.wav",
- FEEDBACK_SOUND_TOUCH_DIR"keysharp.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key0.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key1.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key2.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key3.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key4.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key5.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key6.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key7.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key8.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/key9.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/keyasterisk.wav",
+ FEEDBACK_SOUND_TOUCH_DIR"/keysharp.wav",
/* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */
NULL,
/* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */
@@ -87,39 +87,38 @@ const char* snd_file[] = {
NULL,
/* OPERATION : POWER ON/OFF */
- FEEDBACK_SOUND_OPER_DIR"power_on.wav",
+ FEEDBACK_SOUND_OPER_DIR"/power_on.wav",
NULL,
/* OPERATION : CHARGECONN */
- FEEDBACK_SOUND_OPER_DIR"charger_connection.wav",
+ FEEDBACK_SOUND_OPER_DIR"/charger_connection.wav",
/* OPERATION : CHARGECONN ALERT ON CALL */
- FEEDBACK_SOUND_OPER_DIR"charger_connection.wav",
+ FEEDBACK_SOUND_OPER_DIR"/charger_connection.wav",
/* OPERATION : FULLCHAREGED */
- FEEDBACK_SOUND_OPER_DIR"fully_charged.wav",
+ FEEDBACK_SOUND_OPER_DIR"/fully_charged.wav",
/* OPERATION : FULLCHAREGED ALERT ON CALL */
- FEEDBACK_SOUND_OPER_DIR"fully_charged.wav",
+ FEEDBACK_SOUND_OPER_DIR"/fully_charged.wav",
/* OPERATION : LOW BATTERY */
- FEEDBACK_SOUND_OPER_DIR"low_battery.wav",
+ FEEDBACK_SOUND_OPER_DIR"/low_battery.wav",
/* OPERATION : LOW BATTERY ALERT ON CALL */
- FEEDBACK_SOUND_OPER_DIR"low_battery.wav",
+ FEEDBACK_SOUND_OPER_DIR"/low_battery.wav",
/* OPERATION : LOCK/UNLOCK */
- FEEDBACK_SOUND_OPER_DIR"lock.wav",
- FEEDBACK_SOUND_OPER_DIR"unlock.wav",
+ FEEDBACK_SOUND_OPER_DIR"/lock.wav",
+ FEEDBACK_SOUND_OPER_DIR"/unlock.wav",
/* OPERATION : CALL CONNECT/ DISCONNECT */
- FEEDBACK_SOUND_OPER_DIR"call_connect.wav",
- FEEDBACK_SOUND_OPER_DIR"call_disconnect.wav",
+ FEEDBACK_SOUND_OPER_DIR"/call_connect.wav",
+ FEEDBACK_SOUND_OPER_DIR"/call_disconnect.wav",
/* OPERATION : MINUTE MINDER */
- FEEDBACK_SOUND_OPER_DIR"minute_minder.wav",
+ FEEDBACK_SOUND_OPER_DIR"/minute_minder.wav",
/* OPERATION : VIBRATION */
NULL,
/* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */
- FEEDBACK_SOUND_OPER_DIR"shutter.wav",
+ FEEDBACK_SOUND_OPER_DIR"/shutter.wav",
/* OPERATION : LIST RE-ORDER */
- FEEDBACK_SOUND_OPER_DIR"list_reorder.wav",
+ FEEDBACK_SOUND_OPER_DIR"/list_reorder.wav",
/* OPERATION : LIST SLIDER */
- FEEDBACK_SOUND_OPER_DIR"slider_sweep.wav",
+ FEEDBACK_SOUND_OPER_DIR"/slider_sweep.wav",
/* OPERATION : VOLUME KEY */
- FEEDBACK_SOUND_OPER_DIR"volume_control.wav",
-
+ FEEDBACK_SOUND_OPER_DIR"/volume_control.wav",
};
const char* haptic_file[] = {
@@ -143,64 +142,64 @@ const char* haptic_file[] = {
NULL,
NULL,
/* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */
- FEEDBACK_HAPTIC_TOUCH_DIR"touch.tht",
+ FEEDBACK_HAPTIC_TOUCH_DIR"/touch.tht",
/* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */
- FEEDBACK_HAPTIC_TOUCH_DIR"touch.tht",
+ FEEDBACK_HAPTIC_TOUCH_DIR"/touch.tht",
/* TOUCH : H/W OR SOFT TOUCH : TAP */
NULL,
/* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */
NULL,
/* NOTIFICATION : INCOMING : MESSAGE */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : INCOMING : MESSAGE ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : INCOMING : EMAIL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : INCOMING : EMAIL ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : ALARM : WAKEUP */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : ALARM : WAKEUP ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : ALARM : SCHEDULE */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : ALARM : SCHEDULE ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : ALARM : TIMER */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : ALARM : TIMER ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : POWER ON/OFF */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : CHARGECONN */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : CHARGECONN ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : FULLCHAREGED */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : FULLCHAREGED ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : LOW BATTERY */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : LOW BATTERY ALERT ON CALL */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : LOCK/UNLOCK */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : CALL CONNECT/ DISCONNECT */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : MINUTE MINDER */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : VIBRATION */
- FEEDBACK_HAPTIC_DEFAULT_DIR"Basic_call.tht",
+ FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht",
/* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */
NULL,
/* OPERATION : LIST RE-ORDER */
diff --git a/include/feedback-str.h b/include/feedback-str.h
new file mode 100644
index 0000000..0e41857
--- /dev/null
+++ b/include/feedback-str.h
@@ -0,0 +1,84 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __FEEDBACK_STR_H__
+#define __FEEDBACK_STR_H__
+
+static const char *str_type[] =
+{
+ "FEEDBACK_TYPE_NONE",
+ "FEEDBACK_TYPE_SOUND",
+ "FEEDBACK_TYPE_VIBRATION",
+ "FEEDBACK_TYPE_END",
+};
+
+static const char *str_pattern[] =
+{
+ "FEEDBACK_PATTERN_TAP",
+ "FEEDBACK_PATTERN_SIP",
+ "FEEDBACK_PATTERN_SIP_BACKSPACE",
+ "FEEDBACK_PATTERN_MAX_CHARACTER",
+ "FEEDBACK_PATTERN_KEY0",
+ "FEEDBACK_PATTERN_KEY1",
+ "FEEDBACK_PATTERN_KEY2",
+ "FEEDBACK_PATTERN_KEY3",
+ "FEEDBACK_PATTERN_KEY4",
+ "FEEDBACK_PATTERN_KEY5",
+ "FEEDBACK_PATTERN_KEY6",
+ "FEEDBACK_PATTERN_KEY7",
+ "FEEDBACK_PATTERN_KEY8",
+ "FEEDBACK_PATTERN_KEY9",
+ "FEEDBACK_PATTERN_KEY_STAR",
+ "FEEDBACK_PATTERN_KEY_SHARP",
+ "FEEDBACK_PATTERN_HOLD",
+ "FEEDBACK_PATTERN_MULTI_TAP",
+ "FEEDBACK_PATTERN_HW_TAP",
+ "FEEDBACK_PATTERN_HW_HOLD",
+ "FEEDBACK_PATTERN_MESSAGE",
+ "FEEDBACK_PATTERN_MESSAGE_ON_CALL",
+ "FEEDBACK_PATTERN_EMAIL",
+ "FEEDBACK_PATTERN_EMAIL_ON_CALL",
+ "FEEDBACK_PATTERN_WAKEUP",
+ "FEEDBACK_PATTERN_WAKEUP_ON_CALL",
+ "FEEDBACK_PATTERN_SCHEDULE",
+ "FEEDBACK_PATTERN_SCHEDULE_ON_CALL",
+ "FEEDBACK_PATTERN_TIMER",
+ "FEEDBACK_PATTERN_TIMER_ON_CALL",
+ "FEEDBACK_PATTERN_GENERAL",
+ "FEEDBACK_PATTERN_GENERAL_ON_CALL",
+ "FEEDBACK_PATTERN_POWERON",
+ "FEEDBACK_PATTERN_POWEROFF",
+ "FEEDBACK_PATTERN_CHARGERCONN",
+ "FEEDBACK_PATTERN_CHARGERCONN_ON_CALL",
+ "FEEDBACK_PATTERN_FULLCHARGED",
+ "FEEDBACK_PATTERN_FULLCHARGED_ON_CALL",
+ "FEEDBACK_PATTERN_LOWBATT",
+ "FEEDBACK_PATTERN_LOWBATT_ON_CALL",
+ "FEEDBACK_PATTERN_LOCK",
+ "FEEDBACK_PATTERN_UNLOCK",
+ "FEEDBACK_PATTERN_CALLCONNECT",
+ "FEEDBACK_PATTERN_DISCALLCONNECT",
+ "FEEDBACK_PATTERN_MINUTEMINDER",
+ "FEEDBACK_PATTERN_VIBRATION",
+ "FEEDBACK_PATTERN_SHUTTER",
+ "FEEDBACK_PATTERN_LIST_REORDER",
+ "FEEDBACK_PATTERN_SLIDER_SWEEP",
+ "FEEDBACK_PATTERN_VOLUME_KEY",
+};
+
+#endif //__FEEDBACK_STR_H__
diff --git a/include/feedback.h b/include/feedback.h
index 787cea6..ca224a0 100644
--- a/include/feedback.h
+++ b/include/feedback.h
@@ -150,6 +150,28 @@ int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern);
int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, char **path);
/**
+ * @brief Sets the new file path of resource for the given feedback type and pattern.
+ *
+ * @details
+ * Depending on the type of each pattern resouorce has a different format. \n
+ * Currently, System supports two pattern types. \n
+ * #FEEDBACK_TYPE_SOUND type uses .wav format. \n
+ * #FEEDBACK_TYPE_VIBRATION type uses .ivt format. \n
+ * If the given pattern doesn't have a file for the type, @a path will return NULL.
+ *
+ * @param[in] type The pattern type
+ * @param[in] pattern The pre-defined pattern
+ * @param[in] path The new file path of resource for feedback type and pattern
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #FEEDBACK_ERROR_NONE Successful
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation failed
+ *
+ */
+int feedback_set_resource_path(feedback_type_e type, feedback_pattern_e pattern, char *path);
+
+/**
* @}
*/
diff --git a/include/xmlparser.h b/include/xmlparser.h
new file mode 100644
index 0000000..cb92b06
--- /dev/null
+++ b/include/xmlparser.h
@@ -0,0 +1,44 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __XMLPARSER_H__
+#define __XMLPARSER_H__
+
+#include <libxml/parser.h>
+
+struct xmlData {
+ char *label;
+ unsigned char *data;
+};
+
+enum xmlType {
+ XML_LABEL = 0,
+ XML_DATA,
+};
+
+#define VIBRATION "vibration"
+
+xmlDocPtr xml_open(const char *xml);
+void xml_close(xmlDocPtr doc);
+
+xmlNodePtr xml_find(xmlDocPtr doc, const xmlChar* expr);
+struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur);
+int xml_save(xmlDocPtr doc, const char *path);
+void xml_free(struct xmlData* data);
+
+#endif //__XMLPARSER_H__
diff --git a/packaging/libfeedback.spec b/packaging/libfeedback.spec
index cd1fa55..525490f 100644
--- a/packaging/libfeedback.spec
+++ b/packaging/libfeedback.spec
@@ -1,12 +1,13 @@
Name: libfeedback
Summary: Feedback library
-Version: 0.1.2
-Release: 21
+Version: 0.1.3
+Release: 0
Group: System/Libraries
License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
Source1: libsvi.manifest
source2: libfeedback.manifest
+source3: svi-data-sdk.manifest
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: cmake
@@ -14,6 +15,8 @@ BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(mm-keysound)
BuildRequires: pkgconfig(haptic)
+BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(capi-base-common)
%description
@@ -44,6 +47,13 @@ Requires: libsvi = %{version}-%{release}
%description -n libsvi-devel
SVI library (devel)
+%package -n svi-data
+Summary: svi resource package
+Group: Development/Libraries
+
+%description -n svi-data
+svi resource package
+
%prep
%setup -q
@@ -51,6 +61,7 @@ SVI library (devel)
%build
cp %{SOURCE1} .
cp %{SOURCE2} .
+cp %{SOURCE3} .
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
make
@@ -58,10 +69,51 @@ make
rm -rf %{buildroot}
%make_install
+mkdir -p %{buildroot}/opt/share/svi/sound/touch
+mkdir -p %{buildroot}/opt/share/svi/sound/operation
+mkdir -p %{buildroot}/opt/share/svi/haptic/default
+mkdir -p %{buildroot}/opt/share/svi/haptic/touch
+
%post -p /sbin/ldconfig
+%post -n svi-data
+ln -s %{_datadir}/svi/sound/touch/key0.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key1.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key2.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key3.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key4.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key5.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key6.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key7.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key8.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/key9.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/keyasterisk.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/keysharp.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/sip.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/sip_backspace.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/touch/touch.wav /opt/share/svi/sound/touch
+ln -s %{_datadir}/svi/sound/operation/call_connect.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/call_disconnect.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/charger_connection.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/fully_charged.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/list_reorder.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/lock.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/low_battery.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/minute_minder.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/power_on.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/shutter.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/slider_sweep.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/unlock.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/sound/operation/volume_control.wav /opt/share/svi/sound/operation
+ln -s %{_datadir}/svi/haptic/default/Basic_call.tht /opt/share/svi/haptic/default
+ln -s %{_datadir}/svi/haptic/touch/touch.tht /opt/share/svi/haptic/touch
+
%postun -p /sbin/ldconfig
+%postun -n svi-data
+rm -rf %{_datadir}/svi/
+rm -rf /opt/share/svi/
+
%files
%manifest libfeedback.manifest
%defattr(-,root,root,-)
@@ -84,11 +136,12 @@ rm -rf %{buildroot}
%{_libdir}/libsvi.so
%{_libdir}/pkgconfig/svi.pc
-%changelog
-* Mon Dec 10 2012 - Jae-young Hwang <j-zero.hwang@samsung.com>
-- Revise _feedback_play_vibration function for playing tht files.
-- Tag : libfeedback_0.1.2-17
-
-* Wed Nov 21 2012 - Jiyoung Yun <jy910.yun@samsung.com>
-- add FEEDBACK_PATTERN_MAX_CHARACTER enum
-- Tag : libfeedback_0.1.2-16
+%files -n svi-data
+%defattr(644,root,root,-)
+%{_datadir}/svi/*
+%defattr(666,app,app,-)
+%dir /opt/share/svi/sound/touch
+%dir /opt/share/svi/sound/operation
+%dir /opt/share/svi/haptic/default
+%dir /opt/share/svi/haptic/touch
+%manifest svi-data-sdk.manifest
diff --git a/packaging/svi-data-sdk.manifest b/packaging/svi-data-sdk.manifest
new file mode 100644
index 0000000..138f6e0
--- /dev/null
+++ b/packaging/svi-data-sdk.manifest
@@ -0,0 +1,8 @@
+<manifest>
+ <define>
+ <domain name="svi-data"/>
+ </define>
+ <request>
+ <domain name="svi-data"/>
+ </request>
+</manifest>
diff --git a/src/feedback-internal.c b/src/feedback-internal.c
index 8b73987..99329dd 100644
--- a/src/feedback-internal.c
+++ b/src/feedback-internal.c
@@ -33,17 +33,43 @@
#include "feedback.h"
#include "feedback-internal.h"
#include "feedback-file.h"
+#include "feedback-str.h"
#include "feedback-log.h"
+#include "xmlparser.h"
#define FEEDBACK_RETRY_CNT 1
#define MAX_FILE_PATH 512
-static int soundon = -1;
-static int noti_level = -1;
-static int vib_level = -1;
-static int sndstatus = -1;
-static int vibstatus = -1;
-static int callstatus = -1;
+#define DEFAULT_FEEDBACK_HANDLE 0x0F
+
+#define VIBRATION_XML "/usr/share/svi/vibration.xml"
+
+typedef struct {
+ haptic_device_h v_handle;
+ xmlDocPtr v_doc;
+} FEEDBACK_HANDLE;
+
+static int sndstatus;
+static int touch_sndstatus;
+static int soundon;
+static int vibstatus;
+static int vib_level;
+static int noti_level;
+static int callstatus;
+
+static void __feedback_sndstatus_cb(keynode_t *key, void* data)
+{
+ sndstatus = vconf_keynode_get_bool(key);
+ FEEDBACK_LOG("[[[[[[[[[[[[[[sndstatus changed!! new sndstatus => %d", sndstatus);
+ return;
+}
+
+static void __feedback_touch_sndstatus_cb(keynode_t *key, void* data)
+{
+ touch_sndstatus = vconf_keynode_get_bool(key);
+ FEEDBACK_LOG("[[[[[[[[[[[[[[touch_sndstatus changed!! new touch_sndstatus => %d", touch_sndstatus);
+ return;
+}
static void __feedback_soundon_cb(keynode_t *key, void* data)
{
@@ -52,6 +78,13 @@ static void __feedback_soundon_cb(keynode_t *key, void* data)
return;
}
+static void __feedback_vibstatus_cb(keynode_t *key, void* data)
+{
+ vibstatus = vconf_keynode_get_bool(key);
+ FEEDBACK_LOG("[[[[[[[[[[[[[[vibstatus changed!! new vibstatus => %d", vibstatus);
+ return;
+}
+
static void __feedback_vib_cb(keynode_t *key, void* data)
{
vib_level = vconf_keynode_get_int(key);
@@ -66,19 +99,6 @@ static void __feedback_noti_cb(keynode_t *key, void* data)
return;
}
-static void __feedback_sndstatus_cb(keynode_t *key, void* data)
-{
- sndstatus = vconf_keynode_get_bool(key);
- FEEDBACK_LOG("[[[[[[[[[[[[[[sndstatus changed!! new sndstatus => %d", sndstatus);
- return;
-}
-
-static void __feedback_vibstatus_cb(keynode_t *key, void* data)
-{
- vibstatus = vconf_keynode_get_bool(key);
- FEEDBACK_LOG("[[[[[[[[[[[[[[vibstatus changed!! new vibstatus => %d", vibstatus);
- return;
-}
static void __feedback_callstatus_cb(keynode_t *key, void* data)
{
@@ -136,23 +156,15 @@ static int __feedback_get_haptic_level(feedback_pattern_e pattern)
else
level = vib_level;
- FEEDBACK_LOG("Call status : %d, pattern : %d, level : %d", callstatus, pattern, level);
+ FEEDBACK_LOG("Call status : %d, pattern : %s, level : %d", callstatus, str_pattern[pattern], level);
if (callstatus != VCONFKEY_CALL_OFF) {
- pattern = __feedback_get_alert_on_call_key(pattern);
- FEEDBACK_LOG("Call status is connected or connecting. pattern changed : %d", pattern);
-
// if call status is ON, vibration magnitude is 20%
level = (int)(level*0.2f);
level = (level < 1) ? 1 : level;
FEEDBACK_LOG("level changed : %d", level);
}
- // START : Temporary code
- // Casue : Setting vconf of intensity(feedback) is between 0 and 5.
- // the vconf will be changed but not yet.
- level = level*20;
- // END
-
+ level = level * 20;
return level;
}
@@ -168,6 +180,35 @@ static bool __feedback_get_always_alert_case(feedback_pattern_e pattern)
return false;
}
+static int __feedback_get_data(xmlDocPtr doc, feedback_pattern_e pattern, struct xmlData **data)
+{
+ xmlNodePtr cur;
+ struct xmlData *retData;
+
+ cur = xml_find(doc, (const xmlChar*)str_pattern[pattern]);
+ if (cur == NULL) {
+ FEEDBACK_ERROR("xml_find fail");
+ return -1;
+ }
+
+ retData = xml_parse(doc, cur);
+ if (retData == NULL) {
+ FEEDBACK_ERROR("xml_parse fail");
+ return -1;
+ }
+
+ *data = retData;
+ return 0;
+}
+
+static void __feedback_release_data(struct xmlData *data)
+{
+ if (data == NULL)
+ return;
+
+ xml_free(data);
+}
+
static int __feedback_change_symlink(const char *sym_path, const char *new_path)
{
struct stat buf;
@@ -208,12 +249,12 @@ static int __feedback_restore_default_file(feedback_type_e type, feedback_patter
int ret = -1;
if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) {
- FEEDBACK_ERROR("Invalid parameter : type(%d)", type);
+ FEEDBACK_ERROR("Invalid parameter : type(%s)", str_type[type]);
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
- FEEDBACK_ERROR("Invalid parameter : pattern(%d)", pattern);
+ FEEDBACK_ERROR("Invalid parameter : pattern(%s)", str_pattern[pattern]);
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
@@ -244,17 +285,24 @@ static int __feedback_restore_default_file(feedback_type_e type, feedback_patter
int _feedback_init(feedback_h *handle)
{
- haptic_device_h v_handle = NULL;
- int ret = -1;
+ FEEDBACK_HANDLE *phandle;
+ haptic_device_h v_handle;
+ xmlDocPtr v_doc;
+ int ret;
/* Sound Init */
- if (vconf_get_int(VCONFKEY_SOUND_STATUS, &soundon) < 0) {
- FEEDBACK_ERROR("vconf_get_int(VCONFKEY_SOUND_STATUS, &soundon) ==> FAIL!!");
+ if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
+ FEEDBACK_ERROR("vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) ==> FAIL!!");
return FEEDBACK_ERROR_OPERATION_FAILED;
}
- if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
- FEEDBACK_ERROR("vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) ==> FAIL!!");
+ if (vconf_get_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &touch_sndstatus) < 0) {
+ FEEDBACK_ERROR("vconf_get_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &touch_sndstatus) ==> FAIL!!");
+ return FEEDBACK_ERROR_OPERATION_FAILED;
+ }
+
+ if (vconf_get_int(VCONFKEY_SOUND_STATUS, &soundon) < 0) {
+ FEEDBACK_ERROR("vconf_get_int(VCONFKEY_SOUND_STATUS, &soundon) ==> FAIL!!");
return FEEDBACK_ERROR_OPERATION_FAILED;
}
@@ -282,49 +330,71 @@ int _feedback_init(feedback_h *handle)
return FEEDBACK_ERROR_OPERATION_FAILED;
}
+ /* xml Init */
+ v_doc = xml_open(VIBRATION_XML);
+ if (v_doc == NULL) {
+ FEEDBACK_ERROR("xml_open(%s) fail", VIBRATION_XML);
+ return FEEDBACK_ERROR_OPERATION_FAILED;
+ }
+
/* Vibration Init */
ret = haptic_open(HAPTIC_DEVICE_ALL, &v_handle);
if (ret != HAPTIC_ERROR_NONE) {
FEEDBACK_ERROR("haptic_open(HAPTIC_DEVICE_ALL, &v_handle) ==> FAIL!! : %d", ret);
- return FEEDBACK_ERROR_OPERATION_FAILED;
+ v_handle = (haptic_device_h)DEFAULT_FEEDBACK_HANDLE;
}
/* add watch for status value */
- vconf_notify_key_changed(VCONFKEY_SOUND_STATUS, __feedback_soundon_cb, NULL);
vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, __feedback_sndstatus_cb, NULL);
+ vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, __feedback_touch_sndstatus_cb, NULL);
+ vconf_notify_key_changed(VCONFKEY_SOUND_STATUS, __feedback_soundon_cb, NULL);
vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, __feedback_vibstatus_cb, NULL);
vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, __feedback_vib_cb, NULL);
vconf_notify_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, __feedback_noti_cb, NULL);
vconf_notify_key_changed(VCONFKEY_CALL_STATE, __feedback_callstatus_cb, NULL);
- FEEDBACK_LOG("vconf_get_int(VCONFKEY_SOUND_STATUS, &soundon) ==> %d", soundon);
FEEDBACK_LOG("vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) ==> %d", sndstatus);
+ FEEDBACK_LOG("vconf_get_bool(VCONFKEY_SETAPPL_....UNDS_BOOL, &touch_sndstatus) ==> %d", touch_sndstatus);
+ FEEDBACK_LOG("vconf_get_int(VCONFKEY_SOUND_STATUS, &soundon) ==> %d", soundon);
FEEDBACK_LOG("vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibstatus) ==> %d", vibstatus);
FEEDBACK_LOG("vconf_get_int(VCONFKEY_FEEDBACK_VIBRATION_LEVEL_INT, &vib_level) ==> %d", vib_level);
FEEDBACK_LOG("vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &noti_level) ==> %d", noti_level);
FEEDBACK_LOG("vconf_get_int(VCONFKEY_CALL_STATUS, &callstatus) ==> %d", callstatus);
- *handle = (feedback_h)v_handle;
+ phandle = (FEEDBACK_HANDLE *)malloc(sizeof(FEEDBACK_HANDLE));
+ phandle->v_handle = v_handle;
+ phandle->v_doc = v_doc;
+ *handle = (feedback_h)phandle;
+ FEEDBACK_LOG("handle value : %x", handle);
return FEEDBACK_ERROR_NONE;
}
int _feedback_fini(feedback_h handle)
{
+ FEEDBACK_HANDLE *phandle = (FEEDBACK_HANDLE *)handle;
int ret = -1;
- if (handle <= 0) {
- FEEDBACK_ERROR("Invalid parameter : handle(%d)", handle);
+ if (!handle) {
+ FEEDBACK_ERROR("Invalid parameter : handle(NULL)");
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
- ret = haptic_close((haptic_device_h)handle);
- if (ret != HAPTIC_ERROR_NONE) {
- FEEDBACK_ERROR("haptic_close is failed : %d", ret);
- return FEEDBACK_ERROR_OPERATION_FAILED;
+ if (phandle->v_handle != DEFAULT_FEEDBACK_HANDLE) {
+ ret = haptic_close(phandle->v_handle);
+ if (ret != HAPTIC_ERROR_NONE) {
+ FEEDBACK_ERROR("haptic_close is failed : %d", ret);
+ }
}
- vconf_ignore_key_changed(VCONFKEY_SOUND_STATUS, __feedback_soundon_cb);
+ if (phandle->v_doc) {
+ xml_close(phandle->v_doc);
+ }
+
+ free(phandle);
+
vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, __feedback_sndstatus_cb);
+ vconf_ignore_key_changed(VCONFKEY_SOUND_STATUS, __feedback_soundon_cb);
+ vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, __feedback_touch_sndstatus_cb);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, __feedback_vibstatus_cb);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, __feedback_vib_cb);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, __feedback_noti_cb);
@@ -339,8 +409,8 @@ int _feedback_play_sound(feedback_h handle, feedback_pattern_e pattern)
int retry = FEEDBACK_RETRY_CNT;
struct stat buf;
- if (handle <= 0) {
- FEEDBACK_ERROR("Please call _feedback_init() for sound init ");
+ if (!handle) {
+ FEEDBACK_ERROR("Invalid parameter : handle(NULL)");
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
@@ -354,13 +424,18 @@ int _feedback_play_sound(feedback_h handle, feedback_pattern_e pattern)
return FEEDBACK_ERROR_NONE;
}
- if (pattern == FEEDBACK_PATTERN_NONE) {
- FEEDBACK_LOG("call _feedback_play_sound passing FEEDBACK_PATTERN_NONE");
+ if (touch_sndstatus == 0 && pattern >= FEEDBACK_PATTERN_TAP && pattern <= FEEDBACK_PATTERN_HW_HOLD) {
+ FEEDBACK_LOG("Touch Sound condition is OFF and pattern is touch type (touch_sndstatus : %d, pattern : %s)", touch_sndstatus, str_pattern[pattern]);
return FEEDBACK_ERROR_NONE;
}
+ if (callstatus != VCONFKEY_CALL_OFF) {
+ pattern = __feedback_get_alert_on_call_key(pattern);
+ FEEDBACK_LOG("Call status is connected or connecting. pattern changed : %s", str_pattern[pattern]);
+ }
+
if (snd_file[pattern] == NULL) {
- FEEDBACK_LOG("This case(%d) does not play sound", pattern);
+ FEEDBACK_LOG("This case(%s) does not play sound", str_pattern[pattern]);
return FEEDBACK_ERROR_NONE;
}
@@ -368,18 +443,12 @@ int _feedback_play_sound(feedback_h handle, feedback_pattern_e pattern)
FEEDBACK_ERROR("%s is not presents", snd_file[pattern]);
ret = __feedback_restore_default_file(FEEDBACK_TYPE_SOUND, pattern);
if (FEEDBACK_FAILED(ret)) {
- FEEDBACK_ERROR("__feedback_restore_default_file(%d/%d) error", FEEDBACK_TYPE_SOUND, pattern);
+ FEEDBACK_ERROR("__feedback_restore_default_file(%s) error", str_pattern[pattern]);
return FEEDBACK_ERROR_OPERATION_FAILED;
}
FEEDBACK_LOG("%s is restored", snd_file[pattern]);
}
- FEEDBACK_LOG("Call status : %d, pattern : %d", callstatus, pattern);
- if (callstatus != VCONFKEY_CALL_OFF) {
- pattern = __feedback_get_alert_on_call_key(pattern);
- FEEDBACK_LOG("Call status is connected or connecting. pattern changed : %d", pattern);
- }
-
do {
ret = mm_sound_play_keysound(snd_file[pattern], __feedback_get_volume_type(pattern));
if (ret == MM_ERROR_NONE) {
@@ -394,45 +463,53 @@ int _feedback_play_sound(feedback_h handle, feedback_pattern_e pattern)
int _feedback_play_vibration(feedback_h handle, feedback_pattern_e pattern)
{
- int ret = -1;
+ FEEDBACK_HANDLE *phandle = (FEEDBACK_HANDLE *)handle;
+ int ret;
struct stat buf;
+ struct xmlData *data;
- if (handle <= 0) {
- FEEDBACK_ERROR("Please call _feedback_init() for sound init ");
+ if (!handle) {
+ FEEDBACK_ERROR("Invalid parameter : handle(NULL)");
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
+ if (handle == DEFAULT_FEEDBACK_HANDLE) {
+ FEEDBACK_ERROR("haptic is not initialized");
+ return FEEDBACK_ERROR_OPERATION_FAILED;
+ }
+
if (vibstatus == 0 && !__feedback_get_always_alert_case(pattern)) {
FEEDBACK_LOG("Vibration condition is OFF (vibstatus : %d)", vibstatus);
return FEEDBACK_ERROR_NONE;
}
- if (pattern == FEEDBACK_PATTERN_NONE) {
- FEEDBACK_LOG("call _feedback_play_vibration passing FEEDBACK_PATTERN_NONE");
- return FEEDBACK_ERROR_NONE;
+ if (callstatus != VCONFKEY_CALL_OFF) {
+ pattern = __feedback_get_alert_on_call_key(pattern);
+ FEEDBACK_LOG("Call status is connected or connecting. pattern changed : %s", str_pattern[pattern]);
}
- if (haptic_file[pattern] == NULL) {
- FEEDBACK_LOG("This case(%d) does not play vibration", pattern);
- return FEEDBACK_ERROR_NONE;
+ ret = __feedback_get_data(phandle->v_doc, pattern, &data);
+ if (ret < 0) {
+ FEEDBACK_ERROR("__feedback_get_vibration_data fail");
+ return FEEDBACK_ERROR_OPERATION_FAILED;
}
- if (stat(haptic_file[pattern], &buf)) {
- FEEDBACK_ERROR("%s is not presents", haptic_file[pattern]);
- ret = __feedback_restore_default_file(FEEDBACK_TYPE_VIBRATION, pattern);
- if (FEEDBACK_FAILED(ret)) {
- FEEDBACK_ERROR("__feedback_restore_default_file(%d/%d) error", FEEDBACK_TYPE_VIBRATION, pattern);
- return FEEDBACK_ERROR_OPERATION_FAILED;
- }
- FEEDBACK_LOG("%s is restored", haptic_file[pattern]);
+ if (data->data == NULL) {
+ FEEDBACK_LOG("This case(%s) does not play vibration", str_pattern[pattern]);
+ __feedback_release_data(data);
+ return FEEDBACK_ERROR_NONE;
}
- ret = haptic_vibrate_file_with_detail((haptic_device_h)handle, haptic_file[pattern], HAPTIC_ITERATION_ONCE, __feedback_get_haptic_level(pattern), __feedback_get_priority(pattern), NULL);
+ /* play haptic buffer */
+ ret = haptic_vibrate_buffer_with_detail(phandle->v_handle, data->data, HAPTIC_ITERATION_ONCE,
+ __feedback_get_haptic_level(pattern), __feedback_get_priority(pattern), NULL);
if (ret != HAPTIC_ERROR_NONE) {
- FEEDBACK_ERROR("haptic_vibrate_file_with_detail(%s) is failed", haptic_file[pattern]);
+ FEEDBACK_ERROR("haptic_vibrate_buffer_with_detail is failed");
+ __feedback_release_data(data);
return FEEDBACK_ERROR_OPERATION_FAILED;
}
+ __feedback_release_data(data);
return FEEDBACK_ERROR_NONE;
}
@@ -442,12 +519,12 @@ int _feedback_set_path(feedback_type_e type, feedback_pattern_e pattern, char* p
int ret = -1;
if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) {
- FEEDBACK_ERROR("Invalid parameter : type(%d)", type);
+ FEEDBACK_ERROR("Invalid parameter : type(%s)", str_type[type]);
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
- FEEDBACK_ERROR("Invalid parameter : pattern(%d)", pattern);
+ FEEDBACK_ERROR("Invalid parameter : pattern(%s)", str_pattern[pattern]);
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
@@ -468,7 +545,7 @@ int _feedback_set_path(feedback_type_e type, feedback_pattern_e pattern, char* p
}
if (cur_path == NULL) {
- FEEDBACK_ERROR("This pattern(%d) in this type(%d) is not supported to play", pattern, type);
+ FEEDBACK_ERROR("This pattern(%s) in this type(%s) is not supported to play", str_pattern[pattern], str_type[type]);
return FEEDBACK_ERROR_OPERATION_FAILED;
}
@@ -487,12 +564,12 @@ int _feedback_get_path(feedback_type_e type, feedback_pattern_e pattern, char* b
int retry = FEEDBACK_RETRY_CNT;
if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) {
- FEEDBACK_ERROR("Invalid parameter : type(%d)", type);
+ FEEDBACK_ERROR("Invalid parameter : type(%s)", str_type[type]);
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
- FEEDBACK_ERROR("Invalid parameter : pattern(%d)", pattern);
+ FEEDBACK_ERROR("Invalid parameter : pattern(%s)", str_pattern[pattern]);
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
@@ -508,7 +585,7 @@ int _feedback_get_path(feedback_type_e type, feedback_pattern_e pattern, char* b
}
if (cur_path == NULL) {
- FEEDBACK_ERROR("This pattern(%d) in this type(%d) is not supported to play", pattern, type);
+ FEEDBACK_ERROR("This pattern(%s) in this type(%s) is not supported to play", str_pattern[pattern], str_type[type]);
snprintf(buf, buflen, "NULL");
return FEEDBACK_ERROR_OPERATION_FAILED;
}
diff --git a/src/feedback.c b/src/feedback.c
index 368fbb5..bfd6b7a 100644
--- a/src/feedback.c
+++ b/src/feedback.c
@@ -82,6 +82,11 @@ API int feedback_play(feedback_pattern_e pattern)
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
+ if (pattern == FEEDBACK_PATTERN_NONE) {
+ FEEDBACK_LOG("pattern is NONE");
+ return FEEDBACK_ERROR_NONE;
+ }
+
err = _feedback_play_sound(_feedback_handle, pattern);
if (FEEDBACK_FAILED(err)) {
FEEDBACK_ERROR("_feedback_play_sound is failed");
@@ -116,6 +121,11 @@ API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern)
return FEEDBACK_ERROR_INVALID_PARAMETER;
}
+ if (pattern == FEEDBACK_PATTERN_NONE) {
+ FEEDBACK_LOG("pattern is NONE");
+ return FEEDBACK_ERROR_NONE;
+ }
+
switch(type) {
case FEEDBACK_TYPE_SOUND:
err = _feedback_play_sound(_feedback_handle, pattern);
@@ -166,3 +176,31 @@ API int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e patt
return FEEDBACK_ERROR_NONE;
}
+
+API int feedback_set_resource_path(feedback_type_e type, feedback_pattern_e pattern, char* path)
+{
+ int err = -1;
+
+ if (path == NULL) {
+ FEEDBACK_ERROR("Invalid parameter : path(NULL)");
+ return FEEDBACK_ERROR_INVALID_PARAMETER;
+ }
+
+ if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) {
+ FEEDBACK_ERROR("Invalid parameter : type(%d)", type);
+ return FEEDBACK_ERROR_INVALID_PARAMETER;
+ }
+
+ if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
+ FEEDBACK_ERROR("Invalid parameter : pattern(%d)", pattern);
+ return FEEDBACK_ERROR_INVALID_PARAMETER;
+ }
+
+ err = _feedback_set_path(type, pattern, path);
+ if (FEEDBACK_FAILED(err)) {
+ FEEDBACK_ERROR("_feedback_set_path is failed");
+ return FEEDBACK_ERROR_OPERATION_FAILED;
+ }
+
+ return FEEDBACK_ERROR_NONE;
+}
diff --git a/src/svi.c b/src/svi.c
index 1f73ae6..1f73ae6 100644..100755
--- a/src/svi.c
+++ b/src/svi.c
diff --git a/src/xmlparser.c b/src/xmlparser.c
new file mode 100644
index 0000000..d7d1837
--- /dev/null
+++ b/src/xmlparser.c
@@ -0,0 +1,160 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <assert.h>
+#include <glib.h>
+
+#include "xmlparser.h"
+#include "feedback-log.h"
+
+static const xmlChar* data_str[] = {
+ [XML_LABEL] = "label",
+ [XML_DATA] = "data",
+};
+
+xmlDocPtr xml_open(const char *xml)
+{
+ xmlDocPtr doc;
+
+ doc = xmlReadFile(xml, NULL, 0);
+ if (doc == NULL) {
+ FEEDBACK_ERROR("xmlReadFile fail");
+ return NULL;
+ }
+
+ return doc;
+}
+
+void xml_close(xmlDocPtr doc)
+{
+ xmlFreeDoc(doc);
+}
+
+static int xml_compare(xmlDocPtr doc, xmlNodePtr cur, const xmlChar* expr)
+{
+ xmlNodePtr node;
+ xmlChar *key;
+ int r;
+
+ assert(doc);
+ assert(cur);
+ assert(expr);
+
+ for (node = cur->children; node != NULL; node = node->next) {
+ if (xmlStrcmp(node->name, data_str[XML_LABEL]))
+ continue;
+
+ key = xmlNodeListGetString(doc, node->children, 1);
+ r = xmlStrcmp(key, expr);
+ xmlFree(key);
+
+ if (r == 0)
+ return 1;
+
+ break;
+ }
+
+ return 0;
+}
+
+xmlNodePtr xml_find(xmlDocPtr doc, const xmlChar* expr)
+{
+ xmlNodePtr root;
+ xmlNodePtr cur;
+
+ assert(doc);
+ assert(expr);
+
+ root = xmlDocGetRootElement(doc);
+ if (root == NULL) {
+ FEEDBACK_ERROR("xmlDocGetRootElement fail");
+ return NULL;
+ }
+
+ for (cur = root->children; cur != NULL; cur = cur->next) {
+ if (xmlStrcmp(cur->name, (const xmlChar*)VIBRATION))
+ continue;
+
+ if (!xml_compare(doc, cur, expr))
+ continue;
+
+ return cur;
+ }
+
+ return NULL;
+}
+
+struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur)
+{
+ xmlNodePtr node;
+ struct xmlData *data;
+ char *b64_data;
+ int len;
+
+ assert(doc);
+ assert(cur);
+
+ data = (struct xmlData*)malloc(sizeof(struct xmlData));
+ if (data == NULL) {
+ FEEDBACK_ERROR("out of memory");
+ return NULL;
+ }
+
+ memset(data, 0, sizeof(struct xmlData));
+ for (node = cur->children; node != NULL; node = node->next) {
+ if (!xmlStrcmp(node->name, data_str[XML_LABEL])) {
+ data->label = (char*)xmlNodeListGetString(doc, node->children, 1);
+ FEEDBACK_LOG("label : %s", data->label);
+ } else if (!xmlStrcmp(node->name, data_str[XML_DATA])) {
+ b64_data = (char *)xmlNodeListGetString(doc, node->children, 1);
+ if (b64_data != NULL) {
+ FEEDBACK_LOG("b64_data : %s", b64_data);
+ data->data = g_base64_decode(b64_data, &len);
+ xmlFree(b64_data);
+ }
+ }
+ }
+
+ return data;
+}
+
+int xml_save(xmlDocPtr doc, const char *path)
+{
+ int r;
+
+ assert(doc);
+ assert(path);
+
+ r = xmlSaveFile(path, doc);
+ if (r < 0) {
+ FEEDBACK_ERROR("xmlSaveFile fail");
+ return -1;
+ }
+
+ return 0;
+}
+
+void xml_free(struct xmlData* data)
+{
+ assert(data);
+
+ free(data->label);
+ free(data->data);
+ free(data);
+}
diff --git a/svi.pc.in b/svi.pc.in
index 9ec1dcf..9ec1dcf 100644..100755
--- a/svi.pc.in
+++ b/svi.pc.in
diff --git a/svidata/svi/haptic/default/Basic_call.tht b/svidata/svi/haptic/default/Basic_call.tht
new file mode 100755
index 0000000..3167416
--- /dev/null
+++ b/svidata/svi/haptic/default/Basic_call.tht
Binary files differ
diff --git a/svidata/svi/haptic/touch/touch.tht b/svidata/svi/haptic/touch/touch.tht
new file mode 100755
index 0000000..e374bea
--- /dev/null
+++ b/svidata/svi/haptic/touch/touch.tht
Binary files differ
diff --git a/svidata/svi/sound/operation/call_connect.wav b/svidata/svi/sound/operation/call_connect.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/call_connect.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/call_disconnect.wav b/svidata/svi/sound/operation/call_disconnect.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/call_disconnect.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/charger_connection.wav b/svidata/svi/sound/operation/charger_connection.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/charger_connection.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/fully_charged.wav b/svidata/svi/sound/operation/fully_charged.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/fully_charged.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/list_reorder.wav b/svidata/svi/sound/operation/list_reorder.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/list_reorder.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/lock.wav b/svidata/svi/sound/operation/lock.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/lock.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/low_battery.wav b/svidata/svi/sound/operation/low_battery.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/low_battery.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/minute_minder.wav b/svidata/svi/sound/operation/minute_minder.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/minute_minder.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/power_on.wav b/svidata/svi/sound/operation/power_on.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/power_on.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/shutter.wav b/svidata/svi/sound/operation/shutter.wav
new file mode 100755
index 0000000..9dea92b
--- /dev/null
+++ b/svidata/svi/sound/operation/shutter.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/slider_sweep.wav b/svidata/svi/sound/operation/slider_sweep.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/slider_sweep.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/unlock.wav b/svidata/svi/sound/operation/unlock.wav
new file mode 100755
index 0000000..5383bdf
--- /dev/null
+++ b/svidata/svi/sound/operation/unlock.wav
Binary files differ
diff --git a/svidata/svi/sound/operation/volume_control.wav b/svidata/svi/sound/operation/volume_control.wav
new file mode 100755
index 0000000..1ec9de4
--- /dev/null
+++ b/svidata/svi/sound/operation/volume_control.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key0.wav b/svidata/svi/sound/touch/key0.wav
new file mode 100755
index 0000000..e2cd877
--- /dev/null
+++ b/svidata/svi/sound/touch/key0.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key1.wav b/svidata/svi/sound/touch/key1.wav
new file mode 100755
index 0000000..fa77cf4
--- /dev/null
+++ b/svidata/svi/sound/touch/key1.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key2.wav b/svidata/svi/sound/touch/key2.wav
new file mode 100755
index 0000000..53da84c
--- /dev/null
+++ b/svidata/svi/sound/touch/key2.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key3.wav b/svidata/svi/sound/touch/key3.wav
new file mode 100755
index 0000000..ede9a2b
--- /dev/null
+++ b/svidata/svi/sound/touch/key3.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key4.wav b/svidata/svi/sound/touch/key4.wav
new file mode 100755
index 0000000..105bddc
--- /dev/null
+++ b/svidata/svi/sound/touch/key4.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key5.wav b/svidata/svi/sound/touch/key5.wav
new file mode 100755
index 0000000..a34b4d0
--- /dev/null
+++ b/svidata/svi/sound/touch/key5.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key6.wav b/svidata/svi/sound/touch/key6.wav
new file mode 100755
index 0000000..34a8bec
--- /dev/null
+++ b/svidata/svi/sound/touch/key6.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key7.wav b/svidata/svi/sound/touch/key7.wav
new file mode 100755
index 0000000..3b845a4
--- /dev/null
+++ b/svidata/svi/sound/touch/key7.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key8.wav b/svidata/svi/sound/touch/key8.wav
new file mode 100755
index 0000000..2a05528
--- /dev/null
+++ b/svidata/svi/sound/touch/key8.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/key9.wav b/svidata/svi/sound/touch/key9.wav
new file mode 100755
index 0000000..80699c8
--- /dev/null
+++ b/svidata/svi/sound/touch/key9.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/keyasterisk.wav b/svidata/svi/sound/touch/keyasterisk.wav
new file mode 100755
index 0000000..9ec2e71
--- /dev/null
+++ b/svidata/svi/sound/touch/keyasterisk.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/keysharp.wav b/svidata/svi/sound/touch/keysharp.wav
new file mode 100755
index 0000000..ce7cd88
--- /dev/null
+++ b/svidata/svi/sound/touch/keysharp.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/sip.wav b/svidata/svi/sound/touch/sip.wav
new file mode 100755
index 0000000..5b44d12
--- /dev/null
+++ b/svidata/svi/sound/touch/sip.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/sip_backspace.wav b/svidata/svi/sound/touch/sip_backspace.wav
new file mode 100755
index 0000000..5b44d12
--- /dev/null
+++ b/svidata/svi/sound/touch/sip_backspace.wav
Binary files differ
diff --git a/svidata/svi/sound/touch/touch.wav b/svidata/svi/sound/touch/touch.wav
new file mode 100755
index 0000000..1ec9de4
--- /dev/null
+++ b/svidata/svi/sound/touch/touch.wav
Binary files differ
diff --git a/svidata/svi/vibration.xml b/svidata/svi/vibration.xml
new file mode 100644
index 0000000..9db7adc
--- /dev/null
+++ b/svidata/svi/vibration.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="utf-8"?>
+<config>
+ <label>svi-data</label>
+ <description>Vibration Resource</description>
+ <vibration>
+ <label>FEEDBACK_PATTERN_TAP</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_SIP</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_SIP_BACKSPACE</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_MAX_CHARACTER</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY0</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY1</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY2</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY3</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY4</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY5</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY6</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY7</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY8</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY9</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY_STAR</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_KEY_SHARP</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_HOLD</label>
+ <data>VEhGTSwAAABmbXQgFAAAAAEAAQBjAAAAZAAAAGRhdGEQ</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_MULTI_TAP</label>
+ <data>VEhGTSwAAABmbXQgFAAAAAEAAQBjAAAAZAAAAGRhdGEQ</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_HW_TAP</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_HW_HOLD</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_MESSAGE</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_MESSAGE_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_EMAIL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_EMAIL_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_WAKEUP</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_WAKEUP_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_SCHEDULE</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_SCHEDULE_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_TIMER</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_TIMER_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_GENERAL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_GENERAL_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_POWERON</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_POWEROFF</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_CHARGERCONN</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_CHARGERCONN_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_FULLCHARGED</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_FULLCHARGED_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_LOWBATT</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_LOWBATT_ON_CALL</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_LOCK</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_UNLOCK</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_CALLCONNECT</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_DISCALLCONNECT</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_MINUTEMINDER</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_VIBRATION</label>
+ <data>VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA</data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_SHUTTER</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_LIST_REORDER</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_SLIDER_SWEEP</label>
+ <data></data>
+ </vibration>
+ <vibration>
+ <label>FEEDBACK_PATTERN_VOLUME_KEY</label>
+ <data></data>
+ </vibration>
+</config>