X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fsigsession.cpp;h=e4a58a6190af8bc023c31297751cfd7ccf430596;hb=7d29656f1e4de945eee3a9ea5dbc0ef88c4a7e30;hp=580b6796c680f8a76c679dfad20d7ea11640aaa4;hpb=5b7cf66c34d7beeef055b06b95d72f9d7a3de680;p=pulseview.git diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 580b679..e4a58a6 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -94,8 +94,6 @@ void SigSession::stop_capture() if(_sampling_thread.get()) _sampling_thread->join(); _sampling_thread.reset(); - - _capture_state = Stopped; } vector< shared_ptr > SigSession::get_signals() @@ -109,6 +107,13 @@ boost::shared_ptr SigSession::get_data() return _logic_data; } +void SigSession::set_capture_state(capture_state state) +{ + lock_guard 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) { @@ -140,13 +145,12 @@ void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, return; } - { - lock_guard lock(_state_mutex); - _capture_state = Running; - } + set_capture_state(Running); sr_session_run(); sr_session_destroy(); + + set_capture_state(Stopped); } void SigSession::data_feed_in(const struct sr_dev_inst *sdi,