+ ResetValue( mCurrentLoopUpdated, mCurrentLoop, currentLoopCount, mConditionalWait );
+ }
+ }
+ else if( currentFrame == startFrame && !mForward ) // first frame
+ {
+ if( loopCount < 0 || ++currentLoopCount < loopCount ) // repeat forever or before the last loop
+ {
+ mForward = true;
+ }
+ else
+ {
+ animationFinished = true; // end of animation
+ }
+ ResetValue( mCurrentLoopUpdated, mCurrentLoop, currentLoopCount, mConditionalWait );
+ }
+
+ if( animationFinished )
+ {
+ if( mStopBehavior == DevelImageVisual::StopBehavior::CURRENT_FRAME )
+ {
+ stopped = true;
+ }
+ else
+ {
+ mPlayState = PlayState::STOPPING;