cannam@0: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ cannam@0: /* cannam@0: Vamp feature extraction plugin using the MATCH audio alignment cannam@0: algorithm. cannam@0: cannam@0: Centre for Digital Music, Queen Mary, University of London. cannam@0: This file copyright 2007 Simon Dixon, Chris Cannam and QMUL. cannam@0: cannam@0: This program is free software; you can redistribute it and/or cannam@0: modify it under the terms of the GNU General Public License as cannam@0: published by the Free Software Foundation; either version 2 of the cannam@0: License, or (at your option) any later version. See the file cannam@0: COPYING included with this distribution for more information. cannam@0: */ cannam@0: cannam@0: #ifndef _MATCH_FEEDER_H_ cannam@0: #define _MATCH_FEEDER_H_ cannam@0: cannam@0: #include "Matcher.h" cannam@0: #include "Finder.h" cannam@0: cannam@0: #include Chris@14: #include cannam@0: cannam@0: class MatchFeeder cannam@0: { cannam@0: public: cannam@0: MatchFeeder(Matcher *m1, Matcher *m2); cannam@0: ~MatchFeeder(); cannam@0: Chris@14: /** Chris@14: * Feed the two supplied channels of frequency-domain input data Chris@14: * to feeders 1 and 2 respectively, as appropriate (depending on Chris@14: * their advance status). Chris@14: */ cannam@0: void feed(const float *const *input); cannam@0: Chris@14: struct Features { Chris@14: std::vector > f1; Chris@14: std::vector > f2; Chris@14: }; Chris@14: Chris@14: /** Chris@14: * Feed the two supplied channels of frequency-domain input data Chris@24: * to matchers 1 and 2 respectively, as appropriate (depending on Chris@14: * their advance status) and return any new feature vectors Chris@14: * calculated by the two feeders. Chris@14: */ Chris@14: Features feedAndGetFeatures(const float *const *input); Chris@14: cannam@0: Finder *getFinder() { return finder; } cannam@0: cannam@0: protected: Chris@14: void prepare(const float *const *input); Chris@14: Features feedBlock(); Chris@14: std::vector feed1(); Chris@14: std::vector feed2(); cannam@0: cannam@0: Finder *finder; cannam@0: Matcher *pm1; cannam@0: Matcher *pm2; cannam@0: cannam@0: size_t fftSize; cannam@0: double *reBuffer; cannam@0: double *imBuffer; cannam@0: cannam@0: std::queue q1; cannam@0: std::queue q2; cannam@0: }; cannam@0: cannam@0: #endif