comparison transform/FeatureExtractionModelTransformer.h @ 890:4cbf8c6a462d tony_integration

Merge from branch tonioni
author Chris Cannam
date Tue, 11 Mar 2014 17:30:35 +0000
parents b109b88bfa85
children 06579b8ffb7b
comparison
equal deleted inserted replaced
874:862fe7b20df7 890:4cbf8c6a462d
21 #include <QString> 21 #include <QString>
22 22
23 #include <vamp-hostsdk/Plugin.h> 23 #include <vamp-hostsdk/Plugin.h>
24 24
25 #include <iostream> 25 #include <iostream>
26 #include <map>
26 27
27 class DenseTimeValueModel; 28 class DenseTimeValueModel;
29 class SparseTimeValueModel;
28 30
29 class FeatureExtractionModelTransformer : public ModelTransformer 31 class FeatureExtractionModelTransformer : public ModelTransformer
30 { 32 {
31 Q_OBJECT 33 Q_OBJECT
32 34
40 FeatureExtractionModelTransformer(Input input, 42 FeatureExtractionModelTransformer(Input input,
41 const Transforms &relatedTransforms); 43 const Transforms &relatedTransforms);
42 44
43 virtual ~FeatureExtractionModelTransformer(); 45 virtual ~FeatureExtractionModelTransformer();
44 46
47 // ModelTransformer method, retrieve the additional models
48 Models getAdditionalOutputModels();
49 bool willHaveAdditionalOutputModels();
50
45 protected: 51 protected:
46 bool initialise(); 52 bool initialise();
47 53
48 virtual void run(); 54 virtual void run();
49 55
50 Vamp::Plugin *m_plugin; 56 Vamp::Plugin *m_plugin;
51 std::vector<Vamp::Plugin::OutputDescriptor *> m_descriptors; // per transform 57 std::vector<Vamp::Plugin::OutputDescriptor *> m_descriptors; // per transform
52 std::vector<int> m_fixedRateFeatureNos; // to assign times to FixedSampleRate features 58 std::vector<int> m_fixedRateFeatureNos; // to assign times to FixedSampleRate features
53 std::vector<int> m_outputNos; 59 std::vector<int> m_outputNos; // list of plugin output indexes required for this group of transforms
54 60
55 void createOutputModel(int n); 61 void createOutputModels(int n);
62
63 std::map<int, bool> m_needAdditionalModels; // transformNo -> necessity
64 typedef std::map<int, std::map<int, SparseTimeValueModel *> > AdditionalModelMap;
65 AdditionalModelMap m_additionalModels;
66 SparseTimeValueModel *getAdditionalModel(int transformNo, int binNo);
56 67
57 void addFeature(int n, 68 void addFeature(int n,
58 size_t blockFrame, 69 size_t blockFrame,
59 const Vamp::Plugin::Feature &feature); 70 const Vamp::Plugin::Feature &feature);
60 71