X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fanimation%2Fanimation-playlist.h;h=c31c11dfd047a9c035a9d68a516fd1f7369a00d7;hb=0c17fedc6fae9c4ca443b1eda9eab846215ca518;hp=41664da3590bad6ed9dc51006593456d65e885fa;hpb=df59eea2434495c32414fcf9ffafe4cb7dff5324;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/animation/animation-playlist.h b/dali/internal/event/animation/animation-playlist.h index 41664da..c31c11d 100644 --- a/dali/internal/event/animation/animation-playlist.h +++ b/dali/internal/event/animation/animation-playlist.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_ANIMATION_PLAYLIST_H__ -#define __DALI_INTERNAL_ANIMATION_PLAYLIST_H__ +#ifndef DALI_INTERNAL_ANIMATION_PLAYLIST_H +#define DALI_INTERNAL_ANIMATION_PLAYLIST_H /* - * 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. @@ -20,9 +20,11 @@ // INTERNAL INCLUDES #include -#include +#include +#include #include -#include +#include +#include namespace Dali { @@ -36,7 +38,7 @@ class Animation; * AnimationPlaylist provides notifications to applications when animations are finished. * It reference-counts playing animations, to allow "fire and forget" behaviour. */ -class AnimationPlaylist : public AnimationFinishedNotifier +class AnimationPlaylist : public CompleteNotificationInterface { public: @@ -74,11 +76,25 @@ public: void OnClear( Animation& animation ); /** - * From AnimationFinishedNotifier; emit "Finished" signal on any animations that have finished. - * This method should be called in the event-thread; the update-thread must use AnimationFinishedMessage. - * @post The "Finished" animations will no longer be referenced by AnimationPlaylist. + * @brief Notify that an animation has reached a progress marker + * @param[in] sceneGraphAnimation scene graph animation that has reached progress */ - void NotifyFinishedAnimations(); + void NotifyProgressReached( const SceneGraph::Animation* sceneGraphAnimation ); + + /** + * @brief Retrive the number of Animations. + * + * @return The number of Animations. + */ + uint32_t GetAnimationCount(); + + /** + * @brief Retrieve an Animation by index. + * + * @param[in] index The index of the Animation to retrieve + * @return The Dali::Animation for the given index or empty handle + */ + Dali::Animation GetAnimationAt( uint32_t index ); private: @@ -93,16 +109,33 @@ private: // Undefined AnimationPlaylist& operator=(const AnimationPlaylist& rhs); +private: // from CompleteNotificationInterface + + /** + * @copydoc CompleteNotificationInterface::NotifyCompleted() + */ + virtual void NotifyCompleted(); + private: - std::set< Animation* > mAnimations; ///< All existing animations (not referenced) + Dali::Vector< Animation* > mAnimations; ///< All existing animations (not owned) + std::vector< Dali::Animation > mPlaylist; ///< The currently playing animations (owned through handle) - std::set< Dali::Animation > mPlaylist; ///< The currently playing animations (reference counted) }; +/** + * Called when an animation reaches a progress marker + * + * Note animationPlaylist is of type CompleteNotificationInterface because of updateManager only knowing about the interface not actual playlist + */ +inline MessageBase* NotifyProgressReachedMessage( CompleteNotificationInterface& animationPlaylist, const SceneGraph::Animation* animation ) +{ + return new MessageValue1< AnimationPlaylist, const SceneGraph::Animation* >( static_cast(&animationPlaylist), &AnimationPlaylist::NotifyProgressReached, animation ); +} + } // namespace Internal } // namespace Dali -#endif // __DALI_INTERNAL_NOTIFICATION_MANAGER_H__ +#endif // DALI_INTERNAL_ANIMATION_PLAYLIST_H