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

Method SetActionTrackID

trinity/Controllers/Tr2TimelineController.cpp:475–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475BlueStdResult Tr2TimelineController::SetActionTrackID( size_t index, uint32_t trackID )
476{
477 if( index >= m_actions.size() )
478 {
479 return BlueStdResult( BLUE_STD_RESULT_VALUE_ERROR, "Index out of range" );
480 }
481 auto wasActive = IsActionEnabled( index );
482 m_entries[index].trackID = trackID;
483 auto nowActive = IsActionEnabled( index );
484 if( m_isActive && wasActive != nowActive )
485 {
486 auto action = m_actions[index];
487 auto& entry = m_entries[index];
488 if( InRange( m_time, entry ) )
489 {
490 CcpAutoMutex lock( g_controllerMutex );
491 if( nowActive )
492 {
493 action->Start( *this );
494 }
495 else
496 {
497 action->Stop( *this );
498 }
499 }
500 }
501 return {};
502}
503
504void Tr2TimelineController::AddAction( ITr2ControllerAction* action, float startTime, float endTime, uint32_t trackID )
505{

Callers

nothing calls this directly

Calls 4

InRangeFunction · 0.85
sizeMethod · 0.80
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected