comparison plugin/transform/FeatureExtractionModelTransformer.h @ 350:d7c41483af8f

* Merge from transforms branch -- switch over to using Transform object properly
author Chris Cannam
date Fri, 07 Dec 2007 16:47:31 +0000
parents 277006c62fea
children 399ea254afd6
comparison
equal deleted inserted replaced
348:edda24bb85fc 350:d7c41483af8f
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 <vamp-sdk/Plugin.h>
22
23 #include <iostream>
20 24
21 class DenseTimeValueModel; 25 class DenseTimeValueModel;
22 26
23 class FeatureExtractionModelTransformer : public PluginTransformer 27 class FeatureExtractionModelTransformer : public ModelTransformer
24 { 28 {
25 Q_OBJECT 29 Q_OBJECT
26 30
27 public: 31 public:
28 FeatureExtractionModelTransformer(Model *inputModel, 32 FeatureExtractionModelTransformer(Input input,
29 QString plugin, 33 const Transform &transform);
30 const ExecutionContext &context,
31 QString configurationXml = "",
32 QString outputName = "");
33 virtual ~FeatureExtractionModelTransformer(); 34 virtual ~FeatureExtractionModelTransformer();
34 35
35 protected: 36 protected:
36 virtual void run(); 37 virtual void run();
37 38
46 47
47 void getFrames(int channel, int channelCount, 48 void getFrames(int channel, int channelCount,
48 long startFrame, long size, float *buffer); 49 long startFrame, long size, float *buffer);
49 50
50 // just casts 51 // just casts
51 DenseTimeValueModel *getInput(); 52 DenseTimeValueModel *getConformingInput();
52 template <typename ModelClass> ModelClass *getOutput() { 53 template <typename ModelClass> ModelClass *getConformingOutput() {
53 ModelClass *mc = dynamic_cast<ModelClass *>(m_output); 54 ModelClass *mc = dynamic_cast<ModelClass *>(m_output);
54 if (!mc) { 55 if (!mc) {
55 std::cerr << "FeatureExtractionModelTransformer::getOutput: Output model not conformable" << std::endl; 56 std::cerr << "FeatureExtractionModelTransformer::getOutput: Output model not conformable" << std::endl;
56 } 57 }
57 return mc; 58 return mc;