- // 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();