annotate MatchVampPlugin.h @ 32:37c0b59fd514

Expose smooth parameter through plugin
author Chris Cannam
date Fri, 31 Oct 2014 16:36:19 +0000
parents 27f418d77095
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 /*
cannam@0 4 Vamp feature extraction plugin using the MATCH audio alignment
cannam@0 5 algorithm.
cannam@0 6
cannam@0 7 Centre for Digital Music, Queen Mary, University of London.
cannam@0 8 This file copyright 2007 Simon Dixon, Chris Cannam and QMUL.
cannam@0 9
cannam@0 10 This program is free software; you can redistribute it and/or
cannam@0 11 modify it under the terms of the GNU General Public License as
cannam@0 12 published by the Free Software Foundation; either version 2 of the
cannam@0 13 License, or (at your option) any later version. See the file
cannam@0 14 COPYING included with this distribution for more information.
cannam@0 15 */
cannam@0 16
cannam@0 17 #ifndef _MATCH_VAMP_PLUGIN_H_
cannam@0 18 #define _MATCH_VAMP_PLUGIN_H_
cannam@0 19
cannam@0 20 #include <vamp-sdk/Plugin.h>
cannam@0 21
cannam@0 22 #ifdef _WIN32
cannam@0 23 #include <windows.h>
cannam@0 24 #else
cannam@0 25 #include <pthread.h>
cannam@0 26 #endif
cannam@0 27
Chris@17 28 #include "Matcher.h"
Chris@17 29
cannam@0 30 class MatchFeeder;
cannam@0 31
cannam@0 32 class MatchVampPlugin : public Vamp::Plugin
cannam@0 33 {
cannam@0 34 public:
cannam@0 35 MatchVampPlugin(float inputSampleRate);
cannam@0 36 virtual ~MatchVampPlugin();
cannam@0 37
cannam@0 38 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
cannam@0 39 void reset();
cannam@0 40
cannam@0 41 InputDomain getInputDomain() const { return FrequencyDomain; }
cannam@0 42
cannam@0 43 size_t getPreferredStepSize() const;
cannam@0 44 size_t getPreferredBlockSize() const;
cannam@0 45
cannam@0 46 size_t getMinChannelCount() const { return 2; }
cannam@0 47 size_t getMaxChannelCount() const { return 2; }
cannam@0 48
cannam@0 49 std::string getIdentifier() const;
cannam@0 50 std::string getName() const;
cannam@0 51 std::string getDescription() const;
cannam@0 52 std::string getMaker() const;
cannam@0 53 int getPluginVersion() const;
cannam@0 54 std::string getCopyright() const;
cannam@0 55
cannam@0 56 ParameterList getParameterDescriptors() const;
cannam@0 57 float getParameter(std::string) const;
cannam@0 58 void setParameter(std::string, float);
cannam@0 59
cannam@0 60 OutputList getOutputDescriptors() const;
cannam@0 61
cannam@0 62 FeatureSet process(const float *const *inputBuffers,
cannam@0 63 Vamp::RealTime timestamp);
cannam@0 64
cannam@0 65 FeatureSet getRemainingFeatures();
cannam@0 66
cannam@0 67 protected:
Chris@17 68 void createMatchers();
Chris@16 69
Chris@17 70 Matcher *pm1;
Chris@17 71 Matcher *pm2;
Chris@17 72 MatchFeeder *feeder;
Chris@16 73
Chris@10 74 Vamp::RealTime m_startTime;
Chris@15 75 int m_stepSize;
Chris@15 76 float m_stepTime;
Chris@15 77 int m_blockSize;
cannam@0 78 bool m_serialise;
cannam@0 79 bool m_begin;
cannam@0 80 bool m_locked;
Chris@32 81 bool m_smooth;
cannam@0 82
Chris@17 83 Matcher::Parameters m_params;
Chris@17 84 Matcher::Parameters m_defaultParams;
Chris@17 85
Chris@16 86 mutable int m_pathOutNo;
Chris@16 87 mutable int m_abOutNo;
Chris@16 88 mutable int m_baOutNo;
Chris@16 89 mutable int m_abDivOutNo;
Chris@16 90 mutable int m_abRatioOutNo;
Chris@16 91 mutable int m_aFeaturesOutNo;
Chris@16 92 mutable int m_bFeaturesOutNo;
Chris@16 93
cannam@0 94 #ifdef _WIN32
cannam@0 95 static HANDLE m_serialisingMutex;
cannam@0 96 #else
cannam@0 97 static pthread_mutex_t m_serialisingMutex;
cannam@0 98 #endif
cannam@0 99
cannam@0 100 static bool m_serialisingMutexInitialised;
cannam@0 101 };
cannam@0 102
cannam@0 103
cannam@0 104 #endif