diff layer/WaveformLayer.cpp @ 167:53b9c7656798

* Use RangeMappers in various places in plugin parameters, layer properties, playback parameters &c
author Chris Cannam
date Mon, 16 Oct 2006 20:42:23 +0000
parents 9e6b3e239b9d
children 42118892f428
line wrap: on
line diff
--- a/layer/WaveformLayer.cpp	Mon Oct 16 13:13:57 2006 +0000
+++ b/layer/WaveformLayer.cpp	Mon Oct 16 20:42:23 2006 +0000
@@ -18,6 +18,7 @@
 #include "base/AudioLevel.h"
 #include "view/View.h"
 #include "base/Profiler.h"
+#include "base/RangeMapper.h"
 
 #include <QPainter>
 #include <QPixmap>
@@ -224,6 +225,15 @@
     return tr("<unknown>");
 }
 
+RangeMapper *
+WaveformLayer::getNewPropertyRangeMapper(const PropertyName &name) const
+{
+    if (name == "Gain") {
+        return new LinearRangeMapper(-50, 50, -25, 25, tr("dB"));
+    }
+    return 0;
+}
+
 void
 WaveformLayer::setProperty(const PropertyName &name, int value)
 {