comparison runner/FeatureExtractionManager.cpp @ 51:c30b9720bde0

Add proper support and tests for window type parameter (requires latest update to Vamp host SDK)
author Chris Cannam
date Tue, 21 Jun 2011 15:41:52 +0100
parents 91d20795a109
children 513230b19248
comparison
equal deleted inserted replaced
50:d40b62a2006f 51:c30b9720bde0
112 } 112 }
113 m_summaries = names; 113 m_summaries = names;
114 m_summariesOnly = summariesOnly; 114 m_summariesOnly = summariesOnly;
115 m_boundaries = boundaries; 115 m_boundaries = boundaries;
116 return true; 116 return true;
117 }
118
119 static PluginInputDomainAdapter::WindowType
120 convertWindowType(WindowType t)
121 {
122 switch (t) {
123 case RectangularWindow:
124 return PluginInputDomainAdapter::RectangularWindow;
125 case BartlettWindow:
126 return PluginInputDomainAdapter::BartlettWindow;
127 case HammingWindow:
128 return PluginInputDomainAdapter::HammingWindow;
129 case HanningWindow:
130 return PluginInputDomainAdapter::HanningWindow;
131 case BlackmanWindow:
132 return PluginInputDomainAdapter::BlackmanWindow;
133 case NuttallWindow:
134 return PluginInputDomainAdapter::NuttallWindow;
135 case BlackmanHarrisWindow:
136 return PluginInputDomainAdapter::BlackmanHarrisWindow;
137 default:
138 cerr << "ERROR: Unknown or unsupported window type \"" << t << "\", using Hann (\"" << HanningWindow << "\")" << endl;
139 return PluginInputDomainAdapter::HanningWindow;
140 }
117 } 141 }
118 142
119 bool FeatureExtractionManager::addFeatureExtractor 143 bool FeatureExtractionManager::addFeatureExtractor
120 (Transform transform, const vector<FeatureWriter*> &writers) 144 (Transform transform, const vector<FeatureWriter*> &writers)
121 { 145 {
208 232
209 PluginInputDomainAdapter *pida = 0; 233 PluginInputDomainAdapter *pida = 0;
210 234
211 // adapt the plugin for buffering, channels, etc. 235 // adapt the plugin for buffering, channels, etc.
212 if (plugin->getInputDomain() == Plugin::FrequencyDomain) { 236 if (plugin->getInputDomain() == Plugin::FrequencyDomain) {
237
213 pida = new PluginInputDomainAdapter(plugin); 238 pida = new PluginInputDomainAdapter(plugin);
214 pida->setProcessTimestampMethod(PluginInputDomainAdapter::ShiftData); 239 pida->setProcessTimestampMethod(PluginInputDomainAdapter::ShiftData);
240
241 PluginInputDomainAdapter::WindowType wtype =
242 convertWindowType(transform.getWindowType());
243 pida->setWindowType(wtype);
215 plugin = pida; 244 plugin = pida;
216 } 245 }
217 246
218 PluginBufferingAdapter *pba = new PluginBufferingAdapter(plugin); 247 PluginBufferingAdapter *pba = new PluginBufferingAdapter(plugin);
219 plugin = pba; 248 plugin = pba;