} // anonymous namespace
-
AnimationPtr Animation::New(float durationSeconds)
{
if( durationSeconds < 0.0f )
return animation;
}
-Animation::Animation( EventThreadServices& eventThreadServices, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, EndAction disconnectAction, AlphaFunction defaultAlpha )
-: mAnimation( nullptr ),
- mEventThreadServices( eventThreadServices ),
- mPlaylist( playlist ),
- mFinishedSignal(),
- mConnectors(),
- mConnectorTargetValues(),
- mPlayRange( Vector2(0.0f,1.0f)),
- mDurationSeconds( durationSeconds ),
- mSpeedFactor(1.0f),
- mNotificationCount( 0 ),
- mLoopCount(1),
- mCurrentLoop(0),
- mEndAction( endAction ),
- mDisconnectAction( disconnectAction ),
- mDefaultAlpha( defaultAlpha ),
- mState(Dali::Animation::STOPPED),
- mProgressReachedMarker( 0.0f ),
- mDelaySeconds( 0.0f ),
- mAutoReverseEnabled( false )
+Animation::Animation(EventThreadServices& eventThreadServices, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, EndAction disconnectAction, AlphaFunction defaultAlpha)
+: mEventThreadServices(eventThreadServices),
+ mPlaylist(playlist),
+ mDefaultAlpha(defaultAlpha),
+ mDurationSeconds(durationSeconds),
+ mEndAction(endAction),
+ mDisconnectAction(disconnectAction)
{
}
class Animation : public BaseObject
{
public:
-
- enum Type
+ enum Type : uint8_t
{
- TO, ///< Animating TO the given value
- BY, ///< Animating BY the given value
- BETWEEN ///< Animating BETWEEN key-frames
+ TO, ///< Animating TO the given value
+ BY, ///< Animating BY the given value
+ BETWEEN ///< Animating BETWEEN key-frames
};
using EndAction = Dali::Animation::EndAction;
Animation::Type animatorType{TO};
};
- enum class Notify
+ enum class Notify : uint8_t
{
USE_CURRENT_VALUE, ///< Set the current value for the property
USE_TARGET_VALUE, ///< Set the animator's target value for the property
void SendFinalProgressNotificationMessage();
private:
+ using AnimatorConnectorContainer = OwnerContainer<AnimatorConnectorBase*>;
+ using ConnectorTargetValuesContainer = std::vector<ConnectorTargetValues>;
- const SceneGraph::Animation* mAnimation;
+ const SceneGraph::Animation* mAnimation{ nullptr };
EventThreadServices& mEventThreadServices;
- AnimationPlaylist& mPlaylist;
-
- Dali::Animation::AnimationSignalType mFinishedSignal;
-
- Dali::Animation::AnimationSignalType mProgressReachedSignal;
-
- using AnimatorConnectorContainer = OwnerContainer<AnimatorConnectorBase*>;
- AnimatorConnectorContainer mConnectors; ///< Owned by the Animation
-
- using ConnectorTargetValuesContainer = std::vector<ConnectorTargetValues>;
- ConnectorTargetValuesContainer mConnectorTargetValues; //< Used to store animating property target value information
-
- Vector2 mPlayRange;
-
- float mDurationSeconds;
- float mSpeedFactor;
- int32_t mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
- int32_t mLoopCount;
- int32_t mCurrentLoop;
- EndAction mEndAction;
- EndAction mDisconnectAction;
- AlphaFunction mDefaultAlpha;
- Dali::Animation::State mState;
- float mProgressReachedMarker;
- float mDelaySeconds;
- bool mAutoReverseEnabled; ///< Flag to identify that the looping mode is auto reverse.
+ AnimationPlaylist& mPlaylist;
+
+ Dali::Animation::AnimationSignalType mFinishedSignal{};
+ Dali::Animation::AnimationSignalType mProgressReachedSignal{};
+
+ AnimatorConnectorContainer mConnectors{}; ///< Owned by the Animation
+ ConnectorTargetValuesContainer mConnectorTargetValues{}; //< Used to store animating property target value information
+
+ AlphaFunction mDefaultAlpha;
+ Vector2 mPlayRange{0.0f, 1.0f};
+ float mDurationSeconds;
+ float mSpeedFactor{1.0f};
+ int32_t mNotificationCount{0}; ///< Keep track of how many Finished signals have been emitted.
+ int32_t mLoopCount{1};
+ int32_t mCurrentLoop{0};
+ float mProgressReachedMarker{0.0f};
+ float mDelaySeconds{0.0f};
+ EndAction mEndAction;
+ EndAction mDisconnectAction;
+ Dali::Animation::State mState{Dali::Animation::STOPPED};
+ bool mAutoReverseEnabled{false}; ///< Flag to identify that the looping mode is auto reverse.
};
} // namespace Internal
*/
// EXTERNAL INCLUDES
-#include <cstdint> // uint32_t
+#include <cstdint> // uint32_t, uint8_t
// INTERNAL INCLUDES
#include <dali/public-api/animation/alpha-function.h>
* @brief Enumeration for what to do when the animation ends, is stopped, or is destroyed.
* @SINCE_1_0.0
*/
- enum EndAction
+ enum EndAction : uint8_t
{
BAKE, ///< When the animation ends, the animated property values are saved. @SINCE_1_0.0
DISCARD, ///< When the animation ends, the animated property values are forgotten. @SINCE_1_0.0
* @brief Enumeration for what interpolation method to use on key-frame animations.
* @SINCE_1_0.0
*/
- enum Interpolation
+ enum Interpolation : uint8_t
{
LINEAR, ///< Values in between key frames are interpolated using a linear polynomial. (Default) @SINCE_1_0.0
CUBIC ///< Values in between key frames are interpolated using a cubic polynomial. @SINCE_1_0.0
*
* @SINCE_1_1.21
*/
- enum State
+ enum State : uint8_t
{
STOPPED, ///< Animation has stopped @SINCE_1_1.21
PLAYING, ///< The animation is playing @SINCE_1_1.21
*
* @SINCE_1_2.60
*/
- enum LoopingMode
+ enum LoopingMode : uint8_t
{
RESTART, ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning. @SINCE_1_2.60
AUTO_REVERSE ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again. @SINCE_1_2.60