/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
namespace Internal
{
-
KeyFrames* KeyFrames::New()
{
return new KeyFrames();
}
default:
{
- DALI_ABORT( "Property type is not animatable" );
+ DALI_ABORT("Property type is not animatable");
break;
}
}
}
// Once we have created a type, can only add values of the same type
- DALI_ASSERT_ALWAYS( mType == value.GetType() && "Can only add values of the same type to a KeyFrame" );
+ DALI_ASSERT_ALWAYS(mType == value.GetType() && "Can only add values of the same type to a KeyFrame");
auto keyframes = mKeyFrames.get();
Property::Value value;
std::size_t noOfKeyFrames = mKeyFrames->GetNumberOfKeyFrames();
- if( noOfKeyFrames )
+ if(noOfKeyFrames)
{
- mKeyFrames->GetKeyFrameAsValue( noOfKeyFrames - 1, value );
+ float time;
+ mKeyFrames->GetKeyFrameAsValue(noOfKeyFrames - 1, time, value);
}
return value;
}
-} // Internal
-} // Dali
+std::size_t KeyFrames::GetKeyFrameCount() const
+{
+ return mKeyFrames->GetNumberOfKeyFrames();
+}
+
+void KeyFrames::GetKeyFrame(std::size_t index, float& time, Property::Value& value) const
+{
+ if(index < mKeyFrames->GetNumberOfKeyFrames())
+ {
+ mKeyFrames->GetKeyFrameAsValue(index, time, value);
+ }
+}
+
+} // namespace Internal
+} // namespace Dali