+void AnimatedImageVisual::OnDoAction( const Dali::Property::Index actionId, const Dali::Property::Value& attributes )
+{
+ // Check if action is valid for this visual type and perform action if possible
+
+ switch ( actionId )
+ {
+ case DevelAnimatedImageVisual::Action::PAUSE:
+ {
+ // Pause will be executed on next timer tick
+ mActionStatus = DevelAnimatedImageVisual::Action::PAUSE;
+ break;
+ }
+ case DevelAnimatedImageVisual::Action::PLAY:
+ {
+ if( IsOnStage() && mActionStatus != DevelAnimatedImageVisual::Action::PLAY )
+ {
+ mFrameDelayTimer.Start();
+ }
+ mActionStatus = DevelAnimatedImageVisual::Action::PLAY;
+ break;
+ }
+ case DevelAnimatedImageVisual::Action::STOP:
+ {
+ // STOP reset functionality will actually be done in a future change
+ // Stop will be executed on next timer tick
+ mActionStatus = DevelAnimatedImageVisual::Action::STOP;
+ if( IsOnStage() )
+ {
+ DisplayNextFrame();
+ }
+ break;
+ }
+ case DevelAnimatedImageVisual::Action::JUMP_TO:
+ {
+ int32_t frameNumber;
+ if( attributes.Get( frameNumber ) )
+ {
+ if( frameNumber < 0 || frameNumber >= static_cast<int32_t>( mFrameCount ) )
+ {
+ DALI_LOG_ERROR( "Invalid frame index used.\n" );
+ }
+ else
+ {
+ mIsJumpTo = true;
+ mCurrentFrameIndex = frameNumber;
+ if( IsOnStage() )
+ {
+ DisplayNextFrame();
+ }
+ }
+ }
+ break;
+ }
+ }
+}
+