summaryrefslogtreecommitdiff
path: root/gtk2_ardour/export_report.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-12 12:52:49 +0100
committerRobin Gareus <robin@gareus.org>2016-02-12 12:52:49 +0100
commitcda4030330655b61560a8120f7c1234ae0f2cfcc (patch)
tree127a1dcaf649e2c972fc04178bd24b8e5bb38274 /gtk2_ardour/export_report.cc
parent50145a93e697ab73a54187fff9d7ff8f8064bd6c (diff)
Visualize Peaks and TruePeaks in Export Report
Diffstat (limited to 'gtk2_ardour/export_report.cc')
-rw-r--r--gtk2_ardour/export_report.cc35
1 files changed, 29 insertions, 6 deletions
diff --git a/gtk2_ardour/export_report.cc b/gtk2_ardour/export_report.cc
index ae5107ef6c..455cf6687c 100644
--- a/gtk2_ardour/export_report.cc
+++ b/gtk2_ardour/export_report.cc
@@ -221,11 +221,11 @@ ExportReport::ExportReport (Session* _session, StatusPtr s)
layout->show_in_cairo_context (cr);
layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
- layout->set_text (string_compose (_("%1 dBFS"), std::setprecision (1), std::fixed,
- accurate_coefficient_to_dB (p->peak)));
+ layout->set_text (string_compose (_("%1 dBFS"), std::setprecision (1), std::fixed, dbfs));
layout->get_pixel_size (w, h);
cr->move_to (rint (nw2 - w * .5), y0[1]);
- if (p->peak > .944) { cr->set_source_rgba (1.0, .5, .5, 1.0); }
+ if (dbfs >= 0.f) { cr->set_source_rgba (1.0, .1, .1, 1.0); }
+ else if (dbfs > -1.f) { cr->set_source_rgba (1.0, .7, .0, 1.0); }
layout->show_in_cairo_context (cr);
if (p->have_dbtp) {
@@ -237,11 +237,11 @@ ExportReport::ExportReport (Session* _session, StatusPtr s)
layout->show_in_cairo_context (cr);
layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
- layout->set_text (string_compose (_("%1 dBTP"), std::setprecision (1), std::fixed,
- accurate_coefficient_to_dB (p->truepeak)));
+ layout->set_text (string_compose (_("%1 dBTP"), std::setprecision (1), std::fixed, dbtp));
layout->get_pixel_size (w, h);
cr->move_to (rint (nw2 - w * .5), y0[3]);
- if (p->truepeak > .944) { cr->set_source_rgba (1.0, .5, .5, 1.0); }
+ if (dbtp >= 0.f) { cr->set_source_rgba (1.0, .1, .1, 1.0); }
+ else if (dbtp > -1.f) { cr->set_source_rgba (1.0, .7, .0, 1.0); }
layout->show_in_cairo_context (cr);
}
@@ -424,6 +424,29 @@ ExportReport::ExportReport (Session* _session, StatusPtr s)
}
cr->stroke ();
+ // > 0dBFS
+ cr->set_source_rgba (1.0, 0, 0, 1.0);
+ for (size_t x = 0 ; x < width; ++x) {
+ if (p->peaks[c][x].max >= 1.0) {
+ cr->move_to (m_l + x - .5, 0);
+ cr->line_to (m_l + x - .5, height_2 * .22);
+ }
+ if (p->peaks[c][x].min <= -1.0) {
+ cr->move_to (m_l + x - .5, height_2 * 1.78);
+ cr->line_to (m_l + x - .5, height_2 * 2.);
+ }
+ }
+ cr->stroke ();
+
+
+ // > -1dBTP
+ cr->set_source_rgba (1.0, 0.7, 0, 0.7);
+ for (std::set<framepos_t>::const_iterator i = p->truepeakpos[c].begin (); i != p->truepeakpos[c].end (); ++i) {
+ cr->move_to (m_l + (*i) - .5, height_2 * 0.22);
+ cr->line_to (m_l + (*i) - .5, height_2 * 1.78);
+ cr->stroke ();
+ }
+
// zero line
cr->set_source_rgba (.3, .3, .3, 0.7);
cr->move_to (m_l + 0, height_2 - .5);