]> sigrok.org Git - pulseview.git/blobdiff - pv/mainwindow.cpp
Added proof of concept start/stop support
[pulseview.git] / pv / mainwindow.cpp
index c8c091d8938d5c863bd9cd1508df20f557ed146f..f1493667b766787100f9e8e07a3b9f1107fcb613 100644 (file)
@@ -184,10 +184,18 @@ void MainWindow::on_actionAbout_triggered()
 
 void MainWindow::run_stop()
 {
-       _session.start_capture(
-               _sampling_bar->get_selected_device(),
-               _sampling_bar->get_record_length(),
-               _sampling_bar->get_sample_rate());
+       switch(_session.get_capture_state()) {
+       case SigSession::Stopped:
+               _session.start_capture(
+                       _sampling_bar->get_selected_device(),
+                       _sampling_bar->get_record_length(),
+                       _sampling_bar->get_sample_rate());
+               break;
+
+       case SigSession::Running:
+               _session.stop_capture();
+               break;
+       }
 }
 
 } // namespace pv