X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=0184ef0937c2fd6029cbd0899c8d6719ed3899db;hp=195c460a1de90f3aea20b3fb4af9745a6a34103b;hb=2220e94218298b208041c5e828595d9e1b842c88;hpb=d2fc6be9af3ba409032da6dcabc4630c657bb56c diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 195c460..0184ef0 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -666,20 +666,6 @@ void MainWindow::save_selection_to_file() // Stop any currently running capture session session_.stop_capture(); - // Get sample rate - double samplerate = 0.0; - - for (const shared_ptr d : session_.get_data()) { - assert(d); - const vector< shared_ptr > segments = - d->segments(); - for (const shared_ptr &s : segments) - samplerate = std::max(samplerate, s->samplerate()); - } - - if (samplerate == 0.0) - samplerate = 1; - // Verify that the cursors are active and fetch their values if (!view_->cursors()->enabled()) { show_session_error(tr("Missing Cursors"), tr("You need to set the " \ @@ -688,6 +674,8 @@ void MainWindow::save_selection_to_file() return; } + const double samplerate = session_.get_samplerate(); + const pv::util::Timestamp& start_time = view_->cursors()->first()->time(); const pv::util::Timestamp& end_time = view_->cursors()->second()->time();