Chris@423
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@423
|
2
|
Chris@423
|
3 /*
|
Chris@423
|
4 Vamp
|
Chris@423
|
5
|
Chris@423
|
6 An API for audio analysis and feature extraction plugins.
|
Chris@423
|
7
|
Chris@423
|
8 Centre for Digital Music, Queen Mary, University of London.
|
Chris@423
|
9 Copyright 2006-2016 Chris Cannam and QMUL.
|
Chris@423
|
10
|
Chris@423
|
11 Permission is hereby granted, free of charge, to any person
|
Chris@423
|
12 obtaining a copy of this software and associated documentation
|
Chris@423
|
13 files (the "Software"), to deal in the Software without
|
Chris@423
|
14 restriction, including without limitation the rights to use, copy,
|
Chris@423
|
15 modify, merge, publish, distribute, sublicense, and/or sell copies
|
Chris@423
|
16 of the Software, and to permit persons to whom the Software is
|
Chris@423
|
17 furnished to do so, subject to the following conditions:
|
Chris@423
|
18
|
Chris@423
|
19 The above copyright notice and this permission notice shall be
|
Chris@423
|
20 included in all copies or substantial portions of the Software.
|
Chris@423
|
21
|
Chris@423
|
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
Chris@423
|
23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
Chris@423
|
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
Chris@423
|
25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
Chris@423
|
26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
Chris@423
|
27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
Chris@423
|
28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Chris@423
|
29
|
Chris@423
|
30 Except as contained in this notice, the names of the Centre for
|
Chris@423
|
31 Digital Music; Queen Mary, University of London; and Chris Cannam
|
Chris@423
|
32 shall not be used in advertising or otherwise to promote the sale,
|
Chris@423
|
33 use or other dealings in this Software without prior written
|
Chris@423
|
34 authorization.
|
Chris@423
|
35 */
|
Chris@423
|
36
|
Chris@423
|
37 #ifndef VAMP_PLUGIN_STATIC_DATA_H
|
Chris@423
|
38 #define VAMP_PLUGIN_STATIC_DATA_H
|
Chris@423
|
39
|
Chris@423
|
40 #include "hostguard.h"
|
Chris@423
|
41 #include "Plugin.h"
|
Chris@423
|
42
|
Chris@423
|
43 _VAMP_SDK_HOSTSPACE_BEGIN(PluginStaticData.h)
|
Chris@423
|
44
|
Chris@423
|
45 namespace Vamp {
|
Chris@423
|
46
|
Chris@423
|
47 namespace HostExt {
|
Chris@423
|
48
|
Chris@423
|
49 /**
|
Chris@423
|
50 * \class PluginStaticData PluginStaticData.h <vamp-hostsdk/PluginStaticData.h>
|
Chris@423
|
51 *
|
Chris@423
|
52 * Vamp::HostExt::PluginStaticData is a structure bundling together
|
Chris@423
|
53 * all the information about a plugin that cannot be changed by the
|
Chris@423
|
54 * plugin after it is loaded. That is, everything that does not depend
|
Chris@423
|
55 * on a parameter or initialisation setting.
|
Chris@423
|
56 *
|
Chris@423
|
57 * \note This class was introduced in version 2.7 of the Vamp plugin
|
Chris@423
|
58 * SDK and is used only by host SDK functions that were also
|
Chris@423
|
59 * introduced in that release (or newer).
|
Chris@423
|
60 */
|
Chris@423
|
61 struct PluginStaticData
|
Chris@423
|
62 {
|
Chris@423
|
63 public:
|
Chris@423
|
64 struct Basic {
|
Chris@423
|
65 std::string identifier;
|
Chris@423
|
66 std::string name;
|
Chris@423
|
67 std::string description;
|
Chris@423
|
68 };
|
Chris@423
|
69
|
Chris@423
|
70 PluginStaticData() : // invalid static data by default
|
Chris@423
|
71 pluginVersion(0), minChannelCount(0), maxChannelCount(0),
|
Chris@423
|
72 inputDomain(Plugin::TimeDomain) { }
|
Chris@423
|
73
|
Chris@423
|
74 std::string pluginKey;
|
Chris@423
|
75 Basic basic;
|
Chris@423
|
76 std::string maker;
|
Chris@423
|
77 std::string copyright;
|
Chris@423
|
78 int pluginVersion;
|
Chris@423
|
79 std::vector<std::string> category;
|
Chris@423
|
80 int minChannelCount;
|
Chris@423
|
81 int maxChannelCount;
|
Chris@423
|
82 PluginBase::ParameterList parameters;
|
Chris@423
|
83 PluginBase::ProgramList programs;
|
Chris@423
|
84 Plugin::InputDomain inputDomain;
|
Chris@423
|
85 std::vector<Basic> basicOutputInfo;
|
Chris@423
|
86
|
Chris@423
|
87 static PluginStaticData
|
Chris@423
|
88 fromPlugin(std::string pluginKey,
|
Chris@423
|
89 std::vector<std::string> category,
|
Chris@423
|
90 Plugin *p) {
|
Chris@423
|
91
|
Chris@423
|
92 PluginStaticData d;
|
Chris@423
|
93 d.pluginKey = pluginKey;
|
Chris@423
|
94 d.basic.identifier = p->getIdentifier();
|
Chris@423
|
95 d.basic.name = p->getName();
|
Chris@423
|
96 d.basic.description = p->getDescription();
|
Chris@423
|
97 d.maker = p->getMaker();
|
Chris@423
|
98 d.copyright = p->getCopyright();
|
Chris@423
|
99 d.pluginVersion = p->getPluginVersion();
|
Chris@423
|
100 d.category = category;
|
Chris@423
|
101 d.minChannelCount = p->getMinChannelCount();
|
Chris@423
|
102 d.maxChannelCount = p->getMaxChannelCount();
|
Chris@423
|
103 d.parameters = p->getParameterDescriptors();
|
Chris@423
|
104 d.programs = p->getPrograms();
|
Chris@423
|
105 d.inputDomain = p->getInputDomain();
|
Chris@423
|
106
|
Chris@423
|
107 Plugin::OutputList outputs = p->getOutputDescriptors();
|
Chris@423
|
108 for (Plugin::OutputList::const_iterator i = outputs.begin();
|
Chris@423
|
109 i != outputs.end(); ++i) {
|
Chris@423
|
110 Basic b;
|
Chris@423
|
111 b.identifier = i->identifier;
|
Chris@423
|
112 b.name = i->name;
|
Chris@423
|
113 b.description = i->description;
|
Chris@423
|
114 d.basicOutputInfo.push_back(b);
|
Chris@423
|
115 }
|
Chris@423
|
116
|
Chris@423
|
117 return d;
|
Chris@423
|
118 }
|
Chris@423
|
119 };
|
Chris@423
|
120
|
Chris@423
|
121 }
|
Chris@423
|
122
|
Chris@423
|
123 }
|
Chris@423
|
124
|
Chris@423
|
125 _VAMP_SDK_HOSTSPACE_END(PluginStaticData.h)
|
Chris@423
|
126
|
Chris@423
|
127 #endif
|