+{
+ stop_capture();
+
+
+ _sampling_thread.reset(new boost::thread(
+ &SigSession::sample_thread_proc, this, sdi,
+ record_length, sample_rate));
+}
+
+void SigSession::stop_capture()
+{
+ if (get_capture_state() == Stopped)
+ return;
+
+ sr_session_stop();
+
+ // Check that sampling stopped
+ if (_sampling_thread.get())
+ _sampling_thread->join();
+ _sampling_thread.reset();
+}
+
+vector< shared_ptr<view::Signal> > SigSession::get_signals()
+{
+ lock_guard<mutex> lock(_signals_mutex);
+ return _signals;
+}
+
+boost::shared_ptr<LogicData> SigSession::get_data()
+{
+ return _logic_data;
+}
+
+void SigSession::set_capture_state(capture_state state)
+{
+ lock_guard<mutex> lock(_state_mutex);
+ _capture_state = state;
+ capture_state_changed(state);
+}
+
+void SigSession::sample_thread_proc(struct sr_dev_inst *sdi,
+ uint64_t record_length, uint64_t sample_rate)