MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / enableAutoplay

Method enableAutoplay

pj_app/src/MainWindow.cpp:2792–2809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2790}
2791
2792void 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
2811void MainWindow::applyRestoredLayout(QDomDocument doc, const QString& path) {
2812 // 3. Filters + curve rebinding + plot apply happen together in restoreWorkspaceState

Callers 1

mainFunction · 0.80

Calls 2

setLoopingMethod · 0.80
playMethod · 0.80

Tested by

no test coverage detected