]> sigrok.org Git - pulseview.git/commitdiff
Removed sample_rate parameter from start_capture
authorJoel Holdsworth <redacted>
Sun, 3 Mar 2013 17:05:46 +0000 (17:05 +0000)
committerJoel Holdsworth <redacted>
Sun, 3 Mar 2013 18:15:31 +0000 (18:15 +0000)
We now rely on the statefulness of the device instance instead

pv/mainwindow.cpp
pv/sigsession.cpp
pv/sigsession.h

index 1ee3f4e0d62b0142ac7e93d6db544d60545ecc90..99e545681e71a3a71042dd30c56818606629e24d 100644 (file)
@@ -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:
index 11ba6b068a180df0cb281c94a577ef7329d070de..fc26a23d784b0f5b2c11fecf993e01358f582428 100644 (file)
@@ -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;
index af01ec40a0a59b695bf639bbff367422bc56e306..7805eec65085ee24d7d2f8917eb09f0eca774172 100644 (file)
@@ -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);