| 563 | } |
| 564 | |
| 565 | void Tr2TimelineController::EnableTrack( uint32_t trackID, bool enable ) |
| 566 | { |
| 567 | auto found = find( begin( m_disabledTracks ), end( m_disabledTracks ), trackID ); |
| 568 | if( enable ) |
| 569 | { |
| 570 | if( found != end( m_disabledTracks ) ) |
| 571 | { |
| 572 | m_disabledTracks.erase( found ); |
| 573 | } |
| 574 | else |
| 575 | { |
| 576 | return; |
| 577 | } |
| 578 | } |
| 579 | else |
| 580 | { |
| 581 | if( found == end( m_disabledTracks ) ) |
| 582 | { |
| 583 | m_disabledTracks.push_back( trackID ); |
| 584 | } |
| 585 | else |
| 586 | { |
| 587 | return; |
| 588 | } |
| 589 | } |
| 590 | if( m_isActive ) |
| 591 | { |
| 592 | CcpAutoMutex lock( g_controllerMutex ); |
| 593 | for( size_t i = 0; i < m_actions.size(); ++i ) |
| 594 | { |
| 595 | auto action = m_actions[i]; |
| 596 | auto& entry = m_entries[i]; |
| 597 | if( InRange( m_time, entry ) && entry.trackID == trackID ) |
| 598 | { |
| 599 | if( enable ) |
| 600 | { |
| 601 | action->Start( *this ); |
| 602 | } |
| 603 | else |
| 604 | { |
| 605 | action->Stop( *this ); |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | void Tr2TimelineController::RegisterCallback( const BlueSharedString& callbackName, const BlueScriptCallback& callback ) |
| 613 | { |