- // TODO: This should not be necessary. Multiple concurrent
- // sessions should should be supported and it should be
- // possible to associate a pointer with a sr_session.
- static SigSession *_session;
+ DeviceManager &device_manager_;
+ std::shared_ptr<sigrok::Session> session_;
+
+ /**
+ * The device instance that will be used in the next capture session.
+ */
+ std::shared_ptr<sigrok::Device> device_;
+
+ std::vector< std::shared_ptr<view::DecodeTrace> > decode_traces_;
+
+ mutable std::mutex sampling_mutex_;
+ capture_state capture_state_;
+
+ mutable boost::shared_mutex signals_mutex_;
+ std::vector< std::shared_ptr<view::Signal> > signals_;
+
+ mutable std::mutex data_mutex_;
+ std::shared_ptr<data::Logic> logic_data_;
+ std::shared_ptr<data::LogicSnapshot> cur_logic_snapshot_;
+ std::map< std::shared_ptr<sigrok::Channel>, std::shared_ptr<data::AnalogSnapshot> >
+ cur_analog_snapshots_;
+
+ std::thread sampling_thread_;
+
+Q_SIGNALS:
+ void capture_state_changed(int state);
+
+ void signals_changed();
+
+ void frame_began();
+
+ void data_received();
+
+ void frame_ended();