From 4324efa7f090fa87e8001e40d9b32985c311bf76 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 9 Apr 2021 17:34:38 +0200 Subject: [PATCH] Always show short/momentary loudness in report --- gtk2_ardour/export_report.cc | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/export_report.cc b/gtk2_ardour/export_report.cc index e201e5272a..a8d41fd542 100644 --- a/gtk2_ardour/export_report.cc +++ b/gtk2_ardour/export_report.cc @@ -437,20 +437,34 @@ ExportReport::init (const AnalysisResults & ar, bool with_file) layout->show_in_cairo_context (cr); } else if (p->integrated_loudness == -200 && p->loudness_range == 0) { - layout->set_alignment (Pango::ALIGN_CENTER); - layout->set_font_description (UIConfiguration::instance ().get_LargeFont ()); - layout->set_text (_("Not\nAvailable")); - layout->get_pixel_size (w, h); - cr->move_to (rint (nw2 - w * .5), rint (hh * .5 - h * .66)); - layout->show_in_cairo_context (cr); - int yy = h * .5; - layout->set_font_description (UIConfiguration::instance ().get_SmallFont ()); + layout->set_alignment (Pango::ALIGN_LEFT); + layout->set_text (_("Integrated Loudness:")); + layout->get_pixel_size (w, h); + cr->move_to (rint (nw2 - w * .5), y0[0]); + layout->show_in_cairo_context (cr); + + layout->set_text (_("Not available")); + layout->get_pixel_size (w, h); + cr->move_to (rint (nw2 - w * .5), y0[1]); + layout->show_in_cairo_context (cr); + layout->set_text (_("(too short integration time)")); layout->get_pixel_size (w, h); - cr->move_to (rint (nw2 - w * .5), rint (hh * .5 + yy)); + cr->move_to (rint (nw2 - w * .5), y0[2]); layout->show_in_cairo_context (cr); + if (p->max_loudness_short > -200 && p->max_loudness_momentary > -200) { + layout->set_text (_("Max Short/Momentary:")); + layout->get_pixel_size (w, h); + cr->move_to (rint (nw2 - w * .5), y0[4]); + layout->show_in_cairo_context (cr); + + layout->set_text (string_compose (_("%1/%2 LUFS"), std::setprecision (1), std::fixed, p->max_loudness_short, p->max_loudness_momentary)); + layout->get_pixel_size (w, h); + cr->move_to (rint (nw2 - w * .5), y0[5]); + layout->show_in_cairo_context (cr); + } } else { layout->set_font_description (UIConfiguration::instance ().get_SmallFont ()); layout->set_alignment (Pango::ALIGN_LEFT); @@ -487,8 +501,6 @@ ExportReport::init (const AnalysisResults & ar, bool with_file) layout->get_pixel_size (w, h); cr->move_to (rint (nw2 - w * .5), y0[5]); layout->show_in_cairo_context (cr); - - layout->set_font_description (UIConfiguration::instance ().get_LargeFont ()); } ebur->flush ();