comparison transform/FeatureExtractionModelTransformer.h @ 876:47aa3aeb687b tonioni

For outputs with unknown bin count or multiple bins with variable sample rate, create additional output models for bins beyond the first
author Chris Cannam
date Wed, 29 Jan 2014 09:31:22 +0000
parents 13803edd513d
children b109b88bfa85
comparison
equal deleted inserted replaced
875:3e6ed8a8577b 876:47aa3aeb687b
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
48 virtual void run(); 50 virtual void run();
49 51
50 Vamp::Plugin *m_plugin; 52 Vamp::Plugin *m_plugin;
51 std::vector<Vamp::Plugin::OutputDescriptor *> m_descriptors; // per transform 53 std::vector<Vamp::Plugin::OutputDescriptor *> m_descriptors; // per transform
52 std::vector<int> m_fixedRateFeatureNos; // to assign times to FixedSampleRate features 54 std::vector<int> m_fixedRateFeatureNos; // to assign times to FixedSampleRate features
53 std::vector<int> m_outputNos; 55 std::vector<int> m_outputNos; // list of plugin output indexes required for this group of transforms
54 56
55 void createOutputModel(int n); 57 void createOutputModels(int n);
58
59 std::map<int, bool> m_needAdditionalModels; // transformNo -> necessity
60 typedef std::map<int, std::map<int, SparseTimeValueModel *> > AdditionalModelMap;
61 AdditionalModelMap m_additionalModels;
62 SparseTimeValueModel *getAdditionalModel(int transformNo, int binNo);
63
64 // ModelTransformer method, retrieve the additional models
65 Models getAdditionalOutputModels();
56 66
57 void addFeature(int n, 67 void addFeature(int n,
58 size_t blockFrame, 68 size_t blockFrame,
59 const Vamp::Plugin::Feature &feature); 69 const Vamp::Plugin::Feature &feature);
60 70