Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 3f392fb1e8fac17e2e50bcefd6e09356 > files > 74

jack-audio-connection-kit-devel-1.9.9.5-1.fc18.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Jack2: Handling time</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Jack2
   &#160;<span id="projectnumber">1.9.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Handling time</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad52dc447fd9027922d466f695e697660"><td class="memItemLeft" align="right" valign="top">jack_nframes_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#gad52dc447fd9027922d466f695e697660">jack_frames_since_cycle_start</a> (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT</td></tr>
<tr class="memitem:ga45cec2e76db58e72b46339229de64697"><td class="memItemLeft" align="right" valign="top">jack_nframes_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga45cec2e76db58e72b46339229de64697">jack_frame_time</a> (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT</td></tr>
<tr class="memitem:gae09e1c61ff0c43d4daea6cf480b7b915"><td class="memItemLeft" align="right" valign="top">jack_nframes_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#gae09e1c61ff0c43d4daea6cf480b7b915">jack_last_frame_time</a> (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT</td></tr>
<tr class="memitem:ga06c9af1f47fc72a787435c723e19fa53"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga06c9af1f47fc72a787435c723e19fa53">jack_get_cycle_times</a> (const jack_client_t *client, jack_nframes_t *current_frames, jack_time_t *current_usecs, jack_time_t *next_usecs, float *period_usecs) JACK_OPTIONAL_WEAK_EXPORT</td></tr>
<tr class="memitem:ga9338f5b4866b3e749647d9c4b41c23b6"><td class="memItemLeft" align="right" valign="top">jack_time_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga9338f5b4866b3e749647d9c4b41c23b6">jack_frames_to_time</a> (const jack_client_t *client, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT</td></tr>
<tr class="memitem:ga968ec852b3a33127425fbc479c99f14e"><td class="memItemLeft" align="right" valign="top">jack_nframes_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga968ec852b3a33127425fbc479c99f14e">jack_time_to_frames</a> (const jack_client_t *client, jack_time_t) JACK_OPTIONAL_WEAK_EXPORT</td></tr>
<tr class="memitem:ga7cdc1d48f51bab3e88317b774b3b4193"><td class="memItemLeft" align="right" valign="top">jack_time_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga7cdc1d48f51bab3e88317b774b3b4193">jack_get_time</a> () JACK_OPTIONAL_WEAK_EXPORT</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<p>JACK time is in units of 'frames', according to the current sample rate. The absolute value of frame times is meaningless, frame times have meaning only relative to each other. </p>
<h2>Function Documentation</h2>
<a class="anchor" id="gad52dc447fd9027922d466f695e697660"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">jack_nframes_t jack_frames_since_cycle_start </td>
          <td>(</td>
          <td class="paramtype">const jack_client_t *&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the estimated time in frames that has passed since the JACK server began the current process cycle. </dd></dl>

</div>
</div>
<a class="anchor" id="ga45cec2e76db58e72b46339229de64697"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">jack_nframes_t jack_frame_time </td>
          <td>(</td>
          <td class="paramtype">const jack_client_t *&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the estimated current time in frames. This function is intended for use in other threads (not the process callback). The return value can be compared with the value of jack_last_frame_time to relate time in other threads to JACK time. </dd></dl>

</div>
</div>
<a class="anchor" id="gae09e1c61ff0c43d4daea6cf480b7b915"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">jack_nframes_t jack_last_frame_time </td>
          <td>(</td>
          <td class="paramtype">const jack_client_t *&#160;</td>
          <td class="paramname"><em>client</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the precise time at the start of the current process cycle. This function may only be used from the process callback, and can be used to interpret timestamps generated by <a class="el" href="group__TimeFunctions.html#ga45cec2e76db58e72b46339229de64697">jack_frame_time()</a> in other threads with respect to the current process cycle.</dd></dl>
<p>This is the only jack time function that returns exact time: when used during the process callback it always returns the same value (until the next process callback, where it will return that value + nframes, etc). The return value is guaranteed to be monotonic and linear in this fashion unless an xrun occurs. If an xrun occurs, clients must check this value again, as time may have advanced in a non-linear way (e.g. cycles may have been skipped). </p>

</div>
</div>
<a class="anchor" id="ga06c9af1f47fc72a787435c723e19fa53"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int jack_get_cycle_times </td>
          <td>(</td>
          <td class="paramtype">const jack_client_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jack_nframes_t *&#160;</td>
          <td class="paramname"><em>current_frames</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jack_time_t *&#160;</td>
          <td class="paramname"><em>current_usecs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jack_time_t *&#160;</td>
          <td class="paramname"><em>next_usecs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>period_usecs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function may only be used from the process callback. It provides the internal cycle timing information as used by most of the other time related functions. This allows the caller to map between frame counts and microseconds with full precision (i.e. without rounding frame times to integers), and also provides e.g. the microseconds time of the start of the current cycle directly (it has to be computed otherwise).</p>
<p>If the return value is zero, the following information is provided in the variables pointed to by the arguments:</p>
<p>current_frames: the frame time counter at the start of the current cycle, same as <a class="el" href="group__TimeFunctions.html#gae09e1c61ff0c43d4daea6cf480b7b915">jack_last_frame_time()</a>. current_usecs: the microseconds time at the start of the current cycle. next_usecs: the microseconds time of the start of the next next cycle as computed by the DLL. period_usecs: the current best estimate of the period time in microseconds.</p>
<p>NOTES:</p>
<p>Because of the types used, all the returned values except period_usecs are unsigned. In computations mapping between frames and microseconds <em>signed</em> differences are required. The easiest way is to compute those separately and assign them to the appropriate signed variables, int32_t for frames and int64_t for usecs. See the implementation of <a class="el" href="group__TimeFunctions.html#ga9338f5b4866b3e749647d9c4b41c23b6">jack_frames_to_time()</a> and Jack_time_to_frames() for an example.</p>
<p>Unless there was an xrun, skipped cycles, or the current cycle is the first after freewheeling or starting Jack, the value of current_usecs will always be the value of next_usecs of the previous cycle.</p>
<p>The value of period_usecs will in general NOT be exactly equal to the difference of next_usecs and current_usecs. This is because to ensure stability of the DLL and continuity of the mapping, a fraction of the loop error must be included in next_usecs. For an accurate mapping between frames and microseconds, the difference of next_usecs and current_usecs should be used, and not period_usecs.</p>
<dl class="section return"><dt>Returns</dt><dd>zero if OK, non-zero otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="ga9338f5b4866b3e749647d9c4b41c23b6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">jack_time_t jack_frames_to_time </td>
          <td>(</td>
          <td class="paramtype">const jack_client_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jack_nframes_t&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the estimated time in microseconds of the specified frame time </dd></dl>

</div>
</div>
<a class="anchor" id="ga968ec852b3a33127425fbc479c99f14e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">jack_nframes_t jack_time_to_frames </td>
          <td>(</td>
          <td class="paramtype">const jack_client_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jack_time_t&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the estimated time in frames for the specified system time. </dd></dl>

</div>
</div>
<a class="anchor" id="ga7cdc1d48f51bab3e88317b774b3b4193"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">jack_time_t jack_get_time </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>return JACK's current system time in microseconds, using the JACK clock source.</dd></dl>
<p>The value returned is guaranteed to be monotonic, but not linear. </p>

</div>
</div>
</div><!-- contents -->
<hr size="1"><address style="text-align: right;"><small>
Generated for Jack2 by <a href="http://www.doxygen.org/
index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a>
1.8.1.2</small></address>
</body>
</html>