10 #include "midi_mapper.h"
14 class Ui_AudioExpandedView;
18 class AudioExpandedView;
28 class MainWindow : public QMainWindow, public ControllerReceiver
34 void resizeEvent(QResizeEvent *event) override;
35 void mixer_created(Mixer *mixer);
37 // Used to release FBOs on the global ResourcePool. Call after the
38 // mixer has been shut down but not destroyed yet.
39 void mixer_shutting_down();
43 void x264_bitrate_triggered();
44 void exit_triggered();
45 void about_triggered();
46 void simple_audio_mode_triggered();
47 void multichannel_audio_mode_triggered();
48 void input_mapping_triggered();
49 void midi_mapping_triggered();
50 void transition_clicked(int transition_number);
51 void channel_clicked(int channel_number);
52 void wb_button_clicked(int channel_number);
53 void set_transition_names(std::vector<std::string> transition_names);
54 void update_channel_name(Mixer::Output output, const std::string &name);
55 void update_channel_color(Mixer::Output output, const std::string &color);
56 void gain_staging_knob_changed(unsigned bus_index, int value);
57 void final_makeup_gain_knob_changed(int value);
58 void cutoff_knob_changed(int value);
59 void eq_knob_changed(unsigned bus_index, EQBand band, int value);
60 void limiter_threshold_knob_changed(int value);
61 void compressor_threshold_knob_changed(unsigned bus_index, int value);
62 void mini_fader_changed(int bus, double db_volume);
63 void reset_meters_button_clicked();
66 // ControllerReceiver interface.
67 void set_locut(float value) override;
68 void set_limiter_threshold(float value) override;
69 void set_makeup_gain(float value) override;
71 void set_treble(unsigned bus_idx, float value) override;
72 void set_mid(unsigned bus_idx, float value) override;
73 void set_bass(unsigned bus_idx, float value) override;
74 void set_gain(unsigned bus_idx, float value) override;
75 void set_compressor_threshold(unsigned bus_idx, float value) override;
76 void set_fader(unsigned bus_idx, float value) override;
78 void toggle_locut(unsigned bus_idx) override;
79 void toggle_auto_gain_staging(unsigned bus_idx) override;
80 void toggle_compressor(unsigned bus_idx) override;
81 void clear_peak(unsigned bus_idx) override;
82 void toggle_limiter() override;
83 void toggle_auto_makeup_gain() override;
85 void clear_all_highlights() override;
87 void highlight_locut(bool highlight) override;
88 void highlight_limiter_threshold(bool highlight) override;
89 void highlight_makeup_gain(bool highlight) override;
91 void highlight_treble(unsigned bus_idx, bool highlight) override;
92 void highlight_mid(unsigned bus_idx, bool highlight) override;
93 void highlight_bass(unsigned bus_idx, bool highlight) override;
94 void highlight_gain(unsigned bus_idx, bool highlight) override;
95 void highlight_compressor_threshold(unsigned bus_idx, bool highlight) override;
96 void highlight_fader(unsigned bus_idx, bool highlight) override;
98 void highlight_toggle_locut(unsigned bus_idx, bool highlight) override;
99 void highlight_toggle_auto_gain_staging(unsigned bus_idx, bool highlight) override;
100 void highlight_toggle_compressor(unsigned bus_idx, bool highlight) override;
101 void highlight_clear_peak(unsigned bus_idx, bool highlight) override {} // We don't mark this currently.
102 void highlight_toggle_limiter(bool highlight) override;
103 void highlight_toggle_auto_makeup_gain(bool highlight) override;
105 // Raw receivers are not used.
106 void controller_changed(unsigned controller) override {}
107 void note_on(unsigned note) override {}
110 void reset_audio_mapping_ui();
111 void setup_audio_miniview();
112 void setup_audio_expanded_view();
113 bool eventFilter(QObject *watched, QEvent *event) override;
114 void set_white_balance(int channel_number, int x, int y);
115 void update_cutoff_labels(float cutoff_hz);
116 void update_eq_label(unsigned bus_index, EQBand band, float gain_db);
118 // Called from DiskSpaceEstimator.
119 void report_disk_space(off_t free_bytes, double estimated_seconds_left);
121 // Called from the mixer.
122 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);
123 std::chrono::steady_clock::time_point last_audio_level_callback;
125 void audio_state_changed();
128 void set_relative_value(T *control, float value);
131 void set_relative_value_if_exists(unsigned bus_idx, T *Ui_AudioExpandedView::*control, float value);
134 void click_button_if_exists(unsigned bus_idx, T *Ui_AudioExpandedView::*control);
137 void highlight_control(T *control, bool highlight);
140 void highlight_control_if_exists(unsigned bus_idx, T *(Ui_AudioExpandedView::*control), bool highlight);
143 QLabel *disk_free_label;
144 QPushButton *transition_btn1, *transition_btn2, *transition_btn3;
145 std::vector<Ui::Display *> previews;
146 std::vector<Ui::AudioMiniView *> audio_miniviews;
147 std::vector<Ui::AudioExpandedView *> audio_expanded_views;
148 int current_wb_pick_display = -1;
149 MIDIMapper midi_mapper;
152 extern MainWindow *global_mainwindow;