-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathgroup__TimeFunctions.html
More file actions
454 lines (428 loc) · 28.6 KB
/
group__TimeFunctions.html
File metadata and controls
454 lines (428 loc) · 28.6 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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<!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: 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="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> |
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<div class="title">Handling time<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> » <a class="el" href="group__LatencyFunctions.html">Managing and determining latency</a> » <a class="el" href="group__PortSearching.html">Looking up 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__ErrorOutput"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ErrorOutput.html">Controlling error/information output</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:gad52dc447fd9027922d466f695e697660"><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__TimeFunctions.html#gad52dc447fd9027922d466f695e697660">jack_frames_since_cycle_start</a> (const <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:gad52dc447fd9027922d466f695e697660"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga45cec2e76db58e72b46339229de64697"><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__TimeFunctions.html#ga45cec2e76db58e72b46339229de64697">jack_frame_time</a> (const <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:ga45cec2e76db58e72b46339229de64697"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae09e1c61ff0c43d4daea6cf480b7b915"><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__TimeFunctions.html#gae09e1c61ff0c43d4daea6cf480b7b915">jack_last_frame_time</a> (const <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *client) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:gae09e1c61ff0c43d4daea6cf480b7b915"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga06c9af1f47fc72a787435c723e19fa53"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga06c9af1f47fc72a787435c723e19fa53">jack_get_cycle_times</a> (const <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *client, <a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> *current_frames, <a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> *current_usecs, <a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> *next_usecs, float *period_usecs) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga06c9af1f47fc72a787435c723e19fa53"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9338f5b4866b3e749647d9c4b41c23b6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga9338f5b4866b3e749647d9c4b41c23b6">jack_frames_to_time</a> (const <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *client, <a class="el" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a>) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga9338f5b4866b3e749647d9c4b41c23b6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga968ec852b3a33127425fbc479c99f14e"><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__TimeFunctions.html#ga968ec852b3a33127425fbc479c99f14e">jack_time_to_frames</a> (const <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *client, <a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a>) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga968ec852b3a33127425fbc479c99f14e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3b26460e62a56cf012e9075dcb1b6294"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga3b26460e62a56cf012e9075dcb1b6294">jack_get_time</a> (void) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga3b26460e62a56cf012e9075dcb1b6294"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga550faaef2bb17b03b0068fe094e7b92f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga550faaef2bb17b03b0068fe094e7b92f">jack_set_error_function</a> (void(*func)(const char *)) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga550faaef2bb17b03b0068fe094e7b92f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1555b7b4ae4056a42c70a3fa278ae17f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga1555b7b4ae4056a42c70a3fa278ae17f">jack_set_info_function</a> (void(*func)(const char *)) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga1555b7b4ae4056a42c70a3fa278ae17f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga437010097629ac8124a56c752c02f299"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga437010097629ac8124a56c752c02f299">jack_free</a> (void *ptr) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga437010097629ac8124a56c752c02f299"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ga8795fde90880a9cfa93816033481919f"><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga8795fde90880a9cfa93816033481919f">jack_error_callback</a> )(const char *msg) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga8795fde90880a9cfa93816033481919f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga54df3f389c3bcf51fdb20ef939d5f062"><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__TimeFunctions.html#ga54df3f389c3bcf51fdb20ef939d5f062">jack_info_callback</a> )(const char *msg) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a></td></tr>
<tr class="separator:ga54df3f389c3bcf51fdb20ef939d5f062"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">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 class="groupheader">Function Documentation</h2>
<a id="ga45cec2e76db58e72b46339229de64697"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga45cec2e76db58e72b46339229de64697">◆ </a></span>jack_frame_time()</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_frame_time </td>
<td>(</td>
<td class="paramtype">const <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">
<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 id="gad52dc447fd9027922d466f695e697660"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad52dc447fd9027922d466f695e697660">◆ </a></span>jack_frames_since_cycle_start()</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_frames_since_cycle_start </td>
<td>(</td>
<td class="paramtype">const <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">
<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 id="ga9338f5b4866b3e749647d9c4b41c23b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9338f5b4866b3e749647d9c4b41c23b6">◆ </a></span>jack_frames_to_time()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> jack_frames_to_time </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> * </td>
<td class="paramname"><em>client</em>, </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">
<dl class="section return"><dt>Returns</dt><dd>the estimated time in microseconds of the specified frame time </dd></dl>
</div>
</div>
<a id="ga437010097629ac8124a56c752c02f299"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga437010097629ac8124a56c752c02f299">◆ </a></span>jack_free()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void jack_free </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>ptr</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The free function to be used on memory returned by jack_port_get_connections, jack_port_get_all_connections and jack_get_ports functions. This is MANDATORY on Windows when otherwise all nasty runtime version related crashes can occur. Developers are strongly encouraged to use this function instead of the standard "free" function in new code. </p>
</div>
</div>
<a id="ga06c9af1f47fc72a787435c723e19fa53"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga06c9af1f47fc72a787435c723e19fa53">◆ </a></span>jack_get_cycle_times()</h2>
<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 <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> * </td>
<td class="paramname"><em>client</em>, </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"><em>current_frames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> * </td>
<td class="paramname"><em>current_usecs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> * </td>
<td class="paramname"><em>next_usecs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float * </td>
<td class="paramname"><em>period_usecs</em> </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 id="ga3b26460e62a56cf012e9075dcb1b6294"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3b26460e62a56cf012e9075dcb1b6294">◆ </a></span>jack_get_time()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> jack_get_time </td>
<td>(</td>
<td class="paramtype">void </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>
<a id="gae09e1c61ff0c43d4daea6cf480b7b915"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae09e1c61ff0c43d4daea6cf480b7b915">◆ </a></span>jack_last_frame_time()</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_last_frame_time </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> * </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 id="ga550faaef2bb17b03b0068fe094e7b92f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga550faaef2bb17b03b0068fe094e7b92f">◆ </a></span>jack_set_error_function()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void jack_set_error_function </td>
<td>(</td>
<td class="paramtype">void(*)(const char *) </td>
<td class="paramname"><em>func</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the <a class="el" href="group__TimeFunctions.html#ga8795fde90880a9cfa93816033481919f">jack_error_callback</a> for error message display.</p>
<p>The JACK library provides two built-in callbacks for this purpose: default_jack_error_callback() and silent_jack_error_callback(). </p>
</div>
</div>
<a id="ga1555b7b4ae4056a42c70a3fa278ae17f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1555b7b4ae4056a42c70a3fa278ae17f">◆ </a></span>jack_set_info_function()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void jack_set_info_function </td>
<td>(</td>
<td class="paramtype">void(*)(const char *) </td>
<td class="paramname"><em>func</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the <a class="el" href="group__TimeFunctions.html#ga54df3f389c3bcf51fdb20ef939d5f062">jack_info_callback</a> for info message display. </p>
</div>
</div>
<a id="ga968ec852b3a33127425fbc479c99f14e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga968ec852b3a33127425fbc479c99f14e">◆ </a></span>jack_time_to_frames()</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_time_to_frames </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> * </td>
<td class="paramname"><em>client</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> </td>
<td class="paramname"> </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>
<h2 class="groupheader">Variable Documentation</h2>
<a id="ga8795fde90880a9cfa93816033481919f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8795fde90880a9cfa93816033481919f">◆ </a></span>jack_error_callback</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void(* jack_error_callback) (const char *msg) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a> </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>msg</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Display JACK error message.</p>
<p>Set via <a class="el" href="group__TimeFunctions.html#ga550faaef2bb17b03b0068fe094e7b92f">jack_set_error_function()</a>, otherwise a JACK-provided default will print <em>msg</em> (plus a newline) to stderr.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">msg</td><td>error message text (no newline at end). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga54df3f389c3bcf51fdb20ef939d5f062"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54df3f389c3bcf51fdb20ef939d5f062">◆ </a></span>jack_info_callback</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void(* jack_info_callback) (const char *msg) <a class="el" href="weakmacros_8h.html#adf1bde0dd996bbf61a44311165014dd1">JACK_OPTIONAL_WEAK_EXPORT</a> </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>msg</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Display JACK info message.</p>
<p>Set via <a class="el" href="group__TimeFunctions.html#ga1555b7b4ae4056a42c70a3fa278ae17f">jack_set_info_function()</a>, otherwise a JACK-provided default will print <em>msg</em> (plus a newline) to stdout.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">msg</td><td>info message text (no newline at end). </td></tr>
</table>
</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>