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

Merge
author Chris Cannam
date Tue, 25 Oct 2016 11:04:26 +0100
parents 5d886b7b4029
children 42a4b058f8ba
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_PIPER_VAMP_PLUGIN_FACTORY_H
17 #define SV_PIPER_VAMP_PLUGIN_FACTORY_H
18
19 #include "FeatureExtractionPluginFactory.h"
20
21 #include <QMutex>
22 #include <vector>
23 #include <map>
24
25 #include "base/Debug.h"
26
27 /**
28 * FeatureExtractionPluginFactory type for Vamp plugins hosted in a
29 * separate process using Piper protocol.
30 */
31 class PiperVampPluginFactory : public FeatureExtractionPluginFactory
32 {
33 public:
34 PiperVampPluginFactory();
35
36 virtual ~PiperVampPluginFactory() { }
37
38 virtual std::vector<QString> getPluginIdentifiers(QString &errorMessage)
39 override;
40
41 virtual piper_vamp::PluginStaticData getPluginStaticData(QString identifier)
42 override;
43
44 virtual Vamp::Plugin *instantiatePlugin(QString identifier,
45 sv_samplerate_t inputSampleRate)
46 override;
47
48 virtual QString getPluginCategory(QString identifier) override;
49
50 protected:
51 QMutex m_mutex;
52 std::string m_serverName;
53 std::map<QString, piper_vamp::PluginStaticData> m_pluginData; // identifier -> data
54 std::map<QString, QString> m_taxonomy; // identifier -> category string
55 void populate(QString &errorMessage);
56 };
57
58 #endif