X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fanimation%2Fanimation-playlist.cpp;h=c39385f7fef20f962f6088aaa295cd3c59a40556;hb=0c17fedc6fae9c4ca443b1eda9eab846215ca518;hp=866a4001a5e1924e09b5649b5acb93952193015e;hpb=ec5c7c35fc7991cd4b98d2a641e3e94263a284de;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/animation/animation-playlist.cpp b/dali/internal/event/animation/animation-playlist.cpp index 866a400..c39385f 100644 --- a/dali/internal/event/animation/animation-playlist.cpp +++ b/dali/internal/event/animation/animation-playlist.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -21,7 +21,6 @@ // INTERNAL INCLUDES #include -#include #include @@ -91,6 +90,7 @@ void AnimationPlaylist::NotifyCompleted() // The animation may be present in mPlaylist - remove if necessary // Note that the animation "Finish" signal is emitted after Stop() has been called std::vector< Dali::Animation >::iterator iter = std::find( mPlaylist.begin(), mPlaylist.end(), Dali::Animation(animation) ); + DALI_ASSERT_DEBUG(iter != mPlaylist.end()); mPlaylist.erase( iter ); } } @@ -104,6 +104,44 @@ void AnimationPlaylist::NotifyCompleted() } } +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