]> git.sesse.net Git - nageru/blob - mainwindow.h
Reenable simple audio.
[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 AudioExpandedView;
17 class AudioMiniView;
18 class Display;
19 class MainWindow;
20 }  // namespace Ui
21
22 class QLabel;
23 class QPushButton;
24
25 class MainWindow : public QMainWindow
26 {
27         Q_OBJECT
28
29 public:
30         MainWindow();
31         void resizeEvent(QResizeEvent *event) override;
32         void mixer_created(Mixer *mixer);
33
34         // Used to release FBOs on the global ResourcePool. Call after the
35         // mixer has been shut down but not destroyed yet.
36         void mixer_shutting_down();
37
38 public slots:
39         void cut_triggered();
40         void x264_bitrate_triggered();
41         void exit_triggered();
42         void about_triggered();
43         void simple_audio_mode_triggered();
44         void multichannel_audio_mode_triggered();
45         void input_mapping_triggered();
46         void transition_clicked(int transition_number);
47         void channel_clicked(int channel_number);
48         void wb_button_clicked(int channel_number);
49         void set_transition_names(std::vector<std::string> transition_names);
50         void update_channel_name(Mixer::Output output, const std::string &name);
51         void update_channel_color(Mixer::Output output, const std::string &color);
52         void gain_staging_knob_changed(unsigned bus_index, int value);
53         void final_makeup_gain_knob_changed(int value);
54         void cutoff_knob_changed(int value);
55         void eq_knob_changed(unsigned bus_index, EQBand band, int value);
56         void limiter_threshold_knob_changed(int value);
57         void compressor_threshold_knob_changed(unsigned bus_index, int value);
58         void mini_fader_changed(int bus, double db_volume);
59         void reset_meters_button_clicked();
60         void relayout();
61
62 private:
63         void reset_audio_mapping_ui();
64         void setup_audio_miniview();
65         void setup_audio_expanded_view();
66         bool eventFilter(QObject *watched, QEvent *event) override;
67         void set_white_balance(int channel_number, int x, int y);
68         void update_cutoff_labels(float cutoff_hz);
69         void update_eq_label(unsigned bus_index, EQBand band, float gain_db);
70
71         // Called from DiskSpaceEstimator.
72         void report_disk_space(off_t free_bytes, double estimated_seconds_left);
73
74         // Called from the mixer.
75         void audio_level_callback(float level_lufs, float peak_db, std::vector<AudioMixer::BusLevel> bus_levels, float global_level_lufs, float range_low_lufs, float range_high_lufs, float final_makeup_gain_db, float correlation);
76         std::chrono::steady_clock::time_point last_audio_level_callback;
77
78         void audio_state_changed();
79
80         Ui::MainWindow *ui;
81         QLabel *disk_free_label;
82         QPushButton *transition_btn1, *transition_btn2, *transition_btn3;
83         std::vector<Ui::Display *> previews;
84         std::vector<Ui::AudioMiniView *> audio_miniviews;
85         std::vector<Ui::AudioExpandedView *> audio_expanded_views;
86         int current_wb_pick_display = -1;
87 };
88
89 extern MainWindow *global_mainwindow;
90
91 #endif