Mercurial > hg > vamp-website
view code-doc/PluginAdapter_8cpp-source.html @ 0:351c4ebce5f9 website
* Move website from vamp-website/trunk to plain website
author | cannam |
---|---|
date | Mon, 22 Sep 2008 13:01:46 +0000 |
parents | |
children |
line wrap: on
line source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>VampPluginSDK: PluginAdapter.cpp Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.5 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_5b77fce4b90561041d958141b45c7c55.html">vamp-sdk</a> </div> </div> </div> <h1>PluginAdapter.cpp</h1><a href="PluginAdapter_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */</span> <a name="l00002"></a>00002 <a name="l00003"></a>00003 <span class="comment">/*</span> <a name="l00004"></a>00004 <span class="comment"> Vamp</span> <a name="l00005"></a>00005 <span class="comment"></span> <a name="l00006"></a>00006 <span class="comment"> An API for audio analysis and feature extraction plugins.</span> <a name="l00007"></a>00007 <span class="comment"></span> <a name="l00008"></a>00008 <span class="comment"> Centre for Digital Music, Queen Mary, University of London.</span> <a name="l00009"></a>00009 <span class="comment"> Copyright 2006 Chris Cannam.</span> <a name="l00010"></a>00010 <span class="comment"> </span> <a name="l00011"></a>00011 <span class="comment"> Permission is hereby granted, free of charge, to any person</span> <a name="l00012"></a>00012 <span class="comment"> obtaining a copy of this software and associated documentation</span> <a name="l00013"></a>00013 <span class="comment"> files (the "Software"), to deal in the Software without</span> <a name="l00014"></a>00014 <span class="comment"> restriction, including without limitation the rights to use, copy,</span> <a name="l00015"></a>00015 <span class="comment"> modify, merge, publish, distribute, sublicense, and/or sell copies</span> <a name="l00016"></a>00016 <span class="comment"> of the Software, and to permit persons to whom the Software is</span> <a name="l00017"></a>00017 <span class="comment"> furnished to do so, subject to the following conditions:</span> <a name="l00018"></a>00018 <span class="comment"></span> <a name="l00019"></a>00019 <span class="comment"> The above copyright notice and this permission notice shall be</span> <a name="l00020"></a>00020 <span class="comment"> included in all copies or substantial portions of the Software.</span> <a name="l00021"></a>00021 <span class="comment"></span> <a name="l00022"></a>00022 <span class="comment"> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</span> <a name="l00023"></a>00023 <span class="comment"> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span> <a name="l00024"></a>00024 <span class="comment"> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span> <a name="l00025"></a>00025 <span class="comment"> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR</span> <a name="l00026"></a>00026 <span class="comment"> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF</span> <a name="l00027"></a>00027 <span class="comment"> CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span> <a name="l00028"></a>00028 <span class="comment"> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span> <a name="l00029"></a>00029 <span class="comment"></span> <a name="l00030"></a>00030 <span class="comment"> Except as contained in this notice, the names of the Centre for</span> <a name="l00031"></a>00031 <span class="comment"> Digital Music; Queen Mary, University of London; and Chris Cannam</span> <a name="l00032"></a>00032 <span class="comment"> shall not be used in advertising or otherwise to promote the sale,</span> <a name="l00033"></a>00033 <span class="comment"> use or other dealings in this Software without prior written</span> <a name="l00034"></a>00034 <span class="comment"> authorization.</span> <a name="l00035"></a>00035 <span class="comment">*/</span> <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="PluginAdapter_8h.html">PluginAdapter.h</a>"</span> <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="preprocessor">#include <cstring></span> <a name="l00040"></a>00040 <span class="preprocessor">#include <cstdlib></span> <a name="l00041"></a>00041 <a name="l00042"></a>00042 <span class="comment">//#define DEBUG_PLUGIN_ADAPTER 1</span> <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="keyword">namespace </span>Vamp { <a name="l00045"></a>00045 <a name="l00046"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">00046</a> <span class="keyword">class </span><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">PluginAdapterBase::Impl</a> <a name="l00047"></a>00047 { <a name="l00048"></a>00048 <span class="keyword">public</span>: <a name="l00049"></a>00049 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9b5cff59377109e63b3894920205be9a">Impl</a>(<a class="code" href="classVamp_1_1PluginAdapterBase.html" title="PluginAdapter and PluginAdapterBase provide a wrapper class that a plugin library...">PluginAdapterBase</a> *); <a name="l00050"></a>00050 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#75b00d5c8012db240fc410d18fd1235a">~Impl</a>(); <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="keyword">const</span> <a class="code" href="struct__VampPluginDescriptor.html">VampPluginDescriptor</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#31d6c53c6ef9851782674f3e14bf891d">getDescriptor</a>(); <a name="l00053"></a>00053 <a name="l00054"></a>00054 <span class="keyword">protected</span>: <a name="l00055"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#c0372df58956b4bf99a9ec070b11dea4">00055</a> <a class="code" href="classVamp_1_1PluginAdapterBase.html" title="PluginAdapter and PluginAdapterBase provide a wrapper class that a plugin library...">PluginAdapterBase</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#c0372df58956b4bf99a9ec070b11dea4">m_base</a>; <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="keyword">static</span> <a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8cf9e01074559a6b23064d920629dd55">vampInstantiate</a>(<span class="keyword">const</span> <a class="code" href="struct__VampPluginDescriptor.html">VampPluginDescriptor</a> *desc, <a name="l00058"></a>00058 <span class="keywordtype">float</span> inputSampleRate); <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#198dddb40f4fedc71f8ec45088d22d93">vampCleanup</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#210cd61fc3fd8f66eda087a6d726cd2b">vampInitialise</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, <a name="l00063"></a>00063 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> stepSize, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> blockSize); <a name="l00064"></a>00064 <a name="l00065"></a>00065 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9dc6a2cc51118525c50583e2f7ac339a">vampReset</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00066"></a>00066 <a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#e3791f409c626f856133d1ed473dbcdd">vampGetParameter</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <span class="keywordtype">int</span> param); <a name="l00068"></a>00068 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#96a4f1c8359479d41e9b9c3438b561a6">vampSetParameter</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <span class="keywordtype">int</span> param, <span class="keywordtype">float</span> value); <a name="l00069"></a>00069 <a name="l00070"></a>00070 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#62824538d09f38a060bcc593f79ca8a1">vampGetCurrentProgram</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00071"></a>00071 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#124b1ee65cbb733004ae96f4fa001246">vampSelectProgram</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> program); <a name="l00072"></a>00072 <a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a6e7c06690fed8d7af284be34a590b4b">vampGetPreferredStepSize</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#46d39ad29bb4c689e21379e1eb387ace">vampGetPreferredBlockSize</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9825e946f36f8838ec3d4cb838c00220">vampGetMinChannelCount</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#16bfdb3fc7b683a170b01bf92a49dee2">vampGetMaxChannelCount</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00077"></a>00077 <a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#debb9f604929cde924e783997e9efda3">vampGetOutputCount</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00079"></a>00079 <a name="l00080"></a>00080 <span class="keyword">static</span> <a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#5118f9af094598b9f8c8a295a5e2290c">vampGetOutputDescriptor</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00081"></a>00081 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i); <a name="l00082"></a>00082 <a name="l00083"></a>00083 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#ff063ab7b4dfb0d13883e7ce19cf93a3">vampReleaseOutputDescriptor</a>(<a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> *desc); <a name="l00084"></a>00084 <a name="l00085"></a>00085 <span class="keyword">static</span> <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#bc8f37b80648a0a7108a6e0ebaf45525">vampProcess</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00086"></a>00086 <span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a name="l00087"></a>00087 <span class="keywordtype">int</span> sec, <a name="l00088"></a>00088 <span class="keywordtype">int</span> nsec); <a name="l00089"></a>00089 <a name="l00090"></a>00090 <span class="keyword">static</span> <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f6af04fcb927463cfe1f85e936935767">vampGetRemainingFeatures</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle); <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b0bc48dbdb1396410690d1b190522a95">vampReleaseFeatureSet</a>(<a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *fs); <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b4199ab4a8ba40098aac387032c52aa4">cleanup</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin); <a name="l00095"></a>00095 <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8274f19566392f843cbf5f745308fd2c">checkOutputMap</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin); <a name="l00096"></a>00096 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#17af6e67c075bfb9b5069c51c7861e64">getOutputCount</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin); <a name="l00097"></a>00097 <a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#088345ac72041e44e18b7bf5edd32f44">getOutputDescriptor</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <a name="l00098"></a>00098 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i); <a name="l00099"></a>00099 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0eca18a4ae046e4ac1ebd25bb3ac5a08">process</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <a name="l00100"></a>00100 <span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a name="l00101"></a>00101 <span class="keywordtype">int</span> sec, <span class="keywordtype">int</span> nsec); <a name="l00102"></a>00102 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9fe7df06eb951c259763d56c49544676">getRemainingFeatures</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin); <a name="l00103"></a>00103 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#550b4522bfbf1ad23297be28c51a4d72">convertFeatures</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <a name="l00104"></a>00104 <span class="keyword">const</span> <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">Plugin::FeatureSet</a> &features); <a name="l00105"></a>00105 <a name="l00106"></a>00106 <span class="comment">// maps both plugins and descriptors to adapters</span> <a name="l00107"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#6c8f2c8fce370d586785353c939601d5">00107</a> <span class="keyword">typedef</span> std::map<const void *, Impl *> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#6c8f2c8fce370d586785353c939601d5">AdapterMap</a>; <a name="l00108"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">00108</a> <span class="keyword">static</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#6c8f2c8fce370d586785353c939601d5">AdapterMap</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>; <a name="l00109"></a>00109 <span class="keyword">static</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a>); <a name="l00110"></a>00110 <a name="l00111"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#93384198b121720dfa627dafe77839a6">00111</a> <span class="keywordtype">bool</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#93384198b121720dfa627dafe77839a6">m_populated</a>; <a name="l00112"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">00112</a> <a class="code" href="struct__VampPluginDescriptor.html">VampPluginDescriptor</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>; <a name="l00113"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">00113</a> <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">Plugin::ParameterList</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>; <a name="l00114"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">00114</a> <a class="code" href="classVamp_1_1PluginBase.html#7f66f00437b21e5f694fe02356b12f20">Plugin::ProgramList</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a>; <a name="l00115"></a>00115 <a name="l00116"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#fd448b66d5973d8e14ec592dabcbbd2d">00116</a> <span class="keyword">typedef</span> std::map<Plugin *, Plugin::OutputList *> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#fd448b66d5973d8e14ec592dabcbbd2d">OutputMap</a>; <a name="l00117"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">00117</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#fd448b66d5973d8e14ec592dabcbbd2d">OutputMap</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>; <a name="l00118"></a>00118 <a name="l00119"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">00119</a> std::map<Plugin *, VampFeatureList *> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>; <a name="l00120"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">00120</a> std::map<Plugin *, std::vector<size_t> > <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>; <a name="l00121"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">00121</a> std::map<Plugin *, std::vector<std::vector<size_t> > > <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">m_fvsizes</a>; <a name="l00122"></a>00122 <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#429c029c0068230d1afa97426b04ce0d">resizeFS</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <span class="keywordtype">int</span> n); <a name="l00123"></a>00123 <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f5fcc5331f2dfa4c650eee636af72403">resizeFL</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <span class="keywordtype">int</span> n, <span class="keywordtype">size_t</span> sz); <a name="l00124"></a>00124 <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9b0791b97e91f8b8c3d18f3ed3bed861">resizeFV</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> j, <span class="keywordtype">size_t</span> sz); <a name="l00125"></a>00125 }; <a name="l00126"></a>00126 <a name="l00127"></a><a class="code" href="classVamp_1_1PluginAdapterBase.html#5dad6a9b4b170c0f284962e125ac988e">00127</a> <a class="code" href="classVamp_1_1PluginAdapterBase.html#5dad6a9b4b170c0f284962e125ac988e">PluginAdapterBase::PluginAdapterBase</a>() <a name="l00128"></a>00128 { <a name="l00129"></a>00129 <a class="code" href="classVamp_1_1PluginAdapterBase.html#0e3594c54884efd5a7ef38030645745b">m_impl</a> = <span class="keyword">new</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a>(<span class="keyword">this</span>); <a name="l00130"></a>00130 } <a name="l00131"></a>00131 <a name="l00132"></a><a class="code" href="classVamp_1_1PluginAdapterBase.html#e39492abdca4b588a582962fdeab819d">00132</a> PluginAdapterBase::~PluginAdapterBase() <a name="l00133"></a>00133 { <a name="l00134"></a>00134 <span class="keyword">delete</span> <a class="code" href="classVamp_1_1PluginAdapterBase.html#0e3594c54884efd5a7ef38030645745b">m_impl</a>; <a name="l00135"></a>00135 } <a name="l00136"></a>00136 <a name="l00137"></a>00137 <span class="keyword">const</span> <a class="code" href="struct__VampPluginDescriptor.html">VampPluginDescriptor</a> * <a name="l00138"></a><a class="code" href="classVamp_1_1PluginAdapterBase.html#7ff5c9374a8dc43f977c3707d1da45b5">00138</a> <a class="code" href="classVamp_1_1PluginAdapterBase.html#7ff5c9374a8dc43f977c3707d1da45b5" title="Return a VampPluginDescriptor describing the plugin that is wrapped by this adapter...">PluginAdapterBase::getDescriptor</a>() <a name="l00139"></a>00139 { <a name="l00140"></a>00140 <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginAdapterBase.html#0e3594c54884efd5a7ef38030645745b">m_impl</a>-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#31d6c53c6ef9851782674f3e14bf891d">getDescriptor</a>(); <a name="l00141"></a>00141 } <a name="l00142"></a>00142 <a name="l00143"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9b5cff59377109e63b3894920205be9a">00143</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9b5cff59377109e63b3894920205be9a">PluginAdapterBase::Impl::Impl</a>(<a class="code" href="classVamp_1_1PluginAdapterBase.html" title="PluginAdapter and PluginAdapterBase provide a wrapper class that a plugin library...">PluginAdapterBase</a> *base) : <a name="l00144"></a>00144 m_base(base), <a name="l00145"></a>00145 m_populated(false) <a name="l00146"></a>00146 { <a name="l00147"></a>00147 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00148"></a>00148 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl["</span> << <span class="keyword">this</span> << <span class="stringliteral">"]::Impl"</span> << std::endl; <a name="l00149"></a>00149 <span class="preprocessor">#endif</span> <a name="l00150"></a>00150 <span class="preprocessor"></span>} <a name="l00151"></a>00151 <a name="l00152"></a>00152 <span class="keyword">const</span> <a class="code" href="struct__VampPluginDescriptor.html">VampPluginDescriptor</a> * <a name="l00153"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#31d6c53c6ef9851782674f3e14bf891d">00153</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#31d6c53c6ef9851782674f3e14bf891d">PluginAdapterBase::Impl::getDescriptor</a>() <a name="l00154"></a>00154 { <a name="l00155"></a>00155 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00156"></a>00156 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl["</span> << <span class="keyword">this</span> << <span class="stringliteral">"]::getDescriptor"</span> << std::endl; <a name="l00157"></a>00157 <span class="preprocessor">#endif</span> <a name="l00158"></a>00158 <span class="preprocessor"></span> <a name="l00159"></a>00159 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#93384198b121720dfa627dafe77839a6">m_populated</a>) <span class="keywordflow">return</span> &<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>; <a name="l00160"></a>00160 <a name="l00161"></a>00161 <a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#c0372df58956b4bf99a9ec070b11dea4">m_base</a>-><a class="code" href="classVamp_1_1PluginAdapterBase.html#9116adb9b7a426f4f0ded15e45a5531b">createPlugin</a>(48000); <a name="l00162"></a>00162 <a name="l00163"></a>00163 <span class="keywordflow">if</span> (plugin-><a class="code" href="classVamp_1_1PluginBase.html#8fd2c48291c64b790f0efb8948508dcf" title="Get the Vamp API compatibility level of the plugin.">getVampApiVersion</a>() != <a class="code" href="vamp_8h.html#6d6c8c755dbabf161f72712e0e2143c7" title="Plugin API version.">VAMP_API_VERSION</a>) { <a name="l00164"></a>00164 std::cerr << <span class="stringliteral">"Vamp::PluginAdapterBase::Impl::getDescriptor: ERROR: "</span> <a name="l00165"></a>00165 << <span class="stringliteral">"Plugin object API version "</span> <a name="l00166"></a>00166 << plugin-><a class="code" href="classVamp_1_1PluginBase.html#8fd2c48291c64b790f0efb8948508dcf" title="Get the Vamp API compatibility level of the plugin.">getVampApiVersion</a>() <a name="l00167"></a>00167 << <span class="stringliteral">" does not match actual API version "</span> <a name="l00168"></a>00168 << <a class="code" href="vamp_8h.html#6d6c8c755dbabf161f72712e0e2143c7" title="Plugin API version.">VAMP_API_VERSION</a> << std::endl; <a name="l00169"></a>00169 <span class="keyword">delete</span> plugin; <a name="l00170"></a>00170 <span class="keywordflow">return</span> 0; <a name="l00171"></a>00171 } <a name="l00172"></a>00172 <a name="l00173"></a>00173 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a> = plugin-><a class="code" href="classVamp_1_1PluginBase.html#ac3e49b3b66cacfbb768dfdf07444f21" title="Get the controllable parameters of this plugin.">getParameterDescriptors</a>(); <a name="l00174"></a>00174 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a> = plugin-><a class="code" href="classVamp_1_1PluginBase.html#bb307c60bdb981d5f5af50c3c4ae84af" title="Get the program settings available in this plugin.">getPrograms</a>(); <a name="l00175"></a>00175 <a name="l00176"></a>00176 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#b6c87760e87ddaa9ac3491bccaaa28c2" title="API version with which this descriptor is compatible.">vampApiVersion</a> = plugin-><a class="code" href="classVamp_1_1PluginBase.html#8fd2c48291c64b790f0efb8948508dcf" title="Get the Vamp API compatibility level of the plugin.">getVampApiVersion</a>(); <a name="l00177"></a>00177 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#4915ec8276749cb505c01d25a6d02219" title="Computer-usable name of the plugin.">identifier</a> = strdup(plugin-><a class="code" href="classVamp_1_1PluginBase.html#d1c6dfc77aa03d937a885b7f08258f4a" title="Get the computer-usable name of the plugin.">getIdentifier</a>().c_str()); <a name="l00178"></a>00178 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#9dd5a0190e4d453ff36b5acb7000b150" title="Human-readable name of the plugin.">name</a> = strdup(plugin-><a class="code" href="classVamp_1_1PluginBase.html#18619d5097e444ecefee0c359da53232" title="Get a human-readable name or title of the plugin.">getName</a>().c_str()); <a name="l00179"></a>00179 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#9ff8050f92f1a04a68bb34a9d368295e" title="Human-readable short text about the plugin.">description</a> = strdup(plugin-><a class="code" href="classVamp_1_1PluginBase.html#59153a02364f75fff46973b2072e9e5a" title="Get a human-readable description for the plugin, typically a line of text that may...">getDescription</a>().c_str()); <a name="l00180"></a>00180 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#4dca3d57331802964716edfa80580c9b" title="Human-readable name of plugin&#39;s author or vendor.">maker</a> = strdup(plugin-><a class="code" href="classVamp_1_1PluginBase.html#53d9918bf9ef4d12feedf66b2b26c637" title="Get the name of the author or vendor of the plugin in human-readable form.">getMaker</a>().c_str()); <a name="l00181"></a>00181 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#04427c420d9252c7796c0bf5101345ae" title="Version number of the plugin.">pluginVersion</a> = plugin-><a class="code" href="classVamp_1_1PluginBase.html#63f686d77bc3d6b807e7944cdde83151" title="Get the version number of the plugin.">getPluginVersion</a>(); <a name="l00182"></a>00182 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#e704bba384af0de056a26da1b13ee521" title="Human-readable summary of copyright or licensing for plugin.">copyright</a> = strdup(plugin-><a class="code" href="classVamp_1_1PluginBase.html#b7e9dedbe965f5ab9018b72920fe7661" title="Get the copyright statement or licensing summary for the plugin.">getCopyright</a>().c_str()); <a name="l00183"></a>00183 <a name="l00184"></a>00184 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#e6271dc3ea0cea959c84a64185492cab" title="Number of parameter inputs.">parameterCount</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>.size(); <a name="l00185"></a>00185 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#64d614862604c31d6b84c49005f51913" title="Fixed descriptors for parameter inputs.">parameters</a> = (<span class="keyword">const</span> <a class="code" href="struct__VampParameterDescriptor.html" title="C language API for Vamp plugins.">VampParameterDescriptor</a> **) <a name="l00186"></a>00186 malloc(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>.size() * <span class="keyword">sizeof</span>(<a class="code" href="struct__VampParameterDescriptor.html" title="C language API for Vamp plugins.">VampParameterDescriptor</a>)); <a name="l00187"></a>00187 <a name="l00188"></a>00188 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i; <a name="l00189"></a>00189 <a name="l00190"></a>00190 <span class="keywordflow">for</span> (i = 0; i < <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>.size(); ++i) { <a name="l00191"></a>00191 <a class="code" href="struct__VampParameterDescriptor.html" title="C language API for Vamp plugins.">VampParameterDescriptor</a> *desc = (<a class="code" href="struct__VampParameterDescriptor.html" title="C language API for Vamp plugins.">VampParameterDescriptor</a> *) <a name="l00192"></a>00192 malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__VampParameterDescriptor.html" title="C language API for Vamp plugins.">VampParameterDescriptor</a>)); <a name="l00193"></a>00193 desc-><a class="code" href="struct__VampParameterDescriptor.html#26d74afd6a3341a673f15955031845ab" title="Computer-usable name of the parameter.">identifier</a> = strdup(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].identifier.c_str()); <a name="l00194"></a>00194 desc-><a class="code" href="struct__VampParameterDescriptor.html#bba810bce9656f6002777f6c3f655957" title="Human-readable name of the parameter.">name</a> = strdup(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].name.c_str()); <a name="l00195"></a>00195 desc-><a class="code" href="struct__VampParameterDescriptor.html#95489272d6cf5a5b487e949da8e4fac6" title="Human-readable short text about the parameter.">description</a> = strdup(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].description.c_str()); <a name="l00196"></a>00196 desc-><a class="code" href="struct__VampParameterDescriptor.html#8ca235f816b56dc99125e010eee08fc7" title="Human-readable unit of the parameter.">unit</a> = strdup(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].unit.c_str()); <a name="l00197"></a>00197 desc-><a class="code" href="struct__VampParameterDescriptor.html#b59c84f0bbe0d4d0c578d893c087b0db" title="Minimum value.">minValue</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].minValue; <a name="l00198"></a>00198 desc-><a class="code" href="struct__VampParameterDescriptor.html#6e7646babdb265c4abfc107ba4350d80" title="Maximum value.">maxValue</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].maxValue; <a name="l00199"></a>00199 desc-><a class="code" href="struct__VampParameterDescriptor.html#3d37f986ee152ab55feb9902b35f7aca" title="Default value.">defaultValue</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].defaultValue; <a name="l00200"></a>00200 desc-><a class="code" href="struct__VampParameterDescriptor.html#3f41e3b6b69c7a95ff0ce8625794f83a" title="1 if parameter values are quantized to a particular resolution.">isQuantized</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].isQuantized; <a name="l00201"></a>00201 desc-><a class="code" href="struct__VampParameterDescriptor.html#68c91fd3fc0b0b3617c2d343fe32d0e5" title="Quantization resolution, if isQuantized.">quantizeStep</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].quantizeStep; <a name="l00202"></a>00202 desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a> = 0; <a name="l00203"></a>00203 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampParameterDescriptor.html#3f41e3b6b69c7a95ff0ce8625794f83a" title="1 if parameter values are quantized to a particular resolution.">isQuantized</a> && !<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].valueNames.empty()) { <a name="l00204"></a>00204 desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a> = (<span class="keyword">const</span> <span class="keywordtype">char</span> **) <a name="l00205"></a>00205 malloc((<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].valueNames.size()+1) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *)); <a name="l00206"></a>00206 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j < <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].valueNames.size(); ++j) { <a name="l00207"></a>00207 desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>[j] = strdup(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].valueNames[j].c_str()); <a name="l00208"></a>00208 } <a name="l00209"></a>00209 desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>[<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>[i].valueNames.size()] = 0; <a name="l00210"></a>00210 } <a name="l00211"></a>00211 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#64d614862604c31d6b84c49005f51913" title="Fixed descriptors for parameter inputs.">parameters</a>[i] = desc; <a name="l00212"></a>00212 } <a name="l00213"></a>00213 <a name="l00214"></a>00214 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#1962666aa173e7a9a2c30dc82e4b2e00" title="Number of programs.">programCount</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a>.size(); <a name="l00215"></a>00215 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d488470c582d8472d86455889d71c5ec" title="Fixed names for programs.">programs</a> = (<span class="keyword">const</span> <span class="keywordtype">char</span> **) <a name="l00216"></a>00216 malloc(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a>.size() * <span class="keyword">sizeof</span>(<span class="keyword">const</span> <span class="keywordtype">char</span> *)); <a name="l00217"></a>00217 <a name="l00218"></a>00218 <span class="keywordflow">for</span> (i = 0; i < <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a>.size(); ++i) { <a name="l00219"></a>00219 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d488470c582d8472d86455889d71c5ec" title="Fixed names for programs.">programs</a>[i] = strdup(<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a>[i].c_str()); <a name="l00220"></a>00220 } <a name="l00221"></a>00221 <a name="l00222"></a>00222 <span class="keywordflow">if</span> (plugin-><a class="code" href="classVamp_1_1Plugin.html#e1d317a9702cbeda65ddf0ec500c1ff6" title="Get the plugin&#39;s required input domain.">getInputDomain</a>() == <a class="code" href="classVamp_1_1Plugin.html#39cb7649d6dcc20e4cb1640cd55907bca30e7877ab33f76acbdca28607e6ab53">Plugin::FrequencyDomain</a>) { <a name="l00223"></a>00223 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#ffc4d1796da7ced2c0cbb2cc2c4a22f4" title="Preferred input domain for audio input (time or frequency).">inputDomain</a> = <a class="code" href="vamp_8h.html#b107386a5f042feddf6446bea23bb765ee0c1c0d429276f071b8c0730b7bd87d">vampFrequencyDomain</a>; <a name="l00224"></a>00224 } <span class="keywordflow">else</span> { <a name="l00225"></a>00225 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#ffc4d1796da7ced2c0cbb2cc2c4a22f4" title="Preferred input domain for audio input (time or frequency).">inputDomain</a> = <a class="code" href="vamp_8h.html#b107386a5f042feddf6446bea23bb765e3dbb77ff3e8f292966fd3748888e1a1">vampTimeDomain</a>; <a name="l00226"></a>00226 } <a name="l00227"></a>00227 <a name="l00228"></a>00228 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#19c4ce36fdeb88eeedb539efc544b8ee" title="Create and return a new instance of this plugin.">instantiate</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8cf9e01074559a6b23064d920629dd55">vampInstantiate</a>; <a name="l00229"></a>00229 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#0e4522c33e59c3c518b9262f2477bc27" title="Destroy an instance of this plugin.">cleanup</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#198dddb40f4fedc71f8ec45088d22d93">vampCleanup</a>; <a name="l00230"></a>00230 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d0978f17a5e568079470a1978a9aad22" title="Initialise an instance following parameter configuration.">initialise</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#210cd61fc3fd8f66eda087a6d726cd2b">vampInitialise</a>; <a name="l00231"></a>00231 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#12267f6b506aeda3792ff7c982b02336" title="Reset an instance, ready to use again on new input data.">reset</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9dc6a2cc51118525c50583e2f7ac339a">vampReset</a>; <a name="l00232"></a>00232 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#07174981875b55ee2ec7521a7f4fc395" title="Get a parameter value.">getParameter</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#e3791f409c626f856133d1ed473dbcdd">vampGetParameter</a>; <a name="l00233"></a>00233 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#ad3cfc7a3b432df40bd9db13eee6a481" title="Set a parameter value.">setParameter</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#96a4f1c8359479d41e9b9c3438b561a6">vampSetParameter</a>; <a name="l00234"></a>00234 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#861a77525a95d424cb846820b018af53" title="Get the current program (if programCount &gt; 0).">getCurrentProgram</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#62824538d09f38a060bcc593f79ca8a1">vampGetCurrentProgram</a>; <a name="l00235"></a>00235 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d9af40cb165ca187e49250964af5f5cf" title="Set the current program.">selectProgram</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#124b1ee65cbb733004ae96f4fa001246">vampSelectProgram</a>; <a name="l00236"></a>00236 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#2beddf2ce156c05dd24477ac663adcbb" title="Get the plugin&#39;s preferred processing window increment in samples.">getPreferredStepSize</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a6e7c06690fed8d7af284be34a590b4b">vampGetPreferredStepSize</a>; <a name="l00237"></a>00237 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#c626e42554ab1532c8d8b5132a0faee8" title="Get the plugin&#39;s preferred processing window size in samples.">getPreferredBlockSize</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#46d39ad29bb4c689e21379e1eb387ace">vampGetPreferredBlockSize</a>; <a name="l00238"></a>00238 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#f175ca17716db5a7545b61b01caabd92" title="Get the minimum number of input channels this plugin can handle.">getMinChannelCount</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9825e946f36f8838ec3d4cb838c00220">vampGetMinChannelCount</a>; <a name="l00239"></a>00239 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d1600203418d9646332f5b917284261b" title="Get the maximum number of input channels this plugin can handle.">getMaxChannelCount</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#16bfdb3fc7b683a170b01bf92a49dee2">vampGetMaxChannelCount</a>; <a name="l00240"></a>00240 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#a8fc88da704e24b2b5f674821dd380c1" title="Get the number of feature outputs (distinct sets of results).">getOutputCount</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#debb9f604929cde924e783997e9efda3">vampGetOutputCount</a>; <a name="l00241"></a>00241 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#92c58b8ff99ad0c23a42333aa55c144d" title="Get a descriptor for a given feature output.">getOutputDescriptor</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#5118f9af094598b9f8c8a295a5e2290c">vampGetOutputDescriptor</a>; <a name="l00242"></a>00242 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#8cc38edc921616e67e551aa03397ec79" title="Destroy a descriptor for a feature output.">releaseOutputDescriptor</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#ff063ab7b4dfb0d13883e7ce19cf93a3">vampReleaseOutputDescriptor</a>; <a name="l00243"></a>00243 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#c5a0a75b6e68b22fed536765d1f2f254" title="Process an input block and return a set of features.">process</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#bc8f37b80648a0a7108a6e0ebaf45525">vampProcess</a>; <a name="l00244"></a>00244 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d22c666188aadab83c354a0edb18fcf0" title="Return any remaining features at the end of processing.">getRemainingFeatures</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f6af04fcb927463cfe1f85e936935767">vampGetRemainingFeatures</a>; <a name="l00245"></a>00245 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#c4bafe8ad2734d21a433d745b18e7d63" title="Release a feature set returned from process or getRemainingFeatures.">releaseFeatureSet</a> = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b0bc48dbdb1396410690d1b190522a95">vampReleaseFeatureSet</a>; <a name="l00246"></a>00246 <a name="l00247"></a>00247 <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>) { <a name="l00248"></a>00248 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a> = <span class="keyword">new</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#6c8f2c8fce370d586785353c939601d5">AdapterMap</a>; <a name="l00249"></a>00249 } <a name="l00250"></a>00250 (*m_adapterMap)[&<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>] = <span class="keyword">this</span>; <a name="l00251"></a>00251 <a name="l00252"></a>00252 <span class="keyword">delete</span> plugin; <a name="l00253"></a>00253 <a name="l00254"></a>00254 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#93384198b121720dfa627dafe77839a6">m_populated</a> = <span class="keyword">true</span>; <a name="l00255"></a>00255 <span class="keywordflow">return</span> &<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>; <a name="l00256"></a>00256 } <a name="l00257"></a>00257 <a name="l00258"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#75b00d5c8012db240fc410d18fd1235a">00258</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#75b00d5c8012db240fc410d18fd1235a">PluginAdapterBase::Impl::~Impl</a>() <a name="l00259"></a>00259 { <a name="l00260"></a>00260 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00261"></a>00261 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl["</span> << <span class="keyword">this</span> << <span class="stringliteral">"]::~Impl"</span> << std::endl; <a name="l00262"></a>00262 <span class="preprocessor">#endif</span> <a name="l00263"></a>00263 <span class="preprocessor"></span> <a name="l00264"></a>00264 <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#93384198b121720dfa627dafe77839a6">m_populated</a>) <span class="keywordflow">return</span>; <a name="l00265"></a>00265 <a name="l00266"></a>00266 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#4915ec8276749cb505c01d25a6d02219" title="Computer-usable name of the plugin.">identifier</a>); <a name="l00267"></a>00267 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#9dd5a0190e4d453ff36b5acb7000b150" title="Human-readable name of the plugin.">name</a>); <a name="l00268"></a>00268 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#9ff8050f92f1a04a68bb34a9d368295e" title="Human-readable short text about the plugin.">description</a>); <a name="l00269"></a>00269 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#4dca3d57331802964716edfa80580c9b" title="Human-readable name of plugin&#39;s author or vendor.">maker</a>); <a name="l00270"></a>00270 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#e704bba384af0de056a26da1b13ee521" title="Human-readable summary of copyright or licensing for plugin.">copyright</a>); <a name="l00271"></a>00271 <a name="l00272"></a>00272 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#e6271dc3ea0cea959c84a64185492cab" title="Number of parameter inputs.">parameterCount</a>; ++i) { <a name="l00273"></a>00273 <span class="keyword">const</span> <a class="code" href="struct__VampParameterDescriptor.html" title="C language API for Vamp plugins.">VampParameterDescriptor</a> *desc = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#64d614862604c31d6b84c49005f51913" title="Fixed descriptors for parameter inputs.">parameters</a>[i]; <a name="l00274"></a>00274 free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampParameterDescriptor.html#26d74afd6a3341a673f15955031845ab" title="Computer-usable name of the parameter.">identifier</a>); <a name="l00275"></a>00275 free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampParameterDescriptor.html#bba810bce9656f6002777f6c3f655957" title="Human-readable name of the parameter.">name</a>); <a name="l00276"></a>00276 free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampParameterDescriptor.html#95489272d6cf5a5b487e949da8e4fac6" title="Human-readable short text about the parameter.">description</a>); <a name="l00277"></a>00277 free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampParameterDescriptor.html#8ca235f816b56dc99125e010eee08fc7" title="Human-readable unit of the parameter.">unit</a>); <a name="l00278"></a>00278 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>) { <a name="l00279"></a>00279 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>[j]; ++j) { <a name="l00280"></a>00280 free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>[j]); <a name="l00281"></a>00281 } <a name="l00282"></a>00282 free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>); <a name="l00283"></a>00283 } <a name="l00284"></a>00284 } <a name="l00285"></a>00285 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#64d614862604c31d6b84c49005f51913" title="Fixed descriptors for parameter inputs.">parameters</a>); <a name="l00286"></a>00286 <a name="l00287"></a>00287 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#1962666aa173e7a9a2c30dc82e4b2e00" title="Number of programs.">programCount</a>; ++i) { <a name="l00288"></a>00288 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d488470c582d8472d86455889d71c5ec" title="Fixed names for programs.">programs</a>[i]); <a name="l00289"></a>00289 } <a name="l00290"></a>00290 free((<span class="keywordtype">void</span> *)<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>.<a class="code" href="struct__VampPluginDescriptor.html#d488470c582d8472d86455889d71c5ec" title="Fixed names for programs.">programs</a>); <a name="l00291"></a>00291 <a name="l00292"></a>00292 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>) { <a name="l00293"></a>00293 <a name="l00294"></a>00294 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->erase(&<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>); <a name="l00295"></a>00295 <a name="l00296"></a>00296 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->empty()) { <a name="l00297"></a>00297 <span class="keyword">delete</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>; <a name="l00298"></a>00298 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a> = 0; <a name="l00299"></a>00299 } <a name="l00300"></a>00300 } <a name="l00301"></a>00301 } <a name="l00302"></a>00302 <a name="l00303"></a>00303 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">PluginAdapterBase::Impl</a> * <a name="l00304"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">00304</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">PluginAdapterBase::Impl::lookupAdapter</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00305"></a>00305 { <a name="l00306"></a>00306 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00307"></a>00307 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::lookupAdapter("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00308"></a>00308 <span class="preprocessor">#endif</span> <a name="l00309"></a>00309 <span class="preprocessor"></span> <a name="l00310"></a>00310 <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>) <span class="keywordflow">return</span> 0; <a name="l00311"></a>00311 AdapterMap::const_iterator i = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->find(handle); <a name="l00312"></a>00312 <span class="keywordflow">if</span> (i == <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->end()) <span class="keywordflow">return</span> 0; <a name="l00313"></a>00313 <span class="keywordflow">return</span> i->second; <a name="l00314"></a>00314 } <a name="l00315"></a>00315 <a name="l00316"></a>00316 <a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> <a name="l00317"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8cf9e01074559a6b23064d920629dd55">00317</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8cf9e01074559a6b23064d920629dd55">PluginAdapterBase::Impl::vampInstantiate</a>(<span class="keyword">const</span> <a class="code" href="struct__VampPluginDescriptor.html">VampPluginDescriptor</a> *desc, <a name="l00318"></a>00318 <span class="keywordtype">float</span> inputSampleRate) <a name="l00319"></a>00319 { <a name="l00320"></a>00320 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00321"></a>00321 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampInstantiate("</span> << desc << <span class="stringliteral">")"</span> << std::endl; <a name="l00322"></a>00322 <span class="preprocessor">#endif</span> <a name="l00323"></a>00323 <span class="preprocessor"></span> <a name="l00324"></a>00324 <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>) { <a name="l00325"></a>00325 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a> = <span class="keyword">new</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#6c8f2c8fce370d586785353c939601d5">AdapterMap</a>(); <a name="l00326"></a>00326 } <a name="l00327"></a>00327 <a name="l00328"></a>00328 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->find(desc) == <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->end()) { <a name="l00329"></a>00329 std::cerr << <span class="stringliteral">"WARNING: PluginAdapterBase::Impl::vampInstantiate: Descriptor "</span> << desc << <span class="stringliteral">" not in adapter map"</span> << std::endl; <a name="l00330"></a>00330 <span class="keywordflow">return</span> 0; <a name="l00331"></a>00331 } <a name="l00332"></a>00332 <a name="l00333"></a>00333 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = (*m_adapterMap)[desc]; <a name="l00334"></a>00334 <span class="keywordflow">if</span> (desc != &adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#eeea6028dbc6b4b96f4351a5cb79abac">m_descriptor</a>) <span class="keywordflow">return</span> 0; <a name="l00335"></a>00335 <a name="l00336"></a>00336 <a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin = adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#c0372df58956b4bf99a9ec070b11dea4">m_base</a>-><a class="code" href="classVamp_1_1PluginAdapterBase.html#9116adb9b7a426f4f0ded15e45a5531b">createPlugin</a>(inputSampleRate); <a name="l00337"></a>00337 <span class="keywordflow">if</span> (plugin) { <a name="l00338"></a>00338 (*m_adapterMap)[plugin] = adapter; <a name="l00339"></a>00339 } <a name="l00340"></a>00340 <a name="l00341"></a>00341 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00342"></a>00342 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampInstantiate("</span> << desc << <span class="stringliteral">"): returning handle "</span> << plugin << std::endl; <a name="l00343"></a>00343 <span class="preprocessor">#endif</span> <a name="l00344"></a>00344 <span class="preprocessor"></span> <a name="l00345"></a>00345 <span class="keywordflow">return</span> plugin; <a name="l00346"></a>00346 } <a name="l00347"></a>00347 <a name="l00348"></a>00348 <span class="keywordtype">void</span> <a name="l00349"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#198dddb40f4fedc71f8ec45088d22d93">00349</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#198dddb40f4fedc71f8ec45088d22d93">PluginAdapterBase::Impl::vampCleanup</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00350"></a>00350 { <a name="l00351"></a>00351 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00352"></a>00352 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampCleanup("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00353"></a>00353 <span class="preprocessor">#endif</span> <a name="l00354"></a>00354 <span class="preprocessor"></span> <a name="l00355"></a>00355 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00356"></a>00356 <span class="keywordflow">if</span> (!adapter) { <a name="l00357"></a>00357 <span class="keyword">delete</span> ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle); <a name="l00358"></a>00358 <span class="keywordflow">return</span>; <a name="l00359"></a>00359 } <a name="l00360"></a>00360 adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b4199ab4a8ba40098aac387032c52aa4">cleanup</a>(((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)); <a name="l00361"></a>00361 } <a name="l00362"></a>00362 <a name="l00363"></a>00363 <span class="keywordtype">int</span> <a name="l00364"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#210cd61fc3fd8f66eda087a6d726cd2b">00364</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#210cd61fc3fd8f66eda087a6d726cd2b">PluginAdapterBase::Impl::vampInitialise</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00365"></a>00365 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, <a name="l00366"></a>00366 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> stepSize, <a name="l00367"></a>00367 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> blockSize) <a name="l00368"></a>00368 { <a name="l00369"></a>00369 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00370"></a>00370 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampInitialise("</span> << handle << <span class="stringliteral">", "</span> << channels << <span class="stringliteral">", "</span> << stepSize << <span class="stringliteral">", "</span> << blockSize << <span class="stringliteral">")"</span> << std::endl; <a name="l00371"></a>00371 <span class="preprocessor">#endif</span> <a name="l00372"></a>00372 <span class="preprocessor"></span> <a name="l00373"></a>00373 <span class="keywordtype">bool</span> result = ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->initialise <a name="l00374"></a>00374 (channels, stepSize, blockSize); <a name="l00375"></a>00375 <span class="keywordflow">return</span> result ? 1 : 0; <a name="l00376"></a>00376 } <a name="l00377"></a>00377 <a name="l00378"></a>00378 <span class="keywordtype">void</span> <a name="l00379"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9dc6a2cc51118525c50583e2f7ac339a">00379</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9dc6a2cc51118525c50583e2f7ac339a">PluginAdapterBase::Impl::vampReset</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00380"></a>00380 { <a name="l00381"></a>00381 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00382"></a>00382 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampReset("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00383"></a>00383 <span class="preprocessor">#endif</span> <a name="l00384"></a>00384 <span class="preprocessor"></span> <a name="l00385"></a>00385 ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->reset(); <a name="l00386"></a>00386 } <a name="l00387"></a>00387 <a name="l00388"></a>00388 <span class="keywordtype">float</span> <a name="l00389"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#e3791f409c626f856133d1ed473dbcdd">00389</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#e3791f409c626f856133d1ed473dbcdd">PluginAdapterBase::Impl::vampGetParameter</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00390"></a>00390 <span class="keywordtype">int</span> param) <a name="l00391"></a>00391 { <a name="l00392"></a>00392 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00393"></a>00393 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetParameter("</span> << handle << <span class="stringliteral">", "</span> << param << <span class="stringliteral">")"</span> << std::endl; <a name="l00394"></a>00394 <span class="preprocessor">#endif</span> <a name="l00395"></a>00395 <span class="preprocessor"></span> <a name="l00396"></a>00396 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00397"></a>00397 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span> 0.0; <a name="l00398"></a>00398 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">Plugin::ParameterList</a> &list = adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>; <a name="l00399"></a>00399 <span class="keywordflow">return</span> ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->getParameter(list[param].identifier); <a name="l00400"></a>00400 } <a name="l00401"></a>00401 <a name="l00402"></a>00402 <span class="keywordtype">void</span> <a name="l00403"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#96a4f1c8359479d41e9b9c3438b561a6">00403</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#96a4f1c8359479d41e9b9c3438b561a6">PluginAdapterBase::Impl::vampSetParameter</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00404"></a>00404 <span class="keywordtype">int</span> param, <span class="keywordtype">float</span> value) <a name="l00405"></a>00405 { <a name="l00406"></a>00406 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00407"></a>00407 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampSetParameter("</span> << handle << <span class="stringliteral">", "</span> << param << <span class="stringliteral">", "</span> << value << <span class="stringliteral">")"</span> << std::endl; <a name="l00408"></a>00408 <span class="preprocessor">#endif</span> <a name="l00409"></a>00409 <span class="preprocessor"></span> <a name="l00410"></a>00410 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00411"></a>00411 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span>; <a name="l00412"></a>00412 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">Plugin::ParameterList</a> &list = adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0edebff94969c59cc651b4517bcc6bb9">m_parameters</a>; <a name="l00413"></a>00413 ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->setParameter(list[param].identifier, value); <a name="l00414"></a>00414 } <a name="l00415"></a>00415 <a name="l00416"></a>00416 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00417"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#62824538d09f38a060bcc593f79ca8a1">00417</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#62824538d09f38a060bcc593f79ca8a1">PluginAdapterBase::Impl::vampGetCurrentProgram</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00418"></a>00418 { <a name="l00419"></a>00419 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00420"></a>00420 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetCurrentProgram("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00421"></a>00421 <span class="preprocessor">#endif</span> <a name="l00422"></a>00422 <span class="preprocessor"></span> <a name="l00423"></a>00423 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00424"></a>00424 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span> 0; <a name="l00425"></a>00425 <a class="code" href="classVamp_1_1PluginBase.html#7f66f00437b21e5f694fe02356b12f20">Plugin::ProgramList</a> &list = adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a>; <a name="l00426"></a>00426 std::string program = ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->getCurrentProgram(); <a name="l00427"></a>00427 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < list.size(); ++i) { <a name="l00428"></a>00428 <span class="keywordflow">if</span> (list[i] == program) <span class="keywordflow">return</span> i; <a name="l00429"></a>00429 } <a name="l00430"></a>00430 <span class="keywordflow">return</span> 0; <a name="l00431"></a>00431 } <a name="l00432"></a>00432 <a name="l00433"></a>00433 <span class="keywordtype">void</span> <a name="l00434"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#124b1ee65cbb733004ae96f4fa001246">00434</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#124b1ee65cbb733004ae96f4fa001246">PluginAdapterBase::Impl::vampSelectProgram</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00435"></a>00435 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> program) <a name="l00436"></a>00436 { <a name="l00437"></a>00437 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00438"></a>00438 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampSelectProgram("</span> << handle << <span class="stringliteral">", "</span> << program << <span class="stringliteral">")"</span> << std::endl; <a name="l00439"></a>00439 <span class="preprocessor">#endif</span> <a name="l00440"></a>00440 <span class="preprocessor"></span> <a name="l00441"></a>00441 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00442"></a>00442 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span>; <a name="l00443"></a>00443 <a class="code" href="classVamp_1_1PluginBase.html#7f66f00437b21e5f694fe02356b12f20">Plugin::ProgramList</a> &list = adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#79666690394693c9e293a4e74960b444">m_programs</a>; <a name="l00444"></a>00444 ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->selectProgram(list[program]); <a name="l00445"></a>00445 } <a name="l00446"></a>00446 <a name="l00447"></a>00447 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00448"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a6e7c06690fed8d7af284be34a590b4b">00448</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a6e7c06690fed8d7af284be34a590b4b">PluginAdapterBase::Impl::vampGetPreferredStepSize</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00449"></a>00449 { <a name="l00450"></a>00450 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00451"></a>00451 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetPreferredStepSize("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00452"></a>00452 <span class="preprocessor">#endif</span> <a name="l00453"></a>00453 <span class="preprocessor"></span> <a name="l00454"></a>00454 <span class="keywordflow">return</span> ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->getPreferredStepSize(); <a name="l00455"></a>00455 } <a name="l00456"></a>00456 <a name="l00457"></a>00457 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00458"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#46d39ad29bb4c689e21379e1eb387ace">00458</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#46d39ad29bb4c689e21379e1eb387ace">PluginAdapterBase::Impl::vampGetPreferredBlockSize</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00459"></a>00459 { <a name="l00460"></a>00460 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00461"></a>00461 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetPreferredBlockSize("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00462"></a>00462 <span class="preprocessor">#endif</span> <a name="l00463"></a>00463 <span class="preprocessor"></span> <a name="l00464"></a>00464 <span class="keywordflow">return</span> ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->getPreferredBlockSize(); <a name="l00465"></a>00465 } <a name="l00466"></a>00466 <a name="l00467"></a>00467 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00468"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9825e946f36f8838ec3d4cb838c00220">00468</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9825e946f36f8838ec3d4cb838c00220">PluginAdapterBase::Impl::vampGetMinChannelCount</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00469"></a>00469 { <a name="l00470"></a>00470 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00471"></a>00471 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetMinChannelCount("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00472"></a>00472 <span class="preprocessor">#endif</span> <a name="l00473"></a>00473 <span class="preprocessor"></span> <a name="l00474"></a>00474 <span class="keywordflow">return</span> ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->getMinChannelCount(); <a name="l00475"></a>00475 } <a name="l00476"></a>00476 <a name="l00477"></a>00477 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00478"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#16bfdb3fc7b683a170b01bf92a49dee2">00478</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#16bfdb3fc7b683a170b01bf92a49dee2">PluginAdapterBase::Impl::vampGetMaxChannelCount</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00479"></a>00479 { <a name="l00480"></a>00480 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00481"></a>00481 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetMaxChannelCount("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00482"></a>00482 <span class="preprocessor">#endif</span> <a name="l00483"></a>00483 <span class="preprocessor"></span> <a name="l00484"></a>00484 <span class="keywordflow">return</span> ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle)->getMaxChannelCount(); <a name="l00485"></a>00485 } <a name="l00486"></a>00486 <a name="l00487"></a>00487 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00488"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#debb9f604929cde924e783997e9efda3">00488</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#debb9f604929cde924e783997e9efda3">PluginAdapterBase::Impl::vampGetOutputCount</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00489"></a>00489 { <a name="l00490"></a>00490 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00491"></a>00491 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetOutputCount("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00492"></a>00492 <span class="preprocessor">#endif</span> <a name="l00493"></a>00493 <span class="preprocessor"></span> <a name="l00494"></a>00494 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00495"></a>00495 <a name="l00496"></a>00496 <span class="comment">// std::cerr << "vampGetOutputCount: handle " << handle << " -> adapter "<< adapter << std::endl;</span> <a name="l00497"></a>00497 <a name="l00498"></a>00498 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span> 0; <a name="l00499"></a>00499 <span class="keywordflow">return</span> adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#17af6e67c075bfb9b5069c51c7861e64">getOutputCount</a>((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle); <a name="l00500"></a>00500 } <a name="l00501"></a>00501 <a name="l00502"></a>00502 <a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> * <a name="l00503"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#5118f9af094598b9f8c8a295a5e2290c">00503</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#5118f9af094598b9f8c8a295a5e2290c">PluginAdapterBase::Impl::vampGetOutputDescriptor</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00504"></a>00504 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i) <a name="l00505"></a>00505 { <a name="l00506"></a>00506 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00507"></a>00507 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetOutputDescriptor("</span> << handle << <span class="stringliteral">", "</span> << i << <span class="stringliteral">")"</span> << std::endl; <a name="l00508"></a>00508 <span class="preprocessor">#endif</span> <a name="l00509"></a>00509 <span class="preprocessor"></span> <a name="l00510"></a>00510 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00511"></a>00511 <a name="l00512"></a>00512 <span class="comment">// std::cerr << "vampGetOutputDescriptor: handle " << handle << " -> adapter "<< adapter << std::endl;</span> <a name="l00513"></a>00513 <a name="l00514"></a>00514 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span> 0; <a name="l00515"></a>00515 <span class="keywordflow">return</span> adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#088345ac72041e44e18b7bf5edd32f44">getOutputDescriptor</a>((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle, i); <a name="l00516"></a>00516 } <a name="l00517"></a>00517 <a name="l00518"></a>00518 <span class="keywordtype">void</span> <a name="l00519"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#ff063ab7b4dfb0d13883e7ce19cf93a3">00519</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#ff063ab7b4dfb0d13883e7ce19cf93a3">PluginAdapterBase::Impl::vampReleaseOutputDescriptor</a>(<a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> *desc) <a name="l00520"></a>00520 { <a name="l00521"></a>00521 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00522"></a>00522 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampReleaseOutputDescriptor("</span> << desc << <span class="stringliteral">")"</span> << std::endl; <a name="l00523"></a>00523 <span class="preprocessor">#endif</span> <a name="l00524"></a>00524 <span class="preprocessor"></span> <a name="l00525"></a>00525 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampOutputDescriptor.html#461161b2010370176115967e4f58a5f5" title="Computer-usable name of the output.">identifier</a>) free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampOutputDescriptor.html#461161b2010370176115967e4f58a5f5" title="Computer-usable name of the output.">identifier</a>); <a name="l00526"></a>00526 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampOutputDescriptor.html#f4fca576bd47167fd2bf9b43d588815f" title="Human-readable name of the output.">name</a>) free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampOutputDescriptor.html#f4fca576bd47167fd2bf9b43d588815f" title="Human-readable name of the output.">name</a>); <a name="l00527"></a>00527 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampOutputDescriptor.html#bfa911b138cfb80cf63e8f2e0fa0fb89" title="Human-readable short text about the output.">description</a>) free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampOutputDescriptor.html#bfa911b138cfb80cf63e8f2e0fa0fb89" title="Human-readable short text about the output.">description</a>); <a name="l00528"></a>00528 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampOutputDescriptor.html#d038caa8e596dfd037035637202f1d63" title="Human-readable name of the unit of the output.">unit</a>) free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampOutputDescriptor.html#d038caa8e596dfd037035637202f1d63" title="Human-readable name of the unit of the output.">unit</a>); <a name="l00529"></a>00529 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampOutputDescriptor.html#e8571f5a2bc740738af0cb7dda0c4749" title="1 if output has equal number of values for each returned result.">hasFixedBinCount</a> && desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>) { <a name="l00530"></a>00530 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < desc-><a class="code" href="struct__VampOutputDescriptor.html#652ee422092720e44d23d98bdb68f978" title="Number of values per result, if hasFixedBinCount.">binCount</a>; ++i) { <a name="l00531"></a>00531 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>[i]) { <a name="l00532"></a>00532 free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>[i]); <a name="l00533"></a>00533 } <a name="l00534"></a>00534 } <a name="l00535"></a>00535 } <a name="l00536"></a>00536 <span class="keywordflow">if</span> (desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>) free((<span class="keywordtype">void</span> *)desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>); <a name="l00537"></a>00537 free((<span class="keywordtype">void</span> *)desc); <a name="l00538"></a>00538 } <a name="l00539"></a>00539 <a name="l00540"></a>00540 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> * <a name="l00541"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#bc8f37b80648a0a7108a6e0ebaf45525">00541</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#bc8f37b80648a0a7108a6e0ebaf45525">PluginAdapterBase::Impl::vampProcess</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle, <a name="l00542"></a>00542 <span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a name="l00543"></a>00543 <span class="keywordtype">int</span> sec, <a name="l00544"></a>00544 <span class="keywordtype">int</span> nsec) <a name="l00545"></a>00545 { <a name="l00546"></a>00546 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00547"></a>00547 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampProcess("</span> << handle << <span class="stringliteral">", "</span> << sec << <span class="stringliteral">", "</span> << nsec << <span class="stringliteral">")"</span> << std::endl; <a name="l00548"></a>00548 <span class="preprocessor">#endif</span> <a name="l00549"></a>00549 <span class="preprocessor"></span> <a name="l00550"></a>00550 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00551"></a>00551 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span> 0; <a name="l00552"></a>00552 <span class="keywordflow">return</span> adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0eca18a4ae046e4ac1ebd25bb3ac5a08">process</a>((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle, <a name="l00553"></a>00553 inputBuffers, sec, nsec); <a name="l00554"></a>00554 } <a name="l00555"></a>00555 <a name="l00556"></a>00556 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> * <a name="l00557"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f6af04fcb927463cfe1f85e936935767">00557</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f6af04fcb927463cfe1f85e936935767">PluginAdapterBase::Impl::vampGetRemainingFeatures</a>(<a class="code" href="vamp_8h.html#d3be2952b1f4ad7d775940a6db75c79b">VampPluginHandle</a> handle) <a name="l00558"></a>00558 { <a name="l00559"></a>00559 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00560"></a>00560 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampGetRemainingFeatures("</span> << handle << <span class="stringliteral">")"</span> << std::endl; <a name="l00561"></a>00561 <span class="preprocessor">#endif</span> <a name="l00562"></a>00562 <span class="preprocessor"></span> <a name="l00563"></a>00563 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html">Impl</a> *adapter = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#186446e143fb2bb237c952a14db6ceff">lookupAdapter</a>(handle); <a name="l00564"></a>00564 <span class="keywordflow">if</span> (!adapter) <span class="keywordflow">return</span> 0; <a name="l00565"></a>00565 <span class="keywordflow">return</span> adapter-><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9fe7df06eb951c259763d56c49544676">getRemainingFeatures</a>((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)handle); <a name="l00566"></a>00566 } <a name="l00567"></a>00567 <a name="l00568"></a>00568 <span class="keywordtype">void</span> <a name="l00569"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b0bc48dbdb1396410690d1b190522a95">00569</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b0bc48dbdb1396410690d1b190522a95">PluginAdapterBase::Impl::vampReleaseFeatureSet</a>(<a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *fs) <a name="l00570"></a>00570 { <a name="l00571"></a>00571 <span class="preprocessor">#ifdef DEBUG_PLUGIN_ADAPTER</span> <a name="l00572"></a>00572 <span class="preprocessor"></span> std::cerr << <span class="stringliteral">"PluginAdapterBase::Impl::vampReleaseFeatureSet"</span> << std::endl; <a name="l00573"></a>00573 <span class="preprocessor">#endif</span> <a name="l00574"></a>00574 <span class="preprocessor"></span>} <a name="l00575"></a>00575 <a name="l00576"></a>00576 <span class="keywordtype">void</span> <a name="l00577"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b4199ab4a8ba40098aac387032c52aa4">00577</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#b4199ab4a8ba40098aac387032c52aa4">PluginAdapterBase::Impl::cleanup</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin) <a name="l00578"></a>00578 { <a name="l00579"></a>00579 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>.find(plugin) != <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>.end()) { <a name="l00580"></a>00580 <span class="keywordtype">size_t</span> outputCount = 0; <a name="l00581"></a>00581 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin]) { <a name="l00582"></a>00582 outputCount = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin]->size(); <a name="l00583"></a>00583 } <a name="l00584"></a>00584 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *list = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin]; <a name="l00585"></a>00585 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < outputCount; ++i) { <a name="l00586"></a>00586 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j < <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][i]; ++j) { <a name="l00587"></a>00587 <span class="keywordflow">if</span> (list[i].features[j].label) { <a name="l00588"></a>00588 free(list[i].features[j].label); <a name="l00589"></a>00589 } <a name="l00590"></a>00590 <span class="keywordflow">if</span> (list[i].features[j].values) { <a name="l00591"></a>00591 free(list[i].features[j].values); <a name="l00592"></a>00592 } <a name="l00593"></a>00593 } <a name="l00594"></a>00594 <span class="keywordflow">if</span> (list[i].features) free(list[i].features); <a name="l00595"></a>00595 } <a name="l00596"></a>00596 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>.erase(plugin); <a name="l00597"></a>00597 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>.erase(plugin); <a name="l00598"></a>00598 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">m_fvsizes</a>.erase(plugin); <a name="l00599"></a>00599 } <a name="l00600"></a>00600 <a name="l00601"></a>00601 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>.find(plugin) != <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>.end()) { <a name="l00602"></a>00602 <span class="keyword">delete</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin]; <a name="l00603"></a>00603 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>.erase(plugin); <a name="l00604"></a>00604 } <a name="l00605"></a>00605 <a name="l00606"></a>00606 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>) { <a name="l00607"></a>00607 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->erase(plugin); <a name="l00608"></a>00608 <a name="l00609"></a>00609 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>->empty()) { <a name="l00610"></a>00610 <span class="keyword">delete</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a>; <a name="l00611"></a>00611 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">m_adapterMap</a> = 0; <a name="l00612"></a>00612 } <a name="l00613"></a>00613 } <a name="l00614"></a>00614 <a name="l00615"></a>00615 <span class="keyword">delete</span> ((<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *)plugin); <a name="l00616"></a>00616 } <a name="l00617"></a>00617 <a name="l00618"></a>00618 <span class="keywordtype">void</span> <a name="l00619"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8274f19566392f843cbf5f745308fd2c">00619</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8274f19566392f843cbf5f745308fd2c">PluginAdapterBase::Impl::checkOutputMap</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin) <a name="l00620"></a>00620 { <a name="l00621"></a>00621 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>.find(plugin) == <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>.end() || <a name="l00622"></a>00622 !<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin]) { <a name="l00623"></a>00623 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin] = <span class="keyword">new</span> <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">Plugin::OutputList</a> <a name="l00624"></a>00624 (plugin-><a class="code" href="classVamp_1_1Plugin.html#d064d5d132b5c9bd7064f429c3309e35" title="Get the outputs of this plugin.">getOutputDescriptors</a>()); <a name="l00625"></a>00625 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::checkOutputMap: Have " << m_pluginOutputs[plugin]->size() << " outputs for plugin " << plugin->getIdentifier() << std::endl;</span> <a name="l00626"></a>00626 } <a name="l00627"></a>00627 } <a name="l00628"></a>00628 <a name="l00629"></a>00629 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00630"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#17af6e67c075bfb9b5069c51c7861e64">00630</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#17af6e67c075bfb9b5069c51c7861e64">PluginAdapterBase::Impl::getOutputCount</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin) <a name="l00631"></a>00631 { <a name="l00632"></a>00632 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8274f19566392f843cbf5f745308fd2c">checkOutputMap</a>(plugin); <a name="l00633"></a>00633 <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin]->size(); <a name="l00634"></a>00634 } <a name="l00635"></a>00635 <a name="l00636"></a>00636 <a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> * <a name="l00637"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#088345ac72041e44e18b7bf5edd32f44">00637</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#088345ac72041e44e18b7bf5edd32f44">PluginAdapterBase::Impl::getOutputDescriptor</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <a name="l00638"></a>00638 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i) <a name="l00639"></a>00639 { <a name="l00640"></a>00640 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8274f19566392f843cbf5f745308fd2c">checkOutputMap</a>(plugin); <a name="l00641"></a>00641 <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html">Plugin::OutputDescriptor</a> &od = <a name="l00642"></a>00642 (*<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin])[i]; <a name="l00643"></a>00643 <a name="l00644"></a>00644 <a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> *desc = (<a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> *) <a name="l00645"></a>00645 malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a>)); <a name="l00646"></a>00646 <a name="l00647"></a>00647 desc-><a class="code" href="struct__VampOutputDescriptor.html#461161b2010370176115967e4f58a5f5" title="Computer-usable name of the output.">identifier</a> = strdup(od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a>.c_str()); <a name="l00648"></a>00648 desc-><a class="code" href="struct__VampOutputDescriptor.html#f4fca576bd47167fd2bf9b43d588815f" title="Human-readable name of the output.">name</a> = strdup(od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a>.c_str()); <a name="l00649"></a>00649 desc-><a class="code" href="struct__VampOutputDescriptor.html#bfa911b138cfb80cf63e8f2e0fa0fb89" title="Human-readable short text about the output.">description</a> = strdup(od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a>.c_str()); <a name="l00650"></a>00650 desc-><a class="code" href="struct__VampOutputDescriptor.html#d038caa8e596dfd037035637202f1d63" title="Human-readable name of the unit of the output.">unit</a> = strdup(od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a>.c_str()); <a name="l00651"></a>00651 desc-><a class="code" href="struct__VampOutputDescriptor.html#e8571f5a2bc740738af0cb7dda0c4749" title="1 if output has equal number of values for each returned result.">hasFixedBinCount</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f0e577e1a256ff6eed6ea42133fec77d" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a>; <a name="l00652"></a>00652 desc-><a class="code" href="struct__VampOutputDescriptor.html#652ee422092720e44d23d98bdb68f978" title="Number of values per result, if hasFixedBinCount.">binCount</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a>; <a name="l00653"></a>00653 <a name="l00654"></a>00654 <span class="keywordflow">if</span> (od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f0e577e1a256ff6eed6ea42133fec77d" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> && od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a> > 0) { <a name="l00655"></a>00655 desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a> = (<span class="keyword">const</span> <span class="keywordtype">char</span> **) <a name="l00656"></a>00656 malloc(od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a> * <span class="keyword">sizeof</span>(<span class="keyword">const</span> <span class="keywordtype">char</span> *)); <a name="l00657"></a>00657 <a name="l00658"></a>00658 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a>; ++i) { <a name="l00659"></a>00659 <span class="keywordflow">if</span> (i < od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#31d9b79e2d8241344f551a22fcb5c8c7" title="The (human-readable) names of each of the bins, if appropriate.">binNames</a>.size()) { <a name="l00660"></a>00660 desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>[i] = strdup(od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#31d9b79e2d8241344f551a22fcb5c8c7" title="The (human-readable) names of each of the bins, if appropriate.">binNames</a>[i].c_str()); <a name="l00661"></a>00661 } <span class="keywordflow">else</span> { <a name="l00662"></a>00662 desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>[i] = 0; <a name="l00663"></a>00663 } <a name="l00664"></a>00664 } <a name="l00665"></a>00665 } <span class="keywordflow">else</span> { <a name="l00666"></a>00666 desc-><a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a> = 0; <a name="l00667"></a>00667 } <a name="l00668"></a>00668 <a name="l00669"></a>00669 desc-><a class="code" href="struct__VampOutputDescriptor.html#f6b512d772023b4e852216689c1c4465" title="1 if each returned value falls within the same fixed min/max range.">hasKnownExtents</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e9ccb65f99f477096b65dd031f4c5e31" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a>; <a name="l00670"></a>00670 desc-><a class="code" href="struct__VampOutputDescriptor.html#9a28180989e3d028c12a98517479dc46" title="Minimum value for a returned result in any bin, if hasKnownExtents.">minValue</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#c9f5924c0be7571bba8e7ae7e7a921f4" title="Minimum value of the results in the output.">minValue</a>; <a name="l00671"></a>00671 desc-><a class="code" href="struct__VampOutputDescriptor.html#4cbe540a247df60f85b00b2aa16461ee" title="Maximum value for a returned result in any bin, if hasKnownExtents.">maxValue</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#907b4e8fbb48a46ac5a05f880d72719f" title="Maximum value of the results in the output.">maxValue</a>; <a name="l00672"></a>00672 desc-><a class="code" href="struct__VampOutputDescriptor.html#b56cf0bbb17136819024574d5cc65e30" title="1 if returned results are quantized to a particular resolution.">isQuantized</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#1b4858928d23bfd7d5bc557c82a83fb4" title="True if the output values are quantized to a particular resolution.">isQuantized</a>; <a name="l00673"></a>00673 desc-><a class="code" href="struct__VampOutputDescriptor.html#71aa40222dda4321030cccd0bb655fe3" title="Quantization resolution for returned results, if isQuantized.">quantizeStep</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3bed37153067b625b95acb40b60dbf0b" title="Quantization resolution of the output values (e.g.">quantizeStep</a>; <a name="l00674"></a>00674 <a name="l00675"></a>00675 <span class="keywordflow">switch</span> (od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a>) { <a name="l00676"></a>00676 <span class="keywordflow">case</span> <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c0459d5d0d2198d21e8bc90abe4fdccca" title="Results from each process() align with that call&#39;s block start.">Plugin::OutputDescriptor::OneSamplePerStep</a>: <a name="l00677"></a>00677 desc-><a class="code" href="struct__VampOutputDescriptor.html#5da1d27cc99badc214640e859b882072" title="Time positioning method for returned results (see VampSampleType).">sampleType</a> = <a class="code" href="vamp_8h.html#a24a8cee023d8b7659d25cbe0584b821b546deafd57f175fb1e7f9cbea1c5113" title="Each process call returns results aligned with call&#39;s block start.">vampOneSamplePerStep</a>; <span class="keywordflow">break</span>; <a name="l00678"></a>00678 <span class="keywordflow">case</span> <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c4c74bd2fc96dfe2815623f94b40e5629" title="Results are evenly spaced in time (sampleRate specified below).">Plugin::OutputDescriptor::FixedSampleRate</a>: <a name="l00679"></a>00679 desc-><a class="code" href="struct__VampOutputDescriptor.html#5da1d27cc99badc214640e859b882072" title="Time positioning method for returned results (see VampSampleType).">sampleType</a> = <a class="code" href="vamp_8h.html#a24a8cee023d8b7659d25cbe0584b821afc8a05f722bc83ecce227e12e838cf8" title="Returned results are evenly spaced at samplerate specified below.">vampFixedSampleRate</a>; <span class="keywordflow">break</span>; <a name="l00680"></a>00680 <span class="keywordflow">case</span> <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448cdea995a737867f7b22b52f1c43c5432e" title="Results are unevenly spaced and have individual timestamps.">Plugin::OutputDescriptor::VariableSampleRate</a>: <a name="l00681"></a>00681 desc-><a class="code" href="struct__VampOutputDescriptor.html#5da1d27cc99badc214640e859b882072" title="Time positioning method for returned results (see VampSampleType).">sampleType</a> = <a class="code" href="vamp_8h.html#a24a8cee023d8b7659d25cbe0584b821bae8a21a9e30eb73e16d6abc6c7415e8" title="Returned results have their own individual timestamps.">vampVariableSampleRate</a>; <span class="keywordflow">break</span>; <a name="l00682"></a>00682 } <a name="l00683"></a>00683 <a name="l00684"></a>00684 desc-><a class="code" href="struct__VampOutputDescriptor.html#1ccf193317b2b9c2eb0dbd8dcf61d26e" title="Sample rate of returned results, if sampleType is vampFixedSampleRate.">sampleRate</a> = od.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#dd0cbbdfa9c91764037c39365b1d42af" title="Sample rate of the output results, as samples per second.">sampleRate</a>; <a name="l00685"></a>00685 <a name="l00686"></a>00686 <span class="keywordflow">return</span> desc; <a name="l00687"></a>00687 } <a name="l00688"></a>00688 <a name="l00689"></a>00689 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> * <a name="l00690"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0eca18a4ae046e4ac1ebd25bb3ac5a08">00690</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#0eca18a4ae046e4ac1ebd25bb3ac5a08">PluginAdapterBase::Impl::process</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <a name="l00691"></a>00691 <span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a name="l00692"></a>00692 <span class="keywordtype">int</span> sec, <span class="keywordtype">int</span> nsec) <a name="l00693"></a>00693 { <a name="l00694"></a>00694 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::process" << std::endl;</span> <a name="l00695"></a>00695 <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> rt(sec, nsec); <a name="l00696"></a>00696 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8274f19566392f843cbf5f745308fd2c">checkOutputMap</a>(plugin); <a name="l00697"></a>00697 <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#550b4522bfbf1ad23297be28c51a4d72">convertFeatures</a>(plugin, plugin-><a class="code" href="classVamp_1_1Plugin.html#e4aed3bebfe80a2e2fccd3d37af26996" title="Process a single block of input data.">process</a>(inputBuffers, rt)); <a name="l00698"></a>00698 } <a name="l00699"></a>00699 <a name="l00700"></a>00700 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> * <a name="l00701"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9fe7df06eb951c259763d56c49544676">00701</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9fe7df06eb951c259763d56c49544676">PluginAdapterBase::Impl::getRemainingFeatures</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin) <a name="l00702"></a>00702 { <a name="l00703"></a>00703 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::getRemainingFeatures" << std::endl;</span> <a name="l00704"></a>00704 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#8274f19566392f843cbf5f745308fd2c">checkOutputMap</a>(plugin); <a name="l00705"></a>00705 <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#550b4522bfbf1ad23297be28c51a4d72">convertFeatures</a>(plugin, plugin-><a class="code" href="classVamp_1_1Plugin.html#eca2a26e658ba0314ba90d25dd2195d6" title="After all blocks have been processed, calculate and return any remaining features...">getRemainingFeatures</a>()); <a name="l00706"></a>00706 } <a name="l00707"></a>00707 <a name="l00708"></a>00708 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> * <a name="l00709"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#550b4522bfbf1ad23297be28c51a4d72">00709</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#550b4522bfbf1ad23297be28c51a4d72">PluginAdapterBase::Impl::convertFeatures</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <a name="l00710"></a>00710 <span class="keyword">const</span> <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">Plugin::FeatureSet</a> &features) <a name="l00711"></a>00711 { <a name="l00712"></a>00712 <span class="keywordtype">int</span> lastN = -1; <a name="l00713"></a>00713 <a name="l00714"></a>00714 <span class="keywordtype">int</span> outputCount = 0; <a name="l00715"></a>00715 <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin]) outputCount = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#193241eba6e9bcd3d4482c5f646d3822">m_pluginOutputs</a>[plugin]->size(); <a name="l00716"></a>00716 <a name="l00717"></a>00717 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#429c029c0068230d1afa97426b04ce0d">resizeFS</a>(plugin, outputCount); <a name="l00718"></a>00718 <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *fs = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin]; <a name="l00719"></a>00719 <a name="l00720"></a>00720 <span class="keywordflow">for</span> (Plugin::FeatureSet::const_iterator fi = features.begin(); <a name="l00721"></a>00721 fi != features.end(); ++fi) { <a name="l00722"></a>00722 <a name="l00723"></a>00723 <span class="keywordtype">int</span> n = fi->first; <a name="l00724"></a>00724 <a name="l00725"></a>00725 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::convertFeatures: n = " << n << std::endl;</span> <a name="l00726"></a>00726 <a name="l00727"></a>00727 <span class="keywordflow">if</span> (n >= <span class="keywordtype">int</span>(outputCount)) { <a name="l00728"></a>00728 std::cerr << <span class="stringliteral">"WARNING: PluginAdapterBase::Impl::convertFeatures: Too many outputs from plugin ("</span> << n+1 << <span class="stringliteral">", only should be "</span> << outputCount << <span class="stringliteral">")"</span> << std::endl; <a name="l00729"></a>00729 <span class="keywordflow">continue</span>; <a name="l00730"></a>00730 } <a name="l00731"></a>00731 <a name="l00732"></a>00732 <span class="keywordflow">if</span> (n > lastN + 1) { <a name="l00733"></a>00733 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = lastN + 1; i < n; ++i) { <a name="l00734"></a>00734 fs[i].<a class="code" href="struct__VampFeatureList.html#01db33a31ae5e04a4bd097f4b6aa75f1" title="Number of features in this feature list.">featureCount</a> = 0; <a name="l00735"></a>00735 } <a name="l00736"></a>00736 } <a name="l00737"></a>00737 <a name="l00738"></a>00738 <span class="keyword">const</span> <a class="code" href="classVamp_1_1Plugin.html#0730bc72c87fa02eb8d2854b233f7be1">Plugin::FeatureList</a> &fl = fi->second; <a name="l00739"></a>00739 <a name="l00740"></a>00740 <span class="keywordtype">size_t</span> sz = fl.size(); <a name="l00741"></a>00741 <span class="keywordflow">if</span> (sz > <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][n]) <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f5fcc5331f2dfa4c650eee636af72403">resizeFL</a>(plugin, n, sz); <a name="l00742"></a>00742 fs[n].<a class="code" href="struct__VampFeatureList.html#01db33a31ae5e04a4bd097f4b6aa75f1" title="Number of features in this feature list.">featureCount</a> = sz; <a name="l00743"></a>00743 <a name="l00744"></a>00744 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j < sz; ++j) { <a name="l00745"></a>00745 <a name="l00746"></a>00746 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::convertFeatures: j = " << j << std::endl;</span> <a name="l00747"></a>00747 <a name="l00748"></a>00748 <a class="code" href="struct__VampFeature.html">VampFeature</a> *feature = &fs[n].<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j]; <a name="l00749"></a>00749 <a name="l00750"></a>00750 feature-><a class="code" href="struct__VampFeature.html#be6aa7a08185beeb9deca2d08d99859f" title="1 if the feature has a timestamp (i.e.">hasTimestamp</a> = fl[j].hasTimestamp; <a name="l00751"></a>00751 feature-><a class="code" href="struct__VampFeature.html#31f0b57050e33d082692536097953d9c" title="Seconds component of timestamp.">sec</a> = fl[j].timestamp.sec; <a name="l00752"></a>00752 feature-><a class="code" href="struct__VampFeature.html#8874cb23600c6b10ca6e8a40920d999e" title="Nanoseconds component of timestamp.">nsec</a> = fl[j].timestamp.nsec; <a name="l00753"></a>00753 feature-><a class="code" href="struct__VampFeature.html#b1ce7c8a2b489e9b0694a967497a29fd" title="Number of values.">valueCount</a> = fl[j].values.size(); <a name="l00754"></a>00754 <a name="l00755"></a>00755 <span class="keywordflow">if</span> (feature-><a class="code" href="struct__VampFeature.html#6662b7489a7890cae713bf4e8f6d52cd" title="Label for this returned sample.">label</a>) free(feature-><a class="code" href="struct__VampFeature.html#6662b7489a7890cae713bf4e8f6d52cd" title="Label for this returned sample.">label</a>); <a name="l00756"></a>00756 <a name="l00757"></a>00757 <span class="keywordflow">if</span> (fl[j].label.empty()) { <a name="l00758"></a>00758 feature-><a class="code" href="struct__VampFeature.html#6662b7489a7890cae713bf4e8f6d52cd" title="Label for this returned sample.">label</a> = 0; <a name="l00759"></a>00759 } <span class="keywordflow">else</span> { <a name="l00760"></a>00760 feature-><a class="code" href="struct__VampFeature.html#6662b7489a7890cae713bf4e8f6d52cd" title="Label for this returned sample.">label</a> = strdup(fl[j].label.c_str()); <a name="l00761"></a>00761 } <a name="l00762"></a>00762 <a name="l00763"></a>00763 <span class="keywordflow">if</span> (feature-><a class="code" href="struct__VampFeature.html#b1ce7c8a2b489e9b0694a967497a29fd" title="Number of values.">valueCount</a> > <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">m_fvsizes</a>[plugin][n][j]) { <a name="l00764"></a>00764 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9b0791b97e91f8b8c3d18f3ed3bed861">resizeFV</a>(plugin, n, j, feature-><a class="code" href="struct__VampFeature.html#b1ce7c8a2b489e9b0694a967497a29fd" title="Number of values.">valueCount</a>); <a name="l00765"></a>00765 } <a name="l00766"></a>00766 <a name="l00767"></a>00767 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> k = 0; k < feature-><a class="code" href="struct__VampFeature.html#b1ce7c8a2b489e9b0694a967497a29fd" title="Number of values.">valueCount</a>; ++k) { <a name="l00768"></a>00768 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::convertFeatures: k = " << k << std::endl;</span> <a name="l00769"></a>00769 feature-><a class="code" href="struct__VampFeature.html#e4030f941ddb2bab8bc147b88e1f1c15" title="Values for this returned sample.">values</a>[k] = fl[j].values[k]; <a name="l00770"></a>00770 } <a name="l00771"></a>00771 } <a name="l00772"></a>00772 <a name="l00773"></a>00773 lastN = n; <a name="l00774"></a>00774 } <a name="l00775"></a>00775 <a name="l00776"></a>00776 <span class="keywordflow">if</span> (lastN == -1) <span class="keywordflow">return</span> 0; <a name="l00777"></a>00777 <a name="l00778"></a>00778 <span class="keywordflow">if</span> (<span class="keywordtype">int</span>(outputCount) > lastN + 1) { <a name="l00779"></a>00779 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = lastN + 1; i < int(outputCount); ++i) { <a name="l00780"></a>00780 fs[i].<a class="code" href="struct__VampFeatureList.html#01db33a31ae5e04a4bd097f4b6aa75f1" title="Number of features in this feature list.">featureCount</a> = 0; <a name="l00781"></a>00781 } <a name="l00782"></a>00782 } <a name="l00783"></a>00783 <a name="l00784"></a>00784 <span class="keywordflow">return</span> fs; <a name="l00785"></a>00785 } <a name="l00786"></a>00786 <a name="l00787"></a>00787 <span class="keywordtype">void</span> <a name="l00788"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#429c029c0068230d1afa97426b04ce0d">00788</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#429c029c0068230d1afa97426b04ce0d">PluginAdapterBase::Impl::resizeFS</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <span class="keywordtype">int</span> n) <a name="l00789"></a>00789 { <a name="l00790"></a>00790 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::resizeFS(" << plugin << ", " << n << ")" << std::endl;</span> <a name="l00791"></a>00791 <a name="l00792"></a>00792 <span class="keywordtype">int</span> i = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin].size(); <a name="l00793"></a>00793 <span class="keywordflow">if</span> (i >= n) <span class="keywordflow">return</span>; <a name="l00794"></a>00794 <a name="l00795"></a>00795 <span class="comment">// std::cerr << "resizing from " << i << std::endl;</span> <a name="l00796"></a>00796 <a name="l00797"></a>00797 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin] = (<a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *)realloc <a name="l00798"></a>00798 (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin], n * <span class="keyword">sizeof</span>(<a class="code" href="struct__VampFeatureList.html">VampFeatureList</a>)); <a name="l00799"></a>00799 <a name="l00800"></a>00800 <span class="keywordflow">while</span> (i < n) { <a name="l00801"></a>00801 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][i].featureCount = 0; <a name="l00802"></a>00802 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][i].features = 0; <a name="l00803"></a>00803 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin].push_back(0); <a name="l00804"></a>00804 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">m_fvsizes</a>[plugin].push_back(std::vector<size_t>()); <a name="l00805"></a>00805 i++; <a name="l00806"></a>00806 } <a name="l00807"></a>00807 } <a name="l00808"></a>00808 <a name="l00809"></a>00809 <span class="keywordtype">void</span> <a name="l00810"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f5fcc5331f2dfa4c650eee636af72403">00810</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#f5fcc5331f2dfa4c650eee636af72403">PluginAdapterBase::Impl::resizeFL</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <span class="keywordtype">int</span> n, <span class="keywordtype">size_t</span> sz) <a name="l00811"></a>00811 { <a name="l00812"></a>00812 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::resizeFL(" << plugin << ", " << n << ", "</span> <a name="l00813"></a>00813 <span class="comment">// << sz << ")" << std::endl;</span> <a name="l00814"></a>00814 <a name="l00815"></a>00815 <span class="keywordtype">size_t</span> i = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][n]; <a name="l00816"></a>00816 <span class="keywordflow">if</span> (i >= sz) <span class="keywordflow">return</span>; <a name="l00817"></a>00817 <a name="l00818"></a>00818 <span class="comment">// std::cerr << "resizing from " << i << std::endl;</span> <a name="l00819"></a>00819 <a name="l00820"></a>00820 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][n].features = (<a class="code" href="struct__VampFeature.html">VampFeature</a> *)realloc <a name="l00821"></a>00821 (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][n].features, sz * <span class="keyword">sizeof</span>(<a class="code" href="struct__VampFeature.html">VampFeature</a>)); <a name="l00822"></a>00822 <a name="l00823"></a>00823 <span class="keywordflow">while</span> (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][n] < sz) { <a name="l00824"></a>00824 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][n].features[<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][n]].valueCount = 0; <a name="l00825"></a>00825 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][n].features[<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][n]].values = 0; <a name="l00826"></a>00826 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][n].features[<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][n]].label = 0; <a name="l00827"></a>00827 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">m_fvsizes</a>[plugin][n].push_back(0); <a name="l00828"></a>00828 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#a9fa862a49d49fae2dc4b45bc23f5281">m_fsizes</a>[plugin][n]++; <a name="l00829"></a>00829 } <a name="l00830"></a>00830 } <a name="l00831"></a>00831 <a name="l00832"></a>00832 <span class="keywordtype">void</span> <a name="l00833"></a><a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9b0791b97e91f8b8c3d18f3ed3bed861">00833</a> <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#9b0791b97e91f8b8c3d18f3ed3bed861">PluginAdapterBase::Impl::resizeFV</a>(<a class="code" href="classVamp_1_1Plugin.html" title="Vamp::Plugin is a base class for plugin instance classes that provide feature extraction...">Plugin</a> *plugin, <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> j, <span class="keywordtype">size_t</span> sz) <a name="l00834"></a>00834 { <a name="l00835"></a>00835 <span class="comment">// std::cerr << "PluginAdapterBase::Impl::resizeFV(" << plugin << ", " << n << ", "</span> <a name="l00836"></a>00836 <span class="comment">// << j << ", " << sz << ")" << std::endl;</span> <a name="l00837"></a>00837 <a name="l00838"></a>00838 <span class="keywordtype">size_t</span> i = <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">m_fvsizes</a>[plugin][n][j]; <a name="l00839"></a>00839 <span class="keywordflow">if</span> (i >= sz) <span class="keywordflow">return</span>; <a name="l00840"></a>00840 <a name="l00841"></a>00841 <span class="comment">// std::cerr << "resizing from " << i << std::endl;</span> <a name="l00842"></a>00842 <a name="l00843"></a>00843 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][n].features[j].values = (<span class="keywordtype">float</span> *)realloc <a name="l00844"></a>00844 (<a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#4d3b0d23ae969d2895f13448d294455a">m_fs</a>[plugin][n].features[j].values, sz * <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); <a name="l00845"></a>00845 <a name="l00846"></a>00846 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#166ff8e5df4fcd27f74bc7179e14c33e">m_fvsizes</a>[plugin][n][j] = sz; <a name="l00847"></a>00847 } <a name="l00848"></a>00848 <a name="l00849"></a>00849 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#6c8f2c8fce370d586785353c939601d5">PluginAdapterBase::Impl::AdapterMap</a> * <a name="l00850"></a>00850 <a class="code" href="classVamp_1_1PluginAdapterBase_1_1Impl.html#3526d127572dd900de260ac90433d062">PluginAdapterBase::Impl::m_adapterMap</a> = 0; <a name="l00851"></a>00851 <a name="l00852"></a>00852 } <a name="l00853"></a>00853 </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jul 9 11:36:06 2008 for VampPluginSDK by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address> </body> </html>