]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decoderstack.cpp
DecoderStack: Emancipate from SignalData
[pulseview.git] / pv / data / decoderstack.cpp
index 1c47016055fddae6dda477713487836b34b52793..bb2818bb79aab0d2c336a0045d5e0a0eb3c2a5a6 100644 (file)
@@ -30,7 +30,7 @@
 #include <pv/data/logicsnapshot.hpp>
 #include <pv/data/decode/decoder.hpp>
 #include <pv/data/decode/annotation.hpp>
-#include <pv/sigsession.hpp>
+#include <pv/session.hpp>
 #include <pv/view/logicsignal.hpp>
 
 using std::lock_guard;
@@ -62,6 +62,8 @@ mutex DecoderStack::global_decode_mutex_;
 DecoderStack::DecoderStack(pv::Session &session,
        const srd_decoder *const dec) :
        session_(session),
+       start_time_(0),
+       samplerate_(0),
        sample_count_(0),
        frame_complete_(false),
        samples_decoded_(0)
@@ -112,6 +114,16 @@ void DecoderStack::remove(int index)
        stack_.erase(iter);
 }
 
+double DecoderStack::samplerate() const
+{
+       return samplerate_;
+}
+
+double DecoderStack::start_time() const
+{
+       return start_time_;
+}
+
 int64_t DecoderStack::samples_decoded() const
 {
        lock_guard<mutex> decode_lock(output_mutex_);
@@ -245,7 +257,7 @@ void DecoderStack::begin_decode()
 
        // Check we have a snapshot of data
        const deque< shared_ptr<pv::data::LogicSnapshot> > &snapshots =
-               data->get_snapshots();
+               data->logic_snapshots();
        if (snapshots.empty())
                return;
        snapshot_ = snapshots.front();