From 6745ffbbcf4d8bc858c9094f1e95683a529382a7 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sun, 3 Mar 2013 17:05:46 +0000 Subject: [PATCH] Removed sample_rate parameter from start_capture We now rely on the statefulness of the device instance instead --- pv/mainwindow.cpp | 3 +-- pv/sigsession.cpp | 14 +++----------- pv/sigsession.h | 6 +++--- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 1ee3f4e0..99e54568 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -228,8 +228,7 @@ void MainWindow::run_stop() case SigSession::Stopped: _session.start_capture( _sampling_bar->get_selected_device(), - _sampling_bar->get_record_length(), - _sampling_bar->get_sample_rate()); + _sampling_bar->get_record_length()); break; case SigSession::Running: diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 11ba6b06..fc26a23d 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -72,13 +72,13 @@ SigSession::capture_state SigSession::get_capture_state() const } void SigSession::start_capture(struct sr_dev_inst *sdi, - uint64_t record_length, uint64_t sample_rate) + uint64_t record_length) { stop_capture(); _sampling_thread.reset(new boost::thread( &SigSession::sample_thread_proc, this, sdi, - record_length, sample_rate)); + record_length)); } void SigSession::stop_capture() @@ -135,7 +135,7 @@ void SigSession::load_thread_proc(const string name) } void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, - uint64_t record_length, uint64_t sample_rate) + uint64_t record_length) { assert(sdi); @@ -156,14 +156,6 @@ void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, return; } - // Set the samplerate - if (sr_config_set(sdi, SR_CONF_SAMPLERATE, - &sample_rate) != SR_OK) { - qDebug() << "Failed to configure samplerate."; - sr_session_destroy(); - return; - } - if (sr_session_start() != SR_OK) { qDebug() << "Failed to start session."; return; diff --git a/pv/sigsession.h b/pv/sigsession.h index af01ec40..7805eec6 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -64,8 +64,8 @@ public: capture_state get_capture_state() const; - void start_capture(struct sr_dev_inst* sdi, uint64_t record_length, - uint64_t sample_rate); + void start_capture(struct sr_dev_inst* sdi, + uint64_t record_length); void stop_capture(); @@ -81,7 +81,7 @@ private: void load_thread_proc(const std::string name); void sample_thread_proc(struct sr_dev_inst *sdi, - uint64_t record_length, uint64_t sample_rate); + uint64_t record_length); void feed_in_header(const sr_dev_inst *sdi); -- 2.30.2