c@41: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@41: c@41: /* c@41: * SimilarityPlugin.h c@41: * c@41: * Copyright 2008 Centre for Digital Music, Queen Mary, University of London. c@41: * All rights reserved. c@41: */ c@41: c@41: #ifndef _SIMILARITY_PLUGIN_H_ c@41: #define _SIMILARITY_PLUGIN_H_ c@41: c@41: #include c@41: #include c@41: c@41: class MFCC; c@41: class Decimator; c@41: c@41: class SimilarityPlugin : public Vamp::Plugin c@41: { c@41: public: c@41: SimilarityPlugin(float inputSampleRate); c@41: virtual ~SimilarityPlugin(); c@41: c@41: bool initialise(size_t channels, size_t stepSize, size_t blockSize); c@41: void reset(); c@41: c@41: std::string getIdentifier() const; c@41: std::string getName() const; c@41: std::string getDescription() const; c@41: std::string getMaker() const; c@41: int getPluginVersion() const; c@41: std::string getCopyright() const; c@41: c@41: size_t getPreferredStepSize() const; c@41: size_t getPreferredBlockSize() const; c@41: InputDomain getInputDomain() const { return TimeDomain; } c@41: c@41: size_t getMinChannelCount() const; c@41: size_t getMaxChannelCount() const; c@41: c@41: SimilarityPlugin::ParameterList getParameterDescriptors() const; c@41: float getParameter(std::string param) const; c@41: void setParameter(std::string param, float value); c@41: c@41: OutputList getOutputDescriptors() const; c@41: c@41: FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp); c@41: c@41: FeatureSet getRemainingFeatures(); c@41: c@41: protected: c@41: int getDecimationFactor() const; c@41: c@41: MFCC *m_mfcc; c@41: Decimator *m_decimator; c@41: int m_K; // number of mfcc ceps inc DC c@41: size_t m_blockSize; c@41: int m_channels; c@41: c@41: typedef std::vector MFCCFeature; c@41: typedef std::vector MFCCFeatureVector; c@41: typedef std::vector MFCCFeatureSet; c@41: c@41: MFCCFeatureSet m_mfeatures; c@41: }; c@41: c@41: #endif c@41: