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_PIPER_VAMP_PLUGIN_FACTORY_H
|
Chris@1225
|
17 #define SV_PIPER_VAMP_PLUGIN_FACTORY_H
|
Chris@0
|
18
|
Chris@1249
|
19 #ifdef HAVE_PIPER
|
Chris@1249
|
20
|
Chris@1225
|
21 #include "FeatureExtractionPluginFactory.h"
|
Chris@1225
|
22
|
Chris@1209
|
23 #include <QMutex>
|
Chris@0
|
24 #include <vector>
|
Chris@165
|
25 #include <map>
|
Chris@0
|
26
|
Chris@1225
|
27 #include "base/Debug.h"
|
Chris@1246
|
28 #include "base/HelperExecPath.h"
|
Chris@0
|
29
|
Chris@1225
|
30 /**
|
Chris@1225
|
31 * FeatureExtractionPluginFactory type for Vamp plugins hosted in a
|
Chris@1225
|
32 * separate process using Piper protocol.
|
Chris@1225
|
33 */
|
Chris@1225
|
34 class PiperVampPluginFactory : public FeatureExtractionPluginFactory
|
Chris@0
|
35 {
|
Chris@0
|
36 public:
|
Chris@1225
|
37 PiperVampPluginFactory();
|
Chris@1264
|
38 virtual ~PiperVampPluginFactory();
|
Chris@0
|
39
|
Chris@1227
|
40 virtual std::vector<QString> getPluginIdentifiers(QString &errorMessage)
|
Chris@1227
|
41 override;
|
Chris@0
|
42
|
Chris@1225
|
43 virtual piper_vamp::PluginStaticData getPluginStaticData(QString identifier)
|
Chris@1225
|
44 override;
|
Chris@1223
|
45
|
Chris@66
|
46 virtual Vamp::Plugin *instantiatePlugin(QString identifier,
|
Chris@1225
|
47 sv_samplerate_t inputSampleRate)
|
Chris@1225
|
48 override;
|
Chris@0
|
49
|
Chris@1225
|
50 virtual QString getPluginCategory(QString identifier) override;
|
Chris@165
|
51
|
Chris@0
|
52 protected:
|
Chris@1225
|
53 QMutex m_mutex;
|
Chris@1246
|
54 QList<HelperExecPath::HelperExec> m_servers; // executable file paths
|
Chris@1240
|
55 std::map<QString, QString> m_origins; // plugin identifier -> server path
|
Chris@1225
|
56 std::map<QString, piper_vamp::PluginStaticData> m_pluginData; // identifier -> data
|
Chris@1225
|
57 std::map<QString, QString> m_taxonomy; // identifier -> category string
|
Chris@1240
|
58
|
Chris@1227
|
59 void populate(QString &errorMessage);
|
Chris@1246
|
60 void populateFrom(const HelperExecPath::HelperExec &, QString &errorMessage);
|
Chris@1264
|
61
|
Chris@1264
|
62 class Logger;
|
Chris@1264
|
63 Logger *m_logger;
|
Chris@0
|
64 };
|
Chris@0
|
65
|
Chris@0
|
66 #endif
|
Chris@1249
|
67
|
Chris@1249
|
68 #endif
|