// Start the animation
animation.Play();
+ // Final key frame value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), 0.9f, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
ExtendDuration( period );
+ // Store data to later notify the object that its property is being animated
+ ConnectorTargetValues connectorPair;
+ connectorPair.targetValue = keyFrames.GetLastKeyFrameValue();
+ connectorPair.connectorIndex = mConnectors.Count();
+ connectorPair.timePeriod = period;
+ connectorPair.propertyChangeType = Object::PropertyChange::SET;
+ mConnectorTargetValues.push_back( connectorPair );
+
switch(keyFrames.GetType())
{
case Dali::Property::BOOLEAN:
namespace Internal
{
+namespace
+{
+
+/// Helper to retrieve the value of the final key frame
+template< typename PropertyType, typename KeyFrameType >
+inline void GetLastKeyFrameValueInternal( const IntrusivePtr< KeyFrameSpec >& keyFrames, Property::Value& value )
+{
+ KeyFrameType* kf = static_cast< KeyFrameType* >( keyFrames.Get() );
+ float time = 0;
+ PropertyType actualValue;
+ kf->GetKeyFrame( kf->GetNumberOfKeyFrames() - 1, time, actualValue );
+ value = actualValue;
+}
+
+} // unnamed namespace
+
KeyFrames* KeyFrames::New()
{
return new KeyFrames();
return mKeyFrames.Get();
}
+Property::Value KeyFrames::GetLastKeyFrameValue() const
+{
+ Property::Value value;
+
+ switch(mType)
+ {
+ case Property::BOOLEAN:
+ {
+ GetLastKeyFrameValueInternal< bool, KeyFrameBoolean >( mKeyFrames, value );
+ break;
+ }
+ case Property::INTEGER:
+ {
+ GetLastKeyFrameValueInternal< int, KeyFrameInteger >( mKeyFrames, value );
+ break;
+ }
+ case Property::FLOAT:
+ {
+ GetLastKeyFrameValueInternal< float, KeyFrameNumber >( mKeyFrames, value );
+ break;
+ }
+ case Property::VECTOR2:
+ {
+ GetLastKeyFrameValueInternal< Vector2, KeyFrameVector2 >( mKeyFrames, value );
+ break;
+ }
+ case Property::VECTOR3:
+ {
+ GetLastKeyFrameValueInternal< Vector3, KeyFrameVector3 >( mKeyFrames, value );
+ break;
+ }
+ case Property::VECTOR4:
+ {
+ GetLastKeyFrameValueInternal< Vector4, KeyFrameVector4 >( mKeyFrames, value );
+ break;
+ }
+ case Property::ROTATION:
+ {
+ GetLastKeyFrameValueInternal< Quaternion, KeyFrameQuaternion >( mKeyFrames, value );
+ break;
+ }
+ default:
+ DALI_ASSERT_DEBUG(!"Type not supported");
+ break;
+ }
+
+ return value;
+}
+
} // Internal
} // Dali