Moved DevInst into the pv::device namespace
[pulseview.git] / pv / toolbars / samplingbar.h
index 6fc8abd38e0fcdce4bcd6a45f2a4a36233f0b424..db4e856e26dfff48a59a80bae7f41909aa124e30 100644 (file)
@@ -24,6 +24,9 @@
 #include <stdint.h>
 
 #include <list>
+#include <map>
+
+#include <boost/shared_ptr.hpp>
 
 #include <QComboBox>
 #include <QDoubleSpinBox>
 #include <pv/widgets/popuptoolbutton.h>
 #include <pv/widgets/sweeptimingwidget.h>
 
-struct st_dev_inst;
 class QAction;
 
 namespace pv {
 
 class SigSession;
 
+namespace device {
+class DevInst;
+}
+
 namespace toolbars {
 
 class SamplingBar : public QToolBar
@@ -55,10 +61,13 @@ private:
 public:
        SamplingBar(SigSession &session, QWidget *parent);
 
-       void set_device_list(const std::list<struct sr_dev_inst*> &devices);
+       void set_device_list(
+               const std::list< boost::shared_ptr<pv::device::DevInst> >
+                       &devices);
 
-       struct sr_dev_inst* get_selected_device() const;
-       void set_selected_device(struct sr_dev_inst *const sdi);
+       boost::shared_ptr<pv::device::DevInst> get_selected_device() const;
+       void set_selected_device(
+               boost::shared_ptr<pv::device::DevInst> dev_inst);
 
        void set_capture_state(pv::SigSession::capture_state state);
 
@@ -78,10 +87,14 @@ private slots:
        void on_sample_rate_changed();
        void on_run_stop();
 
+       void on_config_changed();
+
 private:
        SigSession &_session;
 
        QComboBox _device_selector;
+       std::map<const sr_dev_inst*, boost::weak_ptr<device::DevInst> >
+               _device_selector_map;
        bool _updating_device_selector;
 
        pv::widgets::PopupToolButton _configure_button;