Mercurial > hg > svcore
comparison plugin/transform/FeatureExtractionModelTransformer.h @ 383:94fc0591ea43 1.2-stable
* merge from trunk (1.2 ended up being tracked from trunk, but we may want
this branch for fixes later)
author | Chris Cannam |
---|---|
date | Wed, 27 Feb 2008 10:32:45 +0000 |
parents | 277006c62fea |
children |
comparison
equal
deleted
inserted
replaced
349:f39d33b0b265 | 383:94fc0591ea43 |
---|---|
14 */ | 14 */ |
15 | 15 |
16 #ifndef _FEATURE_EXTRACTION_PLUGIN_TRANSFORMER_H_ | 16 #ifndef _FEATURE_EXTRACTION_PLUGIN_TRANSFORMER_H_ |
17 #define _FEATURE_EXTRACTION_PLUGIN_TRANSFORMER_H_ | 17 #define _FEATURE_EXTRACTION_PLUGIN_TRANSFORMER_H_ |
18 | 18 |
19 #include "PluginTransformer.h" | 19 #include "ModelTransformer.h" |
20 | |
21 #include <QString> | |
22 | |
23 #include <vamp-sdk/Plugin.h> | |
24 | |
25 #include <iostream> | |
20 | 26 |
21 class DenseTimeValueModel; | 27 class DenseTimeValueModel; |
22 | 28 |
23 class FeatureExtractionModelTransformer : public PluginTransformer | 29 class FeatureExtractionModelTransformer : public ModelTransformer |
24 { | 30 { |
25 Q_OBJECT | 31 Q_OBJECT |
26 | 32 |
27 public: | 33 public: |
28 FeatureExtractionModelTransformer(Model *inputModel, | 34 FeatureExtractionModelTransformer(Input input, |
29 QString plugin, | 35 const Transform &transform); |
30 const ExecutionContext &context, | |
31 QString configurationXml = "", | |
32 QString outputName = ""); | |
33 virtual ~FeatureExtractionModelTransformer(); | 36 virtual ~FeatureExtractionModelTransformer(); |
34 | 37 |
35 protected: | 38 protected: |
36 virtual void run(); | 39 virtual void run(); |
37 | 40 |
42 void addFeature(size_t blockFrame, | 45 void addFeature(size_t blockFrame, |
43 const Vamp::Plugin::Feature &feature); | 46 const Vamp::Plugin::Feature &feature); |
44 | 47 |
45 void setCompletion(int); | 48 void setCompletion(int); |
46 | 49 |
47 void getFrames(int channel, int channelCount, | 50 void getFrames(int channelCount, long startFrame, long size, |
48 long startFrame, long size, float *buffer); | 51 float **buffer); |
49 | 52 |
50 // just casts | 53 // just casts |
51 DenseTimeValueModel *getInput(); | 54 DenseTimeValueModel *getConformingInput(); |
52 template <typename ModelClass> ModelClass *getOutput() { | 55 template <typename ModelClass> ModelClass *getConformingOutput() { |
53 ModelClass *mc = dynamic_cast<ModelClass *>(m_output); | 56 ModelClass *mc = dynamic_cast<ModelClass *>(m_output); |
54 if (!mc) { | 57 if (!mc) { |
55 std::cerr << "FeatureExtractionModelTransformer::getOutput: Output model not conformable" << std::endl; | 58 std::cerr << "FeatureExtractionModelTransformer::getOutput: Output model not conformable" << std::endl; |
56 } | 59 } |
57 return mc; | 60 return mc; |