| 502 | } |
| 503 | |
| 504 | void Tr2TimelineController::AddAction( ITr2ControllerAction* action, float startTime, float endTime, uint32_t trackID ) |
| 505 | { |
| 506 | if( !action ) |
| 507 | { |
| 508 | return; |
| 509 | } |
| 510 | |
| 511 | m_actions.Append( action ); |
| 512 | |
| 513 | if( m_owner ) |
| 514 | { |
| 515 | action->Link( *this ); |
| 516 | } |
| 517 | Tr2TimelineEntry entry = { startTime, endTime, trackID }; |
| 518 | m_entries.Append( &entry ); |
| 519 | |
| 520 | if( m_isActive ) |
| 521 | { |
| 522 | if( InRange( m_time, entry ) && IsActionEnabled( m_entries.size() - 1 ) ) |
| 523 | { |
| 524 | CcpAutoMutex lock( g_controllerMutex ); |
| 525 | action->Start( *this ); |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | BlueStdResult Tr2TimelineController::RemoveAction( size_t index ) |
| 531 | { |