comparison transform/FeatureExtractionPluginTransform.h @ 0:da6937383da8

initial import
author Chris Cannam
date Tue, 10 Jan 2006 16:33:16 +0000
parents
children d86891498eef
comparison
equal deleted inserted replaced
-1:000000000000 0:da6937383da8
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 A waveform viewer and audio annotation editor.
5 Chris Cannam, Queen Mary University of London, 2005
6
7 This is experimental software. Not for distribution.
8 */
9
10 #ifndef _FEATURE_EXTRACTION_PLUGIN_TRANSFORM_H_
11 #define _FEATURE_EXTRACTION_PLUGIN_TRANSFORM_H_
12
13 #include "Transform.h"
14 #include "FeatureExtractionPlugin.h"
15
16 class DenseTimeValueModel;
17
18 class FeatureExtractionPluginTransform : public Transform
19 {
20 public:
21 FeatureExtractionPluginTransform(Model *inputModel,
22 QString plugin,
23 QString outputName = "");
24 virtual ~FeatureExtractionPluginTransform();
25
26 protected:
27 virtual void run();
28
29 FeatureExtractionPlugin *m_plugin;
30 FeatureExtractionPlugin::OutputDescriptor *m_descriptor;
31 int m_outputFeatureNo;
32
33 void addFeature(size_t blockFrame,
34 const FeatureExtractionPlugin::Feature &feature);
35
36 void setCompletion(int);
37
38 // just casts
39 DenseTimeValueModel *getInput();
40 template <typename ModelClass> ModelClass *getOutput() {
41 ModelClass *mc = dynamic_cast<ModelClass *>(m_output);
42 if (!mc) {
43 std::cerr << "FeatureExtractionPluginTransform::getOutput: Output model not conformable" << std::endl;
44 }
45 return mc;
46 }
47 };
48
49 #endif
50