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