From ff9296e17ce3a5c7ef7d27c8feecefbeeb46a60c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 28 Jul 2013 03:29:16 +0200 Subject: [PATCH] add dedicated line-up level for IEC1/DIN meter (15dbFS) --- gtk2_ardour/level_meter.cc | 10 +++++++--- gtk2_ardour/rc_option_editor.cc | 17 ++++++++++++++++- libs/ardour/ardour/rc_configuration_vars.h | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/level_meter.cc b/gtk2_ardour/level_meter.cc index 951c9c658d..9c32fd68fc 100644 --- a/gtk2_ardour/level_meter.cc +++ b/gtk2_ardour/level_meter.cc @@ -85,8 +85,8 @@ LevelMeterBase::set_meter (PeakMeter* meter) } } -static float meter_lineup(float offset) { - switch (Config->get_meter_line_up_level()) { +static float meter_lineup_cfg(MeterLineUp lul, float offset) { + switch (lul) { case MeteringLineUp24: return offset + 6.0; case MeteringLineUp20: @@ -101,6 +101,10 @@ static float meter_lineup(float offset) { return offset; } +static float meter_lineup(float offset) { + return meter_lineup_cfg(Config->get_meter_line_up_level(), offset); +} + static float vu_standard() { // note - default meter config is +2dB (france) switch (Config->get_meter_vu_standard()) { @@ -148,7 +152,7 @@ LevelMeterBase::update_meters () } else if (meter_type == MeterIEC1NOR) { (*i).meter->set (meter_deflect_nordic (peak + meter_lineup(0))); } else if (meter_type == MeterIEC1DIN) { - (*i).meter->set (meter_deflect_din (peak + meter_lineup(3.0))); + (*i).meter->set (meter_deflect_din (peak + meter_lineup_cfg(Config->get_meter_line_up_din(), 3.0))); } else if (meter_type == MeterIEC2BBC || meter_type == MeterIEC2EBU) { (*i).meter->set (meter_deflect_ppm (peak + meter_lineup(0))); } else if (meter_type == MeterVU) { diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 32667fe17d..317d6403a9 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1930,10 +1930,25 @@ RCOptionEditor::RCOptionEditor () mlu->add (MeteringLineUp18, _("-18dBFS (EBU, BBC)")); mlu->add (MeteringLineUp15, _("-15dBFS (DIN)")); - Gtkmm2ext::UI::instance()->set_tip (mlu->tip_widget(), _("Configure meter-ticks and color-knee point for dBFS scale DPM, set reference/offset level for IEC PPM.")); + Gtkmm2ext::UI::instance()->set_tip (mlu->tip_widget(), _("Configure meter-marks and color-knee point for dBFS scale DPM, set reference level for IEC1/Nordic, IEC2 PPM and VU meter.")); add_option (S_("Preferences|GUI"), mlu); + ComboOption* mld = new ComboOption ( + "meter-line-up-din", + _("IEC1/DIN Meter line-up level; 0dBu"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_line_up_din), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_line_up_din) + ); + + mld->add (MeteringLineUp24, _("-24dBFS (SMPTE US: 4dBu = -20dBFS)")); + mld->add (MeteringLineUp20, _("-20dBFS (SMPTE RP.0155)")); + mld->add (MeteringLineUp18, _("-18dBFS (EBU, BBC)")); + mld->add (MeteringLineUp15, _("-15dBFS (DIN)")); + + Gtkmm2ext::UI::instance()->set_tip (mld->tip_widget(), _("Reference level for IEC1/DIN meter.")); + + add_option (S_("Preferences|GUI"), mld); ComboOption* mvu = new ComboOption ( "meter-vu-standard", diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 9532349f71..42efe78d0d 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -151,6 +151,7 @@ CONFIG_VARIABLE (float, meter_hold, "meter-hold", 100.0f) CONFIG_VARIABLE (float, meter_falloff, "meter-falloff", 32.0f) CONFIG_VARIABLE (VUMeterStandard, meter_vu_standard, "meter-vu-standard", MeteringVUstandard) CONFIG_VARIABLE (MeterLineUp, meter_line_up_level, "meter-line-up-level", MeteringLineUp18) +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)