| 473 | } |
| 474 | |
| 475 | BlueStdResult 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 | |
| 504 | void Tr2TimelineController::AddAction( ITr2ControllerAction* action, float startTime, float endTime, uint32_t trackID ) |
| 505 | { |