Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
166:48182241f594 | 167:53b9c7656798 |
---|---|
18 | 18 |
19 #include "data/model/FFTModel.h" | 19 #include "data/model/FFTModel.h" |
20 #include "view/View.h" | 20 #include "view/View.h" |
21 #include "base/AudioLevel.h" | 21 #include "base/AudioLevel.h" |
22 #include "base/Preferences.h" | 22 #include "base/Preferences.h" |
23 #include "base/RangeMapper.h" | |
23 | 24 |
24 #include <QPainter> | 25 #include <QPainter> |
25 #include <QPainterPath> | 26 #include <QPainterPath> |
26 | 27 |
27 SpectrumLayer::SpectrumLayer() : | 28 SpectrumLayer::SpectrumLayer() : |
348 case 4: return tr("87.5 %"); | 349 case 4: return tr("87.5 %"); |
349 case 5: return tr("93.75 %"); | 350 case 5: return tr("93.75 %"); |
350 } | 351 } |
351 } | 352 } |
352 return tr("<unknown>"); | 353 return tr("<unknown>"); |
354 } | |
355 | |
356 RangeMapper * | |
357 SpectrumLayer::getNewPropertyRangeMapper(const PropertyName &name) const | |
358 { | |
359 if (name == "Gain") { | |
360 return new LinearRangeMapper(-50, 50, -25, 25, tr("dB")); | |
361 } | |
362 return 0; | |
353 } | 363 } |
354 | 364 |
355 void | 365 void |
356 SpectrumLayer::setProperty(const PropertyName &name, int value) | 366 SpectrumLayer::setProperty(const PropertyName &name, int value) |
357 { | 367 { |