PluginInputDomainAdapter.h
Go to the documentation of this file.
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Vamp
An API for audio analysis and feature extraction plugins.
Centre for Digital Music, Queen Mary, University of London.
Copyright 2006-2009 Chris Cannam and QMUL.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the Centre for
Digital Music; Queen Mary, University of London; and Chris Cannam
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written
authorization.
*/
#ifndef _VAMP_PLUGIN_INPUT_DOMAIN_ADAPTER_H_
#define _VAMP_PLUGIN_INPUT_DOMAIN_ADAPTER_H_
#include "hostguard.h"
#include "PluginWrapper.h"
_VAMP_SDK_HOSTSPACE_BEGIN(PluginInputDomainAdapter.h)
namespace Vamp {
namespace HostExt {
class PluginInputDomainAdapter : public PluginWrapper
{
public:
PluginInputDomainAdapter(Plugin *plugin);
virtual ~PluginInputDomainAdapter();
bool initialise(size_t channels, size_t stepSize, size_t blockSize);
void reset();
InputDomain getInputDomain() const;
size_t getPreferredStepSize() const;
size_t getPreferredBlockSize() const;
FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
enum ProcessTimestampMethod {
ShiftTimestamp,
ShiftData,
NoShift
};
void setProcessTimestampMethod(ProcessTimestampMethod);
ProcessTimestampMethod getProcessTimestampMethod() const;
RealTime getTimestampAdjustment() const;
enum WindowType {
RectangularWindow = 0,
BartlettWindow = 1,
TriangularWindow = 1,
HammingWindow = 2,
HanningWindow = 3,
HannWindow = 3,
BlackmanWindow = 4,
NuttallWindow = 7,
BlackmanHarrisWindow = 8
};
WindowType getWindowType() const;
void setWindowType(WindowType type);
protected:
class Impl;
Impl *m_impl;
};
}
}
_VAMP_SDK_HOSTSPACE_END(PluginInputDomainAdapter.h)
#endif
PluginWrapper.h
PluginInputDomainAdapter
PluginInputDomainAdapter is a Vamp plugin adapter that converts time-domain input into frequency-doma...
Definition PluginInputDomainAdapter.h:88
PluginInputDomainAdapter::PluginInputDomainAdapter
PluginInputDomainAdapter(Plugin *plugin)
Construct a PluginInputDomainAdapter wrapping the given plugin.
Vamp::HostExt::PluginInputDomainAdapter::getPreferredBlockSize
size_t getPreferredBlockSize() const
Get the preferred block size (window size – the number of sample frames passed in each block to the p...
Vamp::HostExt::PluginInputDomainAdapter::setProcessTimestampMethod
void setProcessTimestampMethod(ProcessTimestampMethod)
Set the method used for timestamp adjustment in plugins taking frequency-domain input.
Vamp::HostExt::PluginInputDomainAdapter::ProcessTimestampMethod
ProcessTimestampMethod
ProcessTimestampMethod determines how the PluginInputDomainAdapter handles timestamps for the data pa...
Definition PluginInputDomainAdapter.h:143
Vamp::HostExt::PluginInputDomainAdapter::ShiftData
@ ShiftData
Definition PluginInputDomainAdapter.h:145
Vamp::HostExt::PluginInputDomainAdapter::NoShift
@ NoShift
Definition PluginInputDomainAdapter.h:146
Vamp::HostExt::PluginInputDomainAdapter::ShiftTimestamp
@ ShiftTimestamp
Definition PluginInputDomainAdapter.h:144
Vamp::HostExt::PluginInputDomainAdapter::WindowType
WindowType
The set of supported window shapes.
Definition PluginInputDomainAdapter.h:196
Vamp::HostExt::PluginInputDomainAdapter::BlackmanWindow
@ BlackmanWindow
synonym for HanningWindow
Definition PluginInputDomainAdapter.h:208
Vamp::HostExt::PluginInputDomainAdapter::BartlettWindow
@ BartlettWindow
Definition PluginInputDomainAdapter.h:200
Vamp::HostExt::PluginInputDomainAdapter::BlackmanHarrisWindow
@ BlackmanHarrisWindow
Definition PluginInputDomainAdapter.h:212
Vamp::HostExt::PluginInputDomainAdapter::RectangularWindow
@ RectangularWindow
Definition PluginInputDomainAdapter.h:198
Vamp::HostExt::PluginInputDomainAdapter::HammingWindow
@ HammingWindow
synonym for BartlettWindow
Definition PluginInputDomainAdapter.h:203
Vamp::HostExt::PluginInputDomainAdapter::NuttallWindow
@ NuttallWindow
Definition PluginInputDomainAdapter.h:210
Vamp::HostExt::PluginInputDomainAdapter::TriangularWindow
@ TriangularWindow
synonym for RectangularWindow
Definition PluginInputDomainAdapter.h:201
Vamp::HostExt::PluginInputDomainAdapter::HanningWindow
@ HanningWindow
Definition PluginInputDomainAdapter.h:205
Vamp::HostExt::PluginInputDomainAdapter::HannWindow
@ HannWindow
synonym for HannWindow
Definition PluginInputDomainAdapter.h:206
Vamp::HostExt::PluginInputDomainAdapter::getInputDomain
InputDomain getInputDomain() const
Get the plugin's required input domain.
Vamp::HostExt::PluginInputDomainAdapter::getWindowType
WindowType getWindowType() const
Return the current window shape.
Vamp::HostExt::PluginInputDomainAdapter::setWindowType
void setWindowType(WindowType type)
Set the current window shape.
Vamp::HostExt::PluginInputDomainAdapter::initialise
bool initialise(size_t channels, size_t stepSize, size_t blockSize)
Initialise a plugin to prepare it for use with the given number of input channels,...
Vamp::HostExt::PluginInputDomainAdapter::getProcessTimestampMethod
ProcessTimestampMethod getProcessTimestampMethod() const
Retrieve the method used for timestamp adjustment in plugins taking frequency-domain input.
Vamp::HostExt::PluginInputDomainAdapter::PluginInputDomainAdapter
PluginInputDomainAdapter(Plugin *plugin)
Construct a PluginInputDomainAdapter wrapping the given plugin.
Vamp::HostExt::PluginInputDomainAdapter::reset
void reset()
Reset the plugin after use, to prepare it for another clean run.
Vamp::HostExt::PluginInputDomainAdapter::m_impl
Impl * m_impl
Definition PluginInputDomainAdapter.h:228
Vamp::HostExt::PluginInputDomainAdapter::process
FeatureSet process(const float *const *inputBuffers, RealTime timestamp)
Process a single block of input data.
Vamp::HostExt::PluginInputDomainAdapter::~PluginInputDomainAdapter
virtual ~PluginInputDomainAdapter()
Vamp::HostExt::PluginInputDomainAdapter::getPreferredStepSize
size_t getPreferredStepSize() const
Get the preferred step size (window increment – the distance in sample frames between the start frame...
Vamp::HostExt::PluginInputDomainAdapter::getTimestampAdjustment
RealTime getTimestampAdjustment() const
Return the amount by which the timestamps supplied to process() are being incremented when they are p...
Vamp::HostExt::PluginWrapper::PluginWrapper
PluginWrapper(Plugin *plugin)
Vamp::Plugin::Plugin
Plugin(float inputSampleRate)
Definition vamp-sdk/Plugin.h:446
Vamp::Plugin::InputDomain
InputDomain
Definition vamp-sdk/Plugin.h:152
Vamp::Plugin::FeatureSet
std::map< int, FeatureList > FeatureSet
Definition vamp-sdk/Plugin.h:395
hostguard.h
_VAMP_SDK_HOSTSPACE_END
#define _VAMP_SDK_HOSTSPACE_END(h)
Definition hostguard.h:59
_VAMP_SDK_HOSTSPACE_BEGIN
#define _VAMP_SDK_HOSTSPACE_BEGIN(h)
Definition hostguard.h:56
Vamp
Definition FFT.h:43
Vamp::RealTime
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...
Definition vamp-sdk/RealTime.h:67