svcore
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file copyright 2006 Chris Cannam. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef _FEATURE_EXTRACTION_PLUGIN_FACTORY_H_ 00017 #define _FEATURE_EXTRACTION_PLUGIN_FACTORY_H_ 00018 00019 #include <QString> 00020 #include <vector> 00021 #include <map> 00022 00023 #include <vamp-hostsdk/Plugin.h> 00024 00025 #include "base/Debug.h" 00026 00027 class FeatureExtractionPluginFactory 00028 { 00029 public: 00030 virtual ~FeatureExtractionPluginFactory() { } 00031 00032 static FeatureExtractionPluginFactory *instance(QString pluginType); 00033 static FeatureExtractionPluginFactory *instanceFor(QString identifier); 00034 static std::vector<QString> getAllPluginIdentifiers(); 00035 00036 virtual std::vector<QString> getPluginPath(); 00037 00038 virtual std::vector<QString> getPluginIdentifiers(); 00039 00040 virtual QString findPluginFile(QString soname, QString inDir = ""); 00041 00042 // We don't set blockSize or channels on this -- they're 00043 // negotiated and handled via initialize() on the plugin 00044 virtual Vamp::Plugin *instantiatePlugin(QString identifier, 00045 float inputSampleRate); 00046 00050 virtual QString getPluginCategory(QString identifier); 00051 00052 protected: 00053 std::vector<QString> m_pluginPath; 00054 std::map<QString, QString> m_taxonomy; 00055 00056 friend class PluginDeletionNotifyAdapter; 00057 void pluginDeleted(Vamp::Plugin *); 00058 std::map<Vamp::Plugin *, void *> m_handleMap; 00059 00060 void generateTaxonomy(); 00061 }; 00062 00063 #endif