]> sigrok.org Git - pulseview.git/blobdiff - pv/data/signalbase.hpp
Rework signals for modularity
[pulseview.git] / pv / data / signalbase.hpp
index b6f69ef56e0950d628c0b55234f0bbf6770a42a5..733900d56c7caa64c79a32141ea0f68a982d821b 100644 (file)
@@ -55,6 +55,7 @@ class AnalogSegment;
 class DecoderStack;
 class Logic;
 class LogicSegment;
+class Segment;
 class SignalData;
 
 class SignalBase : public QObject
@@ -171,6 +172,11 @@ public:
         */
        void set_data(shared_ptr<pv::data::SignalData> data);
 
+       /**
+        * Clears all sample data and removes all associated segments.
+        */
+       void clear_sample_data();
+
        /**
         * Get the internal data as analog data object in case of analog type.
         */
@@ -192,6 +198,11 @@ public:
         */
        bool has_samples() const;
 
+       /**
+        * Returns the sample rate for this signal.
+        */
+       virtual double get_samplerate() const;
+
        /**
         * Queries the kind of conversion performed on this channel.
         */
@@ -312,7 +323,7 @@ Q_SIGNALS:
 private Q_SLOTS:
        void on_samples_cleared();
 
-       void on_samples_added(QObject* segment, uint64_t start_sample,
+       void on_samples_added(shared_ptr<Segment> segment, uint64_t start_sample,
                uint64_t end_sample);
 
        void on_min_max_changed(float min, float max);