-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathgroup__LatencyFunctions.html
More file actions
369 lines (353 loc) · 30.3 KB
/
group__LatencyFunctions.html
File metadata and controls
369 lines (353 loc) · 30.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JACK-AUDIO-CONNECTION-KIT: Managing and determining latency</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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</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 id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JACK-AUDIO-CONNECTION-KIT
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li class="current"><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Managing and determining latency<div class="ingroups"><a class="el" href="group__ClientFunctions.html">Creating & manipulating clients</a> » <a class="el" href="group__NonCallbackAPI.html">The non-callback API</a> » <a class="el" href="group__ClientCallbacks.html">Setting Client Callbacks</a> » <a class="el" href="group__ServerControl.html">Controlling & querying JACK server operation</a> » <a class="el" href="group__PortFunctions.html">Creating & manipulating ports</a></div></div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__PortSearching"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PortSearching.html">Looking up ports</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaba121996f00bd96ceec5b1c1012fc767"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__LatencyFunctions.html#gaba121996f00bd96ceec5b1c1012fc767">jack_port_set_latency</a> (<a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> *, <a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a>) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT</td></tr>
<tr class="separator:gaba121996f00bd96ceec5b1c1012fc767"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf379bc0e88a6df6c4b7836db4b9382d7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range</a> (<a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> *port, <a class="el" href="types_8h.html#ae415c828fc3da3e5d7a10ed2dbffffce">jack_latency_callback_mode_t</a> mode, <a class="el" href="types_8h.html#a8177c6512bf4aa5842849afd219ecf50">jack_latency_range_t</a> *range) JACK_WEAK_EXPORT</td></tr>
<tr class="separator:gaf379bc0e88a6df6c4b7836db4b9382d7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7a8f181fcec32945db7b8e06ee1ca94b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__LatencyFunctions.html#ga7a8f181fcec32945db7b8e06ee1ca94b">jack_port_set_latency_range</a> (<a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> *port, <a class="el" href="types_8h.html#ae415c828fc3da3e5d7a10ed2dbffffce">jack_latency_callback_mode_t</a> mode, <a class="el" href="types_8h.html#a8177c6512bf4aa5842849afd219ecf50">jack_latency_range_t</a> *range) JACK_WEAK_EXPORT</td></tr>
<tr class="separator:ga7a8f181fcec32945db7b8e06ee1ca94b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga46400b9a573389549784a356ab2d4e3b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__LatencyFunctions.html#ga46400b9a573389549784a356ab2d4e3b">jack_recompute_total_latencies</a> (<a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga46400b9a573389549784a356ab2d4e3b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga47fa957309f9b3111010284e10cc1de0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__LatencyFunctions.html#ga47fa957309f9b3111010284e10cc1de0">jack_port_get_latency</a> (<a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT</td></tr>
<tr class="separator:ga47fa957309f9b3111010284e10cc1de0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7f5835f17cb55a5ed64bb63cb18c462c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__LatencyFunctions.html#ga7f5835f17cb55a5ed64bb63cb18c462c">jack_port_get_total_latency</a> (<a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *, <a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT</td></tr>
<tr class="separator:ga7f5835f17cb55a5ed64bb63cb18c462c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga56372ab81d673cc4a419fd04cd3bfb8a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__LatencyFunctions.html#ga56372ab81d673cc4a419fd04cd3bfb8a">jack_recompute_total_latency</a> (<a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *, <a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT</td></tr>
<tr class="separator:ga56372ab81d673cc4a419fd04cd3bfb8a"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The purpose of JACK's latency API is to allow clients to easily answer two questions:</p>
<ul>
<li>How long has it been since the data read from a port arrived at the edge of the JACK graph (either via a physical port or being synthesized from scratch)?</li>
<li>How long will it be before the data written to a port arrives at the edge of a JACK graph?</li>
</ul>
<p>To help answering these two questions, all JACK ports have two latency values associated with them, both measured in frames:</p>
<p><b>capture latency</b>: how long since the data read from the buffer of a port arrived at at a port marked with JackPortIsTerminal. The data will have come from the "outside
world" if the terminal port is also marked with JackPortIsPhysical, or will have been synthesized by the client that owns the terminal port.</p>
<p><b>playback latency</b>: how long until the data written to the buffer of port will reach a port marked with JackPortIsTerminal.</p>
<p>Both latencies might potentially have more than one value because there may be multiple pathways to/from a given port and a terminal port. Latency is therefore generally expressed a min/max pair.</p>
<p>In most common setups, the minimum and maximum latency are the same, but this design accomodates more complex routing, and allows applications (and thus users) to detect cases where routing is creating an anomalous situation that may either need fixing or more sophisticated handling by clients that care about latency.</p>
<p>See also <a class="el" href="group__ClientCallbacks.html#ga70a38fb1e74c5e9df9f1305c695c58bf">jack_set_latency_callback</a> for details on how clients that add latency to the signal path should interact with JACK to ensure that the correct latency figures are used. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga47fa957309f9b3111010284e10cc1de0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga47fa957309f9b3111010284e10cc1de0">◆ </a></span>jack_port_get_latency()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> jack_port_get_latency </td>
<td>(</td>
<td class="paramtype"><a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> * </td>
<td class="paramname"><em>port</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the time (in frames) between data being available or delivered at/to a port, and the time at which it arrived at or is delivered to the "other side" of the port. E.g. for a physical audio output port, this is the time between writing to the port and when the signal will leave the connector. For a physical audio input port, this is the time between the sound arriving at the connector and the corresponding frames being readable from the port.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000007">Deprecated:</a></b></dt><dd>This method will be removed in the next major release of JACK. It should not be used in new code, and should be replaced by <a class="el" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range()</a> in any existing use cases. </dd></dl>
</div>
</div>
<a id="gaf379bc0e88a6df6c4b7836db4b9382d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf379bc0e88a6df6c4b7836db4b9382d7">◆ </a></span>jack_port_get_latency_range()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void jack_port_get_latency_range </td>
<td>(</td>
<td class="paramtype"><a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> * </td>
<td class="paramname"><em>port</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#ae415c828fc3da3e5d7a10ed2dbffffce">jack_latency_callback_mode_t</a> </td>
<td class="paramname"><em>mode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a8177c6512bf4aa5842849afd219ecf50">jack_latency_range_t</a> * </td>
<td class="paramname"><em>range</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>return the latency range defined by <em>mode</em> for <em>port</em>, in frames.</p>
<p>See <a class="el" href="group__LatencyFunctions.html">Managing and determining latency</a> for the definition of each latency value.</p>
<p>This function is best used from callbacks, specifically the latency callback. Before a port is connected, this returns the default latency: zero. Therefore it only makes sense to call <a class="el" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range()</a> when the port is connected, and that gets signalled by the latency callback. See <a class="el" href="group__ClientCallbacks.html#ga70a38fb1e74c5e9df9f1305c695c58bf">jack_set_latency_callback()</a> for details. </p>
</div>
</div>
<a id="ga7f5835f17cb55a5ed64bb63cb18c462c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f5835f17cb55a5ed64bb63cb18c462c">◆ </a></span>jack_port_get_total_latency()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> jack_port_get_total_latency </td>
<td>(</td>
<td class="paramtype"><a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> * </td>
<td class="paramname"><em>port</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The maximum of the sum of the latencies in every connection path that can be drawn between the port and other ports with the <a class="el" href="types_8h.html#acbcada380e9dfdd5bff1296e7156f478ae902a1c91f82b33cb956e1ac310592b3">JackPortIsTerminal</a> flag set.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000008">Deprecated:</a></b></dt><dd>This method will be removed in the next major release of JACK. It should not be used in new code, and should be replaced by <a class="el" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range()</a> in any existing use cases. </dd></dl>
</div>
</div>
<a id="gaba121996f00bd96ceec5b1c1012fc767"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaba121996f00bd96ceec5b1c1012fc767">◆ </a></span>jack_port_set_latency()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void jack_port_set_latency </td>
<td>(</td>
<td class="paramtype"><a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The port latency is zero by default. Clients that control physical hardware with non-zero latency should call this to set the latency to its correct value. Note that the value should include any systemic latency present "outside" the physical hardware controlled by the client. For example, for a client controlling a digital audio interface connected to an external digital converter, the latency setting should include both buffering by the audio interface <em>and</em> the converter.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000006">Deprecated:</a></b></dt><dd>This method will be removed in the next major release of JACK. It should not be used in new code, and should be replaced by a latency callback that calls <a class="el" href="group__LatencyFunctions.html#ga7a8f181fcec32945db7b8e06ee1ca94b">jack_port_set_latency_range()</a>. </dd></dl>
</div>
</div>
<a id="ga7a8f181fcec32945db7b8e06ee1ca94b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7a8f181fcec32945db7b8e06ee1ca94b">◆ </a></span>jack_port_set_latency_range()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void jack_port_set_latency_range </td>
<td>(</td>
<td class="paramtype"><a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> * </td>
<td class="paramname"><em>port</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#ae415c828fc3da3e5d7a10ed2dbffffce">jack_latency_callback_mode_t</a> </td>
<td class="paramname"><em>mode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a8177c6512bf4aa5842849afd219ecf50">jack_latency_range_t</a> * </td>
<td class="paramname"><em>range</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>set the minimum and maximum latencies defined by <em>mode</em> for <em>port</em>, in frames.</p>
<p>See <a class="el" href="group__LatencyFunctions.html">Managing and determining latency</a> for the definition of each latency value.</p>
<p>This function should ONLY be used inside a latency callback. The client should determine the current value of the latency using <a class="el" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range()</a> (called using the same mode as <em>mode</em>) and then add some number of frames to that reflects latency added by the client.</p>
<p>How much latency a client adds will vary dramatically. For most clients, the answer is zero and there is no reason for them to register a latency callback and thus they should never call this function.</p>
<p>More complex clients that take an input signal, transform it in some way and output the result but not during the same process() callback will generally know a single constant value to add to the value returned by <a class="el" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range()</a>.</p>
<p>Such clients would register a latency callback (see <a class="el" href="group__ClientCallbacks.html#ga70a38fb1e74c5e9df9f1305c695c58bf">jack_set_latency_callback</a>) and must know what input ports feed which output ports as part of their internal state. Their latency callback will update the ports' latency values appropriately.</p>
<p>A pseudo-code example will help. The <em>mode</em> argument to the latency callback will determine whether playback or capture latency is being set. The callback will use <a class="el" href="group__LatencyFunctions.html#ga7a8f181fcec32945db7b8e06ee1ca94b">jack_port_set_latency_range()</a> as follows:</p>
<div class="fragment"><div class="line"><a class="code" href="struct__jack__latency__range.html">jack_latency_range_t</a> range;</div>
<div class="line"><span class="keywordflow">if</span> (mode == <a class="code" href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8a437ff958982a3cbc72a3c2ffba6a1145">JackPlaybackLatency</a>) {</div>
<div class="line"> <span class="keywordflow">foreach</span> input_port in (all <span class="keyword">self</span>-registered port) {</div>
<div class="line"> <a class="code" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range</a> (port_feeding_input_port, <a class="code" href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8a437ff958982a3cbc72a3c2ffba6a1145">JackPlaybackLatency</a>, &range);</div>
<div class="line"> range.<a class="code" href="struct__jack__latency__range.html#ab357b9064e2793e29755f5a6b550c3f2">min</a> += min_delay_added_as_signal_flows_from port_feeding to input_port;</div>
<div class="line"> range.<a class="code" href="struct__jack__latency__range.html#a27a00059e59b8f7790d0479f8748a68f">max</a> += max_delay_added_as_signal_flows_from port_feeding to input_port;</div>
<div class="line"> <a class="code" href="group__LatencyFunctions.html#ga7a8f181fcec32945db7b8e06ee1ca94b">jack_port_set_latency_range</a> (input_port, <a class="code" href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8a437ff958982a3cbc72a3c2ffba6a1145">JackPlaybackLatency</a>, &range);</div>
<div class="line"> }</div>
<div class="line">} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == <a class="code" href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8ae56d658f457dbff2f043e89bc6dc105d">JackCaptureLatency</a>) {</div>
<div class="line"> <span class="keywordflow">foreach</span> output_port in (all <span class="keyword">self</span>-registered port) { </div>
<div class="line"> <a class="code" href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range</a> (port_fed_by_output_port, <a class="code" href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8ae56d658f457dbff2f043e89bc6dc105d">JackCaptureLatency</a>, &range);</div>
<div class="line"> range.<a class="code" href="struct__jack__latency__range.html#ab357b9064e2793e29755f5a6b550c3f2">min</a> += min_delay_added_as_signal_flows_from_output_port_to_fed_by_port;</div>
<div class="line"> range.<a class="code" href="struct__jack__latency__range.html#a27a00059e59b8f7790d0479f8748a68f">max</a> += max_delay_added_as_signal_flows_from_output_port_to_fed_by_port;</div>
<div class="line"> <a class="code" href="group__LatencyFunctions.html#ga7a8f181fcec32945db7b8e06ee1ca94b">jack_port_set_latency_range</a> (output_port, <a class="code" href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8ae56d658f457dbff2f043e89bc6dc105d">JackCaptureLatency</a>, &range);</div>
<div class="line"> }</div>
<div class="line">}</div>
<div class="ttc" id="agroup__LatencyFunctions_html_ga7a8f181fcec32945db7b8e06ee1ca94b"><div class="ttname"><a href="group__LatencyFunctions.html#ga7a8f181fcec32945db7b8e06ee1ca94b">jack_port_set_latency_range</a></div><div class="ttdeci">void jack_port_set_latency_range(jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT</div></div>
<div class="ttc" id="agroup__LatencyFunctions_html_gaf379bc0e88a6df6c4b7836db4b9382d7"><div class="ttname"><a href="group__LatencyFunctions.html#gaf379bc0e88a6df6c4b7836db4b9382d7">jack_port_get_latency_range</a></div><div class="ttdeci">void jack_port_get_latency_range(jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT</div></div>
<div class="ttc" id="astruct__jack__latency__range_html"><div class="ttname"><a href="struct__jack__latency__range.html">_jack_latency_range</a></div><div class="ttdef"><b>Definition:</b> types.h:281</div></div>
<div class="ttc" id="astruct__jack__latency__range_html_a27a00059e59b8f7790d0479f8748a68f"><div class="ttname"><a href="struct__jack__latency__range.html#a27a00059e59b8f7790d0479f8748a68f">_jack_latency_range::max</a></div><div class="ttdeci">jack_nframes_t max</div><div class="ttdef"><b>Definition:</b> types.h:289</div></div>
<div class="ttc" id="astruct__jack__latency__range_html_ab357b9064e2793e29755f5a6b550c3f2"><div class="ttname"><a href="struct__jack__latency__range.html#ab357b9064e2793e29755f5a6b550c3f2">_jack_latency_range::min</a></div><div class="ttdeci">jack_nframes_t min</div><div class="ttdef"><b>Definition:</b> types.h:285</div></div>
<div class="ttc" id="atypes_8h_html_a6e99aa9141e9ee146a56cf53b96964d8a437ff958982a3cbc72a3c2ffba6a1145"><div class="ttname"><a href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8a437ff958982a3cbc72a3c2ffba6a1145">JackPlaybackLatency</a></div><div class="ttdeci">@ JackPlaybackLatency</div><div class="ttdef"><b>Definition:</b> types.h:259</div></div>
<div class="ttc" id="atypes_8h_html_a6e99aa9141e9ee146a56cf53b96964d8ae56d658f457dbff2f043e89bc6dc105d"><div class="ttname"><a href="types_8h.html#a6e99aa9141e9ee146a56cf53b96964d8ae56d658f457dbff2f043e89bc6dc105d">JackCaptureLatency</a></div><div class="ttdeci">@ JackCaptureLatency</div><div class="ttdef"><b>Definition:</b> types.h:252</div></div>
</div><!-- fragment --><p>In this relatively simple pseudo-code example, it is assumed that each input port or output is connected to only 1 output or input port respectively.</p>
<p>If a port is connected to more than 1 other port, then the range.min and range.max values passed to <a class="el" href="group__LatencyFunctions.html#ga7a8f181fcec32945db7b8e06ee1ca94b">jack_port_set_latency_range()</a> should reflect the minimum and maximum values across all connected ports.</p>
<p>See the description of <a class="el" href="group__ClientCallbacks.html#ga70a38fb1e74c5e9df9f1305c695c58bf">jack_set_latency_callback</a> for more information. </p>
</div>
</div>
<a id="ga46400b9a573389549784a356ab2d4e3b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga46400b9a573389549784a356ab2d4e3b">◆ </a></span>jack_recompute_total_latencies()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int jack_recompute_total_latencies </td>
<td>(</td>
<td class="paramtype"><a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> * </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Request a complete recomputation of all port latencies. This can be called by a client that has just changed the internal latency of its port using jack_port_set_latency and wants to ensure that all signal pathways in the graph are updated with respect to the values that will be returned by jack_port_get_total_latency. It allows a client to change multiple port latencies without triggering a recompute for each change.</p>
<dl class="section return"><dt>Returns</dt><dd>zero for successful execution of the request. non-zero otherwise. </dd></dl>
</div>
</div>
<a id="ga56372ab81d673cc4a419fd04cd3bfb8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga56372ab81d673cc4a419fd04cd3bfb8a">◆ </a></span>jack_recompute_total_latency()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int jack_recompute_total_latency </td>
<td>(</td>
<td class="paramtype"><a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a91bf0f8fb0619705676136a7f5e3a931">jack_port_t</a> * </td>
<td class="paramname"><em>port</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Request a complete recomputation of a port's total latency. This can be called by a client that has just changed the internal latency of its port using jack_port_set_latency and wants to ensure that all signal pathways in the graph are updated with respect to the values that will be returned by jack_port_get_total_latency.</p>
<dl class="section return"><dt>Returns</dt><dd>zero for successful execution of the request. non-zero otherwise.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000009">Deprecated:</a></b></dt><dd>This method will be removed in the next major release of JACK. It should not be used in new code, and should be replaced by <a class="el" href="group__LatencyFunctions.html#ga46400b9a573389549784a356ab2d4e3b">jack_recompute_total_latencies()</a> in any existing use cases. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>