* @brief Seeks to a specific position in the file */
| 566 | * @brief Seeks to a specific position in the file |
| 567 | */ |
| 568 | void MDF4::Player::setProgress(const double progress) |
| 569 | { |
| 570 | if (!isOpen()) |
| 571 | return; |
| 572 | |
| 573 | if (isPlaying()) |
| 574 | pause(); |
| 575 | |
| 576 | int newFramePos = qBound(0, static_cast<int>(progress * frameCount()), frameCount() - 1); |
| 577 | |
| 578 | if (newFramePos != m_framePos) { |
| 579 | m_framePos = newFramePos; |
| 580 | |
| 581 | UI::Dashboard::instance().clearPlotData(); |
| 582 | |
| 583 | int framesToLoad = UI::Dashboard::instance().points(); |
| 584 | int startFrame = std::max(0, m_framePos - framesToLoad); |
| 585 | int endFrame = std::min(frameCount() - 1, m_framePos); |
| 586 | |
| 587 | processFrameBatch(startFrame, endFrame); |
| 588 | |
| 589 | updateData(); |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | //-------------------------------------------------------------------------------------------------- |
| 594 | // Data processing |
nothing calls this directly
no test coverage detected