diff layer/WaveformLayer.cpp @ 1147:1badacff7ab2 3.0-integration

Introduce labels in RangeMapper and use them in AudioDial, though only for tooltip at present. Make use of this for spectrogram magic -81dB/-Inf threshold. Also introduce static strings for inf/pi and use where appropriate.
author Chris Cannam
date Fri, 05 Aug 2016 17:48:52 +0100
parents ee01a4062747
children a34a2a25907c
line wrap: on
line diff
--- a/layer/WaveformLayer.cpp	Fri Aug 05 15:05:02 2016 +0100
+++ b/layer/WaveformLayer.cpp	Fri Aug 05 17:48:52 2016 +0100
@@ -19,6 +19,7 @@
 #include "view/View.h"
 #include "base/Profiler.h"
 #include "base/RangeMapper.h"
+#include "base/Strings.h"
 
 #include "ColourDatabase.h"
 #include "PaintAssistant.h"
@@ -1203,7 +1204,7 @@
 	return paint.fontMetrics().width("0.0") + 13;
     } else {
 	return std::max(paint.fontMetrics().width(tr("0dB")),
-			paint.fontMetrics().width(tr("-Inf"))) + 13;
+			paint.fontMetrics().width(Strings::minus_infinity)) + 13;
     }
 }
 
@@ -1257,7 +1258,7 @@
 		text = QString("%1").arg(meterdbs[i]);
 		if (i == n) text = tr("0dB");
 		if (i == 0) {
-                    text = tr("-Inf");
+                    text = Strings::minus_infinity;
                     val = 0.0;
 		}
                 break;
@@ -1267,7 +1268,7 @@
 		text = QString("%1").arg(-(10*n) + i * 10);
 		if (i == n) text = tr("0dB");
 		if (i == 0) {
-                    text = tr("-Inf");
+                    text = Strings::minus_infinity;
                     val = 0.0;
 		}
                 break;