c@21: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@21: c@21: /* c@21: Vamp c@21: c@21: An API for audio analysis and feature extraction plugins. c@21: c@21: Centre for Digital Music, Queen Mary, University of London. c@21: Copyright 2006-2007 QMUL. c@21: c@21: Permission is hereby granted, free of charge, to any person c@21: obtaining a copy of this software and associated documentation c@21: files (the "Software"), to deal in the Software without c@21: restriction, including without limitation the rights to use, copy, c@21: modify, merge, publish, distribute, sublicense, and/or sell copies c@21: of the Software, and to permit persons to whom the Software is c@21: furnished to do so, subject to the following conditions: c@21: c@21: The above copyright notice and this permission notice shall be c@21: included in all copies or substantial portions of the Software. c@21: c@21: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, c@21: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF c@21: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND c@21: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR c@21: ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF c@21: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION c@21: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. c@21: c@21: Except as contained in this notice, the names of the Centre for c@21: Digital Music; Queen Mary, University of London; and Chris Cannam c@21: shall not be used in advertising or otherwise to promote the sale, c@21: use or other dealings in this Software without prior written c@21: authorization. c@21: */ c@21: c@21: #ifndef _GETMODE_PLUGIN_H_ c@21: #define _GETMODE_PLUGIN_H_ c@21: c@21: #include c@21: c@21: #include c@21: c@21: class KeyDetector : public Vamp::Plugin c@21: { c@21: public: c@21: KeyDetector(float inputSampleRate); c@21: virtual ~KeyDetector(); c@21: c@21: bool initialise(size_t channels, size_t stepSize, size_t blockSize); c@21: void reset(); c@21: c@21: InputDomain getInputDomain() const { return TimeDomain; } c@21: c@21: std::string getName() const; c@21: std::string getDescription() const; c@21: std::string getMaker() const; c@21: int getPluginVersion() const; c@21: std::string getCopyright() const; c@21: c@21: ParameterList getParameterDescriptors() const; c@21: float getParameter(std::string) const; c@21: void setParameter(std::string, float); c@21: c@21: OutputList getOutputDescriptors() const; c@21: c@21: FeatureSet process(const float *const *inputBuffers, c@21: Vamp::RealTime timestamp); c@21: c@21: FeatureSet getRemainingFeatures(); c@21: c@21: size_t getPreferredStepSize() const; c@21: size_t getPreferredBlockSize() const; c@21: c@21: protected: c@21: mutable size_t m_stepSize; c@21: mutable size_t m_blockSize; c@21: float m_tuningFrequency; c@21: int m_length; c@21: c@21: const char *getKeyName(int index); c@21: c@21: GetKeyMode* m_getKeyMode; c@21: double* m_inputFrame; c@21: int m_prevKey; c@21: }; c@21: c@21: c@21: #endif