X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fanalogsnapshot.h;h=74d26763825167a41c81390c08647ba0a3b03560;hb=6e3f046e779b939efebdfa4d9e68fe28d9beee59;hp=8eec2797f1a4aa77b5945ccf31f2eef926600dce;hpb=fda5b6e0e0ebbe55f3d173051b8800293f87cd09;p=pulseview.git diff --git a/pv/data/analogsnapshot.h b/pv/data/analogsnapshot.h index 8eec2797..74d26763 100644 --- a/pv/data/analogsnapshot.h +++ b/pv/data/analogsnapshot.h @@ -26,18 +26,31 @@ #include #include +namespace AnalogSnapshotTest { +class Basic; +} + namespace pv { namespace data { class AnalogSnapshot : public Snapshot { -private: +public: struct EnvelopeSample { float min; float max; }; + struct EnvelopeSection + { + uint64_t start; + unsigned int scale; + uint64_t length; + EnvelopeSample *samples; + }; + +private: struct Envelope { uint64_t length; @@ -62,6 +75,9 @@ public: const float* get_samples(int64_t start_sample, int64_t end_sample) const; + void get_envelope_section(EnvelopeSection &s, + uint64_t start, uint64_t end, float min_length) const; + private: void reallocate_envelope(Envelope &l); @@ -69,6 +85,10 @@ private: private: struct Envelope _envelope_levels[ScaleStepCount]; + + friend class AnalogSnapshotTest::Basic; +}; + } // namespace data } // namespace pv