| 420 | } |
| 421 | |
| 422 | BlueStdResult Tr2TimelineController::SetActionStartTime( size_t index, float startTime ) |
| 423 | { |
| 424 | if( index >= m_actions.size() ) |
| 425 | { |
| 426 | return BlueStdResult( BLUE_STD_RESULT_VALUE_ERROR, "Index out of range" ); |
| 427 | } |
| 428 | if( m_isActive && IsActionEnabled( index ) ) |
| 429 | { |
| 430 | auto action = m_actions[index]; |
| 431 | auto& entry = m_entries[index]; |
| 432 | auto wasActive = InRange( m_time, entry ); |
| 433 | auto nowActive = InRange( m_time, { startTime, entry.endTime } ); |
| 434 | if( wasActive && !nowActive ) |
| 435 | { |
| 436 | CcpAutoMutex lock( g_controllerMutex ); |
| 437 | action->Stop( *this ); |
| 438 | } |
| 439 | else if( !wasActive && nowActive ) |
| 440 | { |
| 441 | CcpAutoMutex lock( g_controllerMutex ); |
| 442 | action->Start( *this ); |
| 443 | } |
| 444 | } |
| 445 | m_entries[index].startTime = startTime; |
| 446 | return {}; |
| 447 | } |
| 448 | |
| 449 | BlueStdResult Tr2TimelineController::SetActionEndTime( size_t index, float endTime ) |
| 450 | { |