]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decoder.h
Added missing includes and defintions
[pulseview.git] / pv / data / decoder.h
index c4f7115254141dc5f565960708c54ce47535d0a9..93d8fa6a89fb8dae531e48d9f01e0f7c5d4526d7 100644 (file)
 #include <map>
 
 #include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
+
+#include <QObject>
+
+#include <glib.h>
 
 struct srd_decoder;
 struct srd_decoder_inst;
 struct srd_probe;
+struct srd_proto_data;
+struct srd_session;
 
 namespace pv {
 
 namespace view {
 class Signal;
+
+namespace decode {
+class Annotation;
+}
+
 }
 
 namespace data {
 
-class Decoder : public SignalData
+class Logic;
+
+class Decoder : public QObject, public SignalData
 {
+       Q_OBJECT
+
+private:
+       static const double DecodeMargin;
+       static const double DecodeThreshold;
+       static const int64_t DecodeChunkLength;
+
 public:
        Decoder(const srd_decoder *const decoder,
                std::map<const srd_probe*,
-                       boost::shared_ptr<pv::view::Signal> > probes);
+                       boost::shared_ptr<pv::view::Signal> > probes,
+               GHashTable *options);
+
+       virtual ~Decoder();
 
        const srd_decoder* get_decoder() const;
 
+       const std::vector< boost::shared_ptr<pv::view::decode::Annotation> >
+               annotations() const;
+
        void clear_snapshots();
 
 private:
+       void begin_decode();
+
        void init_decoder();
 
+       void decode_proc(boost::shared_ptr<data::Logic> data);
+
+       static void annotation_callback(srd_proto_data *pdata,
+               void *decoder);
+
+signals:
+       void new_decode_data();
+
 private:
        const srd_decoder *const _decoder;
        std::map<const srd_probe*, boost::shared_ptr<view::Signal> >
                _probes;
+       GHashTable *_options;
 
+       srd_session *_session;
        srd_decoder_inst *_decoder_inst;
+
+       mutable boost::mutex _annotations_mutex;
+       std::vector< boost::shared_ptr<pv::view::decode::Annotation> >
+               _annotations;
+
+       boost::thread _decode_thread;
 };
 
 } // namespace data