| 2790 | } |
| 2791 | |
| 2792 | void MainWindow::enableAutoplay() { |
| 2793 | autoplay_pending_ = true; |
| 2794 | // Start looped playback the first time the engine reports a non-empty range — set |
| 2795 | // synchronously by --test-data, or asynchronously once --layout's worker load |
| 2796 | // finishes and seeds the range. Guarded by autoplay_pending_ so it fires exactly |
| 2797 | // once (the rangeChanged connection stays but no-ops afterward), leaving a later |
| 2798 | // manual pause/seek untouched. |
| 2799 | PlaybackEngine& playback = session_->playbackEngine(); |
| 2800 | connect(&playback, &PlaybackEngine::rangeChanged, this, [this](double min, double max) { |
| 2801 | if (!autoplay_pending_ || !(max > min)) { |
| 2802 | return; |
| 2803 | } |
| 2804 | autoplay_pending_ = false; |
| 2805 | PlaybackEngine& pb = session_->playbackEngine(); |
| 2806 | pb.setLooping(true); |
| 2807 | pb.play(); |
| 2808 | }); |
| 2809 | } |
| 2810 | |
| 2811 | void MainWindow::applyRestoredLayout(QDomDocument doc, const QString& path) { |
| 2812 | // 3. Filters + curve rebinding + plot apply happen together in restoreWorkspaceState |
no test coverage detected