diff layer/SpectrumLayer.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 aaa3a53dbb10
children 42118892f428
line wrap: on
line diff
--- a/layer/SpectrumLayer.cpp	Mon Oct 16 13:13:57 2006 +0000
+++ b/layer/SpectrumLayer.cpp	Mon Oct 16 20:42:23 2006 +0000
@@ -20,6 +20,7 @@
 #include "view/View.h"
 #include "base/AudioLevel.h"
 #include "base/Preferences.h"
+#include "base/RangeMapper.h"
 
 #include <QPainter>
 #include <QPainterPath>
@@ -352,6 +353,15 @@
     return tr("<unknown>");
 }
 
+RangeMapper *
+SpectrumLayer::getNewPropertyRangeMapper(const PropertyName &name) const
+{
+    if (name == "Gain") {
+        return new LinearRangeMapper(-50, 50, -25, 25, tr("dB"));
+    }
+    return 0;
+}
+
 void
 SpectrumLayer::setProperty(const PropertyName &name, int value)
 {