comparison src/TipicVampPlugin.cpp @ 7:9262806af1cd

Add papers, skeleton plugin code
author Chris Cannam
date Fri, 14 Aug 2015 12:02:57 +0100
parents
children f440b0e2192b
comparison
equal deleted inserted replaced
6:e62530cdc1c3 7:9262806af1cd
1
2 #include "TipicVampPlugin.h"
3
4 Tipic::Tipic(float inputSampleRate) :
5 Plugin(inputSampleRate)
6 {
7 }
8
9 Tipic::~Tipic()
10 {
11 }
12
13 string
14 Tipic::getIdentifier() const
15 {
16 return "tipic";
17 }
18
19 string
20 Tipic::getName() const
21 {
22 return "Timbre-Invariant Pitch Chroma";
23 }
24
25 string
26 Tipic::getDescription() const
27 {
28 // Return something helpful here!
29 return "";
30 }
31
32 string
33 Tipic::getMaker() const
34 {
35 // Your name here
36 return "";
37 }
38
39 int
40 Tipic::getPluginVersion() const
41 {
42 // Increment this each time you release a version that behaves
43 // differently from the previous one
44 return 1;
45 }
46
47 string
48 Tipic::getCopyright() const
49 {
50 // This function is not ideally named. It does not necessarily
51 // need to say who made the plugin -- getMaker does that -- but it
52 // should indicate the terms under which it is distributed. For
53 // example, "Copyright (year). All Rights Reserved", or "GPL"
54 return "";
55 }
56
57 Tipic::InputDomain
58 Tipic::getInputDomain() const
59 {
60 return TimeDomain;
61 }
62
63 size_t
64 Tipic::getPreferredBlockSize() const
65 {
66 return 0; // 0 means "I can handle any block size"
67 }
68
69 size_t
70 Tipic::getPreferredStepSize() const
71 {
72 return 0; // 0 means "anything sensible"; in practice this
73 // means the same as the block size for TimeDomain
74 // plugins, or half of it for FrequencyDomain plugins
75 }
76
77 size_t
78 Tipic::getMinChannelCount() const
79 {
80 return 1;
81 }
82
83 size_t
84 Tipic::getMaxChannelCount() const
85 {
86 return 1;
87 }
88
89 Tipic::ParameterList
90 Tipic::getParameterDescriptors() const
91 {
92 ParameterList list;
93 return list;
94 }
95
96 float
97 Tipic::getParameter(string identifier) const
98 {
99 return 0;
100 }
101
102 void
103 Tipic::setParameter(string identifier, float value)
104 {
105 }
106
107 Tipic::ProgramList
108 Tipic::getPrograms() const
109 {
110 ProgramList list;
111 return list;
112 }
113
114 string
115 Tipic::getCurrentProgram() const
116 {
117 return ""; // no programs
118 }
119
120 void
121 Tipic::selectProgram(string name)
122 {
123 }
124
125 Tipic::OutputList
126 Tipic::getOutputDescriptors() const
127 {
128 OutputList list;
129
130 OutputDescriptor d;
131 d.identifier = "pitch";
132 d.name = "Pitch Features";
133 d.description = "";
134 d.unit = "";
135 d.hasFixedBinCount = true;
136 d.binCount = 88;
137 d.hasKnownExtents = false;
138 d.isQuantized = false;
139 d.sampleType = OutputDescriptor::FixedSampleRate;
140 d.sampleRate = 4410.0 / m_inputSampleRate;
141 d.hasDuration = false;
142 list.push_back(d);
143
144 return list;
145 }
146
147 bool
148 Tipic::initialise(size_t channels, size_t stepSize, size_t blockSize)
149 {
150 if (channels < getMinChannelCount() ||
151 channels > getMaxChannelCount()) return false;
152
153 return true;
154 }
155
156 void
157 Tipic::reset()
158 {
159 // Clear buffers, reset stored values, etc
160 }
161
162 Tipic::FeatureSet
163 Tipic::process(const float *const *inputBuffers, Vamp::RealTime timestamp)
164 {
165 return FeatureSet();
166 }
167
168 Tipic::FeatureSet
169 Tipic::getRemainingFeatures()
170 {
171 return FeatureSet();
172 }
173