Ardour  9.0-pre0-582-g084a23a80d
loudness_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _gtkardour_loudness_dialog_h_
20 #define _gtkardour_loudness_dialog_h_
21 
22 #include <cairomm/cairomm.h>
23 #include <gtkmm/box.h>
24 #include <gtkmm/drawingarea.h>
25 #include <gtkmm/frame.h>
26 #include <gtkmm/label.h>
27 #include <gtkmm/progressbar.h>
28 #include <gtkmm/spinbutton.h>
29 #include <gtkmm/table.h>
30 
31 #include "widgets/ardour_button.h"
33 
34 #include "ardour_dialog.h"
35 #include "progress_reporter.h"
36 #include "loudness_settings.h"
37 
38 namespace ARDOUR {
39  class TimelineRange;
40  class ExportAnalysis;
41  class ExportStatus;
42  class PluginInsert;
43  class Processor;
44  class Session;
45 }
46 
48 {
49 public:
51  int run ();
52 
53  float gain_db () const;
54 
55 protected:
57 
58 private:
59  int analyze ();
60  void start_analysis ();
61  void cancel_analysis ();
63  void display_results ();
64  void display_report ();
65  void save_preset ();
66  void remove_preset ();
67  void calculate_gain ();
68 
69  void load_preset (size_t);
70  void apply_preset ();
71  void peak_radio (bool);
72  void update_settings ();
73  void check_preset ();
75 
76  void test_conformity ();
77 
78  void plot_graph (std::shared_ptr<ARDOUR::ExportAnalysis>);
81 
84 
85  static bool _first_time;
87 
90  std::shared_ptr<ARDOUR::ExportStatus> _status;
91  bool _autostart;
92 
100 
103 
109 
115 
121 
127 
129 
130  Cairo::RefPtr<Cairo::ImageSurface> _loudness_surf;
131 
136 
138 
144 
150 
151  float _dbfs;
152  float _dbtp;
153  float _lufs_i;
154  float _lufs_s;
155  float _lufs_m;
156 
157  float _gain_out;
158  float _gain_norm;
161 };
162 
163 #endif
Gtk::Label _gain_amp_label
Gtk::Label _lufs_m_label
Gtk::SpinButton _dbfs_spinbutton
void update_settings()
Gtk::Label _gain_total_label
Gtk::SpinButton _dbtp_spinbutton
Gtk::Button * _ok_button
ArdourWidgets::ArdourButton _lufs_s_btn
Gtk::Label _delta_lufs_m_label
void save_preset()
Cairo::RefPtr< Cairo::ImageSurface > _loudness_surf
bool graph_expose_event(GdkEventExpose *)
ARDOUR::TimelineRange const & _range
ArdourWidgets::ArdourButton _custom_pos_button
void peak_radio(bool)
void check_preset()
Gtk::VBox _setup_box
void start_analysis()
float gain_db() const
Gtk::Label _delta_lufs_s_label
ARDOUR::Session * _session
Gtk::Label _lufs_s_label
void update_sensitivity()
Gtk::Adjustment _dbfs_adjustment
void graph_size_request(Gtk::Requisition *)
Gtk::Label _gain_exceeds_label
Gtk::Label _dbtp_label
Gtk::Adjustment _lufs_m_adjustment
Gtk::Adjustment _dbtp_adjustment
Gtk::VBox _progress_box
ArdourWidgets::ArdourButton _dbfs_btn
Gtk::Label _delta_dbfs_label
ArdourWidgets::ArdourDropdown _preset_dropdown
CLoudnessPreset _preset
Gtk::Adjustment _lufs_s_adjustment
ArdourWidgets::ArdourButton _show_report_button
LoudnessDialog(ARDOUR::Session *, ARDOUR::TimelineRange const &, bool)
void test_conformity()
Gtk::DrawingArea _loudness_graph
void plot_graph(std::shared_ptr< ARDOUR::ExportAnalysis >)
void display_results()
Gtk::Label _dbfs_label
bool on_delete_event(GdkEventAny *)
This is a default handler for the signal signal_delete_event().
ALoudnessPresets _lp
Gtk::VBox _result_box
Gtk::Label _gain_out_label
void display_report()
std::shared_ptr< ARDOUR::ExportStatus > _status
gint progress_timeout()
Gtk::ProgressBar _progress_bar
ArdourWidgets::ArdourButton _lufs_m_btn
ArdourWidgets::ArdourButton _remove_preset
static bool _first_time
Gtk::Adjustment _lufs_i_adjustment
Gtk::Label _gain_norm_label
ArdourWidgets::ArdourButton _start_analysis_button
ArdourWidgets::ArdourButton _save_preset
void cancel_analysis()
void calculate_gain()
Gtk::Label _lufs_i_label
Gtk::Frame _conformity_frame
Gtk::Label _delta_dbtp_label
Gtk::SpinButton _lufs_i_spinbutton
void load_preset(size_t)
static CLoudnessPreset _last_preset
void apply_preset()
Gtk::SpinButton _lufs_s_spinbutton
ArdourWidgets::ArdourButton _rt_analysis_button
ArdourWidgets::ArdourButton _lufs_i_btn
Gtk::Button * _cancel_button
Gtk::Label _delta_lufs_i_label
void remove_preset()
Gtk::SpinButton _lufs_m_spinbutton
ArdourWidgets::ArdourButton _dbtp_btn