]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decoderstack.h
Added show/hide decoder button
[pulseview.git] / pv / data / decoderstack.h
index 8b9d29b2bf89e487c31bf12e030b98678d618e2c..339c1e0386daf3cd1b9421b67613956564444428 100644 (file)
 #include <QObject>
 #include <QString>
 
+#include <pv/data/decode/row.h>
+#include <pv/data/decode/rowdata.h>
+
 struct srd_decoder;
+struct srd_decoder_annotation_row;
 struct srd_probe;
 struct srd_proto_data;
 
@@ -43,16 +47,12 @@ namespace pv {
 
 namespace view {
 class LogicSignal;
-
-namespace decode {
-class Annotation;
-}
-
 }
 
 namespace data {
 
 namespace decode {
+class Annotation;
 class Decoder;
 }
 
@@ -74,13 +74,25 @@ public:
 
        const std::list< boost::shared_ptr<decode::Decoder> >& stack() const;
        void push(boost::shared_ptr<decode::Decoder> decoder);
+       void remove(int index);
+
+       int64_t samples_decoded() const;
 
-       const std::vector< boost::shared_ptr<pv::view::decode::Annotation> >
-               annotations() const;
+       std::vector<decode::Row> get_visible_rows() const;
+
+       /**
+        * Extracts sorted annotations between two period into a vector.
+        */
+       void get_annotation_subset(
+               std::vector<pv::data::decode::Annotation> &dest,
+               const decode::Row &row, uint64_t start_sample,
+               uint64_t end_sample) const;
 
        QString error_message();
 
-       void clear_snapshots();
+       void clear();
+
+       uint64_t get_max_sample_count() const;
 
        void begin_decode();
 
@@ -106,8 +118,12 @@ private:
        std::list< boost::shared_ptr<decode::Decoder> > _stack;
 
        mutable boost::mutex _mutex;
-       std::vector< boost::shared_ptr<pv::view::decode::Annotation> >
-               _annotations;
+       int64_t _samples_decoded;
+
+       std::map<const decode::Row, decode::RowData> _rows;
+
+       std::map<std::pair<const srd_decoder*, int>, decode::Row> _class_rows;
+
        QString _error_message;
 
        boost::thread _decode_thread;