comparison vamp-hostsdk/RequestResponse.h @ 429:9c25e2289faa vampipe

Rename LoadRequest.h -> RequestResponse.h
author Chris Cannam
date Wed, 18 May 2016 10:33:08 +0100
parents vamp-hostsdk/LoadRequest.h@4912b698f3f7
children fbdb06ce1e9a
comparison
equal deleted inserted replaced
428:4912b698f3f7 429:9c25e2289faa
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Vamp
5
6 An API for audio analysis and feature extraction plugins.
7
8 Centre for Digital Music, Queen Mary, University of London.
9 Copyright 2006-2016 Chris Cannam and QMUL.
10
11 Permission is hereby granted, free of charge, to any person
12 obtaining a copy of this software and associated documentation
13 files (the "Software"), to deal in the Software without
14 restriction, including without limitation the rights to use, copy,
15 modify, merge, publish, distribute, sublicense, and/or sell copies
16 of the Software, and to permit persons to whom the Software is
17 furnished to do so, subject to the following conditions:
18
19 The above copyright notice and this permission notice shall be
20 included in all copies or substantial portions of the Software.
21
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 Except as contained in this notice, the names of the Centre for
31 Digital Music; Queen Mary, University of London; and Chris Cannam
32 shall not be used in advertising or otherwise to promote the sale,
33 use or other dealings in this Software without prior written
34 authorization.
35 */
36
37 #ifndef VAMP_LOAD_REQUEST_H
38 #define VAMP_LOAD_REQUEST_H
39
40 #include "PluginStaticData.h"
41 #include "PluginConfiguration.h"
42
43 #include "hostguard.h"
44
45 #include <map>
46 #include <string>
47
48 _VAMP_SDK_HOSTSPACE_BEGIN(RequestResponse.h)
49
50 namespace Vamp {
51
52 class Plugin;
53
54 namespace HostExt {
55
56 /**
57 * \class LoadRequest RequestResponse.h <vamp-hostsdk/RequestResponse.h>
58 *
59 * Vamp::HostExt::LoadRequest is a structure containing the
60 * information necessary to load a plugin. When a request is made to
61 * load a plugin using a LoadRequest, the response is typically
62 * returned in a LoadResponse structure.
63 *
64 * \see LoadResponse
65 *
66 * \note This class was introduced in version 2.7 of the Vamp plugin
67 * SDK, along with the PluginLoader method that accepts this structure
68 * rather than accepting its elements individually.
69 */
70 struct LoadRequest
71 {
72 LoadRequest() : // invalid request by default
73 inputSampleRate(0.f),
74 adapterFlags(0) { }
75
76 /**
77 * PluginKey is a string type that is used to identify a plugin
78 * uniquely within the scope of "the current system". For further
79 * details \see PluginLoader::PluginKey.
80 */
81 typedef std::string PluginKey;
82
83 /**
84 * The identifying key for the plugin to be loaded.
85 */
86 PluginKey pluginKey;
87
88 /**
89 * Sample rate to be passed to the plugin's constructor.
90 */
91 float inputSampleRate;
92
93 /**
94 * A bitwise OR of the values in the PluginLoader::AdapterFlags
95 * enumeration, indicating under which circumstances an adapter
96 * should be used to wrap the original plugin. If adapterFlags is
97 * 0, no optional adapters will be used.
98 *
99 * \see PluginLoader::AdapterFlags, PluginLoader::loadPlugin
100 */
101 int adapterFlags;
102 };
103
104 /**
105 * \class LoadResponse RequestResponse.h <vamp-hostsdk/RequestResponse.h>
106 *
107 * Vamp::HostExt::LoadResponse is a structure containing the
108 * information returned by PluginLoader when asked to load a plugin
109 * using a LoadRequest.
110 *
111 * If the plugin could not be loaded, the plugin field will be 0.
112 *
113 * The caller takes ownership of the plugin contained here, which
114 * should be deleted (using the standard C++ delete keyword) after
115 * use.
116 *
117 * \see LoadRequest
118 *
119 * \note This class was introduced in version 2.7 of the Vamp plugin
120 * SDK, along with the PluginLoader method that returns this structure.
121 */
122 struct LoadResponse
123 {
124 LoadResponse() : // invalid (failed) response by default
125 plugin(0) { }
126
127 /**
128 * A pointer to the loaded plugin, or 0 if loading failed. Caller
129 * takes ownership of the plugin and must delete it after use.
130 */
131 Plugin *plugin;
132
133 /**
134 * The static data associated with the loaded plugin, that is, all
135 * information about it that does not depend on its configuration
136 * (parameters, programs, initialisation parameters). The contents
137 * of this structure are only valid if plugin is non-0.
138 *
139 * Much of the data in here is duplicated with the plugin itself.
140 */
141 PluginStaticData staticData;
142
143 /**
144 * The default configuration for this plugin, that is, default
145 * values for parameters etc. The contents of this structure are
146 * only valid if plugin is non-0.
147 */
148 PluginConfiguration defaultConfiguration;
149 };
150
151 }
152
153 }
154
155 _VAMP_SDK_HOSTSPACE_END(RequestResponse.h)
156
157 #endif