comparison plugin/NativeVampPluginFactory.h @ 1225:ba16388b937d piper

Restore native-Vamp factory and make the choice between Piper and Native a preference
author Chris Cannam
date Fri, 21 Oct 2016 11:49:27 +0100
parents plugin/FeatureExtractionPluginFactory.h@c2207877689d
children 5d886b7b4029
comparison
equal deleted inserted replaced
1224:ab050519c4ba 1225:ba16388b937d
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006-2016 Chris Cannam and QMUL.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #ifndef SV_NATIVE_VAMP_PLUGIN_FACTORY_H
17 #define SV_NATIVE_VAMP_PLUGIN_FACTORY_H
18
19 #include "FeatureExtractionPluginFactory.h"
20
21 #include <vector>
22 #include <map>
23
24 #include "base/Debug.h"
25
26 #include <QMutex>
27
28 /**
29 * FeatureExtractionPluginFactory type for Vamp plugins hosted
30 * in-process.
31 */
32 class NativeVampPluginFactory : public FeatureExtractionPluginFactory
33 {
34 public:
35 virtual ~NativeVampPluginFactory() { }
36
37 virtual std::vector<QString> getPluginIdentifiers();
38
39 virtual QString findPluginFile(QString soname, QString inDir = "");
40
41 virtual piper_vamp::PluginStaticData getPluginStaticData(QString identifier);
42
43 virtual Vamp::Plugin *instantiatePlugin(QString identifier,
44 sv_samplerate_t inputSampleRate);
45
46 /**
47 * Get category metadata about a plugin (without instantiating it).
48 */
49 virtual QString getPluginCategory(QString identifier);
50
51 protected:
52 QMutex m_mutex;
53 std::vector<QString> m_pluginPath;
54 std::vector<QString> m_identifiers;
55 std::map<QString, QString> m_taxonomy; // identifier -> category string
56 std::map<QString, piper_vamp::PluginStaticData> m_pluginData; // identifier -> data (created opportunistically)
57
58 friend class PluginDeletionNotifyAdapter;
59 void pluginDeleted(Vamp::Plugin *);
60 std::map<Vamp::Plugin *, void *> m_handleMap;
61
62 std::vector<QString> getPluginPath();
63 void generateTaxonomy();
64 };
65
66 #endif