2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include <pangomm/layout.h>
22 #include <gtkmm/label.h>
23 #include <gtkmm/table.h>
24 #include <gtkmm/stock.h>
26 #include "pbd/openuri.h"
27 #include "pbd/basename.h"
29 #include "gtkmm2ext/utils.h"
30 #include "gtkmm2ext/colors.h"
32 #include "audiographer/general/analyser.h"
34 #include "ardour/audiofilesource.h"
35 #include "ardour/audioregion.h"
36 #include "ardour/auditioner.h"
37 #include "ardour/dB.h"
38 #include "ardour/logmeter.h"
39 #include "ardour/region_factory.h"
40 #include "ardour/session.h"
41 #include "ardour/smf_source.h"
42 #include "ardour/source_factory.h"
43 #include "ardour/srcfilesource.h"
44 #include "ardour/utils.h"
46 #include "audio_clock.h"
47 #include "export_report.h"
48 #include "ui_config.h"
53 using namespace ARDOUR;
55 ExportReport::ExportReport (Session* session, StatusPtr s)
56 : ArdourDialog (_("Export Report/Analysis"))
63 init (s->result_map, true);
66 ExportReport::ExportReport (const std::string & title, const AnalysisResults & ar)
67 : ArdourDialog (title)
78 ExportReport::init (const AnalysisResults & ar, bool with_file)
80 set_resizable (false);
81 pages.set_scrollable ();
83 std::vector<double> dashes;
84 dashes.push_back (3.0);
85 dashes.push_back (5.0);
88 for (AnalysisResults::const_iterator i = ar.begin (); i != ar.end (); ++i, ++page) {
90 VBox *vb = manage (new VBox ());
91 Table *t = manage (new Table (4, 4));
92 Table *wtbl = manage (new Table (3, 2));
94 t->set_border_width (0);
96 wtbl->set_spacings (4);
98 vb->set_border_width (4);
99 vb->pack_start (*t, false, false, 2);
100 vb->pack_start (*wtbl, false, false, 2);
102 std::string path = i->first;
103 ExportAnalysisPtr p = i->second;
105 std::list<CimgPlayheadArea*> playhead_widgets;
108 l = manage (new Label (_("File:"), ALIGN_END));
109 t->attach (*l, 0, 1, 0, 1);
110 l = manage (new Label ());
111 l->set_ellipsize (Pango::ELLIPSIZE_START);
112 l->set_width_chars (48);
113 l->set_max_width_chars (48);
115 l->set_alignment (ALIGN_START, ALIGN_CENTER);
116 t->attach (*l, 1, 3, 0, 1, FILL, SHRINK);
118 Button *b = manage (new Button (_("Open Folder")));
119 t->attach (*b, 3, 4, 0, 2, FILL, SHRINK);
120 b->signal_clicked ().connect (sigc::bind (sigc::mem_fun (*this, &ExportReport::open_folder), path));
126 samplecnt_t file_length = 0;
127 samplecnt_t sample_rate = 0;
128 samplecnt_t start_off = 0;
129 unsigned int channels = 0;
130 std::string file_fmt;
132 if (with_file && AudioFileSource::get_soundfile_info (path, info, errmsg)) {
135 file_length = info.length;
136 sample_rate = info.samplerate;
137 start_off = info.timecode;
138 channels = info.channels;
140 files.insert (std::make_pair (page, AuditionInfo (path, channels)));
142 /* File Info Table */
144 samplecnt_t const nfr = _session ? _session->nominal_sample_rate () : 25;
145 double src_coef = (double) nfr / info.samplerate;
147 l = manage (new Label (_("Format:"), ALIGN_END));
148 t->attach (*l, 0, 1, 1, 2);
149 file_fmt = info.format_name;
150 std::replace (file_fmt.begin (), file_fmt.end (), '\n', ' ');
151 l = manage (new Label ());
152 l->set_ellipsize (Pango::ELLIPSIZE_START);
153 l->set_width_chars (48);
154 l->set_max_width_chars (48);
155 l->set_text (file_fmt);
156 l->set_alignment (ALIGN_START, ALIGN_CENTER);
157 t->attach (*l, 1, 3, 1, 2, FILL, SHRINK);
159 l = manage (new Label (_("Channels:"), ALIGN_END));
160 t->attach (*l, 0, 1, 2, 3);
161 l = manage (new Label (string_compose ("%1", info.channels), ALIGN_START));
162 t->attach (*l, 1, 2, 2, 3);
164 l = manage (new Label (_("Sample rate:"), ALIGN_END));
165 t->attach (*l, 0, 1, 3, 4);
166 l = manage (new Label (string_compose (_("%1 Hz"), info.samplerate), ALIGN_START));
167 t->attach (*l, 1, 2, 3, 4);
169 l = manage (new Label (_("Duration:"), ALIGN_END));
170 t->attach (*l, 2, 3, 2, 3);
171 clock = manage (new AudioClock ("sfboxLengthClock", true, "", false, false, true, false));
172 clock->set_session (_session);
173 clock->set_mode (AudioClock::MinSec);
174 clock->set (info.length * src_coef + 0.5, true);
175 t->attach (*clock, 3, 4, 2, 3);
177 l = manage (new Label (_("Timecode:"), ALIGN_END));
178 t->attach (*l, 2, 3, 3, 4);
179 clock = manage (new AudioClock ("sfboxTimecodeClock", true, "", false, false, false, false));
180 clock->set_session (_session);
181 clock->set_mode (AudioClock::Timecode);
182 clock->set (info.timecode * src_coef + 0.5, true);
183 t->attach (*clock, 3, 4, 3, 4);
184 } else if (with_file) {
185 l = manage (new Label (_("Error:"), ALIGN_END));
186 t->attach (*l, 0, 1, 1, 2);
187 l = manage (new Label (errmsg, ALIGN_START));
188 t->attach (*l, 1, 4, 1, 2);
192 Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (get_pango_context ());
194 // calc geometry of numerics
195 const float dbfs = accurate_coefficient_to_dB (p->peak);
196 const float dbtp = accurate_coefficient_to_dB (p->truepeak);
198 #define TXTSIZE(LINE, TXT, FONT) { \
199 layout->set_font_description (UIConfiguration::instance ().FONT ()); \
200 layout->set_text (TXT); \
201 layout->get_pixel_size (w, h); \
202 if (w > mnw) { mnw = w; } \
203 if (h > lin[LINE]) { lin[LINE] = h; } \
206 #define TXTWIDTH(TXT, FONT) { \
207 layout->set_font_description (UIConfiguration::instance ().FONT ()); \
208 layout->set_text (TXT); \
209 layout->get_pixel_size (w, h); \
210 if (w > mml) { mml = w; } \
213 int m_r = 0; // right side
214 int mnh = 0; // mono height
215 int mnw = 0; // max numeric width
216 int anw = 0; // spectrum annotation text width
218 int lin[6] = { 0, 0, 0, 0, 0, 0 }; // max line height
220 TXTSIZE(0, _("(too short integration time)"), get_SmallFont);
222 TXTSIZE(0, _("-888"), get_SmallMonospaceFont);
227 TXTSIZE(0, _("Peak:"), get_SmallFont);
228 TXTSIZE(1, string_compose (_("%1 dBFS"), std::setprecision (1), std::fixed, dbfs), get_LargeFont);
229 TXTSIZE(2, _("True Peak:"), get_SmallFont);
230 TXTSIZE(3, string_compose (_("%1 dBTP"), std::setprecision (1), std::fixed, dbtp), get_LargeFont);
231 TXTSIZE(4, _("Normalization Gain:"), get_SmallFont);
232 TXTSIZE(5, _("+888.88 dB"), get_SmallMonospaceFont);
234 TXTSIZE(0, _("Integrated Loudness:"), get_SmallFont);
235 TXTSIZE(1, string_compose (_("%1 LUFS"), std::setprecision (1), std::fixed, p->loudness), get_LargeFont);
236 TXTSIZE(2, _("Loudness Range:"), get_SmallFont);
237 TXTSIZE(3, string_compose (_("%1 LU"), std::setprecision (1), std::fixed, p->loudness_range), get_LargeFont);
240 const int ht = lin[0] * 1.25 + lin[1] * 1.25 + lin[2] * 1.25 + lin[3] *1.25 + lin[4] * 1.25 + lin[5];
241 const int hh = std::max (100, ht + 12);
242 const int htn = lin[0] * 1.25 + lin[1] * 1.25 + lin[2] * 1.25 + lin[3];
243 int m_l = 2 * mnw + /*hist-width*/ 540 + /*box spacing*/ 8 - /*peak-width*/ 800 - m_r; // margin left
245 int mml = 0; // min margin left -- ensure left margin is wide enough
246 TXTWIDTH (_("Time"), get_SmallFont);
247 TXTWIDTH (_("100"), get_SmallMonospaceFont);
248 m_l = (std::max(anw + mnh + 14, std::max (m_l, mml + 8)) + 3) & ~3;
250 mnw = (m_l - /*hist-width*/ 540 - /*box spacing*/ 8 + /*peak-width*/ 800 + m_r) / 2;
251 const int nw2 = mnw / 2; // nums, horizontal center
255 y0[0] = (hh - ht) * .5;
257 y0[0] = (hh - htn) * .5;
259 y0[1] = y0[0] + lin[0] * 1.25;
260 y0[2] = y0[1] + lin[1] * 1.25;
261 y0[3] = y0[2] + lin[2] * 1.25;
262 y0[4] = y0[3] + lin[3] * 1.25;
263 y0[5] = y0[4] + lin[4] * 1.25;
265 /* calc heights & alignment of png-image */
266 const float specth = sizeof (p->spectrum[0]) / sizeof (float);
267 const float waveh2 = std::min (100, 8 * lin[0] / (int) p->n_channels);
269 Cairo::RefPtr<Cairo::ImageSurface> png_surface;
273 if (with_file && UIConfiguration::instance().get_save_export_analysis_image ()) { /*png image */
274 const int top_w = 540 + 2 * (mnw + 4); // 4px spacing
275 const int wav_w = m_l + m_r + 4 + sizeof (p->peaks) / sizeof (ARDOUR::PeakData::PeakDatum) / 4;
276 const int spc_w = m_l + m_r + 4 + sizeof (p->spectrum) / sizeof (float) / specth;
280 if (channels > 0 && file_length > 0 && sample_rate > 0) {
281 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
282 layout->set_text (_("00:00:00.000"));
283 layout->get_pixel_size (w, h);
284 int height = h * 1.75;
285 ann_h = 4 + height /* Time Axis */;
287 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
288 layout->set_text (_("0|A8"));
289 layout->get_pixel_size (w, h);
291 ann_h += 4 + 3 * linesp; /* File Info */;
294 const int png_h = hh + 4 + p->n_channels * (2 * waveh2 + 4) + ann_h + specth + 4;
295 png_w = std::max (std::max (top_w, wav_w), spc_w);
297 png_surface = Cairo::ImageSurface::create (Cairo::FORMAT_RGB24, png_w, png_h);
298 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
299 pcx->set_source_rgb (.2, .2, .2);
302 if (channels > 0 && file_length > 0 && sample_rate > 0) {
304 // Add file-name, format, duration, sample-rate & timecode
305 pcx->set_source_rgb (.7, .7, .7);
306 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
307 layout->set_alignment (Pango::ALIGN_LEFT);
309 #define IMGLABEL(X0, STR, VAL) { \
310 layout->set_text (STR); \
311 pcx->move_to (X0, png_y0); \
312 layout->get_pixel_size (w, h); \
313 layout->show_in_cairo_context (pcx); \
314 layout->set_text (VAL); \
315 pcx->move_to (X0 + w + 2, png_y0); \
316 layout->show_in_cairo_context (pcx); \
319 // TODO get max width of labels per column, right-align labels, x-align 1/3, 2/3 columns
321 const int lx1 = m_l + png_w * 2 / 3; // right-col is short (channels, SR, duration)
322 std::string sha1sum = ARDOUR::compute_sha1_of_file (path);
323 if (!sha1sum.empty()) {
324 sha1sum = " (sha1: " + sha1sum + ")";
327 IMGLABEL (lx0, _("File:"), Glib::path_get_basename (path) + sha1sum);
328 IMGLABEL (lx1, _("Channels:"), string_compose ("%1", channels));
331 IMGLABEL (lx0, _("Format:"), file_fmt);
332 IMGLABEL (lx1, _("Sample rate:"), string_compose (_("%1 Hz"), sample_rate));
337 _session->sample_to_timecode (start_off, tct, false, false);
338 IMGLABEL (lx0, _("Timecode:"), Timecode::timecode_format_time (tct));
340 IMGLABEL (lx1, _("Duration:"), Timecode::timecode_format_sampletime (file_length, sample_rate, 1000, false));
345 { /* peak, loudness and R128 histogram */
346 Cairo::RefPtr<Cairo::ImageSurface> nums = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, mnw, hh);
347 Cairo::RefPtr<Cairo::ImageSurface> ebur = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, mnw, hh);
348 Cairo::RefPtr<Cairo::ImageSurface> hist = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, 540, hh);
350 /* peak and true-peak numerics */
351 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (nums);
352 cr->set_source_rgba (0, 0, 0, 1.0);
355 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
356 layout->set_alignment (Pango::ALIGN_LEFT);
357 layout->set_text (_("Peak:"));
358 layout->get_pixel_size (w, h);
359 cr->move_to (rint (nw2 - w * .5), y0[0]);
360 cr->set_source_rgba (.7, .7, .7, 1.0);
361 layout->show_in_cairo_context (cr);
363 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
364 layout->set_text (string_compose (_("%1 dBFS"), std::setprecision (1), std::fixed, dbfs));
365 layout->get_pixel_size (w, h);
366 cr->move_to (rint (nw2 - w * .5), y0[1]);
367 if (dbfs >= 0.f) { cr->set_source_rgba (1.0, .1, .1, 1.0); }
368 else if (dbfs > -1.f) { cr->set_source_rgba (1.0, .7, .0, 1.0); }
369 layout->show_in_cairo_context (cr);
372 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
373 layout->set_text (_("True Peak:"));
374 layout->get_pixel_size (w, h);
375 cr->move_to (rint (nw2 - w * .5), y0[2]);
376 cr->set_source_rgba (.7, .7, .7, 1.0);
377 layout->show_in_cairo_context (cr);
379 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
380 layout->set_text (string_compose (_("%1 dBTP"), std::setprecision (1), std::fixed, dbtp));
381 layout->get_pixel_size (w, h);
382 cr->move_to (rint (nw2 - w * .5), y0[3]);
383 if (dbtp >= 0.f) { cr->set_source_rgba (1.0, .1, .1, 1.0); }
384 else if (dbtp > -1.f) { cr->set_source_rgba (1.0, .7, .0, 1.0); }
385 layout->show_in_cairo_context (cr);
389 const float ndb = accurate_coefficient_to_dB (p->norm_gain_factor);
390 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
391 layout->set_text (_("Normalization Gain:"));
392 layout->get_pixel_size (w, h);
393 cr->move_to (rint (nw2 - w * .5), y0[4]);
394 cr->set_source_rgba (.7, .7, .7, 1.0);
395 layout->show_in_cairo_context (cr);
397 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
398 layout->set_text (string_compose (_("%1 dB"), std::setprecision (2), std::showpos, std::fixed, ndb));
400 layout->get_pixel_size (w, h);
401 cr->move_to (rint (nw2 - w * .5), y0[5]);
402 // TODO tweak thresholds
403 if (p->norm_gain_factor < 1.0) {
404 cr->set_source_rgba (1.0, .7, .1, 1.0);
405 } else if (p->norm_gain_factor == 1.0) {
406 cr->set_source_rgba (.7, .7, .7, 1.0);
407 } else if (fabsf (ndb) < 12) {
408 cr->set_source_rgba (.1, 1.0, .1, 1.0);
409 } else if (fabsf (ndb) < 18) {
410 cr->set_source_rgba (1.0, .7, .1, 1.0);
412 cr->set_source_rgba (1.0, .1, .1, 1.0);
414 layout->show_in_cairo_context (cr);
419 /* EBU R128 numerics */
420 cr = Cairo::Context::create (ebur);
421 cr->set_source_rgba (0, 0, 0, 1.0);
424 cr->set_source_rgba (.7, .7, .7, 1.0);
426 if (!i->second->have_loudness) {
427 layout->set_alignment (Pango::ALIGN_CENTER);
428 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
429 layout->set_text (_("Not\nAvailable"));
430 layout->get_pixel_size (w, h);
431 cr->move_to (rint (nw2 - w * .5), rint ((hh - h) * .5));
432 layout->show_in_cairo_context (cr);
434 else if (p->loudness == -200 && p->loudness_range == 0) {
435 layout->set_alignment (Pango::ALIGN_CENTER);
436 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
437 layout->set_text (_("Not\nAvailable"));
438 layout->get_pixel_size (w, h);
439 cr->move_to (rint (nw2 - w * .5), rint (hh * .5 - h * .66));
440 layout->show_in_cairo_context (cr);
443 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
444 layout->set_text (_("(too short integration time)"));
445 layout->get_pixel_size (w, h);
446 cr->move_to (rint (nw2 - w * .5), rint (hh * .5 + yy));
447 layout->show_in_cairo_context (cr);
450 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
451 layout->set_alignment (Pango::ALIGN_LEFT);
452 layout->set_text (_("Integrated Loudness:"));
453 layout->get_pixel_size (w, h);
454 cr->move_to (rint (nw2 - w * .5), y0[0]);
455 layout->show_in_cairo_context (cr);
457 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
458 layout->set_text (string_compose (_("%1 LUFS"), std::setprecision (1), std::fixed, p->loudness));
459 layout->get_pixel_size (w, h);
460 cr->move_to (rint (nw2 - w * .5), y0[1]);
461 layout->show_in_cairo_context (cr);
463 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
464 layout->set_text (_("Loudness Range:"));
465 layout->get_pixel_size (w, h);
466 cr->move_to (rint (nw2 - w * .5), y0[2]);
467 layout->show_in_cairo_context (cr);
469 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
470 layout->set_text (string_compose (_("%1 LU"), std::setprecision (1), std::fixed, p->loudness_range));
471 layout->get_pixel_size (w, h);
472 cr->move_to (rint (nw2 - w * .5), y0[3]);
473 layout->show_in_cairo_context (cr);
477 /* draw loudness histogram */
478 cr = Cairo::Context::create (hist);
479 cr->set_source_rgba (0, 0, 0, 1.0);
482 cr->set_source_rgba (.7, .7, .7, 1.0);
483 cr->set_line_width (1.0);
485 if (p->loudness_hist_max > 0 && i->second->have_loudness) {
487 for (size_t x = 0 ; x < 510; ++x) {
488 cr->move_to (x - .5, hh);
489 cr->line_to (x - .5, (float) hh * (1.0 - p->loudness_hist[x] / (float) p->loudness_hist_max));
493 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
494 layout->set_alignment (Pango::ALIGN_CENTER);
497 layout->set_text (_("LUFS\n(short)"));
498 layout->get_pixel_size (w, h);
499 Gtkmm2ext::rounded_rectangle (cr, 5, 5, w + 2, h + 2, 4);
500 cr->set_source_rgba (.1, .1, .1, 0.7);
503 cr->set_source_rgba (.9, .9, .9, 1.0);
504 layout->show_in_cairo_context (cr);
507 layout->set_text (_("Multiplicity"));
508 layout->get_pixel_size (w, h);
509 Gtkmm2ext::rounded_rectangle (cr, 5, hh - w - 3, h + 2, w + 2, 4);
510 cr->set_source_rgba (.1, .1, .1, 0.7);
513 cr->move_to (6, hh - 2);
514 cr->set_source_rgba (.9, .9, .9, 1.0);
515 cr->rotate (M_PI / -2.0);
516 layout->show_in_cairo_context (cr);
520 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
521 layout->set_alignment (Pango::ALIGN_LEFT);
522 for (int g = -53; g <= -8; g += 5) {
523 // grid-lines. [110] -59LUFS .. [650]: -5 LUFS
524 layout->set_text (string_compose ("%1", std::setw(3), std::setfill(' '), g));
525 layout->get_pixel_size (w, h);
527 cr->set_operator (Cairo::OPERATOR_OVER);
528 Gtkmm2ext::rounded_rectangle (cr,
529 rint ((g + 59.0) * 10.0 - h * .5), 5,
531 const float pk = (g + 59.0) / 54.0;
532 Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, .3 + pk * .4, .6);
533 Gtkmm2ext::set_source_rgba (cr, c);
537 cr->set_source_rgba (.9, .9, .9, 1.0);
538 cr->move_to (rint ((g + 59.0) * 10.0 - h * .5), w + 6.0);
539 cr->rotate (M_PI / -2.0);
540 layout->show_in_cairo_context (cr);
543 cr->set_operator (Cairo::OPERATOR_ADD);
545 cr->set_source_rgba (.3, .3, .3, 1.0);
546 cr->set_dash (dashes, 1.0);
547 cr->set_line_cap (Cairo::LINE_CAP_ROUND);
548 cr->move_to (rint ((g + 59.0) * 10.0) + .5, w + 8.0);
549 cr->line_to (rint ((g + 59.0) * 10.0) + .5, hh);
555 layout->set_alignment (Pango::ALIGN_CENTER);
556 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
557 layout->set_text (_("Not\nAvailable"));
558 layout->get_pixel_size (w, h);
559 cr->move_to (rint ((510 - w) * .5), rint ((hh - h) * .5));
560 layout->show_in_cairo_context (cr);
566 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
567 pcx->set_source (nums, 0, png_y0);
569 pcx->set_source (hist, (png_w - 540) / 2, png_y0);
571 pcx->set_source (ebur, png_w - mnw, png_y0);
576 CimgArea *nu = manage (new CimgArea (nums));
577 CimgArea *eb = manage (new CimgArea (ebur));
578 CimgArea *hi = manage (new CimgArea (hist));
579 HBox *hb = manage (new HBox ());
581 hb->pack_start (*nu, false, false);
582 hb->pack_start (*hi, false, false);
583 hb->pack_start (*eb, false, false);
585 wtbl->attach (*hb, 0, 2, wrow, wrow + 1, SHRINK, SHRINK);
589 #define XAXISLABEL(POS, TXT) { \
590 const float yy = rint (POS); \
591 layout->set_text (TXT); \
592 layout->get_pixel_size (w, h); \
593 cr->move_to (m_l - 8 - w, rint ((POS) - h * .5)); \
594 cr->set_source_rgba (.9, .9, .9, 1.0); \
595 cr->set_operator (Cairo::OPERATOR_OVER); \
596 layout->show_in_cairo_context (cr); \
597 cr->move_to (m_l - 4, yy - .5); \
598 cr->line_to (m_l + width, yy - .5); \
599 cr->set_source_rgba (.3, .3, .3, 1.0); \
600 cr->set_operator (Cairo::OPERATOR_ADD); \
606 VBox *lrb = manage (new VBox());
607 ToggleButton *log = manage (new ToggleButton (S_("Logscale|Lg")));
608 ToggleButton *rec = manage (new ToggleButton (S_("Rectified|Rf")));
609 Gtkmm2ext::UI::instance()->set_tip (log, _("Logscale"));
610 Gtkmm2ext::UI::instance()->set_tip (rec, _("Rectified"));
612 lrb->pack_start (*log, false, false, 5);
613 lrb->pack_end (*rec, false, false, 5);
614 log->signal_toggled ().connect (sigc::bind (sigc::mem_fun (*this, &ExportReport::on_logscale_toggled), log));
615 rec->signal_toggled ().connect (sigc::bind (sigc::mem_fun (*this, &ExportReport::on_rectivied_toggled), rec));
617 wtbl->attach (*lrb, 1, 2, wrow, wrow + p->n_channels, SHRINK, SHRINK);
620 for (uint32_t c = 0; c < p->n_channels; ++c) {
622 const size_t width = sizeof (p->peaks) / sizeof (ARDOUR::PeakData::PeakDatum) / 4;
624 Cairo::RefPtr<Cairo::ImageSurface> wave;
625 Cairo::RefPtr<Cairo::ImageSurface> wave_log;
626 Cairo::RefPtr<Cairo::ImageSurface> wave_rect;
627 Cairo::RefPtr<Cairo::ImageSurface> wave_lr;
628 draw_waveform(wave, p, c, m_l, width, anw, waveh2, false, false);
629 draw_waveform(wave_log, p, c, m_l, width, anw, waveh2, true, false);
630 draw_waveform(wave_rect, p, c, m_l, width, anw, waveh2, false, true);
631 draw_waveform(wave_lr, p, c, m_l, width, anw, waveh2, true, true);
633 CimgWaveArea *wv = manage (new CimgWaveArea (wave, wave_log, wave_rect, wave_lr, m_l, width));
635 playhead_widgets.push_back (wv);
636 waves.push_back (wv);
637 wv->seek_playhead.connect (sigc::bind<0> (sigc::mem_fun (*this, &ExportReport::audition_seek), page));
638 wtbl->attach (*wv, 0, 1, wrow, wrow + 1, SHRINK, SHRINK);
642 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
643 pcx->set_source (wave, 0, png_y0);
645 png_y0 += 2 * waveh2 + 4;
649 if (channels > 0 && file_length > 0 && sample_rate > 0)
651 /* Time Axis -- re-use waveform width */
652 const size_t width = sizeof (p->peaks) / sizeof (ARDOUR::PeakData::PeakDatum) / 4;
653 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
654 layout->set_text (_("00:00:00.000"));
655 layout->get_pixel_size (w, h);
656 int height = h * 1.75;
657 Cairo::RefPtr<Cairo::ImageSurface> ytme = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_l + width, height);
658 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (ytme);
659 cr->set_operator (Cairo::OPERATOR_SOURCE);
660 cr->set_source_rgba (0, 0, 0, 1.0);
662 cr->rectangle (0, 0, m_l, height);
663 cr->set_source_rgba (0, 0, 0, 0);
665 cr->set_operator (Cairo::OPERATOR_OVER);
667 cr->set_line_width (1.0);
668 for (int i = 0; i <= 4; ++i) {
669 const float fract = (float) i / 4.0;
670 // " XX:XX:XX.XXX" [space/minus] 12 chars = 13.
671 const float xalign = (i == 4) ? 1.0 : (i == 0) ? 1.0 / 13.0 : 7.0 / 13.0;
674 AudioClock::print_minsec (start_off + file_length * fract,
675 buf, sizeof (buf), sample_rate);
677 layout->set_text (buf);
678 layout->get_pixel_size (w, h);
679 cr->move_to (rint (m_l + width * fract - w * xalign), rint (.5 * (height - h)));
680 cr->set_source_rgba (.9, .9, .9, 1.0);
681 layout->show_in_cairo_context (cr);
683 cr->set_source_rgba (.7, .7, .7, 1.0);
684 cr->move_to (rint (m_l + width * fract) - .5, 0);
685 cr->line_to (rint (m_l + width * fract) - .5, ceil (height * .15));
686 cr->move_to (rint (m_l + width * fract) - .5, floor (height * .85));
687 cr->line_to (rint (m_l + width * fract) - .5, height);
691 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
692 layout->set_text (_("Time"));
693 cr->set_source_rgba (.9, .9, .9, 1.0);
694 layout->get_pixel_size (w, h);
695 cr->move_to (rint (m_l - w - 8), rint (.5 * (height - h)));
696 layout->show_in_cairo_context (cr);
699 CimgPlayheadArea *tm = manage (new CimgPlayheadArea (ytme, m_l, width, true));
700 playhead_widgets.push_back (tm);
701 tm->seek_playhead.connect (sigc::bind<0> (sigc::mem_fun (*this, &ExportReport::audition_seek), page));
702 wtbl->attach (*tm, 0, 1, wrow, wrow + 1, SHRINK, SHRINK);
706 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
707 pcx->set_source (ytme, 0, png_y0);
709 png_y0 += height + 4;
715 const size_t height = specth;
716 const size_t swh = sizeof (p->spectrum) / sizeof (float);
717 const size_t width = swh / height;
719 Cairo::RefPtr<Cairo::ImageSurface> spec = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_l + width, height);
720 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (spec);
721 cr->set_operator (Cairo::OPERATOR_SOURCE);
722 cr->rectangle (0, 0, m_l, height);
723 cr->set_source_rgba (0, 0, 0, 0);
725 cr->rectangle (m_l, 0, width, height);
726 cr->set_source_rgba (0, 0, 0, 1.0);
728 cr->set_operator (Cairo::OPERATOR_OVER);
730 for (size_t x = 0 ; x < width; ++x) {
731 for (size_t y = 0 ; y < height; ++y) {
732 const float pk = p->spectrum[x][y];
733 Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
734 Gtkmm2ext::set_source_rgba (cr, c);
735 cr->rectangle (m_l + x - .5, y - .5, 1, 1);
741 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
742 layout->set_text (_("Hz"));
743 layout->get_pixel_size (w, h);
744 cr->move_to (rint (m_l - h - anw - 10), rint ((height + w) * .5));
745 cr->set_source_rgba (.9, .9, .9, 1.0);
747 cr->rotate (M_PI / -2.0);
748 layout->show_in_cairo_context (cr);
752 cr->set_line_width (1.0);
753 cr->set_dash (dashes, 2.0);
754 cr->set_line_cap (Cairo::LINE_CAP_ROUND);
756 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
757 //XAXISLABEL (p->freq[0], _("50Hz"));
758 XAXISLABEL (p->freq[1], _("100"));
759 XAXISLABEL (p->freq[2], _("500"));
760 XAXISLABEL (p->freq[3], _("1K"));
761 XAXISLABEL (p->freq[4], _("5K"));
762 XAXISLABEL (p->freq[5], _("10K"));
766 Cairo::RefPtr<Cairo::ImageSurface> scale = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_r, height);
767 cr = Cairo::Context::create (scale);
768 cr->set_operator (Cairo::OPERATOR_SOURCE);
769 cr->rectangle (0, 0, m_r, height);
770 cr->set_source_rgba (0, 0, 0, 0);
773 cr->set_operator (Cairo::OPERATOR_OVER);
774 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
775 layout->set_alignment (Pango::ALIGN_LEFT);
776 layout->set_text (_("dBFS"));
777 layout->get_pixel_size (w, h);
778 cr->move_to (rint (.5 * (m_r - w)), height - h - 2);
779 cr->set_source_rgba (.9, .9, .9, 1.0);
780 layout->show_in_cairo_context (cr);
782 int innertop = ceil (mnh * .5) + 1;
783 size_t innerheight = (height - 2 * innertop - h - 2);
785 cr->rectangle (1, innertop - 1, m_r - 2 - anw, innerheight + 2);
786 cr->set_source_rgba (0, 0, 0, 1.0);
787 cr->fill_preserve ();
788 cr->set_line_width (1.0);
789 cr->set_source_rgba (.7, .7, .6, 1.0);
792 for (size_t y = 0 ; y < innerheight - 2; ++y) {
793 const float pk = 1.0 - (float) y / innerheight;
794 Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
795 Gtkmm2ext::set_source_rgba (cr, c);
796 cr->rectangle (2, innertop + y + .5, m_r - 4 - anw, 1);
800 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
801 for (int i = 0; i <= 4; ++i) {
802 const float fract = (float) i / 4.0;
803 const float yalign = .5; // (i == 4) ? 0 : (i == 0) ? 1.0 : .5;
805 snprintf (buf, sizeof (buf), "%.0f", AudioGrapher::Analyser::fft_range_db * -fract);
806 layout->set_text (buf);
807 layout->get_pixel_size (w, h);
809 cr->move_to (m_r - anw, rint (innertop + fract * innerheight - h * yalign));
810 cr->set_source_rgba (.9, .9, .9, 1.0);
811 layout->show_in_cairo_context (cr);
815 CimgPlayheadArea *sp = manage (new CimgPlayheadArea (spec, m_l, width));
816 playhead_widgets.push_back (sp);
817 sp->seek_playhead.connect (sigc::bind<0> (sigc::mem_fun (*this, &ExportReport::audition_seek), page));
818 CimgArea *an = manage (new CimgArea (scale));
819 wtbl->attach (*sp, 0, 1, wrow, wrow + 1, SHRINK, SHRINK);
820 wtbl->attach (*an, 1, 2, wrow, wrow + 1, SHRINK, SHRINK);
824 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
825 pcx->set_source (spec, 0, png_y0);
827 pcx->set_source (scale, png_w - m_r, png_y0);
832 timeline[page] = playhead_widgets;
834 HBox *tab = manage (new HBox ());
835 l = manage (new Label (Glib::path_get_basename (path)));
836 Gtk::Image *img = manage (new Image (Stock::MEDIA_PLAY, ICON_SIZE_MENU));
837 tab->pack_start (*img);
838 tab->pack_start (*l);
842 pages.pages ().push_back (Notebook_Helpers::TabElem (*vb, *tab));
843 pages.signal_switch_page().connect (sigc::mem_fun (*this, &ExportReport::on_switch_page));
846 assert (with_file && !path.empty ());
847 std::string imgpath = Glib::build_filename (Glib::path_get_dirname (path), PBD::basename_nosuffix (path) + ".png");
848 PBD::info << string_compose(_("Writing Export Analysis Image: %1."), imgpath) << endmsg;
849 png_surface->write_to_png (imgpath);
853 pages.set_show_tabs (true);
855 pages.set_name ("ExportReportNotebook");
856 pages.set_current_page (0);
858 get_vbox ()->set_spacing (4);
859 get_vbox ()->pack_start (pages, false, false);
862 _session->AuditionActive.connect(auditioner_connections, invalidator (*this), boost::bind (&ExportReport::audition_active, this, _1), gui_context());
863 _session->the_auditioner()->AuditionProgress.connect(auditioner_connections, invalidator (*this), boost::bind (&ExportReport::audition_progress, this, _1, _2), gui_context());
866 if (_session && with_file) {
867 play_btn = add_button (Stock::MEDIA_PLAY, RESPONSE_ACCEPT);
868 stop_btn = add_button (Stock::MEDIA_STOP, RESPONSE_ACCEPT);
870 add_button (Stock::CLOSE, RESPONSE_CLOSE);
872 set_default_response (RESPONSE_CLOSE);
873 if (_session && with_file) {
874 stop_btn->signal_clicked().connect (sigc::mem_fun (*this, &ExportReport::stop_audition));
875 play_btn->signal_clicked().connect (sigc::mem_fun (*this, &ExportReport::play_audition));
876 stop_btn->set_sensitive (false);
885 int i = ArdourDialog::run ();
886 if (i == Gtk::RESPONSE_DELETE_EVENT || i == RESPONSE_CLOSE) {
892 _session->cancel_audition();
894 return RESPONSE_CLOSE;
898 ExportReport::open_folder (std::string p)
900 PBD::open_folder (Glib::path_get_dirname(p));
904 ExportReport::audition_active (bool active)
906 if (!stop_btn || !play_btn) {
909 stop_btn->set_sensitive (active);
910 play_btn->set_sensitive (!active);
912 if (!active && _audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
913 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
914 i != timeline[_audition_num].end();
916 (*i)->set_playhead (-1);
920 if (_audition_num >= 0 ) {
921 Widget *page = pages.get_nth_page (_audition_num);
922 HBox *box = static_cast<Gtk::HBox*> (pages.get_tab_label (*page));
924 (*(box->get_children().begin()))->hide ();
926 (*(box->get_children().begin()))->show ();
936 ExportReport::audition (std::string path, unsigned n_chn, int page)
939 _session->cancel_audition();
941 if (n_chn ==0) { return; }
943 /* can't really happen, unless the user replaces the file while the dialog is open.. */
944 if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
945 PBD::warning << string_compose(_("Could not read file: %1 (%2)."), path, strerror(errno)) << endmsg;
948 if (SMFSource::valid_midi_file (path)) { return; }
950 boost::shared_ptr<Region> r;
952 boost::shared_ptr<AudioFileSource> afs;
953 bool old_sbp = AudioSource::get_build_peakfiles ();
955 /* don't even think of building peakfiles for these files */
956 AudioSource::set_build_peakfiles (false);
958 for (unsigned int n = 0; n < n_chn; ++n) {
960 afs = boost::dynamic_pointer_cast<AudioFileSource> (
961 SourceFactory::createExternal (DataType::AUDIO, *_session,
963 Source::Flag (ARDOUR::AudioFileSource::NoPeakFile), false));
964 if (afs->sample_rate() != _session->nominal_sample_rate()) {
965 boost::shared_ptr<SrcFileSource> sfs (new SrcFileSource(*_session, afs, ARDOUR::SrcGood));
966 srclist.push_back(sfs);
968 srclist.push_back(afs);
970 } catch (failed_constructor& err) {
971 PBD::error << _("Could not access soundfile: ") << path << endmsg;
972 AudioSource::set_build_peakfiles (old_sbp);
977 AudioSource::set_build_peakfiles (old_sbp);
979 if (srclist.empty()) {
983 afs = boost::dynamic_pointer_cast<AudioFileSource> (srclist[0]);
984 std::string rname = region_name_from_path (afs->path(), false);
986 PBD::PropertyList plist;
988 plist.add (ARDOUR::Properties::start, 0);
989 plist.add (ARDOUR::Properties::length, srclist[0]->length(srclist[0]->timeline_position()));
990 plist.add (ARDOUR::Properties::name, rname);
991 plist.add (ARDOUR::Properties::layer, 0);
993 r = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (srclist, plist, false));
996 _session->audition_region(r);
997 _audition_num = page;
1001 ExportReport::play_audition ()
1003 if (_audition_num >= 0 || !_session) { return; }
1004 if (files.find (_page_num) == files.end()) { return; }
1005 audition (files[_page_num].path, files[_page_num].channels, _page_num);
1009 ExportReport::stop_audition ()
1011 if (_audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
1012 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
1013 i != timeline[_audition_num].end();
1015 (*i)->set_playhead (-1);
1019 _session->cancel_audition();
1024 ExportReport::on_switch_page (GtkNotebookPage*, guint page_num)
1026 if (_audition_num == _page_num) {
1027 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
1028 i != timeline[_audition_num].end();
1030 (*i)->set_playhead (-1);
1033 _page_num = page_num;
1037 ExportReport::audition_progress (samplecnt_t pos, samplecnt_t len)
1039 if (_audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
1040 const float p = (float)pos / len;
1041 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
1042 i != timeline[_audition_num].end();
1044 (*i)->set_playhead (p);
1050 ExportReport::audition_seek (int page, float pos)
1052 if (_audition_num == page && _session) {
1053 _session->the_auditioner()->seek_to_percent (100.f * pos);
1058 ExportReport::on_logscale_toggled (Gtk::ToggleButton* b)
1060 bool en = b->get_active ();
1061 for (std::list<CimgWaveArea*>::iterator i = waves.begin (); i != waves.end (); ++i) {
1062 (*i)->set_logscale (en);
1067 ExportReport::on_rectivied_toggled (Gtk::ToggleButton* b)
1069 bool en = b->get_active ();
1070 for (std::list<CimgWaveArea*>::iterator i = waves.begin (); i != waves.end (); ++i) {
1071 (*i)->set_rectified (en);
1076 ExportReport::draw_waveform (Cairo::RefPtr<Cairo::ImageSurface>& wave, ExportAnalysisPtr p, uint32_t c, int m_l, size_t width, int anw, int height_2, bool log, bool rect)
1079 Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (get_pango_context ());
1080 const float ht = 2.f * height_2;
1082 std::vector<double> dashes;
1083 dashes.push_back (3.0);
1084 dashes.push_back (5.0);
1086 wave = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_l + width, ht);
1087 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (wave);
1088 cr->set_operator (Cairo::OPERATOR_SOURCE);
1089 cr->rectangle (0, 0, m_l, ht);
1090 cr->set_source_rgba (0, 0, 0, 0);
1092 cr->rectangle (m_l, 0, width, ht);
1093 cr->set_source_rgba (0, 0, 0, 1.0);
1095 cr->set_operator (Cairo::OPERATOR_OVER);
1097 cr->set_source_rgba (.7, .7, .7, 1.0);
1098 cr->set_line_width (1.0);
1108 clip_top = ht * (1.f - alt_log_meter (-1));
1109 for (size_t x = 0 ; x < width; ++x) {
1110 const float v = alt_log_meter (fast_coefficient_to_dB (std::max (fabsf (p->peaks[c][x].max), fabsf (p->peaks[c][x].min))));
1111 cr->move_to (m_l + x - .5, ht - ht * v);
1112 cr->line_to (m_l + x - .5, ht);
1116 clip_top = ht * (1.f - dB_to_coefficient (-1));
1117 for (size_t x = 0 ; x < width; ++x) {
1118 const float v = std::max (fabsf (p->peaks[c][x].max), fabsf (p->peaks[c][x].min));
1119 cr->move_to (m_l + x - .5, ht - ht * v);
1120 cr->line_to (m_l + x - .5, ht);
1126 clip_top = height_2 - height_2 * alt_log_meter (-1);
1127 clip_bot = height_2 + height_2 * alt_log_meter (-1);
1128 for (size_t x = 0 ; x < width; ++x) {
1130 if (p->peaks[c][x].max > 0) {
1131 pmax = alt_log_meter (fast_coefficient_to_dB (p->peaks[c][x].max));
1133 pmax = -alt_log_meter (fast_coefficient_to_dB (-p->peaks[c][x].max));
1136 if (p->peaks[c][x].min > 0) {
1137 pmin = alt_log_meter (fast_coefficient_to_dB (p->peaks[c][x].min));
1139 pmin = -alt_log_meter (fast_coefficient_to_dB (-p->peaks[c][x].min));
1141 cr->move_to (m_l + x - .5, height_2 - height_2 * pmax);
1142 cr->line_to (m_l + x - .5, height_2 - height_2 * pmin);
1146 clip_top = height_2 - height_2 * dB_to_coefficient (-1);
1147 clip_bot = height_2 + height_2 * dB_to_coefficient (-1);
1148 for (size_t x = 0 ; x < width; ++x) {
1149 cr->move_to (m_l + x - .5, height_2 - height_2 * p->peaks[c][x].max);
1150 cr->line_to (m_l + x - .5, height_2 - height_2 * p->peaks[c][x].min);
1157 cr->set_source_rgba (1.0, 0, 0, 1.0);
1158 for (size_t x = 0 ; x < width; ++x) {
1159 if (p->peaks[c][x].max >= 1.0) {
1160 cr->move_to (m_l + x - .5, 0);
1161 cr->line_to (m_l + x - .5, clip_top);
1163 if (p->peaks[c][x].min <= -1.0) {
1164 cr->move_to (m_l + x - .5, clip_bot);
1165 cr->line_to (m_l + x - .5, ht);
1170 // >= -1dBTP (coeff >= .89125, libs/vamp-plugins/TruePeak.cpp)
1171 cr->set_source_rgba (1.0, 0.7, 0, 0.7);
1172 for (std::set<samplepos_t>::const_iterator i = p->truepeakpos[c].begin (); i != p->truepeakpos[c].end (); ++i) {
1173 cr->move_to (m_l + (*i) - .5, clip_top);
1174 cr->line_to (m_l + (*i) - .5, clip_bot);
1180 cr->set_source_rgba (.3, .3, .3, 0.7);
1181 cr->move_to (m_l + 0, height_2 - .5);
1182 cr->line_to (m_l + width, height_2 - .5);
1187 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
1188 layout->set_alignment (Pango::ALIGN_LEFT);
1189 layout->set_text (_("dBFS"));
1190 layout->get_pixel_size (w, h);
1191 cr->move_to (rint (m_l - h - anw - 10), rint (height_2 + w * .5));
1192 cr->set_source_rgba (.9, .9, .9, 1.0);
1194 cr->rotate (M_PI / -2.0);
1195 layout->show_in_cairo_context (cr);
1199 cr->set_line_width (1.0);
1200 cr->set_dash (dashes, 2.0);
1201 cr->set_line_cap (Cairo::LINE_CAP_ROUND);
1203 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
1207 XAXISLABEL ((ht - ht * alt_log_meter (-36)), _("-36"));
1208 XAXISLABEL ((ht - ht * alt_log_meter (-18)), _("-18"));
1209 XAXISLABEL ((ht - ht * alt_log_meter (-9)), _("-9"));
1210 XAXISLABEL ((ht - ht * alt_log_meter (-3)), _("-3"));
1212 XAXISLABEL ((ht - ht * .1259), _("-18"));
1213 XAXISLABEL ((ht - ht * .3548), _("-9"));
1214 XAXISLABEL ((ht - ht * .7079), _("-3"));
1218 XAXISLABEL ((height_2 - height_2 * alt_log_meter (-18)), _("-18"));
1219 XAXISLABEL ((height_2 - height_2 * alt_log_meter (-9)), _("-9"));
1220 XAXISLABEL ((height_2 - height_2 * alt_log_meter (-3)), _("-3"));
1221 XAXISLABEL ((height_2 + height_2 * alt_log_meter (-18)), _("-18"));
1222 XAXISLABEL ((height_2 + height_2 * alt_log_meter (-9)), _("-9"));
1223 XAXISLABEL ((height_2 + height_2 * alt_log_meter (-3)), _("-3"));
1225 XAXISLABEL (height_2 * 0.6452, _("-9"));
1226 XAXISLABEL (height_2 * 1.3548, _("-9"));
1227 XAXISLABEL (height_2 * 0.2921, _("-3"));
1228 XAXISLABEL (height_2 * 1.7079, _("-3"));