Mercurial > hg > svgui
comparison layer/LayerFactory.cpp @ 37:21d061e66177
* Make the frequency estimation mode in the spectrogram layer actually useful,
and make sure it gets mostly the right results... Still some tidying to do
in here.
author | Chris Cannam |
---|---|
date | Wed, 22 Feb 2006 17:45:18 +0000 |
parents | 10ba9276a315 |
children | ad214997dddb |
comparison
equal
deleted
inserted
replaced
36:c28ebb4ba4de | 37:21d061e66177 |
---|---|
56 // The user can change all the parameters of this after the | 56 // The user can change all the parameters of this after the |
57 // fact -- there's nothing permanently melodic-range about it | 57 // fact -- there's nothing permanently melodic-range about it |
58 // that should be encoded in its name | 58 // that should be encoded in its name |
59 return Layer::tr("Spectrogram"); | 59 return Layer::tr("Spectrogram"); |
60 | 60 |
61 case PeakFrequencySpectrogram: | |
62 // likewise | |
63 return Layer::tr("Spectrogram"); | |
64 | |
61 default: break; | 65 default: break; |
62 } | 66 } |
63 | 67 |
64 return Layer::tr("Layer"); | 68 return Layer::tr("Layer"); |
65 } | 69 } |
74 } | 78 } |
75 | 79 |
76 if (dynamic_cast<DenseTimeValueModel *>(model)) { | 80 if (dynamic_cast<DenseTimeValueModel *>(model)) { |
77 types.insert(Spectrogram); | 81 types.insert(Spectrogram); |
78 types.insert(MelodicRangeSpectrogram); | 82 types.insert(MelodicRangeSpectrogram); |
83 types.insert(PeakFrequencySpectrogram); | |
79 } | 84 } |
80 | 85 |
81 if (dynamic_cast<RangeSummarisableTimeValueModel *>(model)) { | 86 if (dynamic_cast<RangeSummarisableTimeValueModel *>(model)) { |
82 types.insert(Waveform); | 87 types.insert(Waveform); |
83 } | 88 } |
270 case MelodicRangeSpectrogram: | 275 case MelodicRangeSpectrogram: |
271 layer = new SpectrogramLayer(view, SpectrogramLayer::MelodicRange); | 276 layer = new SpectrogramLayer(view, SpectrogramLayer::MelodicRange); |
272 static_cast<SpectrogramLayer *>(layer)->setChannel(channel); | 277 static_cast<SpectrogramLayer *>(layer)->setChannel(channel); |
273 break; | 278 break; |
274 | 279 |
280 case PeakFrequencySpectrogram: | |
281 layer = new SpectrogramLayer(view, SpectrogramLayer::MelodicPeaks); | |
282 static_cast<SpectrogramLayer *>(layer)->setChannel(channel); | |
283 break; | |
284 | |
275 default: break; | 285 default: break; |
276 } | 286 } |
277 | 287 |
278 if (!layer) { | 288 if (!layer) { |
279 std::cerr << "LayerFactory::createLayer: Unknown layer type " | 289 std::cerr << "LayerFactory::createLayer: Unknown layer type " |