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@42: class Chromagram; 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@42: enum Type { c@42: TypeMFCC, c@42: TypeChroma c@42: }; c@42: c@42: void calculateBlockSize() const; c@42: c@42: Type m_type; c@41: MFCC *m_mfcc; c@42: Chromagram *m_chromagram; c@41: Decimator *m_decimator; c@42: int m_featureColumnSize; c@42: mutable size_t m_blockSize; c@42: size_t m_fftSize; c@41: int m_channels; c@41: c@42: typedef std::vector FeatureColumn; c@42: typedef std::vector FeatureMatrix; c@42: typedef std::vector FeatureMatrixSet; c@41: c@42: FeatureMatrixSet m_values; c@41: }; c@41: c@41: #endif c@41: