| 149 | } |
| 150 | |
| 151 | void VideoController::PlayLine() { |
| 152 | Stop(); |
| 153 | |
| 154 | AssDialogue *curline = context->selectionController->GetActiveLine(); |
| 155 | if (!curline) return; |
| 156 | |
| 157 | context->audioController->PlayRange(TimeRange(curline->Start, curline->End)); |
| 158 | |
| 159 | // Round-trip conversion to convert start to exact |
| 160 | int startFrame = FrameAtTime(context->selectionController->GetActiveLine()->Start, agi::vfr::START); |
| 161 | start_ms = TimeAtFrame(startFrame); |
| 162 | end_frame = FrameAtTime(context->selectionController->GetActiveLine()->End, agi::vfr::END) + 1; |
| 163 | |
| 164 | JumpToFrame(startFrame); |
| 165 | |
| 166 | playback_start_time = std::chrono::steady_clock::now(); |
| 167 | playback.Start(10); |
| 168 | } |
| 169 | |
| 170 | void VideoController::Stop() { |
| 171 | if (IsPlaying()) { |
no test coverage detected