From: taeyoon Date: Thu, 22 Dec 2016 08:39:09 +0000 (+0900) Subject: [3.0] Remove haptic APIs from feedback plugin X-Git-Tag: accepted/tizen/3.0/common/20170407.101133~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=54f5d9966a0a79c0e3ed0d73998cc84edca60875 [3.0] Remove haptic APIs from feedback plugin haptic APIs in deviced package are not supported Change-Id: I80a4a91076c09d4cdd548ac4cbd0c1c0be9aea3d --- diff --git a/build/tizen/plugins/Makefile.am b/build/tizen/plugins/Makefile.am index 2fb8f35..5944acd 100644 --- a/build/tizen/plugins/Makefile.am +++ b/build/tizen/plugins/Makefile.am @@ -56,6 +56,7 @@ libdali_feedback_plugin_la_CXXFLAGS = -DDALI_COMPILATION \ -I../../../adaptors/public-api \ -I../../../adaptors/integration-api \ -I../../../adaptors/public-api/adaptor-framework \ + -I../../../adaptors/devel-api/adaptor-framework \ -Werror -Wall libdali_feedback_plugin_la_LIBADD = \ @@ -65,30 +66,6 @@ libdali_feedback_plugin_la_LIBADD = \ libdali_feedback_plugin_la_LDFLAGS = \ -rdynamic -if MOBILE_PROFILE -libdali_feedback_plugin_la_CXXFLAGS += \ - $(DEVICED_CFLAGS) - -libdali_feedback_plugin_la_LIBADD += \ - $(DEVICED_LIBS) -endif - -if TV_PROFILE -libdali_feedback_plugin_la_CXXFLAGS += \ - $(HAPTIC_CFLAGS) - -libdali_feedback_plugin_la_LIBADD += \ - $(HAPTIC_LIBS) -endif - -if COMMON_PROFILE -libdali_feedback_plugin_la_CXXFLAGS += \ - $(HAPTIC_CFLAGS) - -libdali_feedback_plugin_la_LIBADD += \ - $(HAPTIC_LIBS) -endif - libdali_feedback_plugin_la_LIBADD += \ $(FEEDBACK_LIBS) diff --git a/build/tizen/plugins/configure.ac b/build/tizen/plugins/configure.ac index b8088b2..3bd8eb9 100644 --- a/build/tizen/plugins/configure.ac +++ b/build/tizen/plugins/configure.ac @@ -35,18 +35,12 @@ fi # enable_videoplayer fi # enable_wayland if test "x$enable_feedback" = "xyes"; then - -if test "x$enable_profile" = "xCOMMON" || test "x$enable_profile" = "xTV"; then -PKG_CHECK_MODULES(HAPTIC, haptic) -fi - -if test "x$enable_profile" = "xMOBILE"; then -PKG_CHECK_MODULES(DEVICED, deviced) -fi +if test "x$enable_profile" != "xUBUNTU"; then PKG_CHECK_MODULES(FEEDBACK, feedback) PKG_CHECK_MODULES(MMFSOUND, mm-sound) +fi # check UNBUNTU fi # enable_feedback AC_CONFIG_FILES(Makefile) diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index a711908..e7b64d0 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -40,7 +40,7 @@ BuildRequires: pkgconfig(libtzplatform-config) %if "%{profile}" == "mobile" %define dali_profile MOBILE -%define dali_feedback_plugin 0 +%define dali_feedback_plugin 1 %define dali_videoplayer_plugin 1 %define shaderbincache_flag DISABLE BuildRequires: pkgconfig(gles20) @@ -199,10 +199,8 @@ Integration development package for the Adaptor - headers for integrating with a Summary: Plugin to play haptic and audio feedback for Dali Group: System/Libraries %if 0%{?dali_feedback_plugin} -#Requires: libdeviced BuildRequires: pkgconfig(mm-sound) -#BuildRequires: pkgconfig(haptic) -BuildRequires: libfeedback-devel +BuildRequires: pkgconfig(feedback) %endif %description dali-feedback-plugin @@ -249,7 +247,7 @@ VideoPlayer plugin to play a video file for Dali %endif %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/ -%define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/ +%define dali_plugin_sound_files /plugins/sounds/ %define dev_include_path %{_includedir} ############################## diff --git a/plugins/dali-feedback.cpp b/plugins/dali-feedback.cpp index 1be8589..248aa36 100644 --- a/plugins/dali-feedback.cpp +++ b/plugins/dali-feedback.cpp @@ -47,86 +47,25 @@ namespace Plugin { DaliFeedback::DaliFeedback() -: mHapticInitialized( false ) { feedback_initialize(); - - if( 0 == haptic_open( HAPTIC_DEVICE_0, &mDeviceHandle ) ) - { - mHapticInitialized = true; - } - else - { - DEBUG_PRINTF( "Haptic feedback controller failed to initialize\n" ); - } } DaliFeedback::~DaliFeedback() { - if( mHapticInitialized ) - { - int errorCode = haptic_close( mDeviceHandle ); - if( errorCode < 0 ) - { - DEBUG_PRINTF( "device_haptic_close() failed with error code: %d\n", errorCode ); - } - } - feedback_deinitialize(); } void DaliFeedback::PlayHaptic( const std::string& filePath ) { - if( mHapticInitialized ) - { - if ( filePath.size() == 0 ) - { - DEBUG_PRINTF( "File Path can't be NULL!\n" ); - return; - } - - int errorCode = haptic_vibrate_file_with_detail( mDeviceHandle, filePath.c_str(), HAPTIC_ITERATION_ONCE, HAPTIC_FEEDBACK_AUTO, HAPTIC_PRIORITY_MIN, NULL ); - if( errorCode != 0 ) - { - DEBUG_PRINTF( "PlayHaptic() failed with error code: %d\n", errorCode ); - } - } - else - { - DEBUG_PRINTF( "HapticPlayer is not Initialized\n" ); - } } void DaliFeedback::PlayHapticMonotone( unsigned int duration ) { - if( mHapticInitialized ) - { - int errorCode = haptic_vibrate_monotone_with_detail( mDeviceHandle, duration, HAPTIC_FEEDBACK_AUTO, HAPTIC_PRIORITY_MIN, NULL ); - if( errorCode != 0 ) - { - DEBUG_PRINTF( "PlayHapticMonotone() failed with error code: %d\n", errorCode ); - } - } - else - { - DEBUG_PRINTF( "HapticPlayer is not Initialized\n" ); - } } void DaliFeedback::StopHaptic() { - if( mHapticInitialized ) - { - int errorCode = haptic_stop_all_effects( mDeviceHandle ); - if( errorCode != 0 ) - { - DEBUG_PRINTF( "StopHaptic() failed with error code: %d\n", errorCode ); - } - } - else - { - DEBUG_PRINTF( "HapticPlayer is not Initialized\n" ); - } } int DaliFeedback::PlaySound( const std::string& fileName ) diff --git a/plugins/dali-feedback.h b/plugins/dali-feedback.h index c9967ec..caf9018 100644 --- a/plugins/dali-feedback.h +++ b/plugins/dali-feedback.h @@ -18,13 +18,6 @@ * */ -// EXTERNAL INCLUDES -#if defined(DALI_PROFILE_MOBILE) -#include -#else -#include -#endif - // INTERNAL INCLUDES #include @@ -55,7 +48,7 @@ public: // Construction & Destruction public: // FeedbackPlugin overrides /** - * @copydoc Dali::Integration::FeedbackPlugin::PlayHaptic() + * @copydoc Dali::FeedbackPlugin::PlayHaptic() */ void PlayHaptic( const std::string& filePath ); @@ -84,11 +77,6 @@ public: // FeedbackPlugin overrides */ void PlayFeedbackPattern( int type, int pattern ); -private: - - haptic_device_h mDeviceHandle; - - bool mHapticInitialized; }; } // namespace Plugin