comparison plugin/FeatureExtractionPluginFactory.h @ 1209:385deb828b4a piper

Bodge in piper-cpp client (not yet working)
author Chris Cannam
date Fri, 14 Oct 2016 14:33:43 +0100
parents 6b1af0f05f06
children 584b2d7d7cd9
comparison
equal deleted inserted replaced
1208:fef49844b3f8 1209:385deb828b4a
15 15
16 #ifndef _FEATURE_EXTRACTION_PLUGIN_FACTORY_H_ 16 #ifndef _FEATURE_EXTRACTION_PLUGIN_FACTORY_H_
17 #define _FEATURE_EXTRACTION_PLUGIN_FACTORY_H_ 17 #define _FEATURE_EXTRACTION_PLUGIN_FACTORY_H_
18 18
19 #include <QString> 19 #include <QString>
20 #include <QMutex>
20 #include <vector> 21 #include <vector>
21 #include <map> 22 #include <map>
22 23
23 #include <vamp-hostsdk/Plugin.h> 24 #include <vamp-hostsdk/Plugin.h>
24 25
25 #include "base/Debug.h" 26 #include "base/Debug.h"
26 #include "base/BaseTypes.h" 27 #include "base/BaseTypes.h"
27 28
29 #include "vamp-client/ProcessQtTransport.h"
30 #include "vamp-client/CapnpRRClient.h"
31
28 class FeatureExtractionPluginFactory 32 class FeatureExtractionPluginFactory
29 { 33 {
30 public: 34 public:
35 FeatureExtractionPluginFactory();
31 virtual ~FeatureExtractionPluginFactory() { } 36 virtual ~FeatureExtractionPluginFactory() { }
32 37
33 static FeatureExtractionPluginFactory *instance(QString pluginType); 38 static FeatureExtractionPluginFactory *instance(QString pluginType);
34 static FeatureExtractionPluginFactory *instanceFor(QString identifier); 39 static FeatureExtractionPluginFactory *instanceFor(QString identifier);
35 static std::vector<QString> getAllPluginIdentifiers(); 40 static std::vector<QString> getAllPluginIdentifiers();
36 41
37 virtual std::vector<QString> getPluginPath();
38
39 virtual std::vector<QString> getPluginIdentifiers(); 42 virtual std::vector<QString> getPluginIdentifiers();
40
41 virtual QString findPluginFile(QString soname, QString inDir = "");
42 43
43 // We don't set blockSize or channels on this -- they're 44 // We don't set blockSize or channels on this -- they're
44 // negotiated and handled via initialize() on the plugin 45 // negotiated and handled via initialize() on the plugin
45 virtual Vamp::Plugin *instantiatePlugin(QString identifier, 46 virtual Vamp::Plugin *instantiatePlugin(QString identifier,
46 sv_samplerate_t inputSampleRate); 47 sv_samplerate_t inputSampleRate);
49 * Get category metadata about a plugin (without instantiating it). 50 * Get category metadata about a plugin (without instantiating it).
50 */ 51 */
51 virtual QString getPluginCategory(QString identifier); 52 virtual QString getPluginCategory(QString identifier);
52 53
53 protected: 54 protected:
54 std::vector<QString> m_pluginPath; 55 piper_vamp::client::ProcessQtTransport m_transport;
55 std::map<QString, QString> m_taxonomy; 56 piper_vamp::client::CapnpRRClient m_client;
56 57
57 friend class PluginDeletionNotifyAdapter; 58 QMutex m_mutex;
58 void pluginDeleted(Vamp::Plugin *); 59 std::vector<piper_vamp::PluginStaticData> m_pluginData;
59 std::map<Vamp::Plugin *, void *> m_handleMap; 60 void populate();
60
61 void generateTaxonomy();
62 }; 61 };
63 62
64 #endif 63 #endif