| 447 | } |
| 448 | |
| 449 | BlueStdResult 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 | |
| 475 | BlueStdResult Tr2TimelineController::SetActionTrackID( size_t index, uint32_t trackID ) |
| 476 | { |