annotate plugin/NativeVampPluginFactory.h @ 1483:7459f4c4d7c3

Merge from branch plugin-path-config
author Chris Cannam
date Mon, 11 Jun 2018 14:40:09 +0100
parents 91bb68146dfc
children 5f8fbbde08ff
rev   line source
Chris@49 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 /*
Chris@52 4 Sonic Visualiser
Chris@52 5 An audio file viewer and annotation editor.
Chris@52 6 Centre for Digital Music, Queen Mary, University of London.
Chris@1225 7 This file copyright 2006-2016 Chris Cannam and QMUL.
Chris@0 8
Chris@52 9 This program is free software; you can redistribute it and/or
Chris@52 10 modify it under the terms of the GNU General Public License as
Chris@52 11 published by the Free Software Foundation; either version 2 of the
Chris@52 12 License, or (at your option) any later version. See the file
Chris@52 13 COPYING included with this distribution for more information.
Chris@0 14 */
Chris@0 15
Chris@1225 16 #ifndef SV_NATIVE_VAMP_PLUGIN_FACTORY_H
Chris@1225 17 #define SV_NATIVE_VAMP_PLUGIN_FACTORY_H
Chris@0 18
Chris@1225 19 #include "FeatureExtractionPluginFactory.h"
Chris@1225 20
Chris@0 21 #include <vector>
Chris@165 22 #include <map>
Chris@0 23
Chris@1225 24 #include "base/Debug.h"
Chris@0 25
Chris@1225 26 #include <QMutex>
Chris@686 27
Chris@1225 28 /**
Chris@1225 29 * FeatureExtractionPluginFactory type for Vamp plugins hosted
Chris@1225 30 * in-process.
Chris@1225 31 */
Chris@1225 32 class NativeVampPluginFactory : public FeatureExtractionPluginFactory
Chris@0 33 {
Chris@0 34 public:
Chris@1225 35 virtual ~NativeVampPluginFactory() { }
Chris@0 36
Chris@1227 37 virtual std::vector<QString> getPluginIdentifiers(QString &errorMessage)
Chris@1227 38 override;
Chris@0 39
Chris@1227 40 virtual piper_vamp::PluginStaticData getPluginStaticData(QString identifier)
Chris@1227 41 override;
Chris@1225 42
Chris@66 43 virtual Vamp::Plugin *instantiatePlugin(QString identifier,
Chris@1227 44 sv_samplerate_t inputSampleRate)
Chris@1227 45 override;
Chris@0 46
Chris@1227 47 virtual QString getPluginCategory(QString identifier) override;
Chris@165 48
Chris@1464 49 virtual QString getPluginLibraryPath(QString identifier) override;
Chris@1464 50
Chris@0 51 protected:
Chris@1209 52 QMutex m_mutex;
Chris@1225 53 std::vector<QString> m_pluginPath;
Chris@1225 54 std::vector<QString> m_identifiers;
Chris@1225 55 std::map<QString, QString> m_taxonomy; // identifier -> category string
Chris@1225 56 std::map<QString, piper_vamp::PluginStaticData> m_pluginData; // identifier -> data (created opportunistically)
Chris@1464 57 std::map<QString, QString> m_libraries; // identifier -> full file path
Chris@1225 58
Chris@1225 59 friend class PluginDeletionNotifyAdapter;
Chris@1225 60 void pluginDeleted(Vamp::Plugin *);
Chris@1225 61 std::map<Vamp::Plugin *, void *> m_handleMap;
Chris@1227 62
Chris@1227 63 QString findPluginFile(QString soname, QString inDir = "");
Chris@1225 64 std::vector<QString> getPluginPath();
Chris@1225 65 void generateTaxonomy();
Chris@0 66 };
Chris@0 67
Chris@0 68 #endif