view code-doc/PluginBufferingAdapter_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: PluginBufferingAdapter.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>&nbsp;&raquo&nbsp;<a class="el" href="dir_fa454903fff8cd477733ebe28a3468c0.html">hostext</a>
  </div>
</div>
</div>
<h1>PluginBufferingAdapter.cpp</h1><a href="PluginBufferingAdapter_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-2007 Chris Cannam and QMUL.</span>
<a name="l00010"></a>00010 <span class="comment">    This file by Mark Levy and Chris Cannam.</span>
<a name="l00011"></a>00011 <span class="comment">  </span>
<a name="l00012"></a>00012 <span class="comment">    Permission is hereby granted, free of charge, to any person</span>
<a name="l00013"></a>00013 <span class="comment">    obtaining a copy of this software and associated documentation</span>
<a name="l00014"></a>00014 <span class="comment">    files (the "Software"), to deal in the Software without</span>
<a name="l00015"></a>00015 <span class="comment">    restriction, including without limitation the rights to use, copy,</span>
<a name="l00016"></a>00016 <span class="comment">    modify, merge, publish, distribute, sublicense, and/or sell copies</span>
<a name="l00017"></a>00017 <span class="comment">    of the Software, and to permit persons to whom the Software is</span>
<a name="l00018"></a>00018 <span class="comment">    furnished to do so, subject to the following conditions:</span>
<a name="l00019"></a>00019 <span class="comment"></span>
<a name="l00020"></a>00020 <span class="comment">    The above copyright notice and this permission notice shall be</span>
<a name="l00021"></a>00021 <span class="comment">    included in all copies or substantial portions of the Software.</span>
<a name="l00022"></a>00022 <span class="comment"></span>
<a name="l00023"></a>00023 <span class="comment">    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</span>
<a name="l00024"></a>00024 <span class="comment">    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span>
<a name="l00025"></a>00025 <span class="comment">    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span>
<a name="l00026"></a>00026 <span class="comment">    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR</span>
<a name="l00027"></a>00027 <span class="comment">    ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF</span>
<a name="l00028"></a>00028 <span class="comment">    CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span>
<a name="l00029"></a>00029 <span class="comment">    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span>
<a name="l00030"></a>00030 <span class="comment"></span>
<a name="l00031"></a>00031 <span class="comment">    Except as contained in this notice, the names of the Centre for</span>
<a name="l00032"></a>00032 <span class="comment">    Digital Music; Queen Mary, University of London; and Chris Cannam</span>
<a name="l00033"></a>00033 <span class="comment">    shall not be used in advertising or otherwise to promote the sale,</span>
<a name="l00034"></a>00034 <span class="comment">    use or other dealings in this Software without prior written</span>
<a name="l00035"></a>00035 <span class="comment">    authorization.</span>
<a name="l00036"></a>00036 <span class="comment">*/</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="preprocessor">#include "<a class="code" href="PluginBufferingAdapter_8h.html">PluginBufferingAdapter.h</a>"</span>
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="keyword">using</span> std::vector;
<a name="l00044"></a>00044 <span class="keyword">using</span> std::map;
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="keyword">namespace </span>Vamp {
<a name="l00047"></a>00047         
<a name="l00048"></a><a class="code" href="namespaceVamp_1_1HostExt.html">00048</a> <span class="keyword">namespace </span>HostExt {
<a name="l00049"></a>00049                 
<a name="l00050"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html">00050</a> <span class="keyword">class </span><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html">PluginBufferingAdapter::Impl</a>
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052 <span class="keyword">public</span>:
<a name="l00053"></a>00053     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#97990c497a954220254172f2554e608e">Impl</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">float</span> inputSampleRate);
<a name="l00054"></a>00054     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#772d000b68dde932323ed39ab65e1a9a">~Impl</a>();
<a name="l00055"></a>00055                 
<a name="l00056"></a>00056     <span class="keywordtype">bool</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4b2bbe763ec728b5494145abcebca2e2">initialise</a>(<span class="keywordtype">size_t</span> channels, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize);
<a name="l00057"></a>00057 
<a name="l00058"></a>00058     <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4e8dcacfca3f1b82ac7d70c9d3ddddaf">getOutputDescriptors</a>() <span class="keyword">const</span>;
<a name="l00059"></a>00059 
<a name="l00060"></a>00060     <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#102263ad3dc229a1292792d73da2f0a1">reset</a>();
<a name="l00061"></a>00061 
<a name="l00062"></a>00062     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#03718981c892400287483cc8501adfeb">process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> timestamp);
<a name="l00063"></a>00063                 
<a name="l00064"></a>00064     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#242913f6f438bef150e270cbeeacf711">getRemainingFeatures</a>();
<a name="l00065"></a>00065                 
<a name="l00066"></a>00066 <span class="keyword">protected</span>:
<a name="l00067"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html">00067</a>     <span class="keyword">class </span><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html">RingBuffer</a>
<a name="l00068"></a>00068     {
<a name="l00069"></a>00069     <span class="keyword">public</span>:
<a name="l00070"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3ee5e4cfee66645629063b1db5cffa96">00070</a>         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3ee5e4cfee66645629063b1db5cffa96">RingBuffer</a>(<span class="keywordtype">int</span> n) :
<a name="l00071"></a>00071             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a>(new float[n+1]), <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a>(0), <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a>(0), <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>(n+1) { }
<a name="l00072"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f1e12002a506cc1433793e7b93e73b80">00072</a>         <span class="keyword">virtual</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f1e12002a506cc1433793e7b93e73b80">~RingBuffer</a>() { <span class="keyword">delete</span>[] <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a>; }
<a name="l00073"></a>00073 
<a name="l00074"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#205516271035fef2e94bb1af17b6c47d">00074</a>         <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#205516271035fef2e94bb1af17b6c47d">getSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>-1; }
<a name="l00075"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#c3eba9efa4b5bdb4bfa9907ad9203fe1">00075</a>         <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#c3eba9efa4b5bdb4bfa9907ad9203fe1">reset</a>() { <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a> = 0; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a> = 0; }
<a name="l00076"></a>00076 
<a name="l00077"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#830be6afbe2b46f0c9cd6071cf287cf8">00077</a>         <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#830be6afbe2b46f0c9cd6071cf287cf8">getReadSpace</a>()<span class="keyword"> const </span>{
<a name="l00078"></a>00078             <span class="keywordtype">int</span> writer = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a>, reader = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a>, space;
<a name="l00079"></a>00079             <span class="keywordflow">if</span> (writer &gt; reader) space = writer - reader;
<a name="l00080"></a>00080             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (writer &lt; reader) space = (writer + <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>) - reader;
<a name="l00081"></a>00081             <span class="keywordflow">else</span> space = 0;
<a name="l00082"></a>00082             <span class="keywordflow">return</span> space;
<a name="l00083"></a>00083         }
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f9edfe7748168802019429af240bcc74">00085</a>         <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f9edfe7748168802019429af240bcc74">getWriteSpace</a>()<span class="keyword"> const </span>{
<a name="l00086"></a>00086             <span class="keywordtype">int</span> writer = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a>;
<a name="l00087"></a>00087             <span class="keywordtype">int</span> reader = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a>;
<a name="l00088"></a>00088             <span class="keywordtype">int</span> space = (reader + <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a> - writer - 1);
<a name="l00089"></a>00089             <span class="keywordflow">if</span> (space &gt;= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>) space -= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>;
<a name="l00090"></a>00090             <span class="keywordflow">return</span> space;
<a name="l00091"></a>00091         }
<a name="l00092"></a>00092         
<a name="l00093"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#c68e9b2b24e1ac17f017c80ade70b355">00093</a>         <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#c68e9b2b24e1ac17f017c80ade70b355">peek</a>(<span class="keywordtype">float</span> *destination, <span class="keywordtype">int</span> n)<span class="keyword"> const </span>{
<a name="l00094"></a>00094 
<a name="l00095"></a>00095             <span class="keywordtype">int</span> available = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#830be6afbe2b46f0c9cd6071cf287cf8">getReadSpace</a>();
<a name="l00096"></a>00096 
<a name="l00097"></a>00097             <span class="keywordflow">if</span> (n &gt; available) {
<a name="l00098"></a>00098                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = available; i &lt; n; ++i) {
<a name="l00099"></a>00099                     destination[i] = 0.f;
<a name="l00100"></a>00100                 }
<a name="l00101"></a>00101                 n = available;
<a name="l00102"></a>00102             }
<a name="l00103"></a>00103             <span class="keywordflow">if</span> (n == 0) <span class="keywordflow">return</span> n;
<a name="l00104"></a>00104 
<a name="l00105"></a>00105             <span class="keywordtype">int</span> reader = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a>;
<a name="l00106"></a>00106             <span class="keywordtype">int</span> here = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a> - reader;
<a name="l00107"></a>00107             <span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> bufbase = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a> + reader;
<a name="l00108"></a>00108 
<a name="l00109"></a>00109             <span class="keywordflow">if</span> (here &gt;= n) {
<a name="l00110"></a>00110                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) {
<a name="l00111"></a>00111                     destination[i] = bufbase[i];
<a name="l00112"></a>00112                 }
<a name="l00113"></a>00113             } <span class="keywordflow">else</span> {
<a name="l00114"></a>00114                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; here; ++i) {
<a name="l00115"></a>00115                     destination[i] = bufbase[i];
<a name="l00116"></a>00116                 }
<a name="l00117"></a>00117                 <span class="keywordtype">float</span> *<span class="keyword">const</span> destbase = destination + here;
<a name="l00118"></a>00118                 <span class="keyword">const</span> <span class="keywordtype">int</span> nh = n - here;
<a name="l00119"></a>00119                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; nh; ++i) {
<a name="l00120"></a>00120                     destbase[i] = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a>[i];
<a name="l00121"></a>00121                 }
<a name="l00122"></a>00122             }
<a name="l00123"></a>00123 
<a name="l00124"></a>00124             <span class="keywordflow">return</span> n;
<a name="l00125"></a>00125         }
<a name="l00126"></a>00126 
<a name="l00127"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#62e7a7a8fd76bf3f04add2a7b6932211">00127</a>         <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#62e7a7a8fd76bf3f04add2a7b6932211">skip</a>(<span class="keywordtype">int</span> n) {
<a name="l00128"></a>00128             
<a name="l00129"></a>00129             <span class="keywordtype">int</span> available = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#830be6afbe2b46f0c9cd6071cf287cf8">getReadSpace</a>();
<a name="l00130"></a>00130             <span class="keywordflow">if</span> (n &gt; available) {
<a name="l00131"></a>00131                 n = available;
<a name="l00132"></a>00132             }
<a name="l00133"></a>00133             <span class="keywordflow">if</span> (n == 0) <span class="keywordflow">return</span> n;
<a name="l00134"></a>00134 
<a name="l00135"></a>00135             <span class="keywordtype">int</span> reader = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a>;
<a name="l00136"></a>00136             reader += n;
<a name="l00137"></a>00137             <span class="keywordflow">while</span> (reader &gt;= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>) reader -= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>;
<a name="l00138"></a>00138             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a> = reader;
<a name="l00139"></a>00139             <span class="keywordflow">return</span> n;
<a name="l00140"></a>00140         }
<a name="l00141"></a>00141         
<a name="l00142"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#8e5b1d24ec4534563c48439980368135">00142</a>         <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#8e5b1d24ec4534563c48439980368135">write</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *source, <span class="keywordtype">int</span> n) {
<a name="l00143"></a>00143 
<a name="l00144"></a>00144             <span class="keywordtype">int</span> available = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f9edfe7748168802019429af240bcc74">getWriteSpace</a>();
<a name="l00145"></a>00145             <span class="keywordflow">if</span> (n &gt; available) {
<a name="l00146"></a>00146                 n = available;
<a name="l00147"></a>00147             }
<a name="l00148"></a>00148             <span class="keywordflow">if</span> (n == 0) <span class="keywordflow">return</span> n;
<a name="l00149"></a>00149 
<a name="l00150"></a>00150             <span class="keywordtype">int</span> writer = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a>;
<a name="l00151"></a>00151             <span class="keywordtype">int</span> here = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a> - writer;
<a name="l00152"></a>00152             <span class="keywordtype">float</span> *<span class="keyword">const</span> bufbase = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a> + writer;
<a name="l00153"></a>00153             
<a name="l00154"></a>00154             <span class="keywordflow">if</span> (here &gt;= n) {
<a name="l00155"></a>00155                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) {
<a name="l00156"></a>00156                     bufbase[i] = source[i];
<a name="l00157"></a>00157                 }
<a name="l00158"></a>00158             } <span class="keywordflow">else</span> {
<a name="l00159"></a>00159                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; here; ++i) {
<a name="l00160"></a>00160                     bufbase[i] = source[i];
<a name="l00161"></a>00161                 }
<a name="l00162"></a>00162                 <span class="keyword">const</span> <span class="keywordtype">int</span> nh = n - here;
<a name="l00163"></a>00163                 <span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> srcbase = source + here;
<a name="l00164"></a>00164                 <span class="keywordtype">float</span> *<span class="keyword">const</span> buf = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a>;
<a name="l00165"></a>00165                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; nh; ++i) {
<a name="l00166"></a>00166                     buf[i] = srcbase[i];
<a name="l00167"></a>00167                 }
<a name="l00168"></a>00168             }
<a name="l00169"></a>00169 
<a name="l00170"></a>00170             writer += n;
<a name="l00171"></a>00171             <span class="keywordflow">while</span> (writer &gt;= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>) writer -= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>;
<a name="l00172"></a>00172             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a> = writer;
<a name="l00173"></a>00173 
<a name="l00174"></a>00174             <span class="keywordflow">return</span> n;
<a name="l00175"></a>00175         }
<a name="l00176"></a>00176 
<a name="l00177"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f9d1d2df1f27bd2399b81c82ee9af6df">00177</a>         <span class="keywordtype">int</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f9d1d2df1f27bd2399b81c82ee9af6df">zero</a>(<span class="keywordtype">int</span> n) {
<a name="l00178"></a>00178             
<a name="l00179"></a>00179             <span class="keywordtype">int</span> available = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#f9edfe7748168802019429af240bcc74">getWriteSpace</a>();
<a name="l00180"></a>00180             <span class="keywordflow">if</span> (n &gt; available) {
<a name="l00181"></a>00181                 n = available;
<a name="l00182"></a>00182             }
<a name="l00183"></a>00183             <span class="keywordflow">if</span> (n == 0) <span class="keywordflow">return</span> n;
<a name="l00184"></a>00184 
<a name="l00185"></a>00185             <span class="keywordtype">int</span> writer = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a>;
<a name="l00186"></a>00186             <span class="keywordtype">int</span> here = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a> - writer;
<a name="l00187"></a>00187             <span class="keywordtype">float</span> *<span class="keyword">const</span> bufbase = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a> + writer;
<a name="l00188"></a>00188 
<a name="l00189"></a>00189             <span class="keywordflow">if</span> (here &gt;= n) {
<a name="l00190"></a>00190                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) {
<a name="l00191"></a>00191                     bufbase[i] = 0.f;
<a name="l00192"></a>00192                 }
<a name="l00193"></a>00193             } <span class="keywordflow">else</span> {
<a name="l00194"></a>00194                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; here; ++i) {
<a name="l00195"></a>00195                     bufbase[i] = 0.f;
<a name="l00196"></a>00196                 }
<a name="l00197"></a>00197                 <span class="keyword">const</span> <span class="keywordtype">int</span> nh = n - here;
<a name="l00198"></a>00198                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; nh; ++i) {
<a name="l00199"></a>00199                     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a>[i] = 0.f;
<a name="l00200"></a>00200                 }
<a name="l00201"></a>00201             }
<a name="l00202"></a>00202             
<a name="l00203"></a>00203             writer += n;
<a name="l00204"></a>00204             <span class="keywordflow">while</span> (writer &gt;= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>) writer -= <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>;
<a name="l00205"></a>00205             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a> = writer;
<a name="l00206"></a>00206 
<a name="l00207"></a>00207             <span class="keywordflow">return</span> n;
<a name="l00208"></a>00208         }
<a name="l00209"></a>00209 
<a name="l00210"></a>00210     <span class="keyword">protected</span>:
<a name="l00211"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">00211</a>         <span class="keywordtype">float</span> *<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#4cdf77619ee8e8650b1c71da3ba9b758">m_buffer</a>;
<a name="l00212"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">00212</a>         <span class="keywordtype">int</span>    <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3798697f4cf46c5e9a5433e1bf160b2c">m_writer</a>;
<a name="l00213"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">00213</a>         <span class="keywordtype">int</span>    <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#1775ce5ba3d60520c3634cb2ac8a1dc9">m_reader</a>;
<a name="l00214"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">00214</a>         <span class="keywordtype">int</span>    <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#fe3fe238440e3afe3aa1a8d3b6270e3a">m_size</a>;
<a name="l00215"></a>00215 
<a name="l00216"></a>00216     <span class="keyword">private</span>:
<a name="l00217"></a>00217         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#3ee5e4cfee66645629063b1db5cffa96">RingBuffer</a>(<span class="keyword">const</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html">RingBuffer</a> &amp;); <span class="comment">// not provided</span>
<a name="l00218"></a>00218         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html">RingBuffer</a> &amp;<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html#7166d8a3f7312064f9b2bb1e874ca8ef">operator=</a>(<span class="keyword">const</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html">RingBuffer</a> &amp;); <span class="comment">// not provided</span>
<a name="l00219"></a>00219     };
<a name="l00220"></a>00220 
<a name="l00221"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">00221</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> *<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>;
<a name="l00222"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#6140f55c9120314194d3e73a54b25139">00222</a>     <span class="keywordtype">size_t</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#6140f55c9120314194d3e73a54b25139">m_inputStepSize</a>;
<a name="l00223"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">00223</a>     <span class="keywordtype">size_t</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">m_inputBlockSize</a>;
<a name="l00224"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">00224</a>     <span class="keywordtype">size_t</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a>;
<a name="l00225"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">00225</a>     <span class="keywordtype">size_t</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>;
<a name="l00226"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">00226</a>     <span class="keywordtype">size_t</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a>;
<a name="l00227"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">00227</a>     vector&lt;RingBuffer *&gt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>;
<a name="l00228"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">00228</a>     <span class="keywordtype">float</span> **<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">m_buffers</a>;
<a name="l00229"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#cc747b4e448a316346f9f59e2c85dcfc">00229</a>     <span class="keywordtype">float</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#cc747b4e448a316346f9f59e2c85dcfc">m_inputSampleRate</a>;
<a name="l00230"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#26fe691e7c9ddf55bb55b3d4eb80d8a7">00230</a>     <span class="keywordtype">long</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#26fe691e7c9ddf55bb55b3d4eb80d8a7">m_frame</a>;
<a name="l00231"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#fa825144d91babf38fb27aa7c287dc1e">00231</a>     <span class="keywordtype">bool</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#fa825144d91babf38fb27aa7c287dc1e">m_unrun</a>;
<a name="l00232"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#e65848a6788b5c984635d252fbc8365c">00232</a>     <span class="keyword">mutable</span> <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#e65848a6788b5c984635d252fbc8365c">m_outputs</a>;
<a name="l00233"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#c3055f44b2a62c1a7aa915e180ed054b">00233</a>     <span class="keyword">mutable</span> std::map&lt;int, bool&gt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#c3055f44b2a62c1a7aa915e180ed054b">m_rewriteOutputTimes</a>;
<a name="l00234"></a>00234                 
<a name="l00235"></a>00235     <span class="keywordtype">void</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#65f718273e06cb3d2e0ef09ca173aa54">processBlock</a>(<a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a>&amp; allFeatureSets);
<a name="l00236"></a>00236 };
<a name="l00237"></a>00237                 
<a name="l00238"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#1276bcfcbe1414b33eeefbd7b2b702fe">00238</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#1276bcfcbe1414b33eeefbd7b2b702fe">PluginBufferingAdapter::PluginBufferingAdapter</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="l00239"></a>00239     <a class="code" href="classVamp_1_1HostExt_1_1PluginWrapper.html" title="PluginWrapper is a simple base class for adapter plugins.">PluginWrapper</a>(plugin)
<a name="l00240"></a>00240 {
<a name="l00241"></a>00241     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#51e10c9c63c0349fd74c6d604de5554e">m_impl</a> = <span class="keyword">new</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html">Impl</a>(plugin, <a class="code" href="classVamp_1_1Plugin.html#59b9dd82a4f4eb946cd0474cc81abc23">m_inputSampleRate</a>);
<a name="l00242"></a>00242 }
<a name="l00243"></a>00243                 
<a name="l00244"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#539423b54a4ede511476125f4a97d977">00244</a> PluginBufferingAdapter::~PluginBufferingAdapter()
<a name="l00245"></a>00245 {
<a name="l00246"></a>00246     <span class="keyword">delete</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#51e10c9c63c0349fd74c6d604de5554e">m_impl</a>;
<a name="l00247"></a>00247 }
<a name="l00248"></a>00248                 
<a name="l00249"></a>00249 <span class="keywordtype">bool</span>
<a name="l00250"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#9e7798ba4d7870db46502ab541ab37a8">00250</a> PluginBufferingAdapter::initialise(<span class="keywordtype">size_t</span> channels, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize)
<a name="l00251"></a>00251 {
<a name="l00252"></a>00252     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#51e10c9c63c0349fd74c6d604de5554e">m_impl</a>-&gt;<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4b2bbe763ec728b5494145abcebca2e2">initialise</a>(channels, stepSize, blockSize);
<a name="l00253"></a>00253 }
<a name="l00254"></a>00254 
<a name="l00255"></a>00255 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">PluginBufferingAdapter::OutputList</a>
<a name="l00256"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#85a027f5859efb31d315205e234e94c0">00256</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#85a027f5859efb31d315205e234e94c0" title="Get the outputs of this plugin.">PluginBufferingAdapter::getOutputDescriptors</a>()<span class="keyword"> const</span>
<a name="l00257"></a>00257 <span class="keyword"></span>{
<a name="l00258"></a>00258     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#51e10c9c63c0349fd74c6d604de5554e">m_impl</a>-&gt;<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4e8dcacfca3f1b82ac7d70c9d3ddddaf">getOutputDescriptors</a>();
<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_1HostExt_1_1PluginBufferingAdapter.html#131fd9fe8a1795d7370d8a721176868a">00262</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#131fd9fe8a1795d7370d8a721176868a" title="Reset the plugin after use, to prepare it for another clean run.">PluginBufferingAdapter::reset</a>()
<a name="l00263"></a>00263 {
<a name="l00264"></a>00264     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#51e10c9c63c0349fd74c6d604de5554e">m_impl</a>-&gt;<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#102263ad3dc229a1292792d73da2f0a1">reset</a>();
<a name="l00265"></a>00265 }
<a name="l00266"></a>00266                 
<a name="l00267"></a>00267 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">PluginBufferingAdapter::FeatureSet</a>
<a name="l00268"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#262206b978d9de28ee4bb35f437e915e">00268</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#262206b978d9de28ee4bb35f437e915e" title="Process a single block of input data.">PluginBufferingAdapter::process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers,
<a name="l00269"></a>00269                                 <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> timestamp)
<a name="l00270"></a>00270 {
<a name="l00271"></a>00271     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#51e10c9c63c0349fd74c6d604de5554e">m_impl</a>-&gt;<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#03718981c892400287483cc8501adfeb">process</a>(inputBuffers, timestamp);
<a name="l00272"></a>00272 }
<a name="l00273"></a>00273                 
<a name="l00274"></a>00274 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">PluginBufferingAdapter::FeatureSet</a>
<a name="l00275"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#8771cba75552aaa1340b68de9bf1659c">00275</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#8771cba75552aaa1340b68de9bf1659c" title="After all blocks have been processed, calculate and return any remaining features...">PluginBufferingAdapter::getRemainingFeatures</a>()
<a name="l00276"></a>00276 {
<a name="l00277"></a>00277     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#51e10c9c63c0349fd74c6d604de5554e">m_impl</a>-&gt;<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#242913f6f438bef150e270cbeeacf711">getRemainingFeatures</a>();
<a name="l00278"></a>00278 }
<a name="l00279"></a>00279                 
<a name="l00280"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#97990c497a954220254172f2554e608e">00280</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#97990c497a954220254172f2554e608e">PluginBufferingAdapter::Impl::Impl</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">float</span> inputSampleRate) :
<a name="l00281"></a>00281     <a class="code" href="classVamp_1_1HostExt_1_1PluginWrapper.html#b4e40ecd98b445e1a2aa9e7baa280ea2">m_plugin</a>(plugin),
<a name="l00282"></a>00282     m_inputStepSize(0),
<a name="l00283"></a>00283     m_inputBlockSize(0),
<a name="l00284"></a>00284     m_stepSize(0),
<a name="l00285"></a>00285     m_blockSize(0),
<a name="l00286"></a>00286     m_channels(0), 
<a name="l00287"></a>00287     m_queue(0),
<a name="l00288"></a>00288     m_buffers(0),
<a name="l00289"></a>00289     <a class="code" href="classVamp_1_1Plugin.html#59b9dd82a4f4eb946cd0474cc81abc23">m_inputSampleRate</a>(inputSampleRate),
<a name="l00290"></a>00290     m_frame(0),
<a name="l00291"></a>00291     m_unrun(true)
<a name="l00292"></a>00292 {
<a name="l00293"></a>00293     (void)<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4e8dcacfca3f1b82ac7d70c9d3ddddaf">getOutputDescriptors</a>(); <span class="comment">// set up m_outputs and m_rewriteOutputTimes</span>
<a name="l00294"></a>00294 }
<a name="l00295"></a>00295                 
<a name="l00296"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#772d000b68dde932323ed39ab65e1a9a">00296</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#772d000b68dde932323ed39ab65e1a9a">PluginBufferingAdapter::Impl::~Impl</a>()
<a name="l00297"></a>00297 {
<a name="l00298"></a>00298     <span class="comment">// the adapter will delete the plugin</span>
<a name="l00299"></a>00299 
<a name="l00300"></a>00300     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a>; ++i) {
<a name="l00301"></a>00301         <span class="keyword">delete</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[i];
<a name="l00302"></a>00302         <span class="keyword">delete</span>[] <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">m_buffers</a>[i];
<a name="l00303"></a>00303     }
<a name="l00304"></a>00304     <span class="keyword">delete</span>[] <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">m_buffers</a>;
<a name="l00305"></a>00305 }
<a name="l00306"></a>00306 
<a name="l00307"></a>00307 <span class="keywordtype">size_t</span>
<a name="l00308"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#2e66d009df69c951001e5d2786973d60">00308</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter.html#2e66d009df69c951001e5d2786973d60" title="Get the preferred step size (window increment -- the distance in sample frames between...">PluginBufferingAdapter::getPreferredStepSize</a>()<span class="keyword"> const</span>
<a name="l00309"></a>00309 <span class="keyword"></span>{
<a name="l00310"></a>00310     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginWrapper.html#2c62a656313a819650656643a867ad01" title="Get the preferred block size (window size -- the number of sample frames passed in...">getPreferredBlockSize</a>();
<a name="l00311"></a>00311 }
<a name="l00312"></a>00312                 
<a name="l00313"></a>00313 <span class="keywordtype">bool</span>
<a name="l00314"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4b2bbe763ec728b5494145abcebca2e2">00314</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4b2bbe763ec728b5494145abcebca2e2">PluginBufferingAdapter::Impl::initialise</a>(<span class="keywordtype">size_t</span> channels, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize)
<a name="l00315"></a>00315 {
<a name="l00316"></a>00316     <span class="keywordflow">if</span> (stepSize != blockSize) {
<a name="l00317"></a>00317         std::cerr &lt;&lt; <span class="stringliteral">"PluginBufferingAdapter::initialise: input stepSize must be equal to blockSize for this adapter (stepSize = "</span> &lt;&lt; stepSize &lt;&lt; <span class="stringliteral">", blockSize = "</span> &lt;&lt; blockSize &lt;&lt; <span class="stringliteral">")"</span> &lt;&lt; std::endl;
<a name="l00318"></a>00318         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00319"></a>00319     }
<a name="l00320"></a>00320 
<a name="l00321"></a>00321     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a> = channels;      
<a name="l00322"></a>00322     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#6140f55c9120314194d3e73a54b25139">m_inputStepSize</a> = stepSize;
<a name="l00323"></a>00323     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">m_inputBlockSize</a> = blockSize;
<a name="l00324"></a>00324     
<a name="l00325"></a>00325     <span class="comment">// use the step and block sizes which the plugin prefers</span>
<a name="l00326"></a>00326     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<a class="code" href="classVamp_1_1Plugin.html#514c716c22f81c055f19b56c3f882567" title="Get the preferred step size (window increment -- the distance in sample frames between...">getPreferredStepSize</a>();
<a name="l00327"></a>00327     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<a class="code" href="classVamp_1_1Plugin.html#a529adf83f87a603954eb31407602aac" title="Get the preferred block size (window size -- the number of sample frames passed in...">getPreferredBlockSize</a>();
<a name="l00328"></a>00328     
<a name="l00329"></a>00329     <span class="comment">// or sensible defaults if it has no preference</span>
<a name="l00330"></a>00330     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> == 0) {
<a name="l00331"></a>00331         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> = 1024;
<a name="l00332"></a>00332     }
<a name="l00333"></a>00333     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> == 0) {
<a name="l00334"></a>00334         <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<a class="code" href="classVamp_1_1Plugin.html#e1d317a9702cbeda65ddf0ec500c1ff6" title="Get the plugin&amp;#39;s required input domain.">getInputDomain</a>() == <a class="code" href="classVamp_1_1Plugin.html#39cb7649d6dcc20e4cb1640cd55907bca30e7877ab33f76acbdca28607e6ab53">Vamp::Plugin::FrequencyDomain</a>) {
<a name="l00335"></a>00335             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>/2;
<a name="l00336"></a>00336         } <span class="keywordflow">else</span> {
<a name="l00337"></a>00337             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>;
<a name="l00338"></a>00338         }
<a name="l00339"></a>00339     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> &gt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>) {
<a name="l00340"></a>00340         <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<a class="code" href="classVamp_1_1Plugin.html#e1d317a9702cbeda65ddf0ec500c1ff6" title="Get the plugin&amp;#39;s required input domain.">getInputDomain</a>() == <a class="code" href="classVamp_1_1Plugin.html#39cb7649d6dcc20e4cb1640cd55907bca30e7877ab33f76acbdca28607e6ab53">Vamp::Plugin::FrequencyDomain</a>) {
<a name="l00341"></a>00341             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> * 2;
<a name="l00342"></a>00342         } <span class="keywordflow">else</span> {
<a name="l00343"></a>00343             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a>;
<a name="l00344"></a>00344         }
<a name="l00345"></a>00345     }
<a name="l00346"></a>00346     
<a name="l00347"></a>00347     std::cerr &lt;&lt; <span class="stringliteral">"PluginBufferingAdapter::initialise: stepSize "</span> &lt;&lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#6140f55c9120314194d3e73a54b25139">m_inputStepSize</a> &lt;&lt; <span class="stringliteral">" -&gt; "</span> &lt;&lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> 
<a name="l00348"></a>00348               &lt;&lt; <span class="stringliteral">", blockSize "</span> &lt;&lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">m_inputBlockSize</a> &lt;&lt; <span class="stringliteral">" -&gt; "</span> &lt;&lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> &lt;&lt; std::endl;                      
<a name="l00349"></a>00349     
<a name="l00350"></a>00350     <span class="comment">// current implementation breaks if step is greater than block</span>
<a name="l00351"></a>00351     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> &gt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>) {
<a name="l00352"></a>00352         std::cerr &lt;&lt; <span class="stringliteral">"PluginBufferingAdapter::initialise: plugin's preferred stepSize greater than blockSize, giving up!"</span> &lt;&lt; std::endl;
<a name="l00353"></a>00353         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00354"></a>00354     }
<a name="l00355"></a>00355 
<a name="l00356"></a>00356     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">m_buffers</a> = <span class="keyword">new</span> <span class="keywordtype">float</span> *[<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a>];
<a name="l00357"></a>00357 
<a name="l00358"></a>00358     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a>; ++i) {
<a name="l00359"></a>00359         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>.push_back(<span class="keyword">new</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl_1_1RingBuffer.html">RingBuffer</a>(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> + <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">m_inputBlockSize</a>));
<a name="l00360"></a>00360         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">m_buffers</a>[i] = <span class="keyword">new</span> <span class="keywordtype">float</span>[<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>];
<a name="l00361"></a>00361     }
<a name="l00362"></a>00362     
<a name="l00363"></a>00363     <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<a class="code" href="classVamp_1_1Plugin.html#f26212cf5fc511b603a8b48034247822" title="Initialise a plugin to prepare it for use with the given number of input channels...">initialise</a>(m_channels, <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a>, <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>);
<a name="l00364"></a>00364 }
<a name="l00365"></a>00365                 
<a name="l00366"></a>00366 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">PluginBufferingAdapter::OutputList</a>
<a name="l00367"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4e8dcacfca3f1b82ac7d70c9d3ddddaf">00367</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#4e8dcacfca3f1b82ac7d70c9d3ddddaf">PluginBufferingAdapter::Impl::getOutputDescriptors</a>()<span class="keyword"> const</span>
<a name="l00368"></a>00368 <span class="keyword"></span>{
<a name="l00369"></a>00369     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#e65848a6788b5c984635d252fbc8365c">m_outputs</a>.empty()) {
<a name="l00370"></a>00370         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#e65848a6788b5c984635d252fbc8365c">m_outputs</a> = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<a class="code" href="classVamp_1_1Plugin.html#d064d5d132b5c9bd7064f429c3309e35" title="Get the outputs of this plugin.">getOutputDescriptors</a>();
<a name="l00371"></a>00371     }
<a name="l00372"></a>00372 
<a name="l00373"></a>00373     <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">PluginBufferingAdapter::OutputList</a> outs = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#e65848a6788b5c984635d252fbc8365c">m_outputs</a>;
<a name="l00374"></a>00374 
<a name="l00375"></a>00375     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; outs.size(); ++i) {
<a name="l00376"></a>00376 
<a name="l00377"></a>00377         <span class="keywordflow">switch</span> (outs[i].sampleType) {
<a name="l00378"></a>00378 
<a name="l00379"></a>00379         <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&amp;#39;s block start.">OutputDescriptor::OneSamplePerStep</a>:
<a name="l00380"></a>00380             outs[i].sampleType = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c4c74bd2fc96dfe2815623f94b40e5629" title="Results are evenly spaced in time (sampleRate specified below).">OutputDescriptor::FixedSampleRate</a>;
<a name="l00381"></a>00381             outs[i].sampleRate = (1.f / <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#cc747b4e448a316346f9f59e2c85dcfc">m_inputSampleRate</a>) * <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a>;
<a name="l00382"></a>00382             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#c3055f44b2a62c1a7aa915e180ed054b">m_rewriteOutputTimes</a>[i] = <span class="keyword">true</span>;
<a name="l00383"></a>00383             <span class="keywordflow">break</span>;
<a name="l00384"></a>00384             
<a name="l00385"></a>00385         <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).">OutputDescriptor::FixedSampleRate</a>:
<a name="l00386"></a>00386             <span class="keywordflow">if</span> (outs[i].sampleRate == 0.f) {
<a name="l00387"></a>00387                 outs[i].sampleRate = (1.f / <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#cc747b4e448a316346f9f59e2c85dcfc">m_inputSampleRate</a>) * <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a>;
<a name="l00388"></a>00388             }
<a name="l00389"></a>00389             <span class="comment">// We actually only need to rewrite output times for</span>
<a name="l00390"></a>00390             <span class="comment">// features that don't have timestamps already, but we</span>
<a name="l00391"></a>00391             <span class="comment">// can't tell from here whether our features will have</span>
<a name="l00392"></a>00392             <span class="comment">// timestamps or not</span>
<a name="l00393"></a>00393             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#c3055f44b2a62c1a7aa915e180ed054b">m_rewriteOutputTimes</a>[i] = <span class="keyword">true</span>;
<a name="l00394"></a>00394             <span class="keywordflow">break</span>;
<a name="l00395"></a>00395 
<a name="l00396"></a>00396         <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.">OutputDescriptor::VariableSampleRate</a>:
<a name="l00397"></a>00397             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#c3055f44b2a62c1a7aa915e180ed054b">m_rewriteOutputTimes</a>[i] = <span class="keyword">false</span>;
<a name="l00398"></a>00398             <span class="keywordflow">break</span>;
<a name="l00399"></a>00399         }
<a name="l00400"></a>00400     }
<a name="l00401"></a>00401 
<a name="l00402"></a>00402     <span class="keywordflow">return</span> outs;
<a name="l00403"></a>00403 }
<a name="l00404"></a>00404 
<a name="l00405"></a>00405 <span class="keywordtype">void</span>
<a name="l00406"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#102263ad3dc229a1292792d73da2f0a1">00406</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#102263ad3dc229a1292792d73da2f0a1">PluginBufferingAdapter::Impl::reset</a>()
<a name="l00407"></a>00407 {
<a name="l00408"></a>00408     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#26fe691e7c9ddf55bb55b3d4eb80d8a7">m_frame</a> = 0;
<a name="l00409"></a>00409     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#fa825144d91babf38fb27aa7c287dc1e">m_unrun</a> = <span class="keyword">true</span>;
<a name="l00410"></a>00410 
<a name="l00411"></a>00411     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>.size(); ++i) {
<a name="l00412"></a>00412         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[i]-&gt;reset();
<a name="l00413"></a>00413     }
<a name="l00414"></a>00414 }
<a name="l00415"></a>00415 
<a name="l00416"></a>00416 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">PluginBufferingAdapter::FeatureSet</a>
<a name="l00417"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#03718981c892400287483cc8501adfeb">00417</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#03718981c892400287483cc8501adfeb">PluginBufferingAdapter::Impl::process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers,
<a name="l00418"></a>00418                                       <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> timestamp)
<a name="l00419"></a>00419 {
<a name="l00420"></a>00420     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> allFeatureSets;
<a name="l00421"></a>00421 
<a name="l00422"></a>00422     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#fa825144d91babf38fb27aa7c287dc1e">m_unrun</a>) {
<a name="l00423"></a>00423         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#26fe691e7c9ddf55bb55b3d4eb80d8a7">m_frame</a> = <a class="code" href="structVamp_1_1RealTime.html#1c32b50b1511cdca17cd6c1c3c05d9b5" title="Convert a RealTime into a sample frame at the given sample rate.">RealTime::realTime2Frame</a>(timestamp,
<a name="l00424"></a>00424                                            <span class="keywordtype">int</span>(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#cc747b4e448a316346f9f59e2c85dcfc">m_inputSampleRate</a> + 0.5));
<a name="l00425"></a>00425         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#fa825144d91babf38fb27aa7c287dc1e">m_unrun</a> = <span class="keyword">false</span>;
<a name="l00426"></a>00426     }
<a name="l00427"></a>00427                         
<a name="l00428"></a>00428     <span class="comment">// queue the new input</span>
<a name="l00429"></a>00429     
<a name="l00430"></a>00430     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a>; ++i) {
<a name="l00431"></a>00431         <span class="keywordtype">int</span> written = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[i]-&gt;write(inputBuffers[i], <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">m_inputBlockSize</a>);
<a name="l00432"></a>00432         <span class="keywordflow">if</span> (written &lt; <span class="keywordtype">int</span>(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">m_inputBlockSize</a>) &amp;&amp; i == 0) {
<a name="l00433"></a>00433             std::cerr &lt;&lt; <span class="stringliteral">"WARNING: PluginBufferingAdapter::Impl::process: "</span>
<a name="l00434"></a>00434                       &lt;&lt; <span class="stringliteral">"Buffer overflow: wrote "</span> &lt;&lt; written 
<a name="l00435"></a>00435                       &lt;&lt; <span class="stringliteral">" of "</span> &lt;&lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#2a8d125110b2ee19407d10b4e21a865f">m_inputBlockSize</a> 
<a name="l00436"></a>00436                       &lt;&lt; <span class="stringliteral">" input samples (for plugin step size "</span>
<a name="l00437"></a>00437                       &lt;&lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a> &lt;&lt; <span class="stringliteral">", block size "</span> &lt;&lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> &lt;&lt; <span class="stringliteral">")"</span>
<a name="l00438"></a>00438                       &lt;&lt; std::endl;
<a name="l00439"></a>00439         }
<a name="l00440"></a>00440     }    
<a name="l00441"></a>00441     
<a name="l00442"></a>00442     <span class="comment">// process as much as we can</span>
<a name="l00443"></a>00443 
<a name="l00444"></a>00444     <span class="keywordflow">while</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[0]-&gt;getReadSpace() &gt;= <span class="keywordtype">int</span>(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>)) {
<a name="l00445"></a>00445         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#65f718273e06cb3d2e0ef09ca173aa54">processBlock</a>(allFeatureSets);
<a name="l00446"></a>00446     }   
<a name="l00447"></a>00447     
<a name="l00448"></a>00448     <span class="keywordflow">return</span> allFeatureSets;
<a name="l00449"></a>00449 }
<a name="l00450"></a>00450     
<a name="l00451"></a>00451 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">PluginBufferingAdapter::FeatureSet</a>
<a name="l00452"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#242913f6f438bef150e270cbeeacf711">00452</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#242913f6f438bef150e270cbeeacf711">PluginBufferingAdapter::Impl::getRemainingFeatures</a>() 
<a name="l00453"></a>00453 {
<a name="l00454"></a>00454     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> allFeatureSets;
<a name="l00455"></a>00455     
<a name="l00456"></a>00456     <span class="comment">// process remaining samples in queue</span>
<a name="l00457"></a>00457     <span class="keywordflow">while</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[0]-&gt;getReadSpace() &gt;= <span class="keywordtype">int</span>(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>)) {
<a name="l00458"></a>00458         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#65f718273e06cb3d2e0ef09ca173aa54">processBlock</a>(allFeatureSets);
<a name="l00459"></a>00459     }
<a name="l00460"></a>00460     
<a name="l00461"></a>00461     <span class="comment">// pad any last samples remaining and process</span>
<a name="l00462"></a>00462     <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[0]-&gt;getReadSpace() &gt; 0) {
<a name="l00463"></a>00463         <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a>; ++i) {
<a name="l00464"></a>00464             <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[i]-&gt;zero(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a> - <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[i]-&gt;getReadSpace());
<a name="l00465"></a>00465         }
<a name="l00466"></a>00466         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#65f718273e06cb3d2e0ef09ca173aa54">processBlock</a>(allFeatureSets);
<a name="l00467"></a>00467     }                   
<a name="l00468"></a>00468     
<a name="l00469"></a>00469     <span class="comment">// get remaining features                   </span>
<a name="l00470"></a>00470 
<a name="l00471"></a>00471     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> featureSet = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<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="l00472"></a>00472 
<a name="l00473"></a>00473     <span class="keywordflow">for</span> (map&lt;int, FeatureList&gt;::iterator iter = featureSet.begin();
<a name="l00474"></a>00474          iter != featureSet.end(); ++iter) {
<a name="l00475"></a>00475         <a class="code" href="classVamp_1_1Plugin.html#0730bc72c87fa02eb8d2854b233f7be1">FeatureList</a> featureList = iter-&gt;second;
<a name="l00476"></a>00476         <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; featureList.size(); ++i) {
<a name="l00477"></a>00477             allFeatureSets[iter-&gt;first].push_back(featureList[i]);
<a name="l00478"></a>00478         }
<a name="l00479"></a>00479     }
<a name="l00480"></a>00480     
<a name="l00481"></a>00481     <span class="keywordflow">return</span> allFeatureSets;
<a name="l00482"></a>00482 }
<a name="l00483"></a>00483     
<a name="l00484"></a>00484 <span class="keywordtype">void</span>
<a name="l00485"></a><a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#65f718273e06cb3d2e0ef09ca173aa54">00485</a> <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#65f718273e06cb3d2e0ef09ca173aa54">PluginBufferingAdapter::Impl::processBlock</a>(<a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a>&amp; allFeatureSets)
<a name="l00486"></a>00486 {
<a name="l00487"></a>00487     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#3b8801196c981a9953f6f1fbf5a8aabd">m_channels</a>; ++i) {
<a name="l00488"></a>00488         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[i]-&gt;peek(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">m_buffers</a>[i], <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#7f5f42ff4da0046f38579e9d0f384144">m_blockSize</a>);
<a name="l00489"></a>00489     }
<a name="l00490"></a>00490 
<a name="l00491"></a>00491     <span class="keywordtype">long</span> frame = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#26fe691e7c9ddf55bb55b3d4eb80d8a7">m_frame</a>;
<a name="l00492"></a>00492     <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> timestamp = <a class="code" href="structVamp_1_1RealTime.html#3a5ecc8888b559aad3b7d96911786b3a" title="Convert a sample frame at the given sample rate into a RealTime.">RealTime::frame2RealTime</a>
<a name="l00493"></a>00493         (frame, <span class="keywordtype">int</span>(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#cc747b4e448a316346f9f59e2c85dcfc">m_inputSampleRate</a> + 0.5));
<a name="l00494"></a>00494 
<a name="l00495"></a>00495     <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> featureSet = <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#9c9acb7f9bf51b7406c15d2e60fd4ce2">m_plugin</a>-&gt;<a class="code" href="classVamp_1_1Plugin.html#e4aed3bebfe80a2e2fccd3d37af26996" title="Process a single block of input data.">process</a>(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d0b81884ecf1f01e8272667e59cce02e">m_buffers</a>, timestamp);
<a name="l00496"></a>00496     
<a name="l00497"></a>00497     <span class="keywordflow">for</span> (FeatureSet::iterator iter = featureSet.begin();
<a name="l00498"></a>00498          iter != featureSet.end(); ++iter) {
<a name="l00499"></a>00499 
<a name="l00500"></a>00500         <span class="keywordtype">int</span> outputNo = iter-&gt;first;
<a name="l00501"></a>00501 
<a name="l00502"></a>00502         <span class="keywordflow">if</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#c3055f44b2a62c1a7aa915e180ed054b">m_rewriteOutputTimes</a>[outputNo]) {
<a name="l00503"></a>00503             
<a name="l00504"></a>00504             <a class="code" href="classVamp_1_1Plugin.html#0730bc72c87fa02eb8d2854b233f7be1">FeatureList</a> featureList = iter-&gt;second;
<a name="l00505"></a>00505         
<a name="l00506"></a>00506             <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; featureList.size(); ++i) {
<a name="l00507"></a>00507 
<a name="l00508"></a>00508                 <span class="keywordflow">switch</span> (<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#e65848a6788b5c984635d252fbc8365c">m_outputs</a>[outputNo].sampleType) {
<a name="l00509"></a>00509 
<a name="l00510"></a>00510                 <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&amp;#39;s block start.">OutputDescriptor::OneSamplePerStep</a>:
<a name="l00511"></a>00511                     <span class="comment">// use our internal timestamp, always</span>
<a name="l00512"></a>00512                     featureList[i].timestamp = timestamp;
<a name="l00513"></a>00513                     featureList[i].hasTimestamp = <span class="keyword">true</span>;
<a name="l00514"></a>00514                     <span class="keywordflow">break</span>;
<a name="l00515"></a>00515 
<a name="l00516"></a>00516                 <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).">OutputDescriptor::FixedSampleRate</a>:
<a name="l00517"></a>00517                     <span class="comment">// use our internal timestamp if feature lacks one</span>
<a name="l00518"></a>00518                     <span class="keywordflow">if</span> (!featureList[i].hasTimestamp) {
<a name="l00519"></a>00519                         featureList[i].timestamp = timestamp;
<a name="l00520"></a>00520                         featureList[i].hasTimestamp = <span class="keyword">true</span>;
<a name="l00521"></a>00521                     }
<a name="l00522"></a>00522                     <span class="keywordflow">break</span>;
<a name="l00523"></a>00523 
<a name="l00524"></a>00524                 <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.">OutputDescriptor::VariableSampleRate</a>:
<a name="l00525"></a>00525                     <span class="keywordflow">break</span>;              <span class="comment">// plugin must set timestamp</span>
<a name="l00526"></a>00526 
<a name="l00527"></a>00527                 <span class="keywordflow">default</span>:
<a name="l00528"></a>00528                     <span class="keywordflow">break</span>;
<a name="l00529"></a>00529                 }
<a name="l00530"></a>00530             
<a name="l00531"></a>00531                 allFeatureSets[outputNo].push_back(featureList[i]);
<a name="l00532"></a>00532             }
<a name="l00533"></a>00533         } <span class="keywordflow">else</span> {
<a name="l00534"></a>00534             <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; iter-&gt;second.size(); ++i) {
<a name="l00535"></a>00535                 allFeatureSets[outputNo].push_back(iter-&gt;second[i]);
<a name="l00536"></a>00536             }
<a name="l00537"></a>00537         }
<a name="l00538"></a>00538     }
<a name="l00539"></a>00539     
<a name="l00540"></a>00540     <span class="comment">// step forward</span>
<a name="l00541"></a>00541 
<a name="l00542"></a>00542     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; m_channels; ++i) {
<a name="l00543"></a>00543         <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#d7bc92f4e299bab75d91fbaa08d7c683">m_queue</a>[i]-&gt;skip(<a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a>);
<a name="l00544"></a>00544     }
<a name="l00545"></a>00545     
<a name="l00546"></a>00546     <span class="comment">// increment internal frame counter each time we step forward</span>
<a name="l00547"></a>00547     <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#26fe691e7c9ddf55bb55b3d4eb80d8a7">m_frame</a> += <a class="code" href="classVamp_1_1HostExt_1_1PluginBufferingAdapter_1_1Impl.html#23535474c13c9ed9c2a3dfdcb0943050">m_stepSize</a>;
<a name="l00548"></a>00548 }
<a name="l00549"></a>00549 
<a name="l00550"></a>00550 }
<a name="l00551"></a>00551         
<a name="l00552"></a>00552 }
<a name="l00553"></a>00553 
<a name="l00554"></a>00554 
</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>