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

Method SetActionEndTime

trinity/Controllers/Tr2TimelineController.cpp:449–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449BlueStdResult Tr2TimelineController::SetActionEndTime( size_t index, float endTime )
450{
451 if( index >= m_actions.size() )
452 {
453 return BlueStdResult( BLUE_STD_RESULT_VALUE_ERROR, "Index out of range" );
454 }
455 if( m_isActive && IsActionEnabled( index ) )
456 {
457 CcpAutoMutex lock( g_controllerMutex );
458 auto action = m_actions[index];
459 auto& entry = m_entries[index];
460 auto wasActive = InRange( m_time, entry );
461 auto nowActive = InRange( m_time, { entry.startTime, endTime } );
462 if( wasActive && !nowActive )
463 {
464 action->Stop( *this );
465 }
466 else if( !wasActive && nowActive )
467 {
468 action->Start( *this );
469 }
470 }
471 m_entries[index].endTime = endTime;
472 return {};
473}
474
475BlueStdResult Tr2TimelineController::SetActionTrackID( size_t index, uint32_t trackID )
476{

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected