Chris@1229: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@1229: 
Chris@1229: /*
Chris@1229:     Sonic Visualiser
Chris@1229:     An audio file viewer and annotation editor.
Chris@1229:     Centre for Digital Music, Queen Mary, University of London.
Chris@1229:     This file copyright 2006-2016 Chris Cannam and QMUL.
Chris@1229:     
Chris@1229:     This program is free software; you can redistribute it and/or
Chris@1229:     modify it under the terms of the GNU General Public License as
Chris@1229:     published by the Free Software Foundation; either version 2 of the
Chris@1229:     License, or (at your option) any later version.  See the file
Chris@1229:     COPYING included with this distribution for more information.
Chris@1229: */
Chris@1229: 
Chris@1229: #ifndef SV_FEATURE_EXTRACTION_PLUGIN_FACTORY_H
Chris@1229: #define SV_FEATURE_EXTRACTION_PLUGIN_FACTORY_H
Chris@1229: 
Chris@1229: #include <vamp-hostsdk/Plugin.h>
Chris@1229: 
Chris@1229: #include "vamp-support/PluginStaticData.h"
Chris@1229: 
Chris@1229: #include "base/BaseTypes.h"
Chris@1229: 
Chris@1229: #include <QString>
Chris@1229: 
Chris@1229: class FeatureExtractionPluginFactory
Chris@1229: {
Chris@1229: public:
Chris@1229:     static FeatureExtractionPluginFactory *instance();
Chris@1229:     
Chris@1229:     virtual ~FeatureExtractionPluginFactory() { }
Chris@1229: 
Chris@1229:     /**
Chris@1229:      * Return all installed plugin identifiers.
Chris@1229:      */
Chris@1229:     virtual std::vector<QString> getPluginIdentifiers(QString &errorMessage) {
Chris@1229:         return instance()->getPluginIdentifiers(errorMessage);
Chris@1229:     }
Chris@1229: 
Chris@1229:     /**
Chris@1229:      * Return static data for the given plugin.
Chris@1229:      */
Chris@1229:     virtual piper_vamp::PluginStaticData getPluginStaticData(QString identifier) {
Chris@1229:         return instance()->getPluginStaticData(identifier);
Chris@1229:     }
Chris@1229: 
Chris@1229:     /**
Chris@1229:      * Instantiate (load) and return pointer to the plugin with the
Chris@1229:      * given identifier, at the given sample rate. We don't set
Chris@1229:      * blockSize or channels on this -- they're negotiated and handled
Chris@1229:      * via initialize() on the plugin itself after loading.
Chris@1229:      */
Chris@1229:     virtual Vamp::Plugin *instantiatePlugin(QString identifier,
Chris@1229:                                             sv_samplerate_t inputSampleRate) {
Chris@1229:         return instance()->instantiatePlugin(identifier, inputSampleRate);
Chris@1229:     }
Chris@1229: 
Chris@1229:     /**
Chris@1229:      * Get category metadata about a plugin (without instantiating it).
Chris@1229:      */
Chris@1229:     virtual QString getPluginCategory(QString identifier) {
Chris@1229:         return instance()->getPluginCategory(identifier);
Chris@1229:     }
Chris@1229: };
Chris@1229: 
Chris@1229: #endif