fix locate-while-rolling
[ardour.git] / libs / vamp-pyin / YinVamp.h
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
2
3 /*
4     pYIN - A fundamental frequency estimator for monophonic audio
5     Centre for Digital Music, Queen Mary, University of London.
6
7     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License as
9     published by the Free Software Foundation; either version 2 of the
10     License, or (at your option) any later version.  See the file
11     COPYING included with this distribution for more information.
12 */
13
14 #ifndef _YINVAMP_H_
15 #define _YINVAMP_H_
16
17 #include <vamp-sdk/Plugin.h>
18
19 #include "Yin.h"
20
21 class YinVamp : public Vamp::Plugin
22 {
23 public:
24     YinVamp(float inputSampleRate);
25     virtual ~YinVamp();
26
27     std::string getIdentifier() const;
28     std::string getName() const;
29     std::string getDescription() const;
30     std::string getMaker() const;
31     int getPluginVersion() const;
32     std::string getCopyright() const;
33
34     InputDomain getInputDomain() const;
35     size_t getPreferredBlockSize() const;
36     size_t getPreferredStepSize() const;
37     size_t getMinChannelCount() const;
38     size_t getMaxChannelCount() const;
39
40     ParameterList getParameterDescriptors() const;
41     float getParameter(std::string identifier) const;
42     void setParameter(std::string identifier, float value);
43
44     ProgramList getPrograms() const;
45     std::string getCurrentProgram() const;
46     void selectProgram(std::string name);
47
48     OutputList getOutputDescriptors() const;
49
50     bool initialise(size_t channels, size_t stepSize, size_t blockSize);
51     void reset();
52
53     FeatureSet process(const float *const *inputBuffers,
54                        Vamp::RealTime timestamp);
55
56     FeatureSet getRemainingFeatures();
57
58 protected:
59     size_t m_channels;
60     size_t m_stepSize;
61     size_t m_blockSize;
62     float m_fmin;
63     float m_fmax;
64     Yin m_yin;
65
66     mutable int m_outNoF0;
67     mutable int m_outNoPeriodicity;
68     mutable int m_outNoRms;
69     mutable int m_outNoSalience;
70
71     float m_yinParameter;
72     float m_outputUnvoiced;
73 };
74
75 #endif