]> sigrok.org Git - pulseview.git/blobdiff - pv/data/logic.cpp
Fix #684 by implementing snap-to-edge for TimeItem-based classes
[pulseview.git] / pv / data / logic.cpp
index e78c28468d71ef42da07e7e0eb102076889cfd38..b094a0c828334059029936cd48d40cbd22844dc8 100644 (file)
@@ -69,6 +69,14 @@ void Logic::clear()
        samples_cleared();
 }
 
+double Logic::get_samplerate() const
+{
+       if (segments_.empty())
+               return 1.0;
+
+       return segments_.front()->samplerate();
+}
+
 uint64_t Logic::max_sample_count() const
 {
        uint64_t l = 0;