]> git.sesse.net Git - nageru/blobdiff - nageru/analyzer.h
Move everything into a separate futatabi/ subdir, for the upcoming merge with Futatabi.
[nageru] / nageru / analyzer.h
diff --git a/nageru/analyzer.h b/nageru/analyzer.h
new file mode 100644 (file)
index 0000000..b5aad15
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef _ANALYZER_H
+#define _ANALYZER_H 1
+
+#include <QImage>
+#include <QMainWindow>
+#include <QString>
+#include <QTimer>
+
+#include <string>
+
+#include <epoxy/gl.h>
+
+#include "mixer.h"
+
+class QObject;
+class QOpenGLContext;
+class QSurface;
+
+namespace Ui {
+class Analyzer;
+}  // namespace Ui
+
+namespace movit {
+class ResourcePool;
+}  // namespace movit
+
+class Analyzer : public QMainWindow
+{
+       Q_OBJECT
+
+public:
+       Analyzer();
+       ~Analyzer();
+       void update_channel_name(Mixer::Output output, const std::string &name);
+       void mixer_shutting_down();
+
+public slots:
+       void relayout();
+
+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;
+       QOpenGLContext *context;
+       GLuint pbo;
+       movit::ResourcePool *resource_pool = nullptr;
+       QImage grabbed_image;
+       QTimer grab_timer;
+       int last_x = -1, last_y = -1;
+};
+
+#endif  // !defined(_ANALYZER_H)