]> git.sesse.net Git - nageru/blobdiff - analyzer.h
Fix an issue where the mixer lagging too much behind CEF would cause us to display...
[nageru] / analyzer.h
index d9bd8b8052348cf416020474e8876b5b94895f86..b5aad15c5e400075ac10890353841f5baf43e6a8 100644 (file)
@@ -4,9 +4,14 @@
 #include <QImage>
 #include <QMainWindow>
 #include <QString>
+#include <QTimer>
+
+#include <string>
 
 #include <epoxy/gl.h>
 
+#include "mixer.h"
+
 class QObject;
 class QOpenGLContext;
 class QSurface;
@@ -26,6 +31,7 @@ class Analyzer : public QMainWindow
 public:
        Analyzer();
        ~Analyzer();
+       void update_channel_name(Mixer::Output output, const std::string &name);
        void mixer_shutting_down();
 
 public slots:
@@ -34,8 +40,10 @@ public slots:
 private:
        void grab_clicked();
        void signal_changed();
+       void grab_pixel(int x, int y);
        bool eventFilter(QObject *watched, QEvent *event) override;
        void resizeEvent(QResizeEvent *event) override;
+       void showEvent(QShowEvent *event) override;
 
        Ui::Analyzer *ui;
        QSurface *surface;
@@ -43,6 +51,8 @@ private:
        GLuint pbo;
        movit::ResourcePool *resource_pool = nullptr;
        QImage grabbed_image;
+       QTimer grab_timer;
+       int last_x = -1, last_y = -1;
 };
 
 #endif  // !defined(_ANALYZER_H)