X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsigsession.h;h=8da89d09b3fd6d0cde07fea0fde589d90e779902;hp=29929a9dde63d1b1bbc4520885d28cc3e719370e;hb=5b7cf66c34d7beeef055b06b95d72f9d7a3de680;hpb=8d634081d8b0cc741dd34d8c646474ff6754aea8 diff --git a/pv/sigsession.h b/pv/sigsession.h index 29929a9d..8da89d09 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -22,8 +22,10 @@ #define PULSEVIEW_PV_SIGSESSION_H #include +#include #include +#include #include #include @@ -45,6 +47,12 @@ class SigSession : public QObject { Q_OBJECT +public: + enum capture_state { + Stopped, + Running + }; + public: SigSession(); @@ -52,15 +60,22 @@ public: void load_file(const std::string &name); + capture_state get_capture_state() const; + void start_capture(struct sr_dev_inst* sdi, uint64_t record_length, uint64_t sample_rate); - std::vector< boost::shared_ptr >& + void stop_capture(); + + std::vector< boost::shared_ptr > get_signals(); boost::shared_ptr get_data(); private: + void sample_thread_proc(struct sr_dev_inst *sdi, + uint64_t record_length, uint64_t sample_rate); + void data_feed_in(const struct sr_dev_inst *sdi, struct sr_datafeed_packet *packet); @@ -68,11 +83,21 @@ private: struct sr_datafeed_packet *packet); private: + mutable boost::mutex _state_mutex; + capture_state _capture_state; + + mutable boost::mutex _signals_mutex; std::vector< boost::shared_ptr > _signals; + + mutable boost::mutex _data_mutex; boost::shared_ptr _logic_data; boost::shared_ptr _cur_logic_snapshot; + std::auto_ptr _sampling_thread; + signals: + void signals_changed(); + void data_updated(); private: