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.
|
Chris@236
|
8 Copyright (c) 2007-2020 Simon Dixon, Chris Cannam, and Queen Mary
|
Chris@230
|
9 University of London, Copyright (c) 2014-2015 Tido GmbH.
|
Chris@230
|
10
|
cannam@0
|
11 This program is free software; you can redistribute it and/or
|
cannam@0
|
12 modify it under the terms of the GNU General Public License as
|
cannam@0
|
13 published by the Free Software Foundation; either version 2 of the
|
cannam@0
|
14 License, or (at your option) any later version. See the file
|
cannam@0
|
15 COPYING included with this distribution for more information.
|
cannam@0
|
16 */
|
cannam@0
|
17
|
Chris@236
|
18 #ifndef MATCH_VAMP_PLUGIN_H
|
Chris@236
|
19 #define MATCH_VAMP_PLUGIN_H
|
cannam@0
|
20
|
cannam@0
|
21 #include <vamp-sdk/Plugin.h>
|
cannam@0
|
22
|
cannam@0
|
23 #ifdef _WIN32
|
cannam@0
|
24 #include <windows.h>
|
cannam@0
|
25 #else
|
cannam@0
|
26 #include <pthread.h>
|
cannam@0
|
27 #endif
|
cannam@0
|
28
|
Chris@107
|
29 #include "MatchPipeline.h"
|
cannam@0
|
30
|
cannam@0
|
31 class MatchVampPlugin : public Vamp::Plugin
|
cannam@0
|
32 {
|
cannam@0
|
33 public:
|
cannam@0
|
34 MatchVampPlugin(float inputSampleRate);
|
cannam@0
|
35 virtual ~MatchVampPlugin();
|
cannam@0
|
36
|
cannam@0
|
37 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
cannam@0
|
38 void reset();
|
cannam@0
|
39
|
cannam@0
|
40 InputDomain getInputDomain() const { return FrequencyDomain; }
|
cannam@0
|
41
|
cannam@0
|
42 size_t getPreferredStepSize() const;
|
cannam@0
|
43 size_t getPreferredBlockSize() const;
|
cannam@0
|
44
|
cannam@0
|
45 size_t getMinChannelCount() const { return 2; }
|
cannam@0
|
46 size_t getMaxChannelCount() const { return 2; }
|
cannam@0
|
47
|
cannam@0
|
48 std::string getIdentifier() const;
|
cannam@0
|
49 std::string getName() const;
|
cannam@0
|
50 std::string getDescription() const;
|
cannam@0
|
51 std::string getMaker() const;
|
cannam@0
|
52 int getPluginVersion() const;
|
cannam@0
|
53 std::string getCopyright() const;
|
cannam@0
|
54
|
cannam@0
|
55 ParameterList getParameterDescriptors() const;
|
cannam@0
|
56 float getParameter(std::string) const;
|
cannam@0
|
57 void setParameter(std::string, float);
|
cannam@0
|
58
|
cannam@0
|
59 OutputList getOutputDescriptors() const;
|
cannam@0
|
60
|
cannam@0
|
61 FeatureSet process(const float *const *inputBuffers,
|
cannam@0
|
62 Vamp::RealTime timestamp);
|
cannam@0
|
63
|
cannam@0
|
64 FeatureSet getRemainingFeatures();
|
cannam@0
|
65
|
cannam@0
|
66 protected:
|
Chris@17
|
67 void createMatchers();
|
Chris@74
|
68 bool aboveThreshold(const float *);
|
Chris@16
|
69
|
Chris@107
|
70 MatchPipeline *m_pipeline;
|
Chris@16
|
71
|
Chris@10
|
72 Vamp::RealTime m_startTime;
|
Chris@15
|
73 int m_stepSize;
|
Chris@15
|
74 float m_stepTime;
|
Chris@15
|
75 int m_blockSize;
|
cannam@0
|
76 bool m_serialise;
|
cannam@0
|
77 bool m_begin;
|
cannam@0
|
78 bool m_locked;
|
Chris@32
|
79 bool m_smooth;
|
cannam@0
|
80
|
Chris@74
|
81 int m_frameNo;
|
Chris@74
|
82
|
Chris@17
|
83 Matcher::Parameters m_params;
|
Chris@17
|
84 Matcher::Parameters m_defaultParams;
|
Chris@17
|
85
|
Chris@38
|
86 FeatureExtractor::Parameters m_feParams;
|
Chris@38
|
87 FeatureExtractor::Parameters m_defaultFeParams;
|
Chris@161
|
88 double m_secondReferenceFrequency;
|
Chris@38
|
89
|
Chris@103
|
90 FeatureConditioner::Parameters m_fcParams;
|
Chris@103
|
91 FeatureConditioner::Parameters m_defaultFcParams;
|
Chris@103
|
92
|
Chris@143
|
93 DistanceMetric::Parameters m_dParams;
|
Chris@143
|
94 DistanceMetric::Parameters m_defaultDParams;
|
Chris@143
|
95
|
Chris@16
|
96 mutable int m_pathOutNo;
|
Chris@16
|
97 mutable int m_abOutNo;
|
Chris@16
|
98 mutable int m_baOutNo;
|
Chris@16
|
99 mutable int m_abDivOutNo;
|
Chris@16
|
100 mutable int m_abRatioOutNo;
|
Chris@16
|
101 mutable int m_aFeaturesOutNo;
|
Chris@16
|
102 mutable int m_bFeaturesOutNo;
|
Chris@140
|
103 mutable int m_caFeaturesOutNo;
|
Chris@140
|
104 mutable int m_cbFeaturesOutNo;
|
Chris@163
|
105 mutable int m_overallCostOutNo;
|
Chris@16
|
106
|
cannam@0
|
107 #ifdef _WIN32
|
cannam@0
|
108 static HANDLE m_serialisingMutex;
|
cannam@0
|
109 #else
|
cannam@0
|
110 static pthread_mutex_t m_serialisingMutex;
|
cannam@0
|
111 #endif
|
cannam@0
|
112
|
cannam@0
|
113 static bool m_serialisingMutexInitialised;
|
cannam@0
|
114 };
|
cannam@0
|
115
|
cannam@0
|
116
|
cannam@0
|
117 #endif
|