From 2eaf19a10b9d2380abbd94435043f9a15d7c951f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 9 Apr 2021 21:51:58 +0200 Subject: [PATCH] Tweak loudness graph * plot short on top of momentary data * limit range to 65dB --- gtk2_ardour/export_analysis_graphs.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gtk2_ardour/export_analysis_graphs.cc b/gtk2_ardour/export_analysis_graphs.cc index 6b3eda7da6..93b1083f44 100644 --- a/gtk2_ardour/export_analysis_graphs.cc +++ b/gtk2_ardour/export_analysis_graphs.cc @@ -620,13 +620,13 @@ ArdourGraphs::plot_loudness (Glib::RefPtr pctx, ExportAnalysisPt if (render_for_export) { v_max = ceilf ((v_max - 5.f) / 10.f) * 10.f + 5.f; v_min = floorf ((v_min + 5.f) / 10.f) * 10.f - 5.f; + v_min = std::max (v_min, v_max - 60); } else { v_max = ceilf (v_max / 10.f) * 10.f; v_min = floorf ((v_min + 5.f) / 10.f) * 10.f - 5.f; + v_min = std::max (v_min, v_max - 65); } - v_min = std::max (-95.f, v_min); - std::vector dashes; dashes.push_back (3.0); dashes.push_back (5.0); @@ -797,20 +797,19 @@ ArdourGraphs::plot_loudness (Glib::RefPtr pctx, ExportAnalysisPt } cr->stroke (); - /* short */ - cr->set_source_rgba (1, .2, .1, 1.0); - cr->set_line_width (1.0); + /* momentary */ + cr->set_source_rgba (.1, .4, 1, 1.0); first = true; skip = 0; for (size_t x = 0; x < width; ++x) { - if (p->lgraph_s[x] <= v_min && first) { + if (p->lgraph_m[x] <= v_min && first) { continue; } - float y = y0 + YPOS (p->lgraph_s[x]); + float y = y0 + YPOS (p->lgraph_m[x]); if (first) { - yp = y; cr->move_to (x0 + x, y); + yp = y; first = false; } else if ((x == width - 1) || fabsf (yp - y) > 0.5) { if (skip > 5 && fabsf (yp - y) > 5) { @@ -825,19 +824,20 @@ ArdourGraphs::plot_loudness (Glib::RefPtr pctx, ExportAnalysisPt } cr->stroke (); - /* momentary */ - cr->set_source_rgba (.1, .4, 1, 1.0); + /* short */ + cr->set_source_rgba (1, .2, .1, 1.0); + cr->set_line_width (1.0); first = true; skip = 0; for (size_t x = 0; x < width; ++x) { - if (p->lgraph_m[x] <= v_min && first) { + if (p->lgraph_s[x] <= v_min && first) { continue; } - float y = y0 + YPOS (p->lgraph_m[x]); + float y = y0 + YPOS (p->lgraph_s[x]); if (first) { + yp = y; cr->move_to (x0 + x, y); - yp = y; first = false; } else if ((x == width - 1) || fabsf (yp - y) > 0.5) { if (skip > 5 && fabsf (yp - y) > 5) {