view code-doc/PluginHostAdapter_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: PluginHostAdapter.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&nbsp;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>PluginHostAdapter.cpp</h1><a href="PluginHostAdapter_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="PluginHostAdapter_8h.html">PluginHostAdapter.h</a>"</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;cstdlib&gt;</span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="keyword">namespace </span>Vamp
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 
<a name="l00043"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#6535abd551acfbbaab381bbe1268cd49">00043</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#6535abd551acfbbaab381bbe1268cd49">PluginHostAdapter::PluginHostAdapter</a>(<span class="keyword">const</span> <a class="code" href="struct__VampPluginDescriptor.html">VampPluginDescriptor</a> *descriptor,
<a name="l00044"></a>00044                                      <span class="keywordtype">float</span> inputSampleRate) :
<a name="l00045"></a>00045     <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>(inputSampleRate),
<a name="l00046"></a>00046     m_descriptor(descriptor)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 <span class="comment">//    std::cerr &lt;&lt; "PluginHostAdapter::PluginHostAdapter (plugin = " &lt;&lt; descriptor-&gt;name &lt;&lt; ")" &lt;&lt; std::endl;</span>
<a name="l00049"></a>00049     <a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a> = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>, inputSampleRate);
<a name="l00050"></a>00050     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) {
<a name="l00051"></a>00051 <span class="comment">//        std::cerr &lt;&lt; "WARNING: PluginHostAdapter: Plugin instantiation failed for plugin " &lt;&lt; m_descriptor-&gt;name &lt;&lt; std::endl;</span>
<a name="l00052"></a>00052     }
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054 
<a name="l00055"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#b0f354cb332852ab1892488f6b8e8c0e">00055</a> PluginHostAdapter::~PluginHostAdapter()
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 <span class="comment">//    std::cerr &lt;&lt; "PluginHostAdapter::~PluginHostAdapter (plugin = " &lt;&lt; m_descriptor-&gt;name &lt;&lt; ")" &lt;&lt; std::endl;</span>
<a name="l00058"></a>00058     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#0e4522c33e59c3c518b9262f2477bc27" title="Destroy an instance of this plugin.">cleanup</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 std::vector&lt;std::string&gt;
<a name="l00062"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#08d7ed3a11bf4a3c30fa0f9b41a0fed6">00062</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#08d7ed3a11bf4a3c30fa0f9b41a0fed6">PluginHostAdapter::getPluginPath</a>()
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064     std::vector&lt;std::string&gt; path;
<a name="l00065"></a>00065     std::string envPath;
<a name="l00066"></a>00066 
<a name="l00067"></a>00067     <span class="keywordtype">char</span> *cpath = getenv(<span class="stringliteral">"VAMP_PATH"</span>);
<a name="l00068"></a>00068     <span class="keywordflow">if</span> (cpath) envPath = cpath;
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="preprocessor">#ifdef _WIN32</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define PATH_SEPARATOR ';'</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_VAMP_PATH "%ProgramFiles%\\Vamp Plugins"</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#define PATH_SEPARATOR ':'</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#ifdef __APPLE__</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_VAMP_PATH "$HOME/Library/Audio/Plug-Ins/Vamp:/Library/Audio/Plug-Ins/Vamp"</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_VAMP_PATH "$HOME/vamp:$HOME/.vamp:/usr/local/lib/vamp:/usr/lib/vamp"</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00081"></a>00081 <span class="preprocessor"></span>
<a name="l00082"></a>00082     <span class="keywordflow">if</span> (envPath == <span class="stringliteral">""</span>) {
<a name="l00083"></a>00083         envPath = <a class="code" href="PluginHostAdapter_8cpp.html#a7a9ce1e832e4f26cd5197ed38d4a58d">DEFAULT_VAMP_PATH</a>;
<a name="l00084"></a>00084         <span class="keywordtype">char</span> *chome = getenv(<span class="stringliteral">"HOME"</span>);
<a name="l00085"></a>00085         <span class="keywordflow">if</span> (chome) {
<a name="l00086"></a>00086             std::string home(chome);
<a name="l00087"></a>00087             std::string::size_type f;
<a name="l00088"></a>00088             <span class="keywordflow">while</span> ((f = envPath.find(<span class="stringliteral">"$HOME"</span>)) != std::string::npos &amp;&amp;
<a name="l00089"></a>00089                     f &lt; envPath.length()) {
<a name="l00090"></a>00090                 envPath.replace(f, 5, home);
<a name="l00091"></a>00091             }
<a name="l00092"></a>00092         }
<a name="l00093"></a>00093 <span class="preprocessor">#ifdef _WIN32</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span>        <span class="keywordtype">char</span> *cpfiles = getenv(<span class="stringliteral">"ProgramFiles"</span>);
<a name="l00095"></a>00095         <span class="keywordflow">if</span> (!cpfiles) cpfiles = <span class="stringliteral">"C:\\Program Files"</span>;
<a name="l00096"></a>00096         std::string pfiles(cpfiles);
<a name="l00097"></a>00097         std::string::size_type f;
<a name="l00098"></a>00098         <span class="keywordflow">while</span> ((f = envPath.find(<span class="stringliteral">"%ProgramFiles%"</span>)) != std::string::npos &amp;&amp;
<a name="l00099"></a>00099                f &lt; envPath.length()) {
<a name="l00100"></a>00100             envPath.replace(f, 14, pfiles);
<a name="l00101"></a>00101         }
<a name="l00102"></a>00102 <span class="preprocessor">#endif</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span>    }
<a name="l00104"></a>00104 
<a name="l00105"></a>00105     std::string::size_type index = 0, newindex = 0;
<a name="l00106"></a>00106 
<a name="l00107"></a>00107     <span class="keywordflow">while</span> ((newindex = envPath.find(<a class="code" href="PluginHostAdapter_8cpp.html#256a5721249aa3309437212cc21a9fe4">PATH_SEPARATOR</a>, index)) &lt; envPath.size()) {
<a name="l00108"></a>00108         path.push_back(envPath.substr(index, newindex - index));
<a name="l00109"></a>00109         index = newindex + 1;
<a name="l00110"></a>00110     }
<a name="l00111"></a>00111     
<a name="l00112"></a>00112     path.push_back(envPath.substr(index));
<a name="l00113"></a>00113 
<a name="l00114"></a>00114     <span class="keywordflow">return</span> path;
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="keywordtype">bool</span>
<a name="l00118"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#dd6a2f1ee7e47bd97fa599cead14b738">00118</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#dd6a2f1ee7e47bd97fa599cead14b738" title="Initialise a plugin to prepare it for use with the given number of input channels...">PluginHostAdapter::initialise</a>(<span class="keywordtype">size_t</span> channels,
<a name="l00119"></a>00119                               <span class="keywordtype">size_t</span> stepSize,
<a name="l00120"></a>00120                               <span class="keywordtype">size_t</span> blockSize)
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00123"></a>00123     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#d0978f17a5e568079470a1978a9aad22" title="Initialise an instance following parameter configuration.">initialise</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>, channels, stepSize, blockSize) ?
<a name="l00124"></a>00124         <span class="keyword">true</span> : <span class="keyword">false</span>;
<a name="l00125"></a>00125 }
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 <span class="keywordtype">void</span>
<a name="l00128"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#5d54c5bbd76bc27b7a243827148afeaa">00128</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#5d54c5bbd76bc27b7a243827148afeaa" title="Reset the plugin after use, to prepare it for another clean run.">PluginHostAdapter::reset</a>()
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span>;
<a name="l00131"></a>00131     <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133 
<a name="l00134"></a>00134 <a class="code" href="classVamp_1_1Plugin.html#39cb7649d6dcc20e4cb1640cd55907bc">PluginHostAdapter::InputDomain</a>
<a name="l00135"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#9c5239a4da67f1a426cd059e1a2856eb">00135</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#9c5239a4da67f1a426cd059e1a2856eb" title="Get the plugin&amp;#39;s required input domain.">PluginHostAdapter::getInputDomain</a>()<span class="keyword"> const</span>
<a name="l00136"></a>00136 <span class="keyword"></span>{
<a name="l00137"></a>00137     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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="l00138"></a>00138         <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1Plugin.html#39cb7649d6dcc20e4cb1640cd55907bca30e7877ab33f76acbdca28607e6ab53">FrequencyDomain</a>;
<a name="l00139"></a>00139     } <span class="keywordflow">else</span> {
<a name="l00140"></a>00140         <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1Plugin.html#39cb7649d6dcc20e4cb1640cd55907bcd4a9f31b958a43a9757af7893aa2e7ff">TimeDomain</a>;
<a name="l00141"></a>00141     }
<a name="l00142"></a>00142 }
<a name="l00143"></a>00143 
<a name="l00144"></a>00144 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00145"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#98aadddc8403eb46c9d8c5a9d1fdd19e">00145</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#98aadddc8403eb46c9d8c5a9d1fdd19e" title="Get the Vamp API compatibility level of the plugin.">PluginHostAdapter::getVampApiVersion</a>()<span class="keyword"> const</span>
<a name="l00146"></a>00146 <span class="keyword"></span>{
<a name="l00147"></a>00147     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#b6c87760e87ddaa9ac3491bccaaa28c2" title="API version with which this descriptor is compatible.">vampApiVersion</a>;
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 std::string
<a name="l00151"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#b27423a656f878d97d2ad2eba4e76c7a">00151</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#b27423a656f878d97d2ad2eba4e76c7a" title="Get the computer-usable name of the plugin.">PluginHostAdapter::getIdentifier</a>()<span class="keyword"> const</span>
<a name="l00152"></a>00152 <span class="keyword"></span>{
<a name="l00153"></a>00153     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#4915ec8276749cb505c01d25a6d02219" title="Computer-usable name of the plugin.">identifier</a>;
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 std::string
<a name="l00157"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#45f1d0377e233eeddd1b7cefb48be62a">00157</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#45f1d0377e233eeddd1b7cefb48be62a" title="Get a human-readable name or title of the plugin.">PluginHostAdapter::getName</a>()<span class="keyword"> const</span>
<a name="l00158"></a>00158 <span class="keyword"></span>{
<a name="l00159"></a>00159     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#9dd5a0190e4d453ff36b5acb7000b150" title="Human-readable name of the plugin.">name</a>;
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 std::string
<a name="l00163"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#5eaafcef030e81b90a3e77cf16cf8ae1">00163</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#5eaafcef030e81b90a3e77cf16cf8ae1" title="Get a human-readable description for the plugin, typically a line of text that may...">PluginHostAdapter::getDescription</a>()<span class="keyword"> const</span>
<a name="l00164"></a>00164 <span class="keyword"></span>{
<a name="l00165"></a>00165     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#9ff8050f92f1a04a68bb34a9d368295e" title="Human-readable short text about the plugin.">description</a>;
<a name="l00166"></a>00166 }
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 std::string
<a name="l00169"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#f572be0b175f5661559006a380a0f3db">00169</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#f572be0b175f5661559006a380a0f3db" title="Get the name of the author or vendor of the plugin in human-readable form.">PluginHostAdapter::getMaker</a>()<span class="keyword"> const</span>
<a name="l00170"></a>00170 <span class="keyword"></span>{
<a name="l00171"></a>00171     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#4dca3d57331802964716edfa80580c9b" title="Human-readable name of plugin&amp;#39;s author or vendor.">maker</a>;
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 
<a name="l00174"></a>00174 <span class="keywordtype">int</span>
<a name="l00175"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#6fbd94781867ca46a20368c2a3593c77">00175</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#6fbd94781867ca46a20368c2a3593c77" title="Get the version number of the plugin.">PluginHostAdapter::getPluginVersion</a>()<span class="keyword"> const</span>
<a name="l00176"></a>00176 <span class="keyword"></span>{
<a name="l00177"></a>00177     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#04427c420d9252c7796c0bf5101345ae" title="Version number of the plugin.">pluginVersion</a>;
<a name="l00178"></a>00178 }
<a name="l00179"></a>00179 
<a name="l00180"></a>00180 std::string
<a name="l00181"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#c73c9d6baad04369beee695e99584815">00181</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#c73c9d6baad04369beee695e99584815" title="Get the copyright statement or licensing summary for the plugin.">PluginHostAdapter::getCopyright</a>()<span class="keyword"> const</span>
<a name="l00182"></a>00182 <span class="keyword"></span>{
<a name="l00183"></a>00183     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#e704bba384af0de056a26da1b13ee521" title="Human-readable summary of copyright or licensing for plugin.">copyright</a>;
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185 
<a name="l00186"></a>00186 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">PluginHostAdapter::ParameterList</a>
<a name="l00187"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#bfa93b20d9b5651a32042a9bb7c8df13">00187</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#bfa93b20d9b5651a32042a9bb7c8df13" title="Get the controllable parameters of this plugin.">PluginHostAdapter::getParameterDescriptors</a>()<span class="keyword"> const</span>
<a name="l00188"></a>00188 <span class="keyword"></span>{
<a name="l00189"></a>00189     <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">ParameterList</a> list;
<a name="l00190"></a>00190     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#e6271dc3ea0cea959c84a64185492cab" title="Number of parameter inputs.">parameterCount</a>; ++i) {
<a name="l00191"></a>00191         <span class="keyword">const</span> <a class="code" href="struct__VampParameterDescriptor.html" title="C language API for Vamp plugins.">VampParameterDescriptor</a> *spd = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#64d614862604c31d6b84c49005f51913" title="Fixed descriptors for parameter inputs.">parameters</a>[i];
<a name="l00192"></a>00192         <a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html">ParameterDescriptor</a> pd;
<a name="l00193"></a>00193         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#116fd9f0dc94c2bc4bbc60b5443c598c" title="The name of the parameter, in computer-usable form.">identifier</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#26d74afd6a3341a673f15955031845ab" title="Computer-usable name of the parameter.">identifier</a>;
<a name="l00194"></a>00194         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#0ecebb94fb4ada4aad2640e20aa57084" title="The human-readable name of the parameter.">name</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#bba810bce9656f6002777f6c3f655957" title="Human-readable name of the parameter.">name</a>;
<a name="l00195"></a>00195         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#780ddad41e433d85c82f9ea4d959cbaf" title="A human-readable short text describing the parameter.">description</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#95489272d6cf5a5b487e949da8e4fac6" title="Human-readable short text about the parameter.">description</a>;
<a name="l00196"></a>00196         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#3bc3df322e4c02e17e96bc6d44982d7b" title="The unit of the parameter, in human-readable form.">unit</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#8ca235f816b56dc99125e010eee08fc7" title="Human-readable unit of the parameter.">unit</a>;
<a name="l00197"></a>00197         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b3e4d84f5bc199eea8b642b27e425ec8" title="The minimum value of the parameter.">minValue</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#b59c84f0bbe0d4d0c578d893c087b0db" title="Minimum value.">minValue</a>;
<a name="l00198"></a>00198         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b934b20dd708228a0e3c2811a3e2cec4" title="The maximum value of the parameter.">maxValue</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#6e7646babdb265c4abfc107ba4350d80" title="Maximum value.">maxValue</a>;
<a name="l00199"></a>00199         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#ec4ef77451ec02193ecc4a0856673fbc" title="The default value of the parameter.">defaultValue</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#3d37f986ee152ab55feb9902b35f7aca" title="Default value.">defaultValue</a>;
<a name="l00200"></a>00200         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#7c556d58d552f737ee5a34efdf7f9425" title="True if the parameter values are quantized to a particular resolution.">isQuantized</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#3f41e3b6b69c7a95ff0ce8625794f83a" title="1 if parameter values are quantized to a particular resolution.">isQuantized</a>;
<a name="l00201"></a>00201         pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#01f8387e7c853d5e4e35d4e9a37353d7" title="Quantization resolution of the parameter values (e.g.">quantizeStep</a> = spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#68c91fd3fc0b0b3617c2d343fe32d0e5" title="Quantization resolution, if isQuantized.">quantizeStep</a>;
<a name="l00202"></a>00202         <span class="keywordflow">if</span> (pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#7c556d58d552f737ee5a34efdf7f9425" title="True if the parameter values are quantized to a particular resolution.">isQuantized</a> &amp;&amp; spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>) {
<a name="l00203"></a>00203             <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>[j]; ++j) {
<a name="l00204"></a>00204                 pd.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#94df96f53835980b4739965007ff222b" title="Names for the quantized values.">valueNames</a>.push_back(spd-&gt;<a class="code" href="struct__VampParameterDescriptor.html#188883325ab1e4a898e3dc53a8f88f9d" title="Human-readable names of the values, if isQuantized.">valueNames</a>[j]);
<a name="l00205"></a>00205             }
<a name="l00206"></a>00206         }
<a name="l00207"></a>00207         list.push_back(pd);
<a name="l00208"></a>00208     }
<a name="l00209"></a>00209     <span class="keywordflow">return</span> list;
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211 
<a name="l00212"></a>00212 <span class="keywordtype">float</span>
<a name="l00213"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#f0c46d4f67ca93be7c76f3ea2e6c8efb">00213</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#f0c46d4f67ca93be7c76f3ea2e6c8efb" title="Get the value of a named parameter.">PluginHostAdapter::getParameter</a>(std::string param)<span class="keyword"> const</span>
<a name="l00214"></a>00214 <span class="keyword"></span>{
<a name="l00215"></a>00215     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> 0.0;
<a name="l00216"></a>00216 
<a name="l00217"></a>00217     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#e6271dc3ea0cea959c84a64185492cab" title="Number of parameter inputs.">parameterCount</a>; ++i) {
<a name="l00218"></a>00218         <span class="keywordflow">if</span> (param == <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#64d614862604c31d6b84c49005f51913" title="Fixed descriptors for parameter inputs.">parameters</a>[i]-&gt;<a class="code" href="struct__VampParameterDescriptor.html#26d74afd6a3341a673f15955031845ab" title="Computer-usable name of the parameter.">identifier</a>) {
<a name="l00219"></a>00219             <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#07174981875b55ee2ec7521a7f4fc395" title="Get a parameter value.">getParameter</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>, i);
<a name="l00220"></a>00220         }
<a name="l00221"></a>00221     }
<a name="l00222"></a>00222 
<a name="l00223"></a>00223     <span class="keywordflow">return</span> 0.0;
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225 
<a name="l00226"></a>00226 <span class="keywordtype">void</span>
<a name="l00227"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#29f75395aa75b9de0228aa11edf9c6d6">00227</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#29f75395aa75b9de0228aa11edf9c6d6" title="Set a named parameter.">PluginHostAdapter::setParameter</a>(std::string param, 
<a name="l00228"></a>00228                                 <span class="keywordtype">float</span> value)
<a name="l00229"></a>00229 {
<a name="l00230"></a>00230     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span>;
<a name="l00231"></a>00231 
<a name="l00232"></a>00232     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#e6271dc3ea0cea959c84a64185492cab" title="Number of parameter inputs.">parameterCount</a>; ++i) {
<a name="l00233"></a>00233         <span class="keywordflow">if</span> (param == <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#64d614862604c31d6b84c49005f51913" title="Fixed descriptors for parameter inputs.">parameters</a>[i]-&gt;<a class="code" href="struct__VampParameterDescriptor.html#26d74afd6a3341a673f15955031845ab" title="Computer-usable name of the parameter.">identifier</a>) {
<a name="l00234"></a>00234             <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#ad3cfc7a3b432df40bd9db13eee6a481" title="Set a parameter value.">setParameter</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>, i, value);
<a name="l00235"></a>00235             <span class="keywordflow">return</span>;
<a name="l00236"></a>00236         }
<a name="l00237"></a>00237     }
<a name="l00238"></a>00238 }
<a name="l00239"></a>00239 
<a name="l00240"></a>00240 <a class="code" href="classVamp_1_1PluginBase.html#7f66f00437b21e5f694fe02356b12f20">PluginHostAdapter::ProgramList</a>
<a name="l00241"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#7ac5681dcfe08b7b8a796bffc0aff3e3">00241</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#7ac5681dcfe08b7b8a796bffc0aff3e3" title="Get the program settings available in this plugin.">PluginHostAdapter::getPrograms</a>()<span class="keyword"> const</span>
<a name="l00242"></a>00242 <span class="keyword"></span>{
<a name="l00243"></a>00243     <a class="code" href="classVamp_1_1PluginBase.html#7f66f00437b21e5f694fe02356b12f20">ProgramList</a> list;
<a name="l00244"></a>00244     
<a name="l00245"></a>00245     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#1962666aa173e7a9a2c30dc82e4b2e00" title="Number of programs.">programCount</a>; ++i) {
<a name="l00246"></a>00246         list.push_back(<a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#d488470c582d8472d86455889d71c5ec" title="Fixed names for programs.">programs</a>[i]);
<a name="l00247"></a>00247     }
<a name="l00248"></a>00248     
<a name="l00249"></a>00249     <span class="keywordflow">return</span> list;
<a name="l00250"></a>00250 }
<a name="l00251"></a>00251 
<a name="l00252"></a>00252 std::string
<a name="l00253"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#34859eff8ca8d862af39be9636ec1867">00253</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#34859eff8ca8d862af39be9636ec1867" title="Get the current program.">PluginHostAdapter::getCurrentProgram</a>()<span class="keyword"> const</span>
<a name="l00254"></a>00254 <span class="keyword"></span>{
<a name="l00255"></a>00255     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
<a name="l00256"></a>00256 
<a name="l00257"></a>00257     <span class="keywordtype">int</span> pn = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#861a77525a95d424cb846820b018af53" title="Get the current program (if programCount &amp;gt; 0).">getCurrentProgram</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00258"></a>00258     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#d488470c582d8472d86455889d71c5ec" title="Fixed names for programs.">programs</a>[pn];
<a name="l00259"></a>00259 }
<a name="l00260"></a>00260 
<a name="l00261"></a>00261 <span class="keywordtype">void</span>
<a name="l00262"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#8f5515ab34cc13d9403ccc6b4b788683">00262</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#8f5515ab34cc13d9403ccc6b4b788683" title="Select a program.">PluginHostAdapter::selectProgram</a>(std::string program)
<a name="l00263"></a>00263 {
<a name="l00264"></a>00264     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span>;
<a name="l00265"></a>00265 
<a name="l00266"></a>00266     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#1962666aa173e7a9a2c30dc82e4b2e00" title="Number of programs.">programCount</a>; ++i) {
<a name="l00267"></a>00267         <span class="keywordflow">if</span> (program == <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#d488470c582d8472d86455889d71c5ec" title="Fixed names for programs.">programs</a>[i]) {
<a name="l00268"></a>00268             <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#d9af40cb165ca187e49250964af5f5cf" title="Set the current program.">selectProgram</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>, i);
<a name="l00269"></a>00269             <span class="keywordflow">return</span>;
<a name="l00270"></a>00270         }
<a name="l00271"></a>00271     }
<a name="l00272"></a>00272 }
<a name="l00273"></a>00273 
<a name="l00274"></a>00274 <span class="keywordtype">size_t</span>
<a name="l00275"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#859ad5d59402691daed3cf1af1899ebe">00275</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#859ad5d59402691daed3cf1af1899ebe" title="Get the preferred step size (window increment -- the distance in sample frames between...">PluginHostAdapter::getPreferredStepSize</a>()<span class="keyword"> const</span>
<a name="l00276"></a>00276 <span class="keyword"></span>{
<a name="l00277"></a>00277     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> 0;
<a name="l00278"></a>00278     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#2beddf2ce156c05dd24477ac663adcbb" title="Get the plugin&amp;#39;s preferred processing window increment in samples.">getPreferredStepSize</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00279"></a>00279 }
<a name="l00280"></a>00280 
<a name="l00281"></a>00281 <span class="keywordtype">size_t</span>
<a name="l00282"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#d5e0ea8042bdec4dd18428991117e07a">00282</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#d5e0ea8042bdec4dd18428991117e07a" title="Get the preferred block size (window size -- the number of sample frames passed in...">PluginHostAdapter::getPreferredBlockSize</a>()<span class="keyword"> const</span>
<a name="l00283"></a>00283 <span class="keyword"></span>{
<a name="l00284"></a>00284     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> 0;
<a name="l00285"></a>00285     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#c626e42554ab1532c8d8b5132a0faee8" title="Get the plugin&amp;#39;s preferred processing window size in samples.">getPreferredBlockSize</a>(<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00286"></a>00286 }
<a name="l00287"></a>00287 
<a name="l00288"></a>00288 <span class="keywordtype">size_t</span>
<a name="l00289"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#67d1198c0e58d3f0076d0eda599ff28d">00289</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#67d1198c0e58d3f0076d0eda599ff28d" title="Get the minimum supported number of input channels.">PluginHostAdapter::getMinChannelCount</a>()<span class="keyword"> const</span>
<a name="l00290"></a>00290 <span class="keyword"></span>{
<a name="l00291"></a>00291     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> 0;
<a name="l00292"></a>00292     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00293"></a>00293 }
<a name="l00294"></a>00294 
<a name="l00295"></a>00295 <span class="keywordtype">size_t</span>
<a name="l00296"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#25091905e97e39d515d8ffc1a9f2b9e0">00296</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#25091905e97e39d515d8ffc1a9f2b9e0" title="Get the maximum supported number of input channels.">PluginHostAdapter::getMaxChannelCount</a>()<span class="keyword"> const</span>
<a name="l00297"></a>00297 <span class="keyword"></span>{
<a name="l00298"></a>00298     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> 0;
<a name="l00299"></a>00299     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00300"></a>00300 }
<a name="l00301"></a>00301 
<a name="l00302"></a>00302 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">PluginHostAdapter::OutputList</a>
<a name="l00303"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#e02670cca9d25cdc4100cbe7a12e3e68">00303</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#e02670cca9d25cdc4100cbe7a12e3e68" title="Get the outputs of this plugin.">PluginHostAdapter::getOutputDescriptors</a>()<span class="keyword"> const</span>
<a name="l00304"></a>00304 <span class="keyword"></span>{
<a name="l00305"></a>00305     <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> list;
<a name="l00306"></a>00306     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) {
<a name="l00307"></a>00307 <span class="comment">//        std::cerr &lt;&lt; "PluginHostAdapter::getOutputDescriptors: no handle " &lt;&lt; std::endl;</span>
<a name="l00308"></a>00308         <span class="keywordflow">return</span> list;
<a name="l00309"></a>00309     }
<a name="l00310"></a>00310 
<a name="l00311"></a>00311     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00312"></a>00312 
<a name="l00313"></a>00313     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; count; ++i) {
<a name="l00314"></a>00314         <a class="code" href="struct__VampOutputDescriptor.html">VampOutputDescriptor</a> *sd = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>, i);
<a name="l00315"></a>00315         <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html">OutputDescriptor</a> d;
<a name="l00316"></a>00316         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#461161b2010370176115967e4f58a5f5" title="Computer-usable name of the output.">identifier</a>;
<a name="l00317"></a>00317         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#f4fca576bd47167fd2bf9b43d588815f" title="Human-readable name of the output.">name</a>;
<a name="l00318"></a>00318         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#bfa911b138cfb80cf63e8f2e0fa0fb89" title="Human-readable short text about the output.">description</a>;
<a name="l00319"></a>00319         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#d038caa8e596dfd037035637202f1d63" title="Human-readable name of the unit of the output.">unit</a>;
<a name="l00320"></a>00320         d.<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> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#e8571f5a2bc740738af0cb7dda0c4749" title="1 if output has equal number of values for each returned result.">hasFixedBinCount</a>;
<a name="l00321"></a>00321         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#652ee422092720e44d23d98bdb68f978" title="Number of values per result, if hasFixedBinCount.">binCount</a>;
<a name="l00322"></a>00322         <span class="keywordflow">if</span> (d.<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="l00323"></a>00323             <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j &lt; sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#652ee422092720e44d23d98bdb68f978" title="Number of values per result, if hasFixedBinCount.">binCount</a>; ++j) {
<a name="l00324"></a>00324                 d.<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>.push_back(sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>[j] ? sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#10fffaa32bd894843ff7592240dfe447" title="Names of returned value bins, if hasFixedBinCount.">binNames</a>[j] : <span class="stringliteral">""</span>);
<a name="l00325"></a>00325             }
<a name="l00326"></a>00326         }
<a name="l00327"></a>00327         d.<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> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#f6b512d772023b4e852216689c1c4465" title="1 if each returned value falls within the same fixed min/max range.">hasKnownExtents</a>;
<a name="l00328"></a>00328         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#c9f5924c0be7571bba8e7ae7e7a921f4" title="Minimum value of the results in the output.">minValue</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#9a28180989e3d028c12a98517479dc46" title="Minimum value for a returned result in any bin, if hasKnownExtents.">minValue</a>;
<a name="l00329"></a>00329         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#907b4e8fbb48a46ac5a05f880d72719f" title="Maximum value of the results in the output.">maxValue</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#4cbe540a247df60f85b00b2aa16461ee" title="Maximum value for a returned result in any bin, if hasKnownExtents.">maxValue</a>;
<a name="l00330"></a>00330         d.<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> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#b56cf0bbb17136819024574d5cc65e30" title="1 if returned results are quantized to a particular resolution.">isQuantized</a>;
<a name="l00331"></a>00331         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3bed37153067b625b95acb40b60dbf0b" title="Quantization resolution of the output values (e.g.">quantizeStep</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#71aa40222dda4321030cccd0bb655fe3" title="Quantization resolution for returned results, if isQuantized.">quantizeStep</a>;
<a name="l00332"></a>00332 
<a name="l00333"></a>00333         <span class="keywordflow">switch</span> (sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#5da1d27cc99badc214640e859b882072" title="Time positioning method for returned results (see VampSampleType).">sampleType</a>) {
<a name="l00334"></a>00334         <span class="keywordflow">case</span> <a class="code" href="vamp_8h.html#a24a8cee023d8b7659d25cbe0584b821b546deafd57f175fb1e7f9cbea1c5113" title="Each process call returns results aligned with call&amp;#39;s block start.">vampOneSamplePerStep</a>:
<a name="l00335"></a>00335             d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c0459d5d0d2198d21e8bc90abe4fdccca" title="Results from each process() align with that call&amp;#39;s block start.">OutputDescriptor::OneSamplePerStep</a>; <span class="keywordflow">break</span>;
<a name="l00336"></a>00336         <span class="keywordflow">case</span> <a class="code" href="vamp_8h.html#a24a8cee023d8b7659d25cbe0584b821afc8a05f722bc83ecce227e12e838cf8" title="Returned results are evenly spaced at samplerate specified below.">vampFixedSampleRate</a>:
<a name="l00337"></a>00337             d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c4c74bd2fc96dfe2815623f94b40e5629" title="Results are evenly spaced in time (sampleRate specified below).">OutputDescriptor::FixedSampleRate</a>; <span class="keywordflow">break</span>;
<a name="l00338"></a>00338         <span class="keywordflow">case</span> <a class="code" href="vamp_8h.html#a24a8cee023d8b7659d25cbe0584b821bae8a21a9e30eb73e16d6abc6c7415e8" title="Returned results have their own individual timestamps.">vampVariableSampleRate</a>:
<a name="l00339"></a>00339             d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448cdea995a737867f7b22b52f1c43c5432e" title="Results are unevenly spaced and have individual timestamps.">OutputDescriptor::VariableSampleRate</a>; <span class="keywordflow">break</span>;
<a name="l00340"></a>00340         }
<a name="l00341"></a>00341 
<a name="l00342"></a>00342         d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#dd0cbbdfa9c91764037c39365b1d42af" title="Sample rate of the output results, as samples per second.">sampleRate</a> = sd-&gt;<a class="code" href="struct__VampOutputDescriptor.html#1ccf193317b2b9c2eb0dbd8dcf61d26e" title="Sample rate of returned results, if sampleType is vampFixedSampleRate.">sampleRate</a>;
<a name="l00343"></a>00343 
<a name="l00344"></a>00344         list.push_back(d);
<a name="l00345"></a>00345 
<a name="l00346"></a>00346         <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#8cc38edc921616e67e551aa03397ec79" title="Destroy a descriptor for a feature output.">releaseOutputDescriptor</a>(sd);
<a name="l00347"></a>00347     }
<a name="l00348"></a>00348 
<a name="l00349"></a>00349     <span class="keywordflow">return</span> list;
<a name="l00350"></a>00350 }
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">PluginHostAdapter::FeatureSet</a>
<a name="l00353"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#82c29a512c0587ea0121eee4b0c2a684">00353</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#82c29a512c0587ea0121eee4b0c2a684" title="Process a single block of input data.">PluginHostAdapter::process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers,
<a name="l00354"></a>00354                            <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> timestamp)
<a name="l00355"></a>00355 {
<a name="l00356"></a>00356     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs;
<a name="l00357"></a>00357     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> fs;
<a name="l00358"></a>00358 
<a name="l00359"></a>00359     <span class="keywordtype">int</span> sec = timestamp.<a class="code" href="structVamp_1_1RealTime.html#b4d81983384a9f57ce064e6c343f2267">sec</a>;
<a name="l00360"></a>00360     <span class="keywordtype">int</span> nsec = timestamp.<a class="code" href="structVamp_1_1RealTime.html#2078835bef7bb92514a65b6051cfc6c8">nsec</a>;
<a name="l00361"></a>00361     
<a name="l00362"></a>00362     <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *features = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>,
<a name="l00363"></a>00363                                                       inputBuffers,
<a name="l00364"></a>00364                                                       sec, nsec);
<a name="l00365"></a>00365     
<a name="l00366"></a>00366     <a class="code" href="classVamp_1_1PluginHostAdapter.html#ee417a4c9ba9dbb63777c963d5f9452a">convertFeatures</a>(features, fs);
<a name="l00367"></a>00367     <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#c4bafe8ad2734d21a433d745b18e7d63" title="Release a feature set returned from process or getRemainingFeatures.">releaseFeatureSet</a>(features);
<a name="l00368"></a>00368     <span class="keywordflow">return</span> fs;
<a name="l00369"></a>00369 }
<a name="l00370"></a>00370 
<a name="l00371"></a>00371 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">PluginHostAdapter::FeatureSet</a>
<a name="l00372"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#d3f5f16a89a821da2ec1186fd2062e83">00372</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#d3f5f16a89a821da2ec1186fd2062e83" title="After all blocks have been processed, calculate and return any remaining features...">PluginHostAdapter::getRemainingFeatures</a>()
<a name="l00373"></a>00373 {
<a name="l00374"></a>00374     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs;
<a name="l00375"></a>00375     <span class="keywordflow">if</span> (!<a class="code" href="classVamp_1_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>) <span class="keywordflow">return</span> fs;
<a name="l00376"></a>00376     
<a name="l00377"></a>00377     <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *features = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>); 
<a name="l00378"></a>00378 
<a name="l00379"></a>00379     <a class="code" href="classVamp_1_1PluginHostAdapter.html#ee417a4c9ba9dbb63777c963d5f9452a">convertFeatures</a>(features, fs);
<a name="l00380"></a>00380     <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<a class="code" href="struct__VampPluginDescriptor.html#c4bafe8ad2734d21a433d745b18e7d63" title="Release a feature set returned from process or getRemainingFeatures.">releaseFeatureSet</a>(features);
<a name="l00381"></a>00381     <span class="keywordflow">return</span> fs;
<a name="l00382"></a>00382 }
<a name="l00383"></a>00383 
<a name="l00384"></a>00384 <span class="keywordtype">void</span>
<a name="l00385"></a><a class="code" href="classVamp_1_1PluginHostAdapter.html#ee417a4c9ba9dbb63777c963d5f9452a">00385</a> <a class="code" href="classVamp_1_1PluginHostAdapter.html#ee417a4c9ba9dbb63777c963d5f9452a">PluginHostAdapter::convertFeatures</a>(<a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> *features,
<a name="l00386"></a>00386                                    <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> &amp;fs)
<a name="l00387"></a>00387 {
<a name="l00388"></a>00388     <span class="keywordflow">if</span> (!features) <span class="keywordflow">return</span>;
<a name="l00389"></a>00389 
<a name="l00390"></a>00390     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> outputs = <a class="code" href="classVamp_1_1PluginHostAdapter.html#0c9f252aca8ac298e30cadd0de032ec2">m_descriptor</a>-&gt;<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_1PluginHostAdapter.html#02ebd03b226b4a467cad747ce77e79ee">m_handle</a>);
<a name="l00391"></a>00391 
<a name="l00392"></a>00392     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; outputs; ++i) {
<a name="l00393"></a>00393         
<a name="l00394"></a>00394         <a class="code" href="struct__VampFeatureList.html">VampFeatureList</a> &amp;list = features[i];
<a name="l00395"></a>00395 
<a name="l00396"></a>00396         <span class="keywordflow">if</span> (list.<a class="code" href="struct__VampFeatureList.html#01db33a31ae5e04a4bd097f4b6aa75f1" title="Number of features in this feature list.">featureCount</a> &gt; 0) {
<a name="l00397"></a>00397 
<a name="l00398"></a>00398             <a class="code" href="structVamp_1_1Plugin_1_1Feature.html">Feature</a> feature;
<a name="l00399"></a>00399             feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.reserve(list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[0].<a class="code" href="struct__VampFeature.html#b1ce7c8a2b489e9b0694a967497a29fd" title="Number of values.">valueCount</a>);
<a name="l00400"></a>00400 
<a name="l00401"></a>00401             <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j &lt; list.<a class="code" href="struct__VampFeatureList.html#01db33a31ae5e04a4bd097f4b6aa75f1" title="Number of features in this feature list.">featureCount</a>; ++j) {
<a name="l00402"></a>00402 
<a name="l00403"></a>00403                 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#98907091d0b6a589720ae35ae588a82b" title="True if an output feature has its own timestamp.">hasTimestamp</a> = list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#be6aa7a08185beeb9deca2d08d99859f" title="1 if the feature has a timestamp (i.e.">hasTimestamp</a>;
<a name="l00404"></a>00404                 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#caa605f36839c07e76f4882f5e22d8d7" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a>(list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#31f0b57050e33d082692536097953d9c" title="Seconds component of timestamp.">sec</a>,
<a name="l00405"></a>00405                                              list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#8874cb23600c6b10ca6e8a40920d999e" title="Nanoseconds component of timestamp.">nsec</a>);
<a name="l00406"></a>00406 
<a name="l00407"></a>00407                 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> k = 0; k &lt; list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#b1ce7c8a2b489e9b0694a967497a29fd" title="Number of values.">valueCount</a>; ++k) {
<a name="l00408"></a>00408                     feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.push_back(list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#e4030f941ddb2bab8bc147b88e1f1c15" title="Values for this returned sample.">values</a>[k]);
<a name="l00409"></a>00409                 }
<a name="l00410"></a>00410 
<a name="l00411"></a>00411                 <span class="keywordflow">if</span> (list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#6662b7489a7890cae713bf4e8f6d52cd" title="Label for this returned sample.">label</a>) {
<a name="l00412"></a>00412                     feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#6662b7489a7890cae713bf4e8f6d52cd" title="Label for this returned sample.">label</a>;
<a name="l00413"></a>00413                 }
<a name="l00414"></a>00414 
<a name="l00415"></a>00415                 fs[i].push_back(feature);
<a name="l00416"></a>00416 
<a name="l00417"></a>00417                 <span class="keywordflow">if</span> (list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#b1ce7c8a2b489e9b0694a967497a29fd" title="Number of values.">valueCount</a> &gt; 0) {
<a name="l00418"></a>00418                     feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.clear();
<a name="l00419"></a>00419                 }
<a name="l00420"></a>00420 
<a name="l00421"></a>00421                 <span class="keywordflow">if</span> (list.<a class="code" href="struct__VampFeatureList.html#a2d18873fd5e58354460ea77fc48692f" title="Features in this feature list.">features</a>[j].<a class="code" href="struct__VampFeature.html#6662b7489a7890cae713bf4e8f6d52cd" title="Label for this returned sample.">label</a>) {
<a name="l00422"></a>00422                     feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>;
<a name="l00423"></a>00423                 }
<a name="l00424"></a>00424             }
<a name="l00425"></a>00425         }
<a name="l00426"></a>00426     }
<a name="l00427"></a>00427 }
<a name="l00428"></a>00428 
<a name="l00429"></a>00429 }
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Jul 9 11:36:06 2008 for VampPluginSDK by&nbsp;
<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>