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"
28 #include "gtkmm2ext/utils.h"
29 #include "gtkmm2ext/utils.h"
30 #include "canvas/utils.h"
31 #include "canvas/colors.h"
33 #include "audiographer/general/analyser.h"
35 #include "ardour/audiofilesource.h"
36 #include "ardour/audioregion.h"
37 #include "ardour/auditioner.h"
38 #include "ardour/dB.h"
39 #include "ardour/logmeter.h"
40 #include "ardour/region_factory.h"
41 #include "ardour/session.h"
42 #include "ardour/smf_source.h"
43 #include "ardour/source_factory.h"
44 #include "ardour/srcfilesource.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 framecnt_t file_length = 0;
127 framecnt_t sample_rate = 0;
128 framecnt_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 framecnt_t const nfr = _session ? _session->nominal_frame_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;
323 IMGLABEL (lx0, _("File:"), Glib::path_get_basename (path));
324 IMGLABEL (lx1, _("Channels:"), string_compose ("%1", channels));
327 IMGLABEL (lx0, _("Format:"), file_fmt);
328 IMGLABEL (lx1, _("Sample rate:"), string_compose (_("%1 Hz"), sample_rate));
333 _session->sample_to_timecode (start_off, tct, false, false);
334 IMGLABEL (lx0, _("Timecode:"), Timecode::timecode_format_time (tct));
336 IMGLABEL (lx1, _("Duration:"), Timecode::timecode_format_sampletime (file_length, sample_rate, 1000, false));
341 { /* peak, loudness and R128 histogram */
342 Cairo::RefPtr<Cairo::ImageSurface> nums = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, mnw, hh);
343 Cairo::RefPtr<Cairo::ImageSurface> ebur = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, mnw, hh);
344 Cairo::RefPtr<Cairo::ImageSurface> hist = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, 540, hh);
346 /* peak and true-peak numerics */
347 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (nums);
348 cr->set_source_rgba (0, 0, 0, 1.0);
351 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
352 layout->set_alignment (Pango::ALIGN_LEFT);
353 layout->set_text (_("Peak:"));
354 layout->get_pixel_size (w, h);
355 cr->move_to (rint (nw2 - w * .5), y0[0]);
356 cr->set_source_rgba (.7, .7, .7, 1.0);
357 layout->show_in_cairo_context (cr);
359 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
360 layout->set_text (string_compose (_("%1 dBFS"), std::setprecision (1), std::fixed, dbfs));
361 layout->get_pixel_size (w, h);
362 cr->move_to (rint (nw2 - w * .5), y0[1]);
363 if (dbfs >= 0.f) { cr->set_source_rgba (1.0, .1, .1, 1.0); }
364 else if (dbfs > -1.f) { cr->set_source_rgba (1.0, .7, .0, 1.0); }
365 layout->show_in_cairo_context (cr);
368 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
369 layout->set_text (_("True Peak:"));
370 layout->get_pixel_size (w, h);
371 cr->move_to (rint (nw2 - w * .5), y0[2]);
372 cr->set_source_rgba (.7, .7, .7, 1.0);
373 layout->show_in_cairo_context (cr);
375 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
376 layout->set_text (string_compose (_("%1 dBTP"), std::setprecision (1), std::fixed, dbtp));
377 layout->get_pixel_size (w, h);
378 cr->move_to (rint (nw2 - w * .5), y0[3]);
379 if (dbtp >= 0.f) { cr->set_source_rgba (1.0, .1, .1, 1.0); }
380 else if (dbtp > -1.f) { cr->set_source_rgba (1.0, .7, .0, 1.0); }
381 layout->show_in_cairo_context (cr);
385 const float ndb = accurate_coefficient_to_dB (p->norm_gain_factor);
386 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
387 layout->set_text (_("Normalization Gain:"));
388 layout->get_pixel_size (w, h);
389 cr->move_to (rint (nw2 - w * .5), y0[4]);
390 cr->set_source_rgba (.7, .7, .7, 1.0);
391 layout->show_in_cairo_context (cr);
393 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
394 layout->set_text (string_compose (_("%1 dB"), std::setprecision (2), std::showpos, std::fixed, ndb));
396 layout->get_pixel_size (w, h);
397 cr->move_to (rint (nw2 - w * .5), y0[5]);
398 // TODO tweak thresholds
399 if (p->norm_gain_factor < 1.0) {
400 cr->set_source_rgba (1.0, .7, .1, 1.0);
401 } else if (p->norm_gain_factor == 1.0) {
402 cr->set_source_rgba (.7, .7, .7, 1.0);
403 } else if (fabsf (ndb) < 12) {
404 cr->set_source_rgba (.1, 1.0, .1, 1.0);
405 } else if (fabsf (ndb) < 18) {
406 cr->set_source_rgba (1.0, .7, .1, 1.0);
408 cr->set_source_rgba (1.0, .1, .1, 1.0);
410 layout->show_in_cairo_context (cr);
415 /* EBU R128 numerics */
416 cr = Cairo::Context::create (ebur);
417 cr->set_source_rgba (0, 0, 0, 1.0);
420 cr->set_source_rgba (.7, .7, .7, 1.0);
422 if (!i->second->have_loudness) {
423 layout->set_alignment (Pango::ALIGN_CENTER);
424 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
425 layout->set_text (_("Not\nAvailable"));
426 layout->get_pixel_size (w, h);
427 cr->move_to (rint (nw2 - w * .5), rint ((hh - h) * .5));
428 layout->show_in_cairo_context (cr);
430 else if (p->loudness == -200 && p->loudness_range == 0) {
431 layout->set_alignment (Pango::ALIGN_CENTER);
432 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
433 layout->set_text (_("Not\nAvailable"));
434 layout->get_pixel_size (w, h);
435 cr->move_to (rint (nw2 - w * .5), rint (hh * .5 - h * .66));
436 layout->show_in_cairo_context (cr);
439 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
440 layout->set_text (_("(too short integration time)"));
441 layout->get_pixel_size (w, h);
442 cr->move_to (rint (nw2 - w * .5), rint (hh * .5 + yy));
443 layout->show_in_cairo_context (cr);
446 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
447 layout->set_alignment (Pango::ALIGN_LEFT);
448 layout->set_text (_("Integrated Loudness:"));
449 layout->get_pixel_size (w, h);
450 cr->move_to (rint (nw2 - w * .5), y0[0]);
451 layout->show_in_cairo_context (cr);
453 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
454 layout->set_text (string_compose (_("%1 LUFS"), std::setprecision (1), std::fixed, p->loudness));
455 layout->get_pixel_size (w, h);
456 cr->move_to (rint (nw2 - w * .5), y0[1]);
457 layout->show_in_cairo_context (cr);
459 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
460 layout->set_text (_("Loudness Range:"));
461 layout->get_pixel_size (w, h);
462 cr->move_to (rint (nw2 - w * .5), y0[2]);
463 layout->show_in_cairo_context (cr);
465 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
466 layout->set_text (string_compose (_("%1 LU"), std::setprecision (1), std::fixed, p->loudness_range));
467 layout->get_pixel_size (w, h);
468 cr->move_to (rint (nw2 - w * .5), y0[3]);
469 layout->show_in_cairo_context (cr);
473 /* draw loudness histogram */
474 cr = Cairo::Context::create (hist);
475 cr->set_source_rgba (0, 0, 0, 1.0);
478 cr->set_source_rgba (.7, .7, .7, 1.0);
479 cr->set_line_width (1.0);
481 if (p->loudness_hist_max > 0 && i->second->have_loudness) {
483 for (size_t x = 0 ; x < 510; ++x) {
484 cr->move_to (x - .5, hh);
485 cr->line_to (x - .5, (float) hh * (1.0 - p->loudness_hist[x] / (float) p->loudness_hist_max));
489 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
490 layout->set_alignment (Pango::ALIGN_CENTER);
493 layout->set_text (_("LUFS\n(short)"));
494 layout->get_pixel_size (w, h);
495 Gtkmm2ext::rounded_rectangle (cr, 5, 5, w + 2, h + 2, 4);
496 cr->set_source_rgba (.1, .1, .1, 0.7);
499 cr->set_source_rgba (.9, .9, .9, 1.0);
500 layout->show_in_cairo_context (cr);
503 layout->set_text (_("Multiplicity"));
504 layout->get_pixel_size (w, h);
505 Gtkmm2ext::rounded_rectangle (cr, 5, hh - w - 3, h + 2, w + 2, 4);
506 cr->set_source_rgba (.1, .1, .1, 0.7);
509 cr->move_to (6, hh - 2);
510 cr->set_source_rgba (.9, .9, .9, 1.0);
511 cr->rotate (M_PI / -2.0);
512 layout->show_in_cairo_context (cr);
516 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
517 layout->set_alignment (Pango::ALIGN_LEFT);
518 for (int g = -53; g <= -8; g += 5) {
519 // grid-lines. [110] -59LUFS .. [650]: -5 LUFS
520 layout->set_text (string_compose ("%1", std::setw(3), std::setfill(' '), g));
521 layout->get_pixel_size (w, h);
523 cr->set_operator (Cairo::OPERATOR_OVER);
524 Gtkmm2ext::rounded_rectangle (cr,
525 rint ((g + 59.0) * 10.0 - h * .5), 5,
527 const float pk = (g + 59.0) / 54.0;
528 ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, .3 + pk * .4, .6);
529 ArdourCanvas::set_source_rgba (cr, c);
533 cr->set_source_rgba (.9, .9, .9, 1.0);
534 cr->move_to (rint ((g + 59.0) * 10.0 - h * .5), w + 6.0);
535 cr->rotate (M_PI / -2.0);
536 layout->show_in_cairo_context (cr);
539 cr->set_operator (Cairo::OPERATOR_ADD);
541 cr->set_source_rgba (.3, .3, .3, 1.0);
542 cr->set_dash (dashes, 1.0);
543 cr->set_line_cap (Cairo::LINE_CAP_ROUND);
544 cr->move_to (rint ((g + 59.0) * 10.0) + .5, w + 8.0);
545 cr->line_to (rint ((g + 59.0) * 10.0) + .5, hh);
551 layout->set_alignment (Pango::ALIGN_CENTER);
552 layout->set_font_description (UIConfiguration::instance ().get_LargeFont ());
553 layout->set_text (_("Not\nAvailable"));
554 layout->get_pixel_size (w, h);
555 cr->move_to (rint ((510 - w) * .5), rint ((hh - h) * .5));
556 layout->show_in_cairo_context (cr);
562 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
563 pcx->set_source (nums, 0, png_y0);
565 pcx->set_source (hist, (png_w - 540) / 2, png_y0);
567 pcx->set_source (ebur, png_w - mnw, png_y0);
572 CimgArea *nu = manage (new CimgArea (nums));
573 CimgArea *eb = manage (new CimgArea (ebur));
574 CimgArea *hi = manage (new CimgArea (hist));
575 HBox *hb = manage (new HBox ());
577 hb->pack_start (*nu, false, false);
578 hb->pack_start (*hi, false, false);
579 hb->pack_start (*eb, false, false);
581 wtbl->attach (*hb, 0, 2, wrow, wrow + 1, SHRINK, SHRINK);
585 #define XAXISLABEL(POS, TXT) { \
586 const float yy = rint (POS); \
587 layout->set_text (TXT); \
588 layout->get_pixel_size (w, h); \
589 cr->move_to (m_l - 8 - w, rint ((POS) - h * .5)); \
590 cr->set_source_rgba (.9, .9, .9, 1.0); \
591 cr->set_operator (Cairo::OPERATOR_OVER); \
592 layout->show_in_cairo_context (cr); \
593 cr->move_to (m_l - 4, yy - .5); \
594 cr->line_to (m_l + width, yy - .5); \
595 cr->set_source_rgba (.3, .3, .3, 1.0); \
596 cr->set_operator (Cairo::OPERATOR_ADD); \
602 VBox *lrb = manage (new VBox());
603 ToggleButton *log = manage (new ToggleButton (S_("Logscale|Lg")));
604 ToggleButton *rec = manage (new ToggleButton (S_("Rectified|Rf")));
605 Gtkmm2ext::UI::instance()->set_tip (log, _("Logscale"));
606 Gtkmm2ext::UI::instance()->set_tip (rec, _("Rectified"));
608 lrb->pack_start (*log, false, false, 5);
609 lrb->pack_end (*rec, false, false, 5);
610 log->signal_toggled ().connect (sigc::bind (sigc::mem_fun (*this, &ExportReport::on_logscale_toggled), log));
611 rec->signal_toggled ().connect (sigc::bind (sigc::mem_fun (*this, &ExportReport::on_rectivied_toggled), rec));
613 wtbl->attach (*lrb, 1, 2, wrow, wrow + p->n_channels, SHRINK, SHRINK);
616 for (uint32_t c = 0; c < p->n_channels; ++c) {
618 const size_t width = sizeof (p->peaks) / sizeof (ARDOUR::PeakData::PeakDatum) / 4;
620 Cairo::RefPtr<Cairo::ImageSurface> wave;
621 Cairo::RefPtr<Cairo::ImageSurface> wave_log;
622 Cairo::RefPtr<Cairo::ImageSurface> wave_rect;
623 Cairo::RefPtr<Cairo::ImageSurface> wave_lr;
624 draw_waveform(wave, p, c, m_l, width, anw, waveh2, false, false);
625 draw_waveform(wave_log, p, c, m_l, width, anw, waveh2, true, false);
626 draw_waveform(wave_rect, p, c, m_l, width, anw, waveh2, false, true);
627 draw_waveform(wave_lr, p, c, m_l, width, anw, waveh2, true, true);
629 CimgWaveArea *wv = manage (new CimgWaveArea (wave, wave_log, wave_rect, wave_lr, m_l, width));
631 playhead_widgets.push_back (wv);
632 waves.push_back (wv);
633 wv->seek_playhead.connect (sigc::bind<0> (sigc::mem_fun (*this, &ExportReport::audition_seek), page));
634 wtbl->attach (*wv, 0, 1, wrow, wrow + 1, SHRINK, SHRINK);
638 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
639 pcx->set_source (wave, 0, png_y0);
641 png_y0 += 2 * waveh2 + 4;
645 if (channels > 0 && file_length > 0 && sample_rate > 0)
647 /* Time Axis -- re-use waveform width */
648 const size_t width = sizeof (p->peaks) / sizeof (ARDOUR::PeakData::PeakDatum) / 4;
649 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
650 layout->set_text (_("00:00:00.000"));
651 layout->get_pixel_size (w, h);
652 int height = h * 1.75;
653 Cairo::RefPtr<Cairo::ImageSurface> ytme = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_l + width, height);
654 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (ytme);
655 cr->set_operator (Cairo::OPERATOR_SOURCE);
656 cr->set_source_rgba (0, 0, 0, 1.0);
658 cr->rectangle (0, 0, m_l, height);
659 cr->set_source_rgba (0, 0, 0, 0);
661 cr->set_operator (Cairo::OPERATOR_OVER);
663 cr->set_line_width (1.0);
664 for (int i = 0; i <= 4; ++i) {
665 const float fract = (float) i / 4.0;
666 // " XX:XX:XX.XXX" [space/minus] 12 chars = 13.
667 const float xalign = (i == 4) ? 1.0 : (i == 0) ? 1.0 / 13.0 : 7.0 / 13.0;
670 AudioClock::print_minsec (start_off + file_length * fract,
671 buf, sizeof (buf), sample_rate);
673 layout->set_text (buf);
674 layout->get_pixel_size (w, h);
675 cr->move_to (rint (m_l + width * fract - w * xalign), rint (.5 * (height - h)));
676 cr->set_source_rgba (.9, .9, .9, 1.0);
677 layout->show_in_cairo_context (cr);
679 cr->set_source_rgba (.7, .7, .7, 1.0);
680 cr->move_to (rint (m_l + width * fract) - .5, 0);
681 cr->line_to (rint (m_l + width * fract) - .5, ceil (height * .15));
682 cr->move_to (rint (m_l + width * fract) - .5, floor (height * .85));
683 cr->line_to (rint (m_l + width * fract) - .5, height);
687 layout->set_font_description (UIConfiguration::instance ().get_SmallFont ());
688 layout->set_text (_("Time"));
689 cr->set_source_rgba (.9, .9, .9, 1.0);
690 layout->get_pixel_size (w, h);
691 cr->move_to (rint (m_l - w - 8), rint (.5 * (height - h)));
692 layout->show_in_cairo_context (cr);
695 CimgPlayheadArea *tm = manage (new CimgPlayheadArea (ytme, m_l, width, true));
696 playhead_widgets.push_back (tm);
697 tm->seek_playhead.connect (sigc::bind<0> (sigc::mem_fun (*this, &ExportReport::audition_seek), page));
698 wtbl->attach (*tm, 0, 1, wrow, wrow + 1, SHRINK, SHRINK);
702 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
703 pcx->set_source (ytme, 0, png_y0);
705 png_y0 += height + 4;
711 const size_t height = specth;
712 const size_t swh = sizeof (p->spectrum) / sizeof (float);
713 const size_t width = swh / height;
715 Cairo::RefPtr<Cairo::ImageSurface> spec = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_l + width, height);
716 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (spec);
717 cr->set_operator (Cairo::OPERATOR_SOURCE);
718 cr->rectangle (0, 0, m_l, height);
719 cr->set_source_rgba (0, 0, 0, 0);
721 cr->rectangle (m_l, 0, width, height);
722 cr->set_source_rgba (0, 0, 0, 1.0);
724 cr->set_operator (Cairo::OPERATOR_OVER);
726 for (size_t x = 0 ; x < width; ++x) {
727 for (size_t y = 0 ; y < height; ++y) {
728 const float pk = p->spectrum[x][y];
729 ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
730 ArdourCanvas::set_source_rgba (cr, c);
731 cr->rectangle (m_l + x - .5, y - .5, 1, 1);
737 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
738 layout->set_text (_("Hz"));
739 layout->get_pixel_size (w, h);
740 cr->move_to (rint (m_l - h - anw - 10), rint ((height + w) * .5));
741 cr->set_source_rgba (.9, .9, .9, 1.0);
743 cr->rotate (M_PI / -2.0);
744 layout->show_in_cairo_context (cr);
748 cr->set_line_width (1.0);
749 cr->set_dash (dashes, 2.0);
750 cr->set_line_cap (Cairo::LINE_CAP_ROUND);
752 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
753 //XAXISLABEL (p->freq[0], _("50Hz"));
754 XAXISLABEL (p->freq[1], _("100"));
755 XAXISLABEL (p->freq[2], _("500"));
756 XAXISLABEL (p->freq[3], _("1K"));
757 XAXISLABEL (p->freq[4], _("5K"));
758 XAXISLABEL (p->freq[5], _("10K"));
762 Cairo::RefPtr<Cairo::ImageSurface> scale = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_r, height);
763 cr = Cairo::Context::create (scale);
764 cr->set_operator (Cairo::OPERATOR_SOURCE);
765 cr->rectangle (0, 0, m_r, height);
766 cr->set_source_rgba (0, 0, 0, 0);
769 cr->set_operator (Cairo::OPERATOR_OVER);
770 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
771 layout->set_alignment (Pango::ALIGN_LEFT);
772 layout->set_text (_("dBFS"));
773 layout->get_pixel_size (w, h);
774 cr->move_to (rint (.5 * (m_r - w)), height - h - 2);
775 cr->set_source_rgba (.9, .9, .9, 1.0);
776 layout->show_in_cairo_context (cr);
778 int innertop = ceil (mnh * .5) + 1;
779 size_t innerheight = (height - 2 * innertop - h - 2);
781 cr->rectangle (1, innertop - 1, m_r - 2 - anw, innerheight + 2);
782 cr->set_source_rgba (0, 0, 0, 1.0);
783 cr->fill_preserve ();
784 cr->set_line_width (1.0);
785 cr->set_source_rgba (.7, .7, .6, 1.0);
788 for (size_t y = 0 ; y < innerheight - 2; ++y) {
789 const float pk = 1.0 - (float) y / innerheight;
790 ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
791 ArdourCanvas::set_source_rgba (cr, c);
792 cr->rectangle (2, innertop + y + .5, m_r - 4 - anw, 1);
796 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
797 for (int i = 0; i <= 4; ++i) {
798 const float fract = (float) i / 4.0;
799 const float yalign = .5; // (i == 4) ? 0 : (i == 0) ? 1.0 : .5;
801 snprintf (buf, sizeof (buf), "%.0f", AudioGrapher::Analyser::fft_range_db * -fract);
802 layout->set_text (buf);
803 layout->get_pixel_size (w, h);
805 cr->move_to (m_r - anw, rint (innertop + fract * innerheight - h * yalign));
806 cr->set_source_rgba (.9, .9, .9, 1.0);
807 layout->show_in_cairo_context (cr);
811 CimgPlayheadArea *sp = manage (new CimgPlayheadArea (spec, m_l, width));
812 playhead_widgets.push_back (sp);
813 sp->seek_playhead.connect (sigc::bind<0> (sigc::mem_fun (*this, &ExportReport::audition_seek), page));
814 CimgArea *an = manage (new CimgArea (scale));
815 wtbl->attach (*sp, 0, 1, wrow, wrow + 1, SHRINK, SHRINK);
816 wtbl->attach (*an, 1, 2, wrow, wrow + 1, SHRINK, SHRINK);
820 Cairo::RefPtr<Cairo::Context> pcx = Cairo::Context::create (png_surface);
821 pcx->set_source (spec, 0, png_y0);
823 pcx->set_source (scale, png_w - m_r, png_y0);
828 timeline[page] = playhead_widgets;
830 HBox *tab = manage (new HBox ());
831 l = manage (new Label (Glib::path_get_basename (path)));
832 Gtk::Image *img = manage (new Image (Stock::MEDIA_PLAY, ICON_SIZE_MENU));
833 tab->pack_start (*img);
834 tab->pack_start (*l);
838 pages.pages ().push_back (Notebook_Helpers::TabElem (*vb, *tab));
839 pages.signal_switch_page().connect (sigc::mem_fun (*this, &ExportReport::on_switch_page));
842 assert (with_file && !path.empty ());
843 std::string imgpath = Glib::build_filename (Glib::path_get_dirname (path), PBD::basename_nosuffix (path) + ".png");
844 PBD::info << string_compose(_("Writing Export Analysis Image: %1."), imgpath) << endmsg;
845 png_surface->write_to_png (imgpath);
849 pages.set_show_tabs (true);
851 pages.set_name ("ExportReportNotebook");
852 pages.set_current_page (0);
854 get_vbox ()->set_spacing (4);
855 get_vbox ()->pack_start (pages, false, false);
858 _session->AuditionActive.connect(auditioner_connections, invalidator (*this), boost::bind (&ExportReport::audition_active, this, _1), gui_context());
859 _session->the_auditioner()->AuditionProgress.connect(auditioner_connections, invalidator (*this), boost::bind (&ExportReport::audition_progress, this, _1, _2), gui_context());
862 if (_session && with_file) {
863 play_btn = add_button (Stock::MEDIA_PLAY, RESPONSE_ACCEPT);
864 stop_btn = add_button (Stock::MEDIA_STOP, RESPONSE_ACCEPT);
866 add_button (Stock::CLOSE, RESPONSE_CLOSE);
868 set_default_response (RESPONSE_CLOSE);
869 if (_session && with_file) {
870 stop_btn->signal_clicked().connect (sigc::mem_fun (*this, &ExportReport::stop_audition));
871 play_btn->signal_clicked().connect (sigc::mem_fun (*this, &ExportReport::play_audition));
872 stop_btn->set_sensitive (false);
881 int i = ArdourDialog::run ();
882 if (i == Gtk::RESPONSE_DELETE_EVENT || i == RESPONSE_CLOSE) {
888 _session->cancel_audition();
890 return RESPONSE_CLOSE;
894 ExportReport::open_folder (std::string p)
896 PBD::open_folder (Glib::path_get_dirname(p));
900 ExportReport::audition_active (bool active)
902 if (!stop_btn || !play_btn) {
905 stop_btn->set_sensitive (active);
906 play_btn->set_sensitive (!active);
908 if (!active && _audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
909 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
910 i != timeline[_audition_num].end();
912 (*i)->set_playhead (-1);
916 if (_audition_num >= 0 ) {
917 Widget *page = pages.get_nth_page (_audition_num);
918 HBox *box = static_cast<Gtk::HBox*> (pages.get_tab_label (*page));
920 (*(box->get_children().begin()))->hide ();
922 (*(box->get_children().begin()))->show ();
932 ExportReport::audition (std::string path, unsigned n_chn, int page)
935 _session->cancel_audition();
937 if (n_chn ==0) { return; }
939 /* can't really happen, unless the user replaces the file while the dialog is open.. */
940 if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
941 PBD::warning << string_compose(_("Could not read file: %1 (%2)."), path, strerror(errno)) << endmsg;
944 if (SMFSource::valid_midi_file (path)) { return; }
946 boost::shared_ptr<Region> r;
948 boost::shared_ptr<AudioFileSource> afs;
949 bool old_sbp = AudioSource::get_build_peakfiles ();
951 /* don't even think of building peakfiles for these files */
952 AudioSource::set_build_peakfiles (false);
954 for (unsigned int n = 0; n < n_chn; ++n) {
956 afs = boost::dynamic_pointer_cast<AudioFileSource> (
957 SourceFactory::createExternal (DataType::AUDIO, *_session,
959 Source::Flag (ARDOUR::AudioFileSource::NoPeakFile), false));
960 if (afs->sample_rate() != _session->nominal_frame_rate()) {
961 boost::shared_ptr<SrcFileSource> sfs (new SrcFileSource(*_session, afs, ARDOUR::SrcGood));
962 srclist.push_back(sfs);
964 srclist.push_back(afs);
966 } catch (failed_constructor& err) {
967 PBD::error << _("Could not access soundfile: ") << path << endmsg;
968 AudioSource::set_build_peakfiles (old_sbp);
973 AudioSource::set_build_peakfiles (old_sbp);
975 if (srclist.empty()) {
979 afs = boost::dynamic_pointer_cast<AudioFileSource> (srclist[0]);
980 std::string rname = region_name_from_path (afs->path(), false);
982 PBD::PropertyList plist;
984 plist.add (ARDOUR::Properties::start, 0);
985 plist.add (ARDOUR::Properties::length, srclist[0]->length(srclist[0]->timeline_position()));
986 plist.add (ARDOUR::Properties::name, rname);
987 plist.add (ARDOUR::Properties::layer, 0);
989 r = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (srclist, plist, false));
992 _session->audition_region(r);
993 _audition_num = page;
997 ExportReport::play_audition ()
999 if (_audition_num >= 0 || !_session) { return; }
1000 if (files.find (_page_num) == files.end()) { return; }
1001 audition (files[_page_num].path, files[_page_num].channels, _page_num);
1005 ExportReport::stop_audition ()
1007 if (_audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
1008 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
1009 i != timeline[_audition_num].end();
1011 (*i)->set_playhead (-1);
1015 _session->cancel_audition();
1020 ExportReport::on_switch_page (GtkNotebookPage*, guint page_num)
1022 if (_audition_num == _page_num) {
1023 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
1024 i != timeline[_audition_num].end();
1026 (*i)->set_playhead (-1);
1029 _page_num = page_num;
1033 ExportReport::audition_progress (framecnt_t pos, framecnt_t len)
1035 if (_audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
1036 const float p = (float)pos / len;
1037 for (std::list<CimgPlayheadArea*>::const_iterator i = timeline[_audition_num].begin();
1038 i != timeline[_audition_num].end();
1040 (*i)->set_playhead (p);
1046 ExportReport::audition_seek (int page, float pos)
1048 if (_audition_num == page && _session) {
1049 _session->the_auditioner()->seek_to_percent (100.f * pos);
1054 ExportReport::on_logscale_toggled (Gtk::ToggleButton* b)
1056 bool en = b->get_active ();
1057 for (std::list<CimgWaveArea*>::iterator i = waves.begin (); i != waves.end (); ++i) {
1058 (*i)->set_logscale (en);
1063 ExportReport::on_rectivied_toggled (Gtk::ToggleButton* b)
1065 bool en = b->get_active ();
1066 for (std::list<CimgWaveArea*>::iterator i = waves.begin (); i != waves.end (); ++i) {
1067 (*i)->set_rectified (en);
1072 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)
1075 Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (get_pango_context ());
1076 const float ht = 2.f * height_2;
1078 std::vector<double> dashes;
1079 dashes.push_back (3.0);
1080 dashes.push_back (5.0);
1082 wave = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, m_l + width, ht);
1083 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (wave);
1084 cr->set_operator (Cairo::OPERATOR_SOURCE);
1085 cr->rectangle (0, 0, m_l, ht);
1086 cr->set_source_rgba (0, 0, 0, 0);
1088 cr->rectangle (m_l, 0, width, ht);
1089 cr->set_source_rgba (0, 0, 0, 1.0);
1091 cr->set_operator (Cairo::OPERATOR_OVER);
1093 cr->set_source_rgba (.7, .7, .7, 1.0);
1094 cr->set_line_width (1.0);
1104 clip_top = ht * (1.f - alt_log_meter (-1));
1105 for (size_t x = 0 ; x < width; ++x) {
1106 const float v = alt_log_meter (fast_coefficient_to_dB (std::max (fabsf (p->peaks[c][x].max), fabsf (p->peaks[c][x].min))));
1107 cr->move_to (m_l + x - .5, ht - ht * v);
1108 cr->line_to (m_l + x - .5, ht);
1112 clip_top = ht * (1.f - dB_to_coefficient (-1));
1113 for (size_t x = 0 ; x < width; ++x) {
1114 const float v = std::max (fabsf (p->peaks[c][x].max), fabsf (p->peaks[c][x].min));
1115 cr->move_to (m_l + x - .5, ht - ht * v);
1116 cr->line_to (m_l + x - .5, ht);
1122 clip_top = height_2 - height_2 * alt_log_meter (-1);
1123 clip_bot = height_2 + height_2 * alt_log_meter (-1);
1124 for (size_t x = 0 ; x < width; ++x) {
1126 if (p->peaks[c][x].max > 0) {
1127 pmax = alt_log_meter (fast_coefficient_to_dB (p->peaks[c][x].max));
1129 pmax = -alt_log_meter (fast_coefficient_to_dB (-p->peaks[c][x].max));
1132 if (p->peaks[c][x].min > 0) {
1133 pmin = alt_log_meter (fast_coefficient_to_dB (p->peaks[c][x].min));
1135 pmin = -alt_log_meter (fast_coefficient_to_dB (-p->peaks[c][x].min));
1137 cr->move_to (m_l + x - .5, height_2 - height_2 * pmax);
1138 cr->line_to (m_l + x - .5, height_2 - height_2 * pmin);
1142 clip_top = height_2 - height_2 * dB_to_coefficient (-1);
1143 clip_bot = height_2 + height_2 * dB_to_coefficient (-1);
1144 for (size_t x = 0 ; x < width; ++x) {
1145 cr->move_to (m_l + x - .5, height_2 - height_2 * p->peaks[c][x].max);
1146 cr->line_to (m_l + x - .5, height_2 - height_2 * p->peaks[c][x].min);
1153 cr->set_source_rgba (1.0, 0, 0, 1.0);
1154 for (size_t x = 0 ; x < width; ++x) {
1155 if (p->peaks[c][x].max >= 1.0) {
1156 cr->move_to (m_l + x - .5, 0);
1157 cr->line_to (m_l + x - .5, clip_top);
1159 if (p->peaks[c][x].min <= -1.0) {
1160 cr->move_to (m_l + x - .5, clip_bot);
1161 cr->line_to (m_l + x - .5, ht);
1166 // >= -1dBTP (coeff >= .89125, libs/vamp-plugins/TruePeak.cpp)
1167 cr->set_source_rgba (1.0, 0.7, 0, 0.7);
1168 for (std::set<framepos_t>::const_iterator i = p->truepeakpos[c].begin (); i != p->truepeakpos[c].end (); ++i) {
1169 cr->move_to (m_l + (*i) - .5, clip_top);
1170 cr->line_to (m_l + (*i) - .5, clip_bot);
1176 cr->set_source_rgba (.3, .3, .3, 0.7);
1177 cr->move_to (m_l + 0, height_2 - .5);
1178 cr->line_to (m_l + width, height_2 - .5);
1183 layout->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
1184 layout->set_alignment (Pango::ALIGN_LEFT);
1185 layout->set_text (_("dBFS"));
1186 layout->get_pixel_size (w, h);
1187 cr->move_to (rint (m_l - h - anw - 10), rint (height_2 + w * .5));
1188 cr->set_source_rgba (.9, .9, .9, 1.0);
1190 cr->rotate (M_PI / -2.0);
1191 layout->show_in_cairo_context (cr);
1195 cr->set_line_width (1.0);
1196 cr->set_dash (dashes, 2.0);
1197 cr->set_line_cap (Cairo::LINE_CAP_ROUND);
1199 layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
1203 XAXISLABEL ((ht - ht * alt_log_meter (-36)), _("-36"));
1204 XAXISLABEL ((ht - ht * alt_log_meter (-18)), _("-18"));
1205 XAXISLABEL ((ht - ht * alt_log_meter (-9)), _("-9"));
1206 XAXISLABEL ((ht - ht * alt_log_meter (-3)), _("-3"));
1208 XAXISLABEL ((ht - ht * .1259), _("-18"));
1209 XAXISLABEL ((ht - ht * .3548), _("-9"));
1210 XAXISLABEL ((ht - ht * .7079), _("-3"));
1214 XAXISLABEL ((height_2 - height_2 * alt_log_meter (-18)), _("-18"));
1215 XAXISLABEL ((height_2 - height_2 * alt_log_meter (-9)), _("-9"));
1216 XAXISLABEL ((height_2 - height_2 * alt_log_meter (-3)), _("-3"));
1217 XAXISLABEL ((height_2 + height_2 * alt_log_meter (-18)), _("-18"));
1218 XAXISLABEL ((height_2 + height_2 * alt_log_meter (-9)), _("-9"));
1219 XAXISLABEL ((height_2 + height_2 * alt_log_meter (-3)), _("-3"));
1221 XAXISLABEL (height_2 * 0.6452, _("-9"));
1222 XAXISLABEL (height_2 * 1.3548, _("-9"));
1223 XAXISLABEL (height_2 * 0.2921, _("-3"));
1224 XAXISLABEL (height_2 * 1.7079, _("-3"));