| 625 | } |
| 626 | |
| 627 | void Tr2TimelineController::SetTime( float time ) |
| 628 | { |
| 629 | if( !m_isActive ) |
| 630 | { |
| 631 | return; |
| 632 | } |
| 633 | if( time == m_time ) |
| 634 | { |
| 635 | return; |
| 636 | } |
| 637 | |
| 638 | auto oldTime = m_time; |
| 639 | m_time = time; |
| 640 | |
| 641 | CcpAutoMutex lock( g_controllerMutex ); |
| 642 | for( size_t i = 0; i < m_actions.size(); ++i ) |
| 643 | { |
| 644 | if( !IsActionEnabled( i ) ) |
| 645 | { |
| 646 | continue; |
| 647 | } |
| 648 | auto action = m_actions[i]; |
| 649 | auto& entry = m_entries[i]; |
| 650 | auto wasActive = InRange( oldTime, entry ); |
| 651 | auto nowActive = InRange( m_time, entry ); |
| 652 | if( wasActive && !nowActive ) |
| 653 | { |
| 654 | action->Stop( *this ); |
| 655 | } |
| 656 | else if( !wasActive && nowActive ) |
| 657 | { |
| 658 | action->Start( *this ); |
| 659 | } |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | void Tr2TimelineController::Pause() |
| 664 | { |