-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 = \
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)
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)
%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)
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
%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}
##############################
{
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 )
*
*/
-// EXTERNAL INCLUDES
-#if defined(DALI_PROFILE_MOBILE)
-#include <dd-haptic.h>
-#else
-#include <haptic.h>
-#endif
-
// INTERNAL INCLUDES
#include <feedback-plugin.h>
public: // FeedbackPlugin overrides
/**
- * @copydoc Dali::Integration::FeedbackPlugin::PlayHaptic()
+ * @copydoc Dali::FeedbackPlugin::PlayHaptic()
*/
void PlayHaptic( const std::string& filePath );
*/
void PlayFeedbackPattern( int type, int pattern );
-private:
-
- haptic_device_h mDeviceHandle;
-
- bool mHapticInitialized;
};
} // namespace Plugin