]> git.sesse.net Git - nageru/blobdiff - nageru/peak_display.h
Make the delay analyzer understand that two sources can have different starting times.
[nageru] / nageru / peak_display.h
index a7a3b9365f40c4bb97123719c64e275cf275d0f3..76687a6ecb643aeba6185fd42c95fb97cb187683 100644 (file)
@@ -2,6 +2,7 @@
 #define PEAK_DISPLAY_H
 
 #include <QWidget>
+#include <chrono>
 #include <mutex>
 
 class AudioClip;
@@ -19,10 +20,23 @@ public:
        }
        void audio_clip_updated();
 
+       void set_base(std::chrono::steady_clock::time_point base)
+       {
+               this->base = base;
+               audio_clip_updated();
+       }
+
+       void reset_base()
+       {
+               base = std::chrono::steady_clock::time_point();
+               audio_clip_updated();
+       }
+
 private:
        void paintEvent(QPaintEvent *event) override;
 
        AudioClip *audio_clip;
+       std::chrono::steady_clock::time_point base;  // Epoch if not set.
 };
 
 #endif