c@38: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@38: c@36: /* c@38: * SegmenterPlugin.h c@36: * c@38: * Created by Mark Levy on 24/03/2006. c@38: * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. c@135: c@135: This program is free software; you can redistribute it and/or c@135: modify it under the terms of the GNU General Public License as c@135: published by the Free Software Foundation; either version 2 of the c@135: License, or (at your option) any later version. See the file c@135: COPYING included with this distribution for more information. 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@38: class Decimator; c@38: 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@45: std::string getIdentifier() const; c@45: std::string getName() const; c@45: std::string getDescription() const; 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@38: InputDomain getInputDomain() const { return TimeDomain; } c@38: c@38: SegmenterPlugin::ParameterList getParameterDescriptors() const; c@38: float getParameter(std::string param) const; c@38: void setParameter(std::string param, float value); c@38: c@36: OutputList getOutputDescriptors() const; c@38: c@36: FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp); c@38: c@36: FeatureSet getRemainingFeatures(); c@36: c@36: protected: c@38: mutable Segmenter* segmenter; c@38: mutable int hopsize; c@38: mutable int windowsize; c@96: mutable float neighbourhoodLimit; // in sec c@38: int nSegmentTypes; c@38: feature_types featureType; // 1 = constant-Q, 2 = chroma c@150: Vamp::RealTime m_endTime; c@38: c@38: void makeSegmenter() const; c@36: }; c@36: c@36: #endif c@36: