diff transform/FeatureExtractionModelTransformer.h @ 1739:565575463752 by-id

Some work on models and transformers
author Chris Cannam
date Wed, 26 Jun 2019 14:59:09 +0100
parents ad5f892c0c4d
children fe3f7f8df3a3
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.h	Wed Jun 26 10:21:15 2019 +0100
+++ b/transform/FeatureExtractionModelTransformer.h	Wed Jun 26 14:59:09 2019 +0100
@@ -38,9 +38,11 @@
     FeatureExtractionModelTransformer(Input input,
                                       const Transform &transform);
 
-    // Obtain outputs for a set of transforms that all use the same
-    // plugin and input (but with different outputs). i.e. run the
-    // plugin once only and collect more than one output from it.
+    /**
+     * Obtain outputs for a set of transforms that all use the same
+     * plugin and input (but with different outputs). i.e. run the
+     * plugin once only and collect more than one output from it.
+     */
     FeatureExtractionModelTransformer(Input input,
                                       const Transforms &relatedTransforms);
 
@@ -57,16 +59,27 @@
     void run() override;
 
     Vamp::Plugin *m_plugin;
-    std::vector<Vamp::Plugin::OutputDescriptor *> m_descriptors; // per transform
-    std::vector<int> m_fixedRateFeatureNos; // to assign times to FixedSampleRate features
-    std::vector<int> m_outputNos; // list of plugin output indexes required for this group of transforms
+
+    // descriptors per transform
+    std::vector<Vamp::Plugin::OutputDescriptor> m_descriptors;
+
+    // to assign times to FixedSampleRate features
+    std::vector<int> m_fixedRateFeatureNos;
+
+    // list of plugin output indexes required for this group of transforms
+    std::vector<int> m_outputNos;
 
     void createOutputModels(int n);
 
-    std::map<int, bool> m_needAdditionalModels; // transformNo -> necessity
-    typedef std::map<int, std::map<int, SparseTimeValueModel *> > AdditionalModelMap;
+    // map from transformNo -> necessity
+    std::map<int, bool> m_needAdditionalModels;
+
+    // map from transformNo -> binNo -> SparseTimeValueModel id
+    typedef std::map<int, std::map<int, ModelId> > AdditionalModelMap;
+    
     AdditionalModelMap m_additionalModels;
-    SparseTimeValueModel *getAdditionalModel(int transformNo, int binNo);
+    
+    ModelId getAdditionalModel(int transformNo, int binNo);
 
     void addFeature(int n,
                     sv_frame_t blockFrame,
@@ -83,7 +96,7 @@
     void awaitOutputModels() override;
     
     // just casts:
-
+/*!!!
     DenseTimeValueModel *getConformingInput();
 
     template <typename ModelClass> bool isOutput(int n) {
@@ -102,6 +115,7 @@
             return 0;
         }
     }
+*/
 };
 
 #endif