2020-07-19 18:29:56 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2021-04-10 15:48:59 -04:00
|
|
|
#ifndef _gtkardour_loudness_dialog_h_
|
|
|
|
#define _gtkardour_loudness_dialog_h_
|
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
#include <cairomm/cairomm.h>
|
2020-07-19 18:29:56 -04:00
|
|
|
#include <gtkmm/box.h>
|
2021-04-11 19:32:00 -04:00
|
|
|
#include <gtkmm/drawingarea.h>
|
|
|
|
#include <gtkmm/frame.h>
|
2020-07-19 18:29:56 -04:00
|
|
|
#include <gtkmm/label.h>
|
|
|
|
#include <gtkmm/progressbar.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/table.h>
|
|
|
|
|
|
|
|
#include "widgets/ardour_button.h"
|
2020-07-22 20:58:59 -04:00
|
|
|
#include "widgets/ardour_dropdown.h"
|
2020-07-19 18:29:56 -04:00
|
|
|
|
|
|
|
#include "ardour_dialog.h"
|
|
|
|
#include "progress_reporter.h"
|
2021-04-11 19:32:00 -04:00
|
|
|
#include "loudness_settings.h"
|
2020-07-19 18:29:56 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
2020-07-20 18:40:11 -04:00
|
|
|
class AudioRange;
|
2021-04-11 19:32:00 -04:00
|
|
|
class ExportAnalysis;
|
2020-07-19 18:29:56 -04:00
|
|
|
class ExportStatus;
|
2020-07-25 02:14:04 -04:00
|
|
|
class PluginInsert;
|
|
|
|
class Processor;
|
2020-07-19 18:29:56 -04:00
|
|
|
class Session;
|
|
|
|
}
|
|
|
|
|
|
|
|
class LoudnessDialog : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
2020-07-20 22:45:46 -04:00
|
|
|
LoudnessDialog (ARDOUR::Session*, ARDOUR::AudioRange const&, bool);
|
2020-07-19 18:29:56 -04:00
|
|
|
int run ();
|
2020-07-21 21:26:19 -04:00
|
|
|
|
2020-07-26 03:06:15 -04:00
|
|
|
float gain_db () const;
|
2020-07-19 18:29:56 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool on_delete_event (GdkEventAny*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
int analyze ();
|
2020-07-20 22:45:46 -04:00
|
|
|
void start_analysis ();
|
2020-07-19 18:29:56 -04:00
|
|
|
void cancel_analysis ();
|
|
|
|
gint progress_timeout ();
|
|
|
|
void display_results ();
|
|
|
|
void display_report ();
|
2021-04-11 19:32:00 -04:00
|
|
|
void save_preset ();
|
|
|
|
void remove_preset ();
|
2020-07-19 18:29:56 -04:00
|
|
|
void calculate_gain ();
|
|
|
|
|
2020-07-22 20:58:59 -04:00
|
|
|
void load_preset (size_t);
|
|
|
|
void apply_preset ();
|
2021-04-11 19:32:00 -04:00
|
|
|
void peak_radio (bool);
|
2020-07-22 20:58:59 -04:00
|
|
|
void update_settings ();
|
2021-04-11 19:32:00 -04:00
|
|
|
void check_preset ();
|
2020-07-23 09:59:17 -04:00
|
|
|
void update_sensitivity ();
|
2020-07-22 20:58:59 -04:00
|
|
|
|
2020-07-27 14:00:17 -04:00
|
|
|
void test_conformity ();
|
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
void plot_graph (boost::shared_ptr<ARDOUR::ExportAnalysis>);
|
|
|
|
void graph_size_request (Gtk::Requisition*);
|
|
|
|
bool graph_expose_event (GdkEventExpose*);
|
2020-07-22 20:58:59 -04:00
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
ALoudnessPresets _lp;
|
|
|
|
CLoudnessPreset _preset;
|
|
|
|
|
|
|
|
static bool _first_time;
|
|
|
|
static CLoudnessPreset _last_preset;
|
2020-07-22 20:58:59 -04:00
|
|
|
|
2020-07-19 18:29:56 -04:00
|
|
|
ARDOUR::Session* _session;
|
2020-07-20 18:40:11 -04:00
|
|
|
ARDOUR::AudioRange const& _range;
|
2020-07-19 18:29:56 -04:00
|
|
|
boost::shared_ptr<ARDOUR::ExportStatus> _status;
|
2020-07-20 22:45:46 -04:00
|
|
|
bool _autostart;
|
2020-07-19 18:29:56 -04:00
|
|
|
|
2020-07-20 22:45:46 -04:00
|
|
|
Gtk::VBox _setup_box;
|
2020-07-19 18:29:56 -04:00
|
|
|
Gtk::VBox _progress_box;
|
|
|
|
Gtk::VBox _result_box;
|
2021-04-11 19:32:00 -04:00
|
|
|
Gtk::Frame _conformity_frame;
|
2020-07-19 18:29:56 -04:00
|
|
|
Gtk::ProgressBar _progress_bar;
|
|
|
|
Gtk::Button* _ok_button;
|
|
|
|
Gtk::Button* _cancel_button;
|
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
ArdourWidgets::ArdourButton _save_preset;
|
|
|
|
ArdourWidgets::ArdourButton _remove_preset;
|
|
|
|
|
2020-07-21 21:26:19 -04:00
|
|
|
ArdourWidgets::ArdourButton _dbfs_btn;
|
|
|
|
ArdourWidgets::ArdourButton _dbtp_btn;
|
|
|
|
ArdourWidgets::ArdourButton _lufs_i_btn;
|
|
|
|
ArdourWidgets::ArdourButton _lufs_s_btn;
|
|
|
|
ArdourWidgets::ArdourButton _lufs_m_btn;
|
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
Gtk::Label _dbfs_label;
|
|
|
|
Gtk::Label _dbtp_label;
|
|
|
|
Gtk::Label _lufs_i_label;
|
|
|
|
Gtk::Label _lufs_s_label;
|
|
|
|
Gtk::Label _lufs_m_label;
|
|
|
|
|
|
|
|
Gtk::Label _delta_dbfs_label;
|
|
|
|
Gtk::Label _delta_dbtp_label;
|
|
|
|
Gtk::Label _delta_lufs_i_label;
|
|
|
|
Gtk::Label _delta_lufs_s_label;
|
|
|
|
Gtk::Label _delta_lufs_m_label;
|
|
|
|
|
|
|
|
Gtk::Label _gain_out_label;
|
|
|
|
Gtk::Label _gain_amp_label;
|
|
|
|
Gtk::Label _gain_norm_label;
|
|
|
|
Gtk::Label _gain_total_label;
|
|
|
|
Gtk::Label _gain_exceeds_label;
|
2020-07-20 22:45:46 -04:00
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
Gtk::DrawingArea _loudness_graph;
|
2020-07-20 22:45:46 -04:00
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
Cairo::RefPtr<Cairo::ImageSurface> _loudness_surf;
|
2020-07-19 18:29:56 -04:00
|
|
|
|
2020-07-20 22:45:46 -04:00
|
|
|
ArdourWidgets::ArdourButton _rt_analysis_button;
|
|
|
|
ArdourWidgets::ArdourButton _start_analysis_button;
|
|
|
|
ArdourWidgets::ArdourButton _show_report_button;
|
2020-07-27 16:00:08 -04:00
|
|
|
ArdourWidgets::ArdourButton _custom_pos_button;
|
2020-07-19 18:29:56 -04:00
|
|
|
|
2020-07-22 20:58:59 -04:00
|
|
|
ArdourWidgets::ArdourDropdown _preset_dropdown;
|
|
|
|
|
2021-04-11 19:32:00 -04:00
|
|
|
Gtk::Adjustment _dbfs_adjustment;
|
|
|
|
Gtk::Adjustment _dbtp_adjustment;
|
|
|
|
Gtk::Adjustment _lufs_i_adjustment;
|
|
|
|
Gtk::Adjustment _lufs_s_adjustment;
|
|
|
|
Gtk::Adjustment _lufs_m_adjustment;
|
2020-07-19 18:29:56 -04:00
|
|
|
|
|
|
|
Gtk::SpinButton _dbfs_spinbutton;
|
2021-04-11 19:32:00 -04:00
|
|
|
Gtk::SpinButton _dbtp_spinbutton;
|
|
|
|
Gtk::SpinButton _lufs_i_spinbutton;
|
|
|
|
Gtk::SpinButton _lufs_s_spinbutton;
|
|
|
|
Gtk::SpinButton _lufs_m_spinbutton;
|
2020-07-19 18:29:56 -04:00
|
|
|
|
|
|
|
float _dbfs;
|
|
|
|
float _dbtp;
|
2020-07-20 22:45:46 -04:00
|
|
|
float _lufs_i;
|
|
|
|
float _lufs_s;
|
|
|
|
float _lufs_m;
|
2020-07-21 21:26:19 -04:00
|
|
|
|
2020-07-25 02:14:04 -04:00
|
|
|
float _gain_out;
|
2020-07-21 21:26:19 -04:00
|
|
|
float _gain_norm;
|
2020-08-04 17:36:29 -04:00
|
|
|
bool _ignore_preset;
|
2020-07-22 20:58:59 -04:00
|
|
|
bool _ignore_change;
|
2020-07-19 18:29:56 -04:00
|
|
|
};
|
2021-04-10 15:48:59 -04:00
|
|
|
|
|
|
|
#endif
|