* @brief Seeks to a normalized position and rebuilds plot history around it. */
| 612 | * @brief Seeks to a normalized position and rebuilds plot history around it. |
| 613 | */ |
| 614 | void Sessions::Player::setProgress(const double progress) |
| 615 | { |
| 616 | if (!isOpen()) |
| 617 | return; |
| 618 | |
| 619 | const auto clamped = std::clamp(progress, 0.0, 1.0); |
| 620 | if (isPlaying()) |
| 621 | pause(); |
| 622 | |
| 623 | const int newPos = qMin(frameCount() - 1, qCeil(frameCount() * clamped)); |
| 624 | if (newPos == m_framePos) |
| 625 | return; |
| 626 | |
| 627 | m_framePos = newPos; |
| 628 | |
| 629 | UI::Dashboard::instance().clearPlotData(); |
| 630 | |
| 631 | const int toLoad = UI::Dashboard::instance().points(); |
| 632 | const int startIdx = std::max(0, m_framePos - toLoad); |
| 633 | processFrameBatch(startIdx, m_framePos); |
| 634 | |
| 635 | updateData(); |
| 636 | } |
| 637 | |
| 638 | /** |
| 639 | * @brief Advances one frame and rebuilds the trailing plot window. |
nothing calls this directly
no test coverage detected