Mercurial > hg > match-vamp
comparison Matcher.cpp @ 10:6ea008aa8817
Fixes to problems reported by plugin tester
author | Chris Cannam |
---|---|
date | Wed, 06 Aug 2014 12:38:00 +0100 |
parents | b3ec48d9cd2e |
children | 66082cc488c3 |
comparison
equal
deleted
inserted
replaced
9:fec395fcdc7c | 10:6ea008aa8817 |
---|---|
25 | 25 |
26 const double Matcher::decay = 0.99; | 26 const double Matcher::decay = 0.99; |
27 const double Matcher::silenceThreshold = 0.0004; | 27 const double Matcher::silenceThreshold = 0.0004; |
28 const int Matcher::MAX_RUN_COUNT = 3; | 28 const int Matcher::MAX_RUN_COUNT = 3; |
29 | 29 |
30 //#define DEBUG_MATCHER 1 | |
31 | |
30 Matcher::Matcher(float rate, Matcher *p) | 32 Matcher::Matcher(float rate, Matcher *p) |
31 { | 33 { |
34 #ifdef DEBUG_MATCHER | |
32 std::cerr << "Matcher::Matcher(" << rate << ", " << p << ")" << std::endl; | 35 std::cerr << "Matcher::Matcher(" << rate << ", " << p << ")" << std::endl; |
36 #endif | |
33 | 37 |
34 sampleRate = rate; | 38 sampleRate = rate; |
35 otherMatcher = p; // the first matcher will need this to be set later | 39 otherMatcher = p; // the first matcher will need this to be set later |
36 firstPM = (!p); | 40 firstPM = (!p); |
37 matchFileOffset = 0; | 41 matchFileOffset = 0; |
80 blockTime = blockSize * hopTime; | 84 blockTime = blockSize * hopTime; |
81 } | 85 } |
82 | 86 |
83 Matcher::~Matcher() | 87 Matcher::~Matcher() |
84 { | 88 { |
89 #ifdef DEBUG_MATCHER | |
85 std::cerr << "Matcher(" << this << ")::~Matcher()" << std::endl; | 90 std::cerr << "Matcher(" << this << ")::~Matcher()" << std::endl; |
91 #endif | |
86 | 92 |
87 if (initialised) { | 93 if (initialised) { |
88 | 94 |
89 for (int i = 0; i < distXSize; ++i) { | 95 for (int i = 0; i < distXSize; ++i) { |
90 if (distance[i]) { | 96 if (distance[i]) { |