]> git.sesse.net Git - nageru/blob - mainwindow.h
Clean up resources in the global ResourcePool on exit, in order to avoid some assert...
[nageru] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QMainWindow>
5 #include <string>
6 #include <vector>
7 #include <sys/time.h>
8
9 #include "mixer.h"
10
11 class GLWidget;
12 class QResizeEvent;
13
14 namespace Ui {
15 class Display;
16 class MainWindow;
17 }  // namespace Ui
18
19 class QPushButton;
20
21 class MainWindow : public QMainWindow
22 {
23         Q_OBJECT
24
25 public:
26         MainWindow();
27         void resizeEvent(QResizeEvent *event) override;
28         void mixer_created(Mixer *mixer);
29
30         // Used to release FBOs on the global ResourcePool. Call after the
31         // mixer has been shut down but not destroyed yet.
32         void mixer_shutting_down();
33
34 public slots:
35         void transition_clicked(int transition_number);
36         void channel_clicked(int channel_number);
37         void wb_button_clicked(int channel_number);
38         void set_transition_names(std::vector<std::string> transition_names);
39         void update_channel_name(Mixer::Output output);
40         void cutoff_knob_changed(int value);
41         void limiter_threshold_knob_changed(int value);
42         void compressor_threshold_knob_changed(int value);
43         void reset_meters_button_clicked();
44         void relayout();
45
46 private:
47         bool eventFilter(QObject *watched, QEvent *event) override;
48         void set_white_balance(int channel_number, int x, int y);
49
50         // Called from the mixer.
51         void audio_level_callback(float level_lufs, float peak_db, float global_level_lufs, float range_low_lufs, float range_high_lufs, float auto_gain_staging_db);
52         timeval last_audio_level_callback{0, 0};
53
54         Ui::MainWindow *ui;
55         QPushButton *transition_btn1, *transition_btn2, *transition_btn3;
56         std::vector<Ui::Display *> previews;
57         int current_wb_pick_display = -1;
58 };
59
60 extern MainWindow *global_mainwindow;
61
62 #endif