/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// INTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/devel-api/common/set-wrapper.h>
#include <dali/internal/event/animation/animation-impl.h>
return new AnimationPlaylist();
}
-AnimationPlaylist::AnimationPlaylist()
-{
-}
+AnimationPlaylist::AnimationPlaylist() = default;
-AnimationPlaylist::~AnimationPlaylist()
-{
-}
+AnimationPlaylist::~AnimationPlaylist() = default;
void AnimationPlaylist::AnimationCreated( Animation& animation )
{
}
}
+void AnimationPlaylist::NotifyProgressReached( const SceneGraph::Animation* sceneGraphAnimation )
+{
+ std::vector< Dali::Animation > notifyProgressAnimations; // Will own animations until all emits have been done
+
+ for ( Dali::Vector< Animation* >::Iterator iter = mAnimations.Begin(); iter != mAnimations.End(); ++iter )
+ {
+ Animation* animation = *iter;
+
+ if ( ( animation->GetSceneObject() ) == sceneGraphAnimation )
+ {
+ // Store handles to animations that need signals emitted in the case of an animation being cleared in-between emits
+ notifyProgressAnimations.push_back( Dali::Animation( animation ) );
+ }
+ }
+
+ for ( std::vector< Dali::Animation >::iterator iter = notifyProgressAnimations.begin(); iter != notifyProgressAnimations.end(); ++iter )
+ {
+ Dali::Animation& handle = *iter;
+
+ GetImplementation(handle).EmitSignalProgressReached();
+ }
+}
+
+uint32_t AnimationPlaylist::GetAnimationCount()
+{
+ return mAnimations.Size();
+}
+
+Dali::Animation AnimationPlaylist::GetAnimationAt( uint32_t index )
+{
+ if( index >= mAnimations.Size() )
+ {
+ DALI_LOG_ERROR( "Animation index is out of bounds.\n" );
+ return Dali::Animation();
+ }
+ return Dali::Animation( mAnimations[index] );
+}
+
} // namespace Internal
} // namespace Dali