# HG changeset patch # User Chris Cannam # Date 1414773379 0 # Node ID 37c0b59fd5141248abd7443f9c89dba5afd1657d # Parent 1ff9ae1dcb507a2dfa22d3d27b0803a8a59455b7 Expose smooth parameter through plugin diff -r 1ff9ae1dcb50 -r 37c0b59fd514 MatchVampPlugin.cpp --- a/MatchVampPlugin.cpp Fri Oct 31 15:54:15 2014 +0000 +++ b/MatchVampPlugin.cpp Fri Oct 31 16:36:19 2014 +0000 @@ -55,6 +55,7 @@ m_serialise(false), m_begin(true), m_locked(false), + m_smooth(true), m_params(inputSampleRate, defaultStepTime, m_blockSize), m_defaultParams(inputSampleRate, defaultStepTime, m_blockSize) { @@ -222,6 +223,17 @@ desc.unit = "s"; list.push_back(desc); + desc.identifier = "smooth"; + desc.name = "Smooth Path"; + desc.description = "Smooth the path by replacing steps with diagonals"; + desc.minValue = 0; + desc.maxValue = 1; + desc.defaultValue = 1; + desc.isQuantized = true; + desc.quantizeStep = 1; + desc.unit = ""; + list.push_back(desc); + return list; } @@ -242,6 +254,8 @@ return m_params.maxRunCount; } else if (name == "zonewidth") { return m_params.blockTime; + } else if (name == "smooth") { + return m_smooth ? 1.0 : 0.0; } return 0.0; @@ -264,6 +278,8 @@ m_params.maxRunCount = int(value + 0.1); } else if (name == "zonewidth") { m_params.blockTime = value; + } else if (name == "smooth") { + m_smooth = (value > 0.5); } } @@ -487,7 +503,7 @@ Finder *finder = feeder->getFinder(); std::vector pathx; std::vector pathy; - int len = finder->retrievePath(true, pathx, pathy); + int len = finder->retrievePath(m_smooth, pathx, pathy); FeatureSet returnFeatures; diff -r 1ff9ae1dcb50 -r 37c0b59fd514 MatchVampPlugin.h --- a/MatchVampPlugin.h Fri Oct 31 15:54:15 2014 +0000 +++ b/MatchVampPlugin.h Fri Oct 31 16:36:19 2014 +0000 @@ -78,6 +78,7 @@ bool m_serialise; bool m_begin; bool m_locked; + bool m_smooth; Matcher::Parameters m_params; Matcher::Parameters m_defaultParams;