+ // Make not set any action when the resource status is already failed.
+ if(mImpl->mResourceStatus == Toolkit::Visual::ResourceStatus::FAILED)
+ {
+ return;
+ }
+
+ // 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(mFrameDelayTimer && IsOnScene() && 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(IsOnScene())
+ {
+ 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;
+ mFrameIndexForJumpTo = frameNumber;
+ if(IsOnScene())
+ {
+ DisplayNextFrame();
+ }
+ }
+ }
+ break;
+ }
+ }
+}