comparison runner/FeatureExtractionManager.h @ 45:69c438d4b9d3

* Pick up default sample rate and channel count from first audio file (formerly they were hardcoded to 44100 and 1...)
author Chris Cannam
date Mon, 18 Oct 2010 14:17:48 +0100
parents 8b20521fc40f
children 91d20795a109
comparison
equal deleted inserted replaced
44:aa521baace07 45:69c438d4b9d3
18 18
19 #include <vector> 19 #include <vector>
20 #include <set> 20 #include <set>
21 #include <string> 21 #include <string>
22 22
23 #include <QMap>
24
23 #include <vamp-hostsdk/Plugin.h> 25 #include <vamp-hostsdk/Plugin.h>
24 #include <vamp-hostsdk/PluginSummarisingAdapter.h> 26 #include <vamp-hostsdk/PluginSummarisingAdapter.h>
25 #include <transform/Transform.h> 27 #include <transform/Transform.h>
26 28
27 using std::vector; 29 using std::vector;
29 using std::string; 31 using std::string;
30 using std::pair; 32 using std::pair;
31 using std::map; 33 using std::map;
32 34
33 class FeatureWriter; 35 class FeatureWriter;
36 class AudioFileReader;
34 37
35 class FeatureExtractionManager 38 class FeatureExtractionManager
36 { 39 {
37 public: 40 public:
38 FeatureExtractionManager(); 41 FeatureExtractionManager();
52 const vector<FeatureWriter*> &writers); 55 const vector<FeatureWriter*> &writers);
53 56
54 bool addDefaultFeatureExtractor(TransformId transformId, 57 bool addDefaultFeatureExtractor(TransformId transformId,
55 const vector<FeatureWriter*> &writers); 58 const vector<FeatureWriter*> &writers);
56 59
60 void addSource(QString audioSource);
57 void extractFeatures(QString audioSource); 61 void extractFeatures(QString audioSource);
58 62
59 private: 63 private:
60 // A plugin may have many outputs, so we can have more than one 64 // A plugin may have many outputs, so we can have more than one
61 // transform requested for a single plugin. The things we want to 65 // transform requested for a single plugin. The things we want to
103 107
104 int m_blockSize; 108 int m_blockSize;
105 int m_defaultSampleRate; 109 int m_defaultSampleRate;
106 int m_sampleRate; 110 int m_sampleRate;
107 int m_channels; 111 int m_channels;
112
113 QMap<QString, AudioFileReader *> m_readyReaders;
108 114
109 void print(Transform transform) const; 115 void print(Transform transform) const;
110 }; 116 };
111 117
112 #endif 118 #endif