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 OnsetsDS onset detector. cannam@0: This file copyright (c) 2008 Chris Cannam. cannam@0: cannam@0: OnsetsDS - real time musical onset detection library. cannam@0: Copyright (c) 2007 Dan Stowell. All rights reserved. cannam@0: cannam@0: This program is free software; you can redistribute it and/or modify cannam@0: it under the terms of the GNU General Public License as published by cannam@0: the Free Software Foundation; either version 2 of the License, or cannam@0: (at your option) any later version. cannam@0: cannam@0: This program is distributed in the hope that it will be useful, cannam@0: but WITHOUT ANY WARRANTY; without even the implied warranty of cannam@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the cannam@0: GNU General Public License for more details. cannam@0: cannam@0: You should have received a copy of the GNU General Public License cannam@0: along with this program; if not, write to the Free Software cannam@0: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA cannam@0: */ cannam@0: cannam@0: #ifndef _ONSETSDS_PLUGIN_H_ cannam@0: #define _ONSETSDS_PLUGIN_H_ cannam@0: cannam@0: #include cannam@0: Chris@5: #include "onsetsds/src/onsetsds.h" cannam@0: cannam@0: class OnsetsDSPlugin : public Vamp::Plugin cannam@0: { cannam@0: public: cannam@0: OnsetsDSPlugin(float inputSampleRate); cannam@0: virtual ~OnsetsDSPlugin(); cannam@0: cannam@0: bool initialise(size_t channels, size_t stepSize, size_t blockSize); cannam@0: void reset(); cannam@0: cannam@0: InputDomain getInputDomain() const { return FrequencyDomain; } cannam@0: cannam@0: std::string getIdentifier() const; cannam@0: std::string getName() const; cannam@0: std::string getDescription() const; cannam@0: std::string getMaker() const; cannam@0: int getPluginVersion() const; cannam@0: std::string getCopyright() const; cannam@0: cannam@0: ParameterList getParameterDescriptors() const; cannam@0: float getParameter(std::string) const; cannam@0: void setParameter(std::string, float); cannam@0: cannam@0: size_t getPreferredStepSize() const; cannam@0: size_t getPreferredBlockSize() const; cannam@0: cannam@0: OutputList getOutputDescriptors() const; cannam@0: cannam@0: FeatureSet process(const float *const *inputBuffers, cannam@0: Vamp::RealTime timestamp); cannam@0: cannam@0: FeatureSet getRemainingFeatures(); cannam@0: cannam@0: protected: cannam@0: OnsetsDS *m_ods; cannam@0: float *m_odsdata; cannam@0: onsetsds_odf_types m_dfType; cannam@1: float m_threshold; cannam@0: size_t m_medspan; cannam@0: size_t m_stepSize; cannam@0: size_t m_fftSize; cannam@0: }; cannam@0: cannam@0: cannam@0: #endif