[3.0] Remove haptic APIs from feedback plugin 34/106634/5
authortaeyoon <taeyoon0.lee@samsung.com>
Thu, 22 Dec 2016 08:39:09 +0000 (17:39 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 29 Mar 2017 08:24:20 +0000 (17:24 +0900)
  haptic APIs in deviced package are not supported

Change-Id: I80a4a91076c09d4cdd548ac4cbd0c1c0be9aea3d

build/tizen/plugins/Makefile.am
build/tizen/plugins/configure.ac
packaging/dali-adaptor.spec
plugins/dali-feedback.cpp
plugins/dali-feedback.h

index 2fb8f35..5944acd 100644 (file)
@@ -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)
 
index b8088b2..3bd8eb9 100644 (file)
@@ -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)
index a711908..e7b64d0 100644 (file)
@@ -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}
 
 ##############################
index 1be8589..248aa36 100644 (file)
@@ -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 )
index c9967ec..caf9018 100644 (file)
  *
  */
 
-// EXTERNAL INCLUDES
-#if defined(DALI_PROFILE_MOBILE)
-#include <dd-haptic.h>
-#else
-#include <haptic.h>
-#endif
-
 // INTERNAL INCLUDES
 #include <feedback-plugin.h>
 
@@ -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