From 9ff32d1b52f7476b6ab55b60bae58ced315047f7 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 4 Aug 2013 00:06:29 +0200 Subject: [PATCH] make master-meter in toolbar optional --- gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/ardour_ui_dialogs.cc | 10 +++++++++- gtk2_ardour/ardour_ui_options.cc | 9 +++++++++ gtk2_ardour/rc_option_editor.cc | 8 ++++++++ libs/ardour/ardour/rc_configuration_vars.h | 1 + 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 0cf1eca67e..34d7a238f3 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1039,7 +1039,7 @@ ARDOUR_UI::every_point_zero_something_seconds () // august 2007: actual update frequency: 25Hz (40ms), not 100Hz SuperRapidScreenUpdate(); /* EMIT_SIGNAL */ - if (editor_meter) { + if (editor_meter && Config->get_show_editor_meter()) { float mpeak = editor_meter->update_meters(); if (mpeak > editor_meter_max_peak) { if (mpeak >= Config->get_meter_peak()) { diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 1f258ca1c8..24f6511b4c 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -203,6 +203,7 @@ ARDOUR_UI::set_session (Session *s) editor_meter->clear_meters(); editor_meter->set_type (_session->master_out()->meter_type()); editor_meter->setup_meters (30, 12, 6); + editor_meter->show(); meter_box.pack_start(*editor_meter); ArdourMeter::ResetAllPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_peak_display)); @@ -214,10 +215,17 @@ ARDOUR_UI::set_session (Session *s) editor_meter_peak_display.unset_flags (Gtk::CAN_FOCUS); editor_meter_peak_display.set_size_request(6, -1); editor_meter_peak_display.set_corner_radius(2); - editor_meter_peak_display.show(); editor_meter_max_peak = -INFINITY; editor_meter_peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &ARDOUR_UI::editor_meter_peak_button_release), false); + + if (Config->get_show_editor_meter()) { + meter_box.show(); + editor_meter_peak_display.show(); + } else { + meter_box.hide(); + editor_meter_peak_display.hide(); + } } } diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index 15c58a8b8d..55314037e3 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -415,6 +415,15 @@ ARDOUR_UI::parameter_changed (std::string p) start_clocking (); } else if (p == "waveform-gradient-depth") { ArdourCanvas::WaveView::set_global_gradient_depth (config()->get_waveform_gradient_depth()); + } else if (p == "show-editor-meter") { + bool show = Config->get_show_editor_meter(); + if (editor_meter && show) { + meter_box.show(); + editor_meter_peak_display.show(); + } else if (editor_meter && !show) { + meter_box.hide(); + editor_meter_peak_display.hide(); + } } } diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 317d6403a9..910dcb89eb 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1315,6 +1315,14 @@ RCOptionEditor::RCOptionEditor () sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_track_meters) )); + add_option (_("Editor"), + new BoolOption ( + "show-editor-meter", + _("Display master-meter in the toolbar"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_editor_meter), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_editor_meter) + )); + bco = new BoolComboOption ( "use-overlap-equivalency", _("Regions in active edit groups are edited together"), diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 8f0b54c165..78be86eaea 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -154,6 +154,7 @@ CONFIG_VARIABLE (MeterLineUp, meter_line_up_level, "meter-line-up-level", Meteri CONFIG_VARIABLE (MeterLineUp, meter_line_up_din, "meter-line-up-din", MeteringLineUp15) CONFIG_VARIABLE (float, meter_peak, "meter-peak", 0.0f) CONFIG_VARIABLE (bool, meter_style_led, "meter-style-led", true) +CONFIG_VARIABLE (bool, show_editor_meter, "show-editor-meter", true) /* miscellany */