FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
jack2/common/JackAPI.cpp at develop · jackaudio/jack2 · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
jackaudio
/
jack2
Public
Notifications
You must be signed in to change notification settings
Fork
396
Star
2.4k
Code
Issues
332
Pull requests
38
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
jack2
/
common
/
JackAPI.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
2277 lines (1963 loc) · 78 KB
Breadcrumbs
jack2
/
common
/
JackAPI.cpp
Copy path
File metadata and controls
2277 lines (1963 loc) · 78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright (C) 2001-2003 Paul Davis
Copyright (C) 2004-2008 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#
define
__STDC_FORMAT_MACROS
1
#
include
<
inttypes.h
>
#
include
"
JackClient.h
"
#
include
"
JackError.h
"
#
include
"
JackGraphManager.h
"
#
include
"
JackEngineControl.h
"
#
include
"
JackClientControl.h
"
#
include
"
JackGlobals.h
"
#
include
"
JackTime.h
"
#
include
"
JackPortType.h
"
#
include
"
JackMetadata.h
"
#
include
<
math.h
>
using
namespace
Jack
;
#
ifdef
__cplusplus
extern
"
C
"
{
#endif
typedef
void
(*print_function)(
const
char
*);
typedef
void
*(*thread_routine)(
void
*);
LIB_EXPORT
void
jack_get_version
(
int
*major_ptr,
int
*minor_ptr,
int
*micro_ptr,
int
*proto_ptr);
LIB_EXPORT
const
char
*
jack_get_version_string
();
jack_client_t
*
jack_client_new_aux
(
const
char
* client_name,
jack_options_t
options,
jack_status_t
*status);
LIB_EXPORT
jack_client_t
*
jack_client_open
(
const
char
* client_name,
jack_options_t
options,
jack_status_t
*status, ...);
LIB_EXPORT
jack_client_t
*
jack_client_new
(
const
char
* client_name);
LIB_EXPORT
int
jack_client_name_size
(
void
);
LIB_EXPORT
char
*
jack_get_client_name
(
jack_client_t
*client);
LIB_EXPORT
int
jack_internal_client_new
(
const
char
* client_name,
const
char
* load_name,
const
char
* load_init);
LIB_EXPORT
void
jack_internal_client_close
(
const
char
* client_name);
LIB_EXPORT
int
jack_is_realtime
(
jack_client_t
*client);
LIB_EXPORT
void
jack_on_shutdown
(
jack_client_t
*client,
JackShutdownCallback shutdown_callback,
void
*arg);
LIB_EXPORT
void
jack_on_info_shutdown
(
jack_client_t
*client,
JackInfoShutdownCallback shutdown_callback,
void
*arg);
LIB_EXPORT
int
jack_set_process_callback
(
jack_client_t
*client,
JackProcessCallback process_callback,
void
*arg);
LIB_EXPORT
jack_nframes_t
jack_thread_wait
(
jack_client_t
*client,
int
status);
//
new
LIB_EXPORT
jack_nframes_t
jack_cycle_wait
(
jack_client_t
*);
LIB_EXPORT
void
jack_cycle_signal
(
jack_client_t
*,
int
status);
LIB_EXPORT
int
jack_set_process_thread
(
jack_client_t
* client, JackThreadCallback fun,
void
*arg);
LIB_EXPORT
int
jack_set_thread_init_callback
(
jack_client_t
*client,
JackThreadInitCallback thread_init_callback,
void
*arg);
LIB_EXPORT
int
jack_set_freewheel_callback
(
jack_client_t
*client,
JackFreewheelCallback freewheel_callback,
void
*arg);
LIB_EXPORT
int
jack_set_freewheel
(
jack_client_t
* client,
int
onoff);
LIB_EXPORT
int
jack_set_buffer_size
(
jack_client_t
*client,
jack_nframes_t
nframes);
LIB_EXPORT
int
jack_set_buffer_size_callback
(
jack_client_t
*client,
JackBufferSizeCallback bufsize_callback,
void
*arg);
LIB_EXPORT
int
jack_set_sample_rate_callback
(
jack_client_t
*client,
JackSampleRateCallback srate_callback,
void
*arg);
LIB_EXPORT
int
jack_set_client_registration_callback
(
jack_client_t
*,
JackClientRegistrationCallback
registration_callback,
void
*arg);
LIB_EXPORT
int
jack_set_port_registration_callback
(
jack_client_t
*,
JackPortRegistrationCallback
registration_callback,
void
*arg);
LIB_EXPORT
int
jack_set_port_connect_callback
(
jack_client_t
*,
JackPortConnectCallback
connect_callback,
void
*arg);
LIB_EXPORT
int
jack_set_port_rename_callback
(
jack_client_t
*,
JackPortRenameCallback
rename_callback,
void
*arg);
LIB_EXPORT
int
jack_set_graph_order_callback
(
jack_client_t
*,
JackGraphOrderCallback graph_callback,
void
*);
LIB_EXPORT
int
jack_set_xrun_callback
(
jack_client_t
*,
JackXRunCallback xrun_callback,
void
*arg);
LIB_EXPORT
int
jack_set_latency_callback
(
jack_client_t
*client,
JackLatencyCallback latency_callback,
void
*arg);
LIB_EXPORT
int
jack_activate
(
jack_client_t
*client);
LIB_EXPORT
int
jack_deactivate
(
jack_client_t
*client);
LIB_EXPORT
jack_port_t
*
jack_port_register
(
jack_client_t
*client,
const
char
* port_name,
const
char
* port_type,
unsigned
long
flags,
unsigned
long
buffer_size);
LIB_EXPORT
int
jack_port_unregister
(
jack_client_t
*,
jack_port_t
*);
LIB_EXPORT
void
*
jack_port_get_buffer
(
jack_port_t
*,
jack_nframes_t
);
LIB_EXPORT
jack_uuid_t
jack_port_uuid
(
const
jack_port_t
*);
LIB_EXPORT
const
char
*
jack_port_name
(
const
jack_port_t
*port);
LIB_EXPORT
const
char
*
jack_port_short_name
(
const
jack_port_t
*port);
LIB_EXPORT
int
jack_port_flags
(
const
jack_port_t
*port);
LIB_EXPORT
const
char
*
jack_port_type
(
const
jack_port_t
*port);
LIB_EXPORT
jack_port_type_id_t
jack_port_type_id
(
const
jack_port_t
*port);
LIB_EXPORT
int
jack_port_is_mine
(
const
jack_client_t
*,
const
jack_port_t
*port);
LIB_EXPORT
int
jack_port_connected
(
const
jack_port_t
*port);
LIB_EXPORT
int
jack_port_connected_to
(
const
jack_port_t
*port,
const
char
* port_name);
LIB_EXPORT
const
char
* *
jack_port_get_connections
(
const
jack_port_t
*port);
LIB_EXPORT
const
char
* *
jack_port_get_all_connections
(
const
jack_client_t
*client,
const
jack_port_t
*port);
LIB_EXPORT
int
jack_port_tie
(
jack_port_t
*src,
jack_port_t
*dst);
LIB_EXPORT
int
jack_port_untie
(
jack_port_t
*port);
//
Old latency API
LIB_EXPORT
jack_nframes_t
jack_port_get_latency
(
jack_port_t
*port);
LIB_EXPORT
jack_nframes_t
jack_port_get_total_latency
(
jack_client_t
*,
jack_port_t
*port);
LIB_EXPORT
void
jack_port_set_latency
(
jack_port_t
*,
jack_nframes_t
);
LIB_EXPORT
int
jack_recompute_total_latency
(
jack_client_t
*,
jack_port_t
* port);
//
New latency API
LIB_EXPORT
void
jack_port_get_latency_range
(
jack_port_t
*port,
jack_latency_callback_mode_t
mode,
jack_latency_range_t
*range);
LIB_EXPORT
void
jack_port_set_latency_range
(
jack_port_t
*port,
jack_latency_callback_mode_t
mode,
jack_latency_range_t
*range);
LIB_EXPORT
int
jack_recompute_total_latencies
(
jack_client_t
*);
LIB_EXPORT
int
jack_port_set_name
(
jack_port_t
*port,
const
char
* port_name);
LIB_EXPORT
int
jack_port_rename
(
jack_client_t
*client,
jack_port_t
*port,
const
char
* port_name);
LIB_EXPORT
int
jack_port_set_alias
(
jack_port_t
*port,
const
char
* alias);
LIB_EXPORT
int
jack_port_unset_alias
(
jack_port_t
*port,
const
char
* alias);
LIB_EXPORT
int
jack_port_get_aliases
(
const
jack_port_t
*port,
char
*
const
aliases[
2
]);
LIB_EXPORT
int
jack_port_request_monitor
(
jack_port_t
*port,
int
onoff);
LIB_EXPORT
int
jack_port_request_monitor_by_name
(
jack_client_t
*client,
const
char
* port_name,
int
onoff);
LIB_EXPORT
int
jack_port_ensure_monitor
(
jack_port_t
*port,
int
onoff);
LIB_EXPORT
int
jack_port_monitoring_input
(
jack_port_t
*port);
LIB_EXPORT
int
jack_connect
(
jack_client_t
*,
const
char
* source_port,
const
char
* destination_port);
LIB_EXPORT
int
jack_disconnect
(
jack_client_t
*,
const
char
* source_port,
const
char
* destination_port);
LIB_EXPORT
int
jack_port_disconnect
(
jack_client_t
*,
jack_port_t
*);
LIB_EXPORT
int
jack_port_name_size
(
void
);
LIB_EXPORT
int
jack_port_type_size
(
void
);
LIB_EXPORT
size_t
jack_port_type_get_buffer_size
(
jack_client_t
*client,
const
char
* port_type);
LIB_EXPORT
jack_nframes_t
jack_get_sample_rate
(
jack_client_t
*);
LIB_EXPORT
jack_nframes_t
jack_get_buffer_size
(
jack_client_t
*);
LIB_EXPORT
const
char
* *
jack_get_ports
(
jack_client_t
*,
const
char
* port_name_pattern,
const
char
* type_name_pattern,
unsigned
long
flags);
LIB_EXPORT
jack_port_t
*
jack_port_by_name
(
jack_client_t
*,
const
char
* port_name);
LIB_EXPORT
jack_port_t
*
jack_port_by_id
(
jack_client_t
*client,
jack_port_id_t
port_id);
LIB_EXPORT
int
jack_engine_takeover_timebase
(
jack_client_t
*);
LIB_EXPORT
jack_nframes_t
jack_frames_since_cycle_start
(
const
jack_client_t
*);
LIB_EXPORT
jack_time_t
jack_get_time
();
LIB_EXPORT
jack_nframes_t
jack_time_to_frames
(
const
jack_client_t
*client,
jack_time_t
usecs);
LIB_EXPORT
jack_time_t
jack_frames_to_time
(
const
jack_client_t
*client,
jack_nframes_t
frames);
LIB_EXPORT
jack_nframes_t
jack_frame_time
(
const
jack_client_t
*);
LIB_EXPORT
jack_nframes_t
jack_last_frame_time
(
const
jack_client_t
*client);
LIB_EXPORT
int
jack_get_cycle_times
(
const
jack_client_t
*client,
jack_nframes_t
*current_frames,
jack_time_t
*current_usecs,
jack_time_t
*next_usecs,
float
*period_usecs);
LIB_EXPORT
float
jack_cpu_load
(
jack_client_t
*client);
LIB_EXPORT
float
jack_max_cpu_load
(
jack_client_t
*client);
LIB_EXPORT
jack_native_thread_t
jack_client_thread_id
(
jack_client_t
*);
LIB_EXPORT
void
jack_set_error_function
(print_function);
LIB_EXPORT
void
jack_set_info_function
(print_function);
LIB_EXPORT
float
jack_get_max_delayed_usecs
(
jack_client_t
*client);
LIB_EXPORT
float
jack_get_xrun_delayed_usecs
(
jack_client_t
*client);
LIB_EXPORT
void
jack_reset_max_delayed_usecs
(
jack_client_t
*client);
LIB_EXPORT
int
jack_release_timebase
(
jack_client_t
*client);
LIB_EXPORT
int
jack_set_sync_callback
(
jack_client_t
*client,
JackSyncCallback sync_callback,
void
*arg);
LIB_EXPORT
int
jack_set_sync_timeout
(
jack_client_t
*client,
jack_time_t
timeout);
LIB_EXPORT
int
jack_set_timebase_callback
(
jack_client_t
*client,
int
conditional,
JackTimebaseCallback timebase_callback,
void
*arg);
LIB_EXPORT
int
jack_transport_locate
(
jack_client_t
*client,
jack_nframes_t
frame);
LIB_EXPORT
jack_transport_state_t
jack_transport_query
(
const
jack_client_t
*client,
jack_position_t
*pos);
LIB_EXPORT
jack_nframes_t
jack_get_current_transport_frame
(
const
jack_client_t
*client);
LIB_EXPORT
int
jack_transport_reposition
(
jack_client_t
*client,
const
jack_position_t
*pos);
LIB_EXPORT
void
jack_transport_start
(
jack_client_t
*client);
LIB_EXPORT
void
jack_transport_stop
(
jack_client_t
*client);
LIB_EXPORT
void
jack_get_transport_info
(
jack_client_t
*client,
jack_transport_info_t
*tinfo);
LIB_EXPORT
void
jack_set_transport_info
(
jack_client_t
*client,
jack_transport_info_t
*tinfo);
LIB_EXPORT
int
jack_client_real_time_priority
(
jack_client_t
*);
LIB_EXPORT
int
jack_client_max_real_time_priority
(
jack_client_t
*);
LIB_EXPORT
int
jack_acquire_real_time_scheduling
(
jack_native_thread_t
thread,
int
priority);
LIB_EXPORT
int
jack_client_create_thread
(
jack_client_t
* client,
jack_native_thread_t
*thread,
int
priority,
int
realtime,
//
boolean
thread_routine routine,
void
*arg);
LIB_EXPORT
int
jack_drop_real_time_scheduling
(
jack_native_thread_t
thread);
LIB_EXPORT
int
jack_client_stop_thread
(
jack_client_t
* client,
jack_native_thread_t
thread);
LIB_EXPORT
int
jack_client_kill_thread
(
jack_client_t
* client,
jack_native_thread_t
thread);
#
ifndef
WIN32
LIB_EXPORT
void
jack_set_thread_creator
(
jack_thread_creator_t
jtc);
#
endif
LIB_EXPORT
char
*
jack_get_internal_client_name
(
jack_client_t
*client,
jack_intclient_t
intclient);
LIB_EXPORT
jack_intclient_t
jack_internal_client_handle
(
jack_client_t
*client,
const
char
* client_name,
jack_status_t
*status);
LIB_EXPORT
jack_intclient_t
jack_internal_client_load
(
jack_client_t
*client,
const
char
* client_name,
jack_options_t
options,
jack_status_t
*status, ...);
LIB_EXPORT
jack_status_t
jack_internal_client_unload
(
jack_client_t
*client,
jack_intclient_t
intclient);
LIB_EXPORT
void
jack_free
(
void
* ptr);
LIB_EXPORT
int
jack_set_session_callback
(
jack_client_t
* ext_client, JackSessionCallback session_callback,
void
* arg);
LIB_EXPORT
jack_session_command_t
*
jack_session_notify
(
jack_client_t
* ext_client,
const
char
* target,
jack_session_event_type_t
ev_type,
const
char
* path);
LIB_EXPORT
int
jack_session_reply
(
jack_client_t
* ext_client,
jack_session_event_t
*event);
LIB_EXPORT
void
jack_session_event_free
(
jack_session_event_t
* ev);
LIB_EXPORT
char
*
jack_client_get_uuid
(
jack_client_t
*client);
LIB_EXPORT
char
*
jack_get_uuid_for_client_name
(
jack_client_t
* ext_client,
const
char
* client_name);
LIB_EXPORT
char
*
jack_get_client_name_by_uuid
(
jack_client_t
* ext_client,
const
char
* client_uuid);
LIB_EXPORT
int
jack_reserve_client_name
(
jack_client_t
* ext_client,
const
char
* name,
const
char
* uuid);
LIB_EXPORT
void
jack_session_commands_free
(
jack_session_command_t
*cmds);
LIB_EXPORT
int
jack_client_has_session_callback
(
jack_client_t
*client,
const
char
* client_name);
LIB_EXPORT
jack_uuid_t
jack_client_uuid_generate
();
LIB_EXPORT
jack_uuid_t
jack_port_uuid_generate
(
uint32_t
port_id);
LIB_EXPORT
uint32_t
jack_uuid_to_index
(
jack_uuid_t
);
LIB_EXPORT
int
jack_uuid_compare
(
jack_uuid_t
,
jack_uuid_t
);
LIB_EXPORT
void
jack_uuid_copy
(
jack_uuid_t
* dst,
jack_uuid_t
src);
LIB_EXPORT
void
jack_uuid_clear
(
jack_uuid_t
*);
LIB_EXPORT
int
jack_uuid_parse
(
const
char
* buf,
jack_uuid_t
*);
LIB_EXPORT
void
jack_uuid_unparse
(
jack_uuid_t
,
char
buf[
JACK_UUID_STRING_SIZE
]);
LIB_EXPORT
int
jack_uuid_empty
(
jack_uuid_t
);
LIB_EXPORT
int
jack_set_property
(
jack_client_t
*,
jack_uuid_t
subject,
const
char
* key,
const
char
* value,
const
char
* type);
LIB_EXPORT
int
jack_get_property
(
jack_uuid_t
subject,
const
char
* key,
char
** value,
char
** type);
LIB_EXPORT
void
jack_free_description
(
jack_description_t
* desc,
int
free_description_itself);
LIB_EXPORT
int
jack_get_properties
(
jack_uuid_t
subject,
jack_description_t
* desc);
LIB_EXPORT
int
jack_get_all_properties
(
jack_description_t
** descs);
LIB_EXPORT
int
jack_remove_property
(
jack_client_t
* client,
jack_uuid_t
subject,
const
char
* key);
LIB_EXPORT
int
jack_remove_properties
(
jack_client_t
* client,
jack_uuid_t
subject);
LIB_EXPORT
int
jack_remove_all_properties
(
jack_client_t
* client);
LIB_EXPORT
int
jack_set_property_change_callback
(
jack_client_t
* client, JackPropertyChangeCallback callback,
void
* arg);
#
ifdef
__cplusplus
}
#
endif
static
inline
bool
CheckPort
(
jack_port_id_t
port_index)
{
return
(port_index >
0
&& port_index <
PORT_NUM_MAX
);
}
static
inline
bool
CheckBufferSize
(
jack_nframes_t
buffer_size)
{
return
(buffer_size >=
1
&& buffer_size <=
BUFFER_SIZE_MAX
);
}
static
inline
void
WaitGraphChange
()
{
/*
TLS key that is set only in RT thread, so never waits for pending
graph change in RT context (just read the current graph state).
*/
if
(
jack_tls_get
(JackGlobals::
fRealTimeThread
) ==
NULL
) {
JackGraphManager* manager =
GetGraphManager
();
JackEngineControl* control =
GetEngineControl
();
assert
(manager);
assert
(control);
if
(manager->
IsPendingChange
()) {
jack_log
(
"
WaitGraphChange...
"
);
JackSleep
(
int
(control->
fPeriodUsecs
*
1
.
1f
));
}
}
}
LIB_EXPORT
void
jack_set_error_function
(print_function func)
{
jack_error_callback = (func ==
NULL
) ? &default_jack_error_callback : func;
}
LIB_EXPORT
void
jack_set_info_function
(print_function func)
{
jack_info_callback = (func ==
NULL
) ? &default_jack_info_callback : func;
}
LIB_EXPORT
jack_client_t
*
jack_client_new
(
const
char
* client_name)
{
JackGlobals::CheckContext
(
"
jack_client_new
"
);
try
{
assert
(JackGlobals::
fOpenMutex
);
JackGlobals::
fOpenMutex
->
Lock
();
jack_error
(
"
jack_client_new: deprecated
"
);
int
options = JackUseExactName;
if
(
getenv
(
"
JACK_START_SERVER
"
) ==
NULL
) {
options |= JackNoStartServer;
}
jack_client_t
* res =
jack_client_new_aux
(client_name, (
jack_options_t
)options,
NULL
);
JackGlobals::
fOpenMutex
->
Unlock
();
return
res;
}
catch
(std::bad_alloc& e) {
jack_error
(
"
Memory allocation error...
"
);
return
NULL
;
}
catch
(...) {
jack_error
(
"
Unknown error...
"
);
return
NULL
;
}
}
LIB_EXPORT
void
*
jack_port_get_buffer
(
jack_port_t
* port,
jack_nframes_t
frames)
{
JackGlobals::CheckContext
(
"
jack_port_get_buffer
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_get_buffer called with an incorrect port %ld
"
, myport);
return
NULL
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetBuffer
(myport, frames) :
NULL
);
}
}
LIB_EXPORT
jack_uuid_t
jack_port_uuid
(
const
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_uuid
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_uuid called with an incorrect port %ld
"
, myport);
return
0
;
}
else
{
return
jack_port_uuid_generate
(myport);
}
}
LIB_EXPORT
const
char
*
jack_port_name
(
const
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_name
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_name called with an incorrect port %ld
"
, myport);
return
NULL
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
GetName
() :
NULL
);
}
}
LIB_EXPORT
const
char
*
jack_port_short_name
(
const
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_short_name
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_short_name called with an incorrect port %ld
"
, myport);
return
NULL
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
GetShortName
() :
NULL
);
}
}
LIB_EXPORT
int
jack_port_flags
(
const
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_flags
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_flags called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
GetFlags
() : -
1
);
}
}
LIB_EXPORT
const
char
*
jack_port_type
(
const
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_type
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_flags called an incorrect port %ld
"
, myport);
return
NULL
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
GetType
() :
NULL
);
}
}
LIB_EXPORT
jack_port_type_id_t
jack_port_type_id
(
const
jack_port_t
*port)
{
JackGlobals::CheckContext
(
"
jack_port_type_id
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_type_id called an incorrect port %ld
"
, myport);
return
0
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ?
GetPortTypeId
(manager->
GetPort
(myport)->
GetType
()) :
0
);
}
}
LIB_EXPORT
int
jack_port_connected
(
const
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_connected
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_connected called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
{
WaitGraphChange
();
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetConnectionsNum
(myport) : -
1
);
}
}
LIB_EXPORT
int
jack_port_connected_to
(
const
jack_port_t
* port,
const
char
* port_name)
{
JackGlobals::CheckContext
(
"
jack_port_connected_to
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
src = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(src)) {
jack_error
(
"
jack_port_connected_to called with an incorrect port %ld
"
, src);
return
-
1
;
}
else
if
(port_name ==
NULL
) {
jack_error
(
"
jack_port_connected_to called with a NULL port name
"
);
return
-
1
;
}
else
{
WaitGraphChange
();
JackGraphManager* manager =
GetGraphManager
();
jack_port_id_t
dst = (manager ? manager->
GetPort
(port_name) :
NO_PORT
);
if
(dst ==
NO_PORT
) {
jack_error
(
"
Unknown destination port port_name = %s
"
, port_name);
return
0
;
}
else
{
return
manager->
IsConnected
(src, dst);
}
}
}
LIB_EXPORT
int
jack_port_tie
(
jack_port_t
* src,
jack_port_t
* dst)
{
JackGlobals::CheckContext
(
"
jack_port_tie
"
);
uintptr_t
src_aux = (
uintptr_t
)src;
jack_port_id_t
mysrc = (
jack_port_id_t
)src_aux;
if
(!
CheckPort
(mysrc)) {
jack_error
(
"
jack_port_tie called with a NULL src port
"
);
return
-
1
;
}
uintptr_t
dst_aux = (
uintptr_t
)dst;
jack_port_id_t
mydst = (
jack_port_id_t
)dst_aux;
if
(!
CheckPort
(mydst)) {
jack_error
(
"
jack_port_tie called with a NULL dst port
"
);
return
-
1
;
}
JackGraphManager* manager =
GetGraphManager
();
if
(manager && manager->
GetPort
(mysrc)->
GetRefNum
() != manager->
GetPort
(mydst)->
GetRefNum
()) {
jack_error
(
"
jack_port_tie called with ports not belonging to the same client
"
);
return
-
1
;
}
else
{
return
(manager ? manager->
GetPort
(mydst)->
Tie
(mysrc) : -
1
);
}
}
LIB_EXPORT
int
jack_port_untie
(
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_untie
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_untie called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
UnTie
() : -
1
);
}
}
LIB_EXPORT
jack_nframes_t
jack_port_get_latency
(
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_get_latency
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_get_latency called with an incorrect port %ld
"
, myport);
return
0
;
}
else
{
WaitGraphChange
();
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
GetLatency
() :
0
);
}
}
LIB_EXPORT
void
jack_port_set_latency
(
jack_port_t
* port,
jack_nframes_t
frames)
{
JackGlobals::CheckContext
(
"
jack_port_set_latency
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_set_latency called with an incorrect port %ld
"
, myport);
}
else
{
JackGraphManager* manager =
GetGraphManager
();
if
(manager)
manager->
GetPort
(myport)->
SetLatency
(frames);
}
}
LIB_EXPORT
void
jack_port_get_latency_range
(
jack_port_t
*port,
jack_latency_callback_mode_t
mode,
jack_latency_range_t
*range)
{
JackGlobals::CheckContext
(
"
jack_port_get_latency_range
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_get_latency_range called with an incorrect port %ld
"
, myport);
}
else
{
WaitGraphChange
();
JackGraphManager* manager =
GetGraphManager
();
if
(manager)
manager->
GetPort
(myport)->
GetLatencyRange
(mode, range);
}
}
LIB_EXPORT
void
jack_port_set_latency_range
(
jack_port_t
*port,
jack_latency_callback_mode_t
mode,
jack_latency_range_t
*range)
{
JackGlobals::CheckContext
(
"
jack_port_set_latency_range
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_set_latency_range called with an incorrect port %ld
"
, myport);
}
else
{
WaitGraphChange
();
JackGraphManager* manager =
GetGraphManager
();
if
(manager)
manager->
GetPort
(myport)->
SetLatencyRange
(mode, range);
}
}
LIB_EXPORT
int
jack_recompute_total_latency
(
jack_client_t
* ext_client,
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_recompute_total_latency
"
);
JackClient* client = (JackClient*)ext_client;
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(client ==
NULL
) {
jack_error
(
"
jack_recompute_total_latency called with a NULL client
"
);
return
-
1
;
}
else
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_recompute_total_latency called with a NULL port
"
);
return
-
1
;
}
else
{
WaitGraphChange
();
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
ComputeTotalLatency
(myport) : -
1
);
}
}
LIB_EXPORT
int
jack_recompute_total_latencies
(
jack_client_t
* ext_client)
{
JackGlobals::CheckContext
(
"
jack_recompute_total_latencies
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_recompute_total_latencies called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
ComputeTotalLatencies
();
}
}
LIB_EXPORT
int
jack_port_set_name
(
jack_port_t
* port,
const
char
* name)
{
JackGlobals::CheckContext
(
"
jack_port_set_name
"
);
jack_error
(
"
jack_port_set_name: deprecated
"
);
//
Find a valid client
jack_client_t
* client =
NULL
;
for
(
int
i =
0
; i <
CLIENT_NUM
; i++) {
if
((client = (
jack_client_t
*)JackGlobals::
fClientTable
[i])) {
break
;
}
}
return
(client) ?
jack_port_rename
(client, port, name) : -
1
;
}
LIB_EXPORT
int
jack_port_rename
(
jack_client_t
* ext_client,
jack_port_t
* port,
const
char
* name)
{
JackGlobals::CheckContext
(
"
jack_port_rename
"
);
JackClient* client = (JackClient*)ext_client;
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(client ==
NULL
) {
jack_error
(
"
jack_port_rename called with a NULL client
"
);
return
-
1
;
}
else
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_rename called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
if
(name ==
NULL
) {
jack_error
(
"
jack_port_rename called with a NULL port name
"
);
return
-
1
;
}
else
{
return
client->
PortRename
(myport, name);
}
}
LIB_EXPORT
int
jack_port_set_alias
(
jack_port_t
* port,
const
char
* name)
{
JackGlobals::CheckContext
(
"
jack_port_set_alias
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_set_alias called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
if
(name ==
NULL
) {
jack_error
(
"
jack_port_set_alias called with a NULL port name
"
);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
SetAlias
(name) : -
1
);
}
}
LIB_EXPORT
int
jack_port_unset_alias
(
jack_port_t
* port,
const
char
* name)
{
JackGlobals::CheckContext
(
"
jack_port_unset_alias
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_unset_alias called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
if
(name ==
NULL
) {
jack_error
(
"
jack_port_unset_alias called with a NULL port name
"
);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
UnsetAlias
(name) : -
1
);
}
}
LIB_EXPORT
int
jack_port_get_aliases
(
const
jack_port_t
* port,
char
*
const
aliases[
2
])
{
JackGlobals::CheckContext
(
"
jack_port_get_aliases
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_get_aliases called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
GetAliases
(aliases) : -
1
);
}
}
LIB_EXPORT
int
jack_port_request_monitor
(
jack_port_t
* port,
int
onoff)
{
JackGlobals::CheckContext
(
"
jack_port_request_monitor
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_request_monitor called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
RequestMonitor
(myport, onoff) : -
1
);
}
}
LIB_EXPORT
int
jack_port_request_monitor_by_name
(
jack_client_t
* ext_client,
const
char
* port_name,
int
onoff)
{
JackGlobals::CheckContext
(
"
jack_port_request_monitor_by_name
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_port_request_monitor_by_name called with a NULL client
"
);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
if
(!manager)
return
-
1
;
jack_port_id_t
myport = manager->
GetPort
(port_name);
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_request_monitor_by_name called with an incorrect port %s
"
, port_name);
return
-
1
;
}
else
{
return
manager->
RequestMonitor
(myport, onoff);
}
}
}
LIB_EXPORT
int
jack_port_ensure_monitor
(
jack_port_t
* port,
int
onoff)
{
JackGlobals::CheckContext
(
"
jack_port_ensure_monitor
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_ensure_monitor called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
EnsureMonitor
(onoff) : -
1
);
}
}
LIB_EXPORT
int
jack_port_monitoring_input
(
jack_port_t
* port)
{
JackGlobals::CheckContext
(
"
jack_port_monitoring_input
"
);
uintptr_t
port_aux = (
uintptr_t
)port;
jack_port_id_t
myport = (
jack_port_id_t
)port_aux;
if
(!
CheckPort
(myport)) {
jack_error
(
"
jack_port_monitoring_input called with an incorrect port %ld
"
, myport);
return
-
1
;
}
else
{
JackGraphManager* manager =
GetGraphManager
();
return
(manager ? manager->
GetPort
(myport)->
MonitoringInput
() : -
1
);
}
}
LIB_EXPORT
int
jack_is_realtime
(
jack_client_t
* ext_client)
{
JackGlobals::CheckContext
(
"
jack_is_realtime
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_is_realtime called with a NULL client
"
);
return
-
1
;
}
else
{
JackEngineControl* control =
GetEngineControl
();
return
(control ? control->
fRealTime
: -
1
);
}
}
LIB_EXPORT
void
jack_on_shutdown
(
jack_client_t
* ext_client, JackShutdownCallback callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_on_shutdown
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_on_shutdown called with a NULL client
"
);
}
else
{
client->
OnShutdown
(callback, arg);
}
}
LIB_EXPORT
void
jack_on_info_shutdown
(
jack_client_t
* ext_client, JackInfoShutdownCallback callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_on_info_shutdown
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_on_info_shutdown called with a NULL client
"
);
}
else
{
client->
OnInfoShutdown
(callback, arg);
}
}
LIB_EXPORT
int
jack_set_process_callback
(
jack_client_t
* ext_client, JackProcessCallback callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_set_process_callback
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_process_callback called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetProcessCallback
(callback, arg);
}
}
LIB_EXPORT
jack_nframes_t
jack_thread_wait
(
jack_client_t
* ext_client,
int
status)
{
JackGlobals::CheckContext
(
"
jack_thread_wait
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_thread_wait called with a NULL client
"
);
return
0
;
}
else
{
jack_error
(
"
jack_thread_wait: deprecated, use jack_cycle_wait/jack_cycle_signal
"
);
return
0
;
}
}
LIB_EXPORT
jack_nframes_t
jack_cycle_wait
(
jack_client_t
* ext_client)
{
JackGlobals::CheckContext
(
"
jack_cycle_wait
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_cycle_wait called with a NULL client
"
);
return
0
;
}
else
{
return
client->
CycleWait
();
}
}
LIB_EXPORT
void
jack_cycle_signal
(
jack_client_t
* ext_client,
int
status)
{
JackGlobals::CheckContext
(
"
jack_cycle_signal
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_cycle_signal called with a NULL client
"
);
}
else
{
client->
CycleSignal
(status);
}
}
LIB_EXPORT
int
jack_set_process_thread
(
jack_client_t
* ext_client, JackThreadCallback fun,
void
*arg)
{
JackGlobals::CheckContext
(
"
jack_set_process_thread
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_process_thread called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetProcessThread
(fun, arg);
}
}
LIB_EXPORT
int
jack_set_freewheel_callback
(
jack_client_t
* ext_client, JackFreewheelCallback freewheel_callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_set_freewheel_callback
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_freewheel_callback called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetFreewheelCallback
(freewheel_callback, arg);
}
}
LIB_EXPORT
int
jack_set_freewheel
(
jack_client_t
* ext_client,
int
onoff)
{
JackGlobals::CheckContext
(
"
jack_set_freewheel
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_freewheel called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetFreeWheel
(onoff);
}
}
LIB_EXPORT
int
jack_set_buffer_size
(
jack_client_t
* ext_client,
jack_nframes_t
buffer_size)
{
JackGlobals::CheckContext
(
"
jack_set_buffer_size
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_buffer_size called with a NULL client
"
);
return
-
1
;
}
else
if
(!
CheckBufferSize
(buffer_size)) {
return
-
1
;
}
else
{
return
client->
SetBufferSize
(buffer_size);
}
}
LIB_EXPORT
int
jack_set_buffer_size_callback
(
jack_client_t
* ext_client, JackBufferSizeCallback bufsize_callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_set_buffer_size_callback
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_buffer_size_callback called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetBufferSizeCallback
(bufsize_callback, arg);
}
}
LIB_EXPORT
int
jack_set_sample_rate_callback
(
jack_client_t
* ext_client, JackSampleRateCallback srate_callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_set_sample_rate_callback
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_sample_rate_callback called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetSampleRateCallback
(srate_callback, arg);
}
}
LIB_EXPORT
int
jack_set_client_registration_callback
(
jack_client_t
* ext_client, JackClientRegistrationCallback registration_callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_set_client_registration_callback
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_client_registration_callback called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetClientRegistrationCallback
(registration_callback, arg);
}
}
LIB_EXPORT
int
jack_set_port_registration_callback
(
jack_client_t
* ext_client, JackPortRegistrationCallback registration_callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_set_port_registration_callback
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_port_registration_callback called with a NULL client
"
);
return
-
1
;
}
else
{
return
client->
SetPortRegistrationCallback
(registration_callback, arg);
}
}
LIB_EXPORT
int
jack_set_port_connect_callback
(
jack_client_t
* ext_client, JackPortConnectCallback portconnect_callback,
void
* arg)
{
JackGlobals::CheckContext
(
"
jack_set_port_connect_callback
"
);
JackClient* client = (JackClient*)ext_client;
if
(client ==
NULL
) {
jack_error
(
"
jack_set_port_connect_callback called with a NULL client
"
);
return
-
1
;
}
else
{
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL