Remove DecodeStack dependency from decode binding wrapper
[pulseview.git] / pv / data / decodesignal.hpp
index f9b866e27e583ce66b593516e6983e55937477ba..cdd061a9769a45484170bd8e69b82a1b131443b7 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef PULSEVIEW_PV_DATA_DECODESIGNAL_HPP
 #define PULSEVIEW_PV_DATA_DECODESIGNAL_HPP
 
+#include <unordered_set>
 #include <vector>
 
 #include <QString>
 #include <libsigrokdecode/libsigrokdecode.h>
 
 #include <pv/data/signalbase.hpp>
+#include <pv/util.hpp>
 
 using std::list;
+using std::unordered_set;
 using std::vector;
 using std::shared_ptr;
 
@@ -62,7 +65,8 @@ class DecodeSignal : public SignalBase
        Q_OBJECT
 
 public:
-       DecodeSignal(shared_ptr<pv::data::DecoderStack> decoder_stack);
+       DecodeSignal(shared_ptr<pv::data::DecoderStack> decoder_stack,
+               const unordered_set< shared_ptr<data::SignalBase> > &all_signals);
        virtual ~DecodeSignal();
 
        bool is_decode_signal() const;
@@ -73,13 +77,20 @@ public:
        void remove_decoder(int index);
        bool toggle_decoder_visibility(int index);
 
+       void begin_decode();
        QString error_message() const;
 
        const list<data::DecodeChannel> get_channels() const;
+       void auto_assign_signals();
        void assign_signal(const uint16_t channel_id, const SignalBase *signal);
 
        void set_initial_pin_state(const uint16_t channel_id, const int init_state);
 
+       double samplerate() const;
+       const pv::util::Timestamp& start_time() const;
+       int64_t sample_count() const;
+       int64_t samples_decoded() const;
+
        vector<decode::Row> visible_rows() const;
 
        /**
@@ -102,6 +113,7 @@ private Q_SLOTS:
 
 private:
        shared_ptr<pv::data::DecoderStack> decoder_stack_;
+       const unordered_set< shared_ptr<data::SignalBase> > &all_signals_;
        list<data::DecodeChannel> channels_;
 };