Mercurial > hg > svcore
comparison transform/FeatureExtractionPluginTransform.cpp @ 20:742e6882e187
* Refactor sparse models. Previously the 1D and time-value models duplicated
a lot of code; now there is a base class (SparseModel) templated on the
stored point type, and the subclasses define point types with the necessary
characteristics.
* Add NoteModel, a new SparseModel subclass.
* Reorganise local feature description display. Instead of asking the layer
to draw its own, just query it for a textual description and draw that in
Pane. Greatly simplifies this part of the layer code.
* Add local feature descriptions to colour 3D plot and waveform layers.
* Add pitch in MIDI-pitch-and-cents to spectrogram layer.
* Give AudioGenerator its own mutex to shorten lock times in CallbackPlaySource.
* Minor adjustments to layers menu &c
author | Chris Cannam |
---|---|
date | Thu, 02 Feb 2006 16:10:19 +0000 |
parents | a7ed14263fe4 |
children | 39ae3dee27b9 |
comparison
equal
deleted
inserted
replaced
19:a7ed14263fe4 | 20:742e6882e187 |
---|---|
108 break; | 108 break; |
109 } | 109 } |
110 | 110 |
111 if (valueCount == 0) { | 111 if (valueCount == 0) { |
112 | 112 |
113 m_output = new SparseOneDimensionalModel(modelRate, modelResolution); | 113 m_output = new SparseOneDimensionalModel(modelRate, modelResolution, |
114 false); | |
114 | 115 |
115 } else if (valueCount == 1 || | 116 } else if (valueCount == 1 || |
116 | 117 |
117 // We don't have a sparse 3D model | 118 // We don't have a sparse 3D model |
118 m_descriptor->sampleType == | 119 m_descriptor->sampleType == |
123 | 124 |
124 } else { | 125 } else { |
125 | 126 |
126 m_output = new DenseThreeDimensionalModel(modelRate, modelResolution, | 127 m_output = new DenseThreeDimensionalModel(modelRate, modelResolution, |
127 valueCount, false); | 128 valueCount, false); |
129 | |
130 if (!m_descriptor->valueNames.empty()) { | |
131 std::vector<QString> names; | |
132 for (size_t i = 0; i < m_descriptor->valueNames.size(); ++i) { | |
133 names.push_back(m_descriptor->valueNames[i].c_str()); | |
134 } | |
135 (dynamic_cast<DenseThreeDimensionalModel *>(m_output)) | |
136 ->setBinNames(names); | |
137 } | |
128 } | 138 } |
129 } | 139 } |
130 | 140 |
131 FeatureExtractionPluginTransform::~FeatureExtractionPluginTransform() | 141 FeatureExtractionPluginTransform::~FeatureExtractionPluginTransform() |
132 { | 142 { |