comparison src/MatchVampPlugin.cpp @ 136:2cbf6237c822 refactors

Expose silence threshold as parameter
author Chris Cannam
date Fri, 19 Dec 2014 10:19:33 +0000
parents 46a652da1415
children a1de1888a96c
comparison
equal deleted inserted replaced
135:42381e437fcd 136:2cbf6237c822
202 desc.defaultValue = m_defaultFeParams.useChromaFrequencyMap ? 1 : 0; 202 desc.defaultValue = m_defaultFeParams.useChromaFrequencyMap ? 1 : 0;
203 desc.isQuantized = true; 203 desc.isQuantized = true;
204 desc.quantizeStep = 1; 204 desc.quantizeStep = 1;
205 list.push_back(desc); 205 list.push_back(desc);
206 206
207 desc.identifier = "silencethreshold";
208 desc.name = "Silence Threshold";
209 desc.description = "Total frame energy threshold below which a feature will be regarded as silent";
210 desc.minValue = 0;
211 desc.maxValue = 1;
212 desc.defaultValue = m_defaultFcParams.silenceThreshold;
213 desc.isQuantized = false;
214 list.push_back(desc);
215
207 desc.identifier = "gradientlimit"; 216 desc.identifier = "gradientlimit";
208 desc.name = "Gradient Limit"; 217 desc.name = "Gradient Limit";
209 desc.description = "Limit of number of frames that will be accepted from one source without a frame from the other source being accepted"; 218 desc.description = "Limit of number of frames that will be accepted from one source without a frame from the other source being accepted";
210 desc.minValue = 1; 219 desc.minValue = 1;
211 desc.maxValue = 10; 220 desc.maxValue = 10;
268 return m_params.diagonalWeight; 277 return m_params.diagonalWeight;
269 } else if (name == "zonewidth") { 278 } else if (name == "zonewidth") {
270 return (float)m_params.blockTime; 279 return (float)m_params.blockTime;
271 } else if (name == "smooth") { 280 } else if (name == "smooth") {
272 return m_smooth ? 1.0 : 0.0; 281 return m_smooth ? 1.0 : 0.0;
282 } else if (name == "silencethreshold") {
283 return m_fcParams.silenceThreshold;
273 } 284 }
274 285
275 return 0.0; 286 return 0.0;
276 } 287 }
277 288
294 m_params.diagonalWeight = value; 305 m_params.diagonalWeight = value;
295 } else if (name == "zonewidth") { 306 } else if (name == "zonewidth") {
296 m_params.blockTime = value; 307 m_params.blockTime = value;
297 } else if (name == "smooth") { 308 } else if (name == "smooth") {
298 m_smooth = (value > 0.5); 309 m_smooth = (value > 0.5);
310 } else if (name == "silencethreshold") {
311 m_fcParams.silenceThreshold = value;
299 } 312 }
300 } 313 }
301 314
302 size_t 315 size_t
303 MatchVampPlugin::getPreferredStepSize() const 316 MatchVampPlugin::getPreferredStepSize() const