To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / src / vamp-hostsdk / PluginWrapper.cpp @ 538:8ffb8985ae8f

History | View | Annotate | Download (4.38 KB)

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-2009 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
#include <vamp-hostsdk/PluginWrapper.h>
38

    
39
_VAMP_SDK_HOSTSPACE_BEGIN(PluginWrapper.cpp)
40

    
41
namespace Vamp {
42

    
43
namespace HostExt {
44

    
45
PluginWrapper::PluginWrapper(Plugin *plugin) :
46
    Plugin(plugin->getInputSampleRate()),
47
    m_plugin(plugin),
48
    m_pluginIsOwned(true)
49
{
50
}
51

    
52
PluginWrapper::~PluginWrapper()
53
{
54
    if (m_pluginIsOwned) {
55
        delete m_plugin;
56
    }
57
}
58

    
59
void
60
PluginWrapper::disownPlugin()
61
{
62
    m_pluginIsOwned = false;
63
}
64

    
65
bool
66
PluginWrapper::initialise(size_t channels, size_t stepSize, size_t blockSize)
67
{
68
    return m_plugin->initialise(channels, stepSize, blockSize);
69
}
70

    
71
void
72
PluginWrapper::reset()
73
{
74
    m_plugin->reset();
75
}
76

    
77
Plugin::InputDomain
78
PluginWrapper::getInputDomain() const
79
{
80
    return m_plugin->getInputDomain();
81
}
82

    
83
unsigned int
84
PluginWrapper::getVampApiVersion() const
85
{
86
    return m_plugin->getVampApiVersion();
87
}
88

    
89
std::string
90
PluginWrapper::getIdentifier() const
91
{
92
    return m_plugin->getIdentifier();
93
}
94

    
95
std::string
96
PluginWrapper::getName() const
97
{
98
    return m_plugin->getName();
99
}
100

    
101
std::string
102
PluginWrapper::getDescription() const
103
{
104
    return m_plugin->getDescription();
105
}
106

    
107
std::string
108
PluginWrapper::getMaker() const
109
{
110
    return m_plugin->getMaker();
111
}
112

    
113
int
114
PluginWrapper::getPluginVersion() const
115
{
116
    return m_plugin->getPluginVersion();
117
}
118

    
119
std::string
120
PluginWrapper::getCopyright() const
121
{
122
    return m_plugin->getCopyright();
123
}
124

    
125
PluginBase::ParameterList
126
PluginWrapper::getParameterDescriptors() const
127
{
128
    return m_plugin->getParameterDescriptors();
129
}
130

    
131
float
132
PluginWrapper::getParameter(std::string parameter) const
133
{
134
    return m_plugin->getParameter(parameter);
135
}
136

    
137
void
138
PluginWrapper::setParameter(std::string parameter, float value)
139
{
140
    m_plugin->setParameter(parameter, value);
141
}
142

    
143
PluginBase::ProgramList
144
PluginWrapper::getPrograms() const
145
{
146
    return m_plugin->getPrograms();
147
}
148

    
149
std::string
150
PluginWrapper::getCurrentProgram() const
151
{
152
    return m_plugin->getCurrentProgram();
153
}
154

    
155
void
156
PluginWrapper::selectProgram(std::string program)
157
{
158
    m_plugin->selectProgram(program);
159
}
160

    
161
size_t
162
PluginWrapper::getPreferredStepSize() const
163
{
164
    return m_plugin->getPreferredStepSize();
165
}
166

    
167
size_t
168
PluginWrapper::getPreferredBlockSize() const
169
{
170
    return m_plugin->getPreferredBlockSize();
171
}
172

    
173
size_t
174
PluginWrapper::getMinChannelCount() const
175
{
176
    return m_plugin->getMinChannelCount();
177
}
178

    
179
size_t PluginWrapper::getMaxChannelCount() const
180
{
181
    return m_plugin->getMaxChannelCount();
182
}
183

    
184
Plugin::OutputList
185
PluginWrapper::getOutputDescriptors() const
186
{
187
    return m_plugin->getOutputDescriptors();
188
}
189

    
190
Plugin::FeatureSet
191
PluginWrapper::process(const float *const *inputBuffers, RealTime timestamp)
192
{
193
    return m_plugin->process(inputBuffers, timestamp);
194
}
195

    
196
Plugin::FeatureSet
197
PluginWrapper::getRemainingFeatures()
198
{
199
    return m_plugin->getRemainingFeatures();
200
}
201

    
202
}
203

    
204
}
205

    
206
_VAMP_SDK_HOSTSPACE_END(PluginWrapper.cpp)