| 528 | } |
| 529 | |
| 530 | BlueStdResult Tr2TimelineController::RemoveAction( size_t index ) |
| 531 | { |
| 532 | if( index >= m_actions.size() ) |
| 533 | { |
| 534 | return BlueStdResult( BLUE_STD_RESULT_VALUE_ERROR, "Index out of range" ); |
| 535 | } |
| 536 | if( m_owner ) |
| 537 | { |
| 538 | if( m_isActive && IsActionEnabled( index ) ) |
| 539 | { |
| 540 | auto action = m_actions[index]; |
| 541 | auto& entry = m_entries[index]; |
| 542 | if( InRange( m_time, entry ) ) |
| 543 | { |
| 544 | CcpAutoMutex lock( g_controllerMutex ); |
| 545 | action->Stop( *this ); |
| 546 | } |
| 547 | } |
| 548 | m_actions[index]->Unlink(); |
| 549 | } |
| 550 | m_actions.Remove( index ); |
| 551 | m_entries.Remove( index ); |
| 552 | return {}; |
| 553 | } |
| 554 | |
| 555 | bool Tr2TimelineController::IsActionEnabled( size_t index ) const |
| 556 | { |