projects
/
platform
/
core
/
uifw
/
dali-adaptor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "[4.0] Added an devel-API to check whether video texture is supported"
[platform/core/uifw/dali-adaptor.git]
/
adaptors
/
ubuntu
/
tilt-sensor-impl-ubuntu.cpp
diff --git
a/adaptors/ubuntu/tilt-sensor-impl-ubuntu.cpp
b/adaptors/ubuntu/tilt-sensor-impl-ubuntu.cpp
index
86aa653
..
95f5724
100644
(file)
--- a/
adaptors/ubuntu/tilt-sensor-impl-ubuntu.cpp
+++ b/
adaptors/ubuntu/tilt-sensor-impl-ubuntu.cpp
@@
-30,19
+30,21
@@
namespace // unnamed namespace
{
namespace // unnamed namespace
{
+const char* const SIGNAL_TILTED = "tilted";
+
const int NUMBER_OF_SAMPLES = 10;
const float MAX_ACCELEROMETER_XY_VALUE = 9.8f;
// Type Registration
const int NUMBER_OF_SAMPLES = 10;
const float MAX_ACCELEROMETER_XY_VALUE = 9.8f;
// Type Registration
-Dali::BaseHandle
Creat
e()
+Dali::BaseHandle
GetInstanc
e()
{
return Dali::Internal::Adaptor::TiltSensor::Get();
}
{
return Dali::Internal::Adaptor::TiltSensor::Get();
}
-Dali::TypeRegistration typeRegistration( typeid(Dali::TiltSensor), typeid(Dali::BaseHandle),
Creat
e );
+Dali::TypeRegistration typeRegistration( typeid(Dali::TiltSensor), typeid(Dali::BaseHandle),
GetInstanc
e );
-Dali::SignalConnectorType signalConnector1( typeRegistration,
Dali::TiltSensor::
SIGNAL_TILTED, Dali::Internal::Adaptor::TiltSensor::DoConnectSignal );
+Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TILTED, Dali::Internal::Adaptor::TiltSensor::DoConnectSignal );
} // unnamed namespace
} // unnamed namespace
@@
-90,10
+92,10
@@
Dali::TiltSensor TiltSensor::Get()
TiltSensor::~TiltSensor()
{
TiltSensor::~TiltSensor()
{
-
Disable
();
+
Stop
();
}
}
-bool TiltSensor::
Enable
()
+bool TiltSensor::
Start
()
{
// Make sure sensor API is responding
bool success = Update();
{
// Make sure sensor API is responding
bool success = Update();
@@
-116,7
+118,7
@@
bool TiltSensor::Enable()
return success;
}
return success;
}
-void TiltSensor::
Disable
()
+void TiltSensor::
Stop
()
{
if ( mTimer )
{
{
if ( mTimer )
{
@@
-125,7
+127,7
@@
void TiltSensor::Disable()
}
}
}
}
-bool TiltSensor::Is
Enabl
ed() const
+bool TiltSensor::Is
Start
ed() const
{
return ( mTimer && mTimer.IsRunning() );
}
{
return ( mTimer && mTimer.IsRunning() );
}
@@
-145,9
+147,9
@@
Quaternion TiltSensor::GetRotation() const
return mRotation;
}
return mRotation;
}
-TiltSensor::TiltedSignal
V2
& TiltSensor::TiltedSignal()
+TiltSensor::TiltedSignal
Type
& TiltSensor::TiltedSignal()
{
{
- return mTiltedSignal
V2
;
+ return mTiltedSignal;
}
void TiltSensor::SetUpdateFrequency( float frequencyHertz )
}
void TiltSensor::SetUpdateFrequency( float frequencyHertz )
@@
-185,8
+187,7
@@
bool TiltSensor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface
bool connected( true );
TiltSensor* sensor = dynamic_cast<TiltSensor*>( object );
bool connected( true );
TiltSensor* sensor = dynamic_cast<TiltSensor*>( object );
- if( sensor &&
- Dali::TiltSensor::SIGNAL_TILTED == signalName )
+ if( sensor && ( SIGNAL_TILTED == signalName ) )
{
sensor->TiltedSignal().Connect( tracker, functor );
}
{
sensor->TiltedSignal().Connect( tracker, functor );
}
@@
-205,7
+206,7
@@
TiltSensor::TiltSensor()
mSensorFrameworkHandle( -1 ),
mRoll( 0.0f ),
mPitch( 0.0f ),
mSensorFrameworkHandle( -1 ),
mRoll( 0.0f ),
mPitch( 0.0f ),
- mRotation(
0.0f
, Vector3::YAXIS ),
+ mRotation(
Dali::ANGLE_0
, Vector3::YAXIS ),
mRotationThreshold( 0.0f )
{
mRollValues.resize( NUMBER_OF_SAMPLES, 0.0f );
mRotationThreshold( 0.0f )
{
mRollValues.resize( NUMBER_OF_SAMPLES, 0.0f );
@@
-226,10
+227,10
@@
bool TiltSensor::Update()
mPitch = newPitch;
mRotation = newRotation;
mPitch = newPitch;
mRotation = newRotation;
- if ( !mTiltedSignal
V2
.Empty() )
+ if ( !mTiltedSignal.Empty() )
{
Dali::TiltSensor handle( this );
{
Dali::TiltSensor handle( this );
- mTiltedSignal
V2
.Emit( handle );
+ mTiltedSignal.Emit( handle );
}
}
}
}