X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fsignal.hpp;h=1b9f254330a79fd150f6f73165f5cb910a76b5be;hp=1c53d8b2260a960669261c056f069a9e35883bfb;hb=af33d4cbacc745f4473f5c0f4fa1f9ebb8d84d0a;hpb=9e773fecf2d4ab8f2fc6e1cc880b9102c22ec228 diff --git a/pv/views/trace/signal.hpp b/pv/views/trace/signal.hpp index 1c53d8b2..1b9f2543 100644 --- a/pv/views/trace/signal.hpp +++ b/pv/views/trace/signal.hpp @@ -27,6 +27,8 @@ #include +#include + #include "trace.hpp" #include "viewitemowner.hpp" @@ -68,6 +70,15 @@ public: virtual shared_ptr data() const = 0; + /** + * Determines the closest level change (i.e. edge) to a given sample, which + * is useful for e.g. the "snap to edge" functionality. + * + * @param sample_pos Sample to use + * @return The changes left and right of the given position + */ + virtual vector get_nearest_level_changes(uint64_t sample_pos) = 0; + /** * Returns true if the trace is visible and enabled. */