annotate onsetsdsplugin.h @ 15:a55de4e9d7e1 tip

URLs
author Chris Cannam
date Wed, 29 Jun 2016 09:31:59 +0100
parents aaf7ade4667e
children
rev   line source
cannam@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@0 2 /*
cannam@0 3 Vamp feature extraction plugin using the OnsetsDS onset detector.
cannam@0 4 This file copyright (c) 2008 Chris Cannam.
cannam@0 5
cannam@0 6 OnsetsDS - real time musical onset detection library.
cannam@0 7 Copyright (c) 2007 Dan Stowell. All rights reserved.
cannam@0 8
cannam@0 9 This program is free software; you can redistribute it and/or modify
cannam@0 10 it under the terms of the GNU General Public License as published by
cannam@0 11 the Free Software Foundation; either version 2 of the License, or
cannam@0 12 (at your option) any later version.
cannam@0 13
cannam@0 14 This program is distributed in the hope that it will be useful,
cannam@0 15 but WITHOUT ANY WARRANTY; without even the implied warranty of
cannam@0 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cannam@0 17 GNU General Public License for more details.
cannam@0 18
cannam@0 19 You should have received a copy of the GNU General Public License
cannam@0 20 along with this program; if not, write to the Free Software
cannam@0 21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
cannam@0 22 */
cannam@0 23
cannam@0 24 #ifndef _ONSETSDS_PLUGIN_H_
cannam@0 25 #define _ONSETSDS_PLUGIN_H_
cannam@0 26
cannam@0 27 #include <vamp-sdk/Plugin.h>
cannam@0 28
Chris@5 29 #include "onsetsds/src/onsetsds.h"
cannam@0 30
cannam@0 31 class OnsetsDSPlugin : public Vamp::Plugin
cannam@0 32 {
cannam@0 33 public:
cannam@0 34 OnsetsDSPlugin(float inputSampleRate);
cannam@0 35 virtual ~OnsetsDSPlugin();
cannam@0 36
cannam@0 37 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
cannam@0 38 void reset();
cannam@0 39
cannam@0 40 InputDomain getInputDomain() const { return FrequencyDomain; }
cannam@0 41
cannam@0 42 std::string getIdentifier() const;
cannam@0 43 std::string getName() const;
cannam@0 44 std::string getDescription() const;
cannam@0 45 std::string getMaker() const;
cannam@0 46 int getPluginVersion() const;
cannam@0 47 std::string getCopyright() const;
cannam@0 48
cannam@0 49 ParameterList getParameterDescriptors() const;
cannam@0 50 float getParameter(std::string) const;
cannam@0 51 void setParameter(std::string, float);
cannam@0 52
cannam@0 53 size_t getPreferredStepSize() const;
cannam@0 54 size_t getPreferredBlockSize() const;
cannam@0 55
cannam@0 56 OutputList getOutputDescriptors() const;
cannam@0 57
cannam@0 58 FeatureSet process(const float *const *inputBuffers,
cannam@0 59 Vamp::RealTime timestamp);
cannam@0 60
cannam@0 61 FeatureSet getRemainingFeatures();
cannam@0 62
cannam@0 63 protected:
cannam@0 64 OnsetsDS *m_ods;
cannam@0 65 float *m_odsdata;
cannam@0 66 onsetsds_odf_types m_dfType;
cannam@1 67 float m_threshold;
cannam@0 68 size_t m_medspan;
cannam@0 69 size_t m_stepSize;
cannam@0 70 size_t m_fftSize;
cannam@0 71 };
cannam@0 72
cannam@0 73
cannam@0 74 #endif