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