diff src/MatchVampPlugin.cpp @ 143:6914a6a01ffc refactors

Transplant the distance metric parameter structure from silence_penalty branch (even though normalisation is currently the only thing in it)
author Chris Cannam
date Fri, 16 Jan 2015 10:18:00 +0000
parents cfba9aec7569
children d307803083e6 246de093f0f1
line wrap: on
line diff
--- a/src/MatchVampPlugin.cpp	Thu Jan 08 12:11:27 2015 +0000
+++ b/src/MatchVampPlugin.cpp	Fri Jan 16 10:18:00 2015 +0000
@@ -63,7 +63,9 @@
     m_feParams(inputSampleRate, m_blockSize),
     m_defaultFeParams(inputSampleRate, m_blockSize),
     m_fcParams(),
-    m_defaultFcParams()
+    m_defaultFcParams(),
+    m_dParams(),
+    m_defaultDParams()
 {
     if (inputSampleRate < sampleRateMin) {
         std::cerr << "MatchVampPlugin::MatchVampPlugin: input sample rate "
@@ -174,7 +176,7 @@
     desc.description = "Type of normalisation to use for distance metric";
     desc.minValue = 0;
     desc.maxValue = 2;
-    desc.defaultValue = (int)m_defaultParams.distanceNorm;
+    desc.defaultValue = (int)m_defaultDParams.norm;
     desc.isQuantized = true;
     desc.quantizeStep = 1;
     desc.valueNames.clear();
@@ -266,7 +268,7 @@
     } else if (name == "framenorm") {
         return (int)m_fcParams.norm;
     } else if (name == "distnorm") {
-        return (int)m_params.distanceNorm;
+        return (int)m_dParams.norm;
     } else if (name == "usespecdiff") {
         return (int)m_fcParams.order;
     } else if (name == "usechroma") {
@@ -294,7 +296,7 @@
     } else if (name == "framenorm") {
         m_fcParams.norm = (FeatureConditioner::Normalisation)(int(value + 0.1));
     } else if (name == "distnorm") {
-        m_params.distanceNorm = (DistanceMetric::DistanceNormalisation)(int(value + 0.1));
+        m_dParams.norm = (DistanceMetric::DistanceNormalisation)(int(value + 0.1));
     } else if (name == "usespecdiff") {
         m_fcParams.order = (FeatureConditioner::OutputOrder)(int(value + 0.1));
     } else if (name == "usechroma") {
@@ -330,7 +332,7 @@
     m_params.hopTime = m_stepTime;
     m_feParams.fftSize = m_blockSize;
 
-    m_pipeline = new MatchPipeline(m_feParams, m_fcParams, m_params);
+    m_pipeline = new MatchPipeline(m_feParams, m_fcParams, m_dParams, m_params);
 }
 
 bool