MCPcopy Create free account
hub / github.com/carbonengine/trinity / EnableTrack

Method EnableTrack

trinity/Controllers/Tr2TimelineController.cpp:565–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565void 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
612void Tr2TimelineController::RegisterCallback( const BlueSharedString& callbackName, const BlueScriptCallback& callback )
613{

Callers

nothing calls this directly

Calls 6

InRangeFunction · 0.85
sizeMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected