X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fsigsession.h;h=37ea3abcdcd936f636714d68d2a01915cfee2bda;hb=c3a740dd5d095eb1cdf42e00df4d5a5c480ac5b3;hp=a624d1d216aaf6e0e280cfde4bf514a61ee118c4;hpb=e8d009288de28cb194bc7964f96677c2baf900c9;p=pulseview.git diff --git a/pv/sigsession.h b/pv/sigsession.h index a624d1d..37ea3ab 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -79,7 +79,13 @@ public: ~SigSession(); - std::shared_ptr get_device() const; + DeviceManager& device_manager(); + + const DeviceManager& device_manager() const; + + const std::shared_ptr& session() const; + + std::shared_ptr device() const; /** * Sets device instance that will be used in the next capture session. @@ -98,8 +104,9 @@ public: std::set< std::shared_ptr > get_data() const; - std::vector< std::shared_ptr > - get_signals() const; + std::mutex& signals_mutex() const; + + const std::vector< std::shared_ptr >& signals() const; #ifdef ENABLE_DECODE bool add_decoder(srd_decoder *const dec); @@ -140,6 +147,7 @@ private: private: DeviceManager &_device_manager; + std::shared_ptr _session; /** * The device instance that will be used in the next capture session. @@ -172,14 +180,6 @@ Q_SIGNALS: void data_received(); void frame_ended(); - -public: - // Hack. The libsigrok API now allows for multiple sessions. However, - // sigrok::Session calls are scattered around the PV architecture and a - // single SigSession object is being used across multiple sequential - // sessions. This is a mess. For now just keep a single sigrok::Session - // pointer here which we can use for all those scattered calls. - static std::shared_ptr _sr_session; }; } // namespace pv