comparison plugin/NativeVampPluginFactory.h @ 1230:9ae2ce9190e6 project-file-rework

Merge
author Chris Cannam
date Tue, 25 Oct 2016 11:04:26 +0100
parents 5d886b7b4029
children 91bb68146dfc
comparison
equal deleted inserted replaced
1228:a2091d148d7f 1230:9ae2ce9190e6
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(QString &errorMessage)
38 override;
39
40 virtual piper_vamp::PluginStaticData getPluginStaticData(QString identifier)
41 override;
42
43 virtual Vamp::Plugin *instantiatePlugin(QString identifier,
44 sv_samplerate_t inputSampleRate)
45 override;
46
47 /**
48 * Get category metadata about a plugin (without instantiating it).
49 */
50 virtual QString getPluginCategory(QString identifier) override;
51
52 protected:
53 QMutex m_mutex;
54 std::vector<QString> m_pluginPath;
55 std::vector<QString> m_identifiers;
56 std::map<QString, QString> m_taxonomy; // identifier -> category string
57 std::map<QString, piper_vamp::PluginStaticData> m_pluginData; // identifier -> data (created opportunistically)
58
59 friend class PluginDeletionNotifyAdapter;
60 void pluginDeleted(Vamp::Plugin *);
61 std::map<Vamp::Plugin *, void *> m_handleMap;
62
63 QString findPluginFile(QString soname, QString inDir = "");
64 std::vector<QString> getPluginPath();
65 void generateTaxonomy();
66 };
67
68 #endif