]> git.sesse.net Git - nageru/blob - analyzer.h
Release Nageru 1.7.2.
[nageru] / analyzer.h
1 #ifndef _ANALYZER_H
2 #define _ANALYZER_H 1
3
4 #include <QImage>
5 #include <QMainWindow>
6 #include <QString>
7 #include <QTimer>
8
9 #include <string>
10
11 #include <epoxy/gl.h>
12
13 #include "mixer.h"
14
15 class QObject;
16 class QOpenGLContext;
17 class QSurface;
18
19 namespace Ui {
20 class Analyzer;
21 }  // namespace Ui
22
23 namespace movit {
24 class ResourcePool;
25 }  // namespace movit
26
27 class Analyzer : public QMainWindow
28 {
29         Q_OBJECT
30
31 public:
32         Analyzer();
33         ~Analyzer();
34         void update_channel_name(Mixer::Output output, const std::string &name);
35         void mixer_shutting_down();
36
37 public slots:
38         void relayout();
39
40 private:
41         void grab_clicked();
42         void signal_changed();
43         void grab_pixel(int x, int y);
44         bool eventFilter(QObject *watched, QEvent *event) override;
45         void resizeEvent(QResizeEvent *event) override;
46         void showEvent(QShowEvent *event) override;
47
48         Ui::Analyzer *ui;
49         QSurface *surface;
50         QOpenGLContext *context;
51         GLuint pbo;
52         movit::ResourcePool *resource_pool = nullptr;
53         QImage grabbed_image;
54         QTimer grab_timer;
55         int last_x = -1, last_y = -1;
56 };
57
58 #endif  // !defined(_ANALYZER_H)