]> git.sesse.net Git - nageru/blob - mainwindow.h
Make the UI show free disk space, and a rough estimation of for how much longer we...
[nageru] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QMainWindow>
5 #include <chrono>
6 #include <string>
7 #include <vector>
8 #include <sys/time.h>
9
10 #include "mixer.h"
11
12 class GLWidget;
13 class QResizeEvent;
14
15 namespace Ui {
16 class Display;
17 class MainWindow;
18 }  // namespace Ui
19
20 class QLabel;
21 class QPushButton;
22
23 class MainWindow : public QMainWindow
24 {
25         Q_OBJECT
26
27 public:
28         MainWindow();
29         void resizeEvent(QResizeEvent *event) override;
30         void mixer_created(Mixer *mixer);
31
32         // Used to release FBOs on the global ResourcePool. Call after the
33         // mixer has been shut down but not destroyed yet.
34         void mixer_shutting_down();
35
36 public slots:
37         void cut_triggered();
38         void x264_bitrate_triggered();
39         void exit_triggered();
40         void about_triggered();
41         void transition_clicked(int transition_number);
42         void channel_clicked(int channel_number);
43         void wb_button_clicked(int channel_number);
44         void set_transition_names(std::vector<std::string> transition_names);
45         void update_channel_name(Mixer::Output output, const std::string &name);
46         void update_channel_color(Mixer::Output output, const std::string &color);
47         void gain_staging_knob_changed(int value);
48         void final_makeup_gain_knob_changed(int value);
49         void cutoff_knob_changed(int value);
50         void limiter_threshold_knob_changed(int value);
51         void compressor_threshold_knob_changed(int value);
52         void reset_meters_button_clicked();
53         void relayout();
54
55 private:
56         bool eventFilter(QObject *watched, QEvent *event) override;
57         void set_white_balance(int channel_number, int x, int y);
58
59         // Called from DiskSpaceEstimator.
60         void report_disk_space(off_t free_bytes, double estimated_seconds_left);
61
62         // Called from the mixer.
63         void audio_level_callback(float level_lufs, float peak_db, float global_level_lufs, float range_low_lufs, float range_high_lufs, float gain_staging_db, float final_makeup_gain_db, float correlation);
64         std::chrono::steady_clock::time_point last_audio_level_callback;
65
66         Ui::MainWindow *ui;
67         QLabel *disk_free_label;
68         QPushButton *transition_btn1, *transition_btn2, *transition_btn3;
69         std::vector<Ui::Display *> previews;
70         int current_wb_pick_display = -1;
71 };
72
73 extern MainWindow *global_mainwindow;
74
75 #endif