c@36: /* c@36: * SegmeterPlugin.h c@36: * soundbite c@36: * c@36: * Created by Mark Levy on 24/03/2006. c@36: * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. All rights reserved. c@36: * c@36: */ c@36: c@36: #ifndef _SEGMENTER_PLUGIN_H_ c@36: #define _SEGMENTER_PLUGIN_H_ c@36: c@36: #include c@36: #include c@37: #include "dsp/segmentation/Segmenter.h" c@37: #include "dsp/segmentation/segment.h" c@36: c@36: class SegmenterPlugin : public Vamp::Plugin c@36: { c@36: public: c@36: SegmenterPlugin(float inputSampleRate); c@36: virtual ~SegmenterPlugin(); c@36: c@36: bool initialise(size_t channels, size_t stepSize, size_t blockSize); c@36: void reset(); c@36: c@37: std::string getIdentifier() const { return "qm-segmenter"; } c@36: std::string getName() const { return "Segmenter"; } c@36: std::string getDescription() const { return "Divide the track into a sequence of consistent segments"; } c@36: std::string getMaker() const; c@36: int getPluginVersion() const; c@36: std::string getCopyright() const; c@36: c@36: size_t getPreferredStepSize() const; c@36: size_t getPreferredBlockSize() const; c@36: InputDomain getInputDomain() const { return TimeDomain; } c@36: c@36: SegmenterPlugin::ParameterList getParameterDescriptors() const; c@36: float getParameter(std::string param) const; c@36: void setParameter(std::string param, float value); c@36: c@36: OutputList getOutputDescriptors() const; c@36: c@36: FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp); c@36: c@36: FeatureSet getRemainingFeatures(); c@36: c@36: protected: c@36: mutable Segmenter* segmenter; c@36: mutable int hopsize; c@36: mutable int windowsize; c@36: int nSegmentTypes; c@36: feature_types featureType; // 1 = constant-Q, 2 = chroma c@36: c@36: void makeSegmenter() const; c@36: }; c@36: c@36: #endif c@36: