comparison vamp-hostsdk/LoadRequest.h @ 423:8c45dee08a95 vampipe

Add PluginConfiguration, PluginStaticData, and LoadRequest structures, and use them in PluginLoader
author Chris Cannam
date Thu, 12 May 2016 12:22:02 +0100
parents
children 6b2567f365b0
comparison
equal deleted inserted replaced
422:9a2998401bbe 423:8c45dee08a95
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(LoadRequest.h)
49
50 namespace Vamp {
51
52 class Plugin;
53
54 namespace HostExt {
55
56 /**
57 * \class LoadRequest LoadRequest.h <vamp-hostsdk/LoadRequest.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 std::string pluginKey; //!!! separate out key from PluginLoader??
77 float inputSampleRate;
78 int adapterFlags; //!!! from PluginLoader::AdapterFlags, but how best to handle?
79 };
80
81 /**
82 * \class LoadResponse LoadResponse.h <vamp-hostsdk/LoadResponse.h>
83 *
84 * Vamp::HostExt::LoadResponse is a structure containing the
85 * information returned by PluginLoader when asked to load a plugin
86 * using a LoadRequest.
87 *
88 * If the plugin could not be loaded, the plugin field will be 0.
89 *
90 * The caller takes ownership of the plugin contained here, which
91 * should be deleted (using the standard C++ delete keyword) after
92 * use.
93 *
94 * \see LoadRequest
95 *
96 * \note This class was introduced in version 2.7 of the Vamp plugin
97 * SDK, along with the PluginLoader method that returns this structure.
98 */
99 struct LoadResponse
100 {
101 LoadResponse() : // invalid (failed) response by default
102 plugin(0) { }
103
104 Plugin *plugin;
105 PluginStaticData staticData;
106 PluginConfiguration defaultConfiguration;
107 };
108
109 }
110
111 }
112
113 _VAMP_SDK_HOSTSPACE_END(LoadRequest.h)
114
115 #endif