~ubuntu-branches/ubuntu/quantal/jackd2/quantal

« back to all changes in this revision

Viewing changes to common/JackAPI.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Adrian Knoth, Reinhard Tartler, Jonas Smedegaard
  • Date: 2010-06-19 18:54:29 UTC
  • Revision ID: james.westby@ubuntu.com-20100619185429-zhbhh0mqvukgzx0l
Tags: 1.9.5~dfsg-15
[ Adrian Knoth ]
* Also provide the shlibs file for libjack-jackd2-0
* Fix FTBFS on sparc64 (Closes: #586257)

[ Reinhard Tartler ]
* jackd must not be a virtual package, use 'jack-daemon' for that
* add breaks/replaces on old libjack0
* change shlibsfile to prefer jackd2's libjack
* use conflicts instead of breaks. libjack-jackd2-0 has file conflicts
  with libjack0 and will keep it

[ Jonas Smedegaard ]
* Update control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    const char *
57
57
    jack_get_version_string();
58
58
 
59
 
    EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
 
59
    jack_client_t * jack_client_new_aux (const char *client_name,
60
60
            jack_options_t options,
61
 
            jack_status_t *status, va_list ap);
 
61
            jack_status_t *status);
62
62
    EXPORT jack_client_t * jack_client_open (const char *client_name,
63
63
            jack_options_t options,
64
64
            jack_status_t *status, ...);
300
300
        int options = JackUseExactName;
301
301
        if (getenv("JACK_START_SERVER") == NULL)
302
302
            options |= JackNoStartServer;
303
 
        jack_client_t* res = jack_client_open_aux(client_name, (jack_options_t)options, NULL, NULL);
 
303
        jack_client_t* res = jack_client_new_aux(client_name, (jack_options_t)options, NULL);
304
304
        JackGlobals::fOpenMutex->Unlock();
305
305
        return res;
306
306
    } catch (std::bad_alloc& e) {
317
317
#ifdef __CLIENTDEBUG__
318
318
    JackGlobals::CheckContext("jack_port_get_buffer");
319
319
#endif
320
 
#if defined(__x86_64__) || defined(__ppc64__)
321
 
    uint64_t port_aux = (uint64_t)port;
322
 
#else
323
 
    uint32_t port_aux = (uint32_t)port;
324
 
#endif
 
320
    uintptr_t port_aux = (uintptr_t)port;
325
321
    jack_port_id_t myport = (jack_port_id_t)port_aux;
326
322
    if (!CheckPort(myport)) {
327
323
        jack_error("jack_port_get_buffer called with an incorrect port %ld", myport);
337
333
#ifdef __CLIENTDEBUG__
338
334
    JackGlobals::CheckContext("jack_port_name");
339
335
#endif
340
 
#if defined(__x86_64__) || defined(__ppc64__)
341
 
    uint64_t port_aux = (uint64_t)port;
342
 
#else
343
 
    uint32_t port_aux = (uint32_t)port;
344
 
#endif
 
336
    uintptr_t port_aux = (uintptr_t)port;
345
337
    jack_port_id_t myport = (jack_port_id_t)port_aux;
346
338
    if (!CheckPort(myport)) {
347
339
        jack_error("jack_port_name called with an incorrect port %ld", myport);
357
349
#ifdef __CLIENTDEBUG__
358
350
    JackGlobals::CheckContext("jack_port_short_name");
359
351
#endif
360
 
#if defined(__x86_64__) || defined(__ppc64__)
361
 
    uint64_t port_aux = (uint64_t)port;
362
 
#else
363
 
    uint32_t port_aux = (uint32_t)port;
364
 
#endif
 
352
    uintptr_t port_aux = (uintptr_t)port;
365
353
    jack_port_id_t myport = (jack_port_id_t)port_aux;
366
354
    if (!CheckPort(myport)) {
367
355
        jack_error("jack_port_short_name called with an incorrect port %ld", myport);
377
365
#ifdef __CLIENTDEBUG__
378
366
    JackGlobals::CheckContext("jack_port_flags");
379
367
#endif
380
 
#if defined(__x86_64__) || defined(__ppc64__)
381
 
    uint64_t port_aux = (uint64_t)port;
382
 
#else
383
 
    uint32_t port_aux = (uint32_t)port;
384
 
#endif
 
368
    uintptr_t port_aux = (uintptr_t)port;
385
369
    jack_port_id_t myport = (jack_port_id_t)port_aux;
386
370
    if (!CheckPort(myport)) {
387
371
        jack_error("jack_port_flags called with an incorrect port %ld", myport);
397
381
#ifdef __CLIENTDEBUG__
398
382
    JackGlobals::CheckContext("jack_port_type");
399
383
#endif
400
 
 #if defined(__x86_64__) || defined(__ppc64__)
401
 
    uint64_t port_aux = (uint64_t)port;
402
 
#else
403
 
    uint32_t port_aux = (uint32_t)port;
404
 
#endif
 
384
    uintptr_t port_aux = (uintptr_t)port;
405
385
    jack_port_id_t myport = (jack_port_id_t)port_aux;
406
386
   if (!CheckPort(myport)) {
407
387
        jack_error("jack_port_flags called an incorrect port %ld", myport);
417
397
#ifdef __CLIENTDEBUG__
418
398
    JackGlobals::CheckContext("jack_port_type_id");
419
399
#endif
420
 
#if defined(__x86_64__) || defined(__ppc64__)
421
 
    uint64_t port_aux = (uint64_t)port;
422
 
#else
423
 
    uint32_t port_aux = (uint32_t)port;
424
 
#endif
 
400
    uintptr_t port_aux = (uintptr_t)port;
425
401
    jack_port_id_t myport = (jack_port_id_t)port_aux;
426
402
    if (!CheckPort(myport)) {
427
403
        jack_error("jack_port_type_id called an incorrect port %ld", myport);
437
413
#ifdef __CLIENTDEBUG__
438
414
    JackGlobals::CheckContext("jack_port_connected");
439
415
#endif
440
 
#if defined(__x86_64__) || defined(__ppc64__)
441
 
    uint64_t port_aux = (uint64_t)port;
442
 
#else
443
 
    uint32_t port_aux = (uint32_t)port;
444
 
#endif
 
416
    uintptr_t port_aux = (uintptr_t)port;
445
417
    jack_port_id_t myport = (jack_port_id_t)port_aux;
446
418
    if (!CheckPort(myport)) {
447
419
        jack_error("jack_port_connected called with an incorrect port %ld", myport);
458
430
#ifdef __CLIENTDEBUG__
459
431
    JackGlobals::CheckContext("jack_port_connected_to");
460
432
#endif
461
 
#if defined(__x86_64__) || defined(__ppc64__)
462
 
    uint64_t port_aux = (uint64_t)port;
463
 
#else
464
 
    uint32_t port_aux = (uint32_t)port;
465
 
#endif
 
433
    uintptr_t port_aux = (uintptr_t)port;
466
434
    jack_port_id_t src = (jack_port_id_t)port_aux;
467
435
    if (!CheckPort(src)) {
468
436
        jack_error("jack_port_connected_to called with an incorrect port %ld", src);
488
456
#ifdef __CLIENTDEBUG__
489
457
    JackGlobals::CheckContext("jack_port_tie");
490
458
#endif
491
 
#if defined(__x86_64__) || defined(__ppc64__)
492
 
    uint64_t src_aux = (uint64_t)src;
493
 
#else
494
 
    uint32_t src_aux = (uint32_t)src;
495
 
#endif
 
459
    uintptr_t src_aux = (uintptr_t)src;
496
460
    jack_port_id_t mysrc = (jack_port_id_t)src_aux;
497
461
    if (!CheckPort(mysrc)) {
498
462
        jack_error("jack_port_tie called with a NULL src port");
499
463
        return -1;
500
464
    }
501
 
#if defined(__x86_64__) || defined(__ppc64__)
502
 
    uint64_t dst_aux = (uint64_t)dst;
503
 
#else
504
 
    uint32_t dst_aux = (uint32_t)dst;
505
 
#endif
 
465
    uintptr_t dst_aux = (uintptr_t)dst;
506
466
    jack_port_id_t mydst = (jack_port_id_t)dst_aux;
507
467
    if (!CheckPort(mydst)) {
508
468
        jack_error("jack_port_tie called with a NULL dst port");
522
482
#ifdef __CLIENTDEBUG__
523
483
    JackGlobals::CheckContext("jack_port_untie");
524
484
#endif
525
 
#if defined(__x86_64__) || defined(__ppc64__)
526
 
    uint64_t port_aux = (uint64_t)port;
527
 
#else
528
 
    uint32_t port_aux = (uint32_t)port;
529
 
#endif
 
485
    uintptr_t port_aux = (uintptr_t)port;
530
486
    jack_port_id_t myport = (jack_port_id_t)port_aux;
531
487
    if (!CheckPort(myport)) {
532
488
        jack_error("jack_port_untie called with an incorrect port %ld", myport);
542
498
#ifdef __CLIENTDEBUG__
543
499
    JackGlobals::CheckContext("jack_port_get_latency");
544
500
#endif
545
 
#if defined(__x86_64__) || defined(__ppc64__)
546
 
    uint64_t port_aux = (uint64_t)port;
547
 
#else
548
 
    uint32_t port_aux = (uint32_t)port;
549
 
#endif
 
501
    uintptr_t port_aux = (uintptr_t)port;
550
502
    jack_port_id_t myport = (jack_port_id_t)port_aux;
551
503
    if (!CheckPort(myport)) {
552
504
        jack_error("jack_port_get_latency called with an incorrect port %ld", myport);
563
515
#ifdef __CLIENTDEBUG__
564
516
    JackGlobals::CheckContext("jack_port_set_latency");
565
517
#endif
566
 
#if defined(__x86_64__) || defined(__ppc64__)
567
 
    uint64_t port_aux = (uint64_t)port;
568
 
#else
569
 
    uint32_t port_aux = (uint32_t)port;
570
 
#endif
 
518
    uintptr_t port_aux = (uintptr_t)port;
571
519
    jack_port_id_t myport = (jack_port_id_t)port_aux;
572
520
    if (!CheckPort(myport)) {
573
521
        jack_error("jack_port_set_latency called with an incorrect port %ld", myport);
585
533
#endif
586
534
 
587
535
    JackClient* client = (JackClient*)ext_client;
588
 
#if defined(__x86_64__) || defined(__ppc64__)
589
 
    uint64_t port_aux = (uint64_t)port;
590
 
#else
591
 
    uint32_t port_aux = (uint32_t)port;
592
 
#endif
 
536
    uintptr_t port_aux = (uintptr_t)port;
593
537
    jack_port_id_t myport = (jack_port_id_t)port_aux;
594
538
    if (client == NULL) {
595
539
        jack_error("jack_recompute_total_latencies called with a NULL client");
630
574
#ifdef __CLIENTDEBUG__
631
575
    JackGlobals::CheckContext("jack_port_set_name");
632
576
#endif
633
 
#if defined(__x86_64__) || defined(__ppc64__)
634
 
    uint64_t port_aux = (uint64_t)port;
635
 
#else
636
 
    uint32_t port_aux = (uint32_t)port;
637
 
#endif
 
577
    uintptr_t port_aux = (uintptr_t)port;
638
578
    jack_port_id_t myport = (jack_port_id_t)port_aux;
639
579
    if (!CheckPort(myport)) {
640
580
        jack_error("jack_port_set_name called with an incorrect port %ld", myport);
660
600
#ifdef __CLIENTDEBUG__
661
601
    JackGlobals::CheckContext("jack_port_set_alias");
662
602
#endif
663
 
#if defined(__x86_64__) || defined(__ppc64__)
664
 
    uint64_t port_aux = (uint64_t)port;
665
 
#else
666
 
    uint32_t port_aux = (uint32_t)port;
667
 
#endif
 
603
    uintptr_t port_aux = (uintptr_t)port;
668
604
    jack_port_id_t myport = (jack_port_id_t)port_aux;
669
605
    if (!CheckPort(myport)) {
670
606
        jack_error("jack_port_set_alias called with an incorrect port %ld", myport);
683
619
#ifdef __CLIENTDEBUG__
684
620
    JackGlobals::CheckContext("jack_port_unset_alias");
685
621
#endif
686
 
#if defined(__x86_64__) || defined(__ppc64__)
687
 
    uint64_t port_aux = (uint64_t)port;
688
 
#else
689
 
    uint32_t port_aux = (uint32_t)port;
690
 
#endif
 
622
    uintptr_t port_aux = (uintptr_t)port;
691
623
    jack_port_id_t myport = (jack_port_id_t)port_aux;
692
624
    if (!CheckPort(myport)) {
693
625
        jack_error("jack_port_unset_alias called with an incorrect port %ld", myport);
706
638
#ifdef __CLIENTDEBUG__
707
639
    JackGlobals::CheckContext("jack_port_get_aliases");
708
640
#endif
709
 
#if defined(__x86_64__) || defined(__ppc64__)
710
 
    uint64_t port_aux = (uint64_t)port;
711
 
#else
712
 
    uint32_t port_aux = (uint32_t)port;
713
 
#endif
 
641
    uintptr_t port_aux = (uintptr_t)port;
714
642
    jack_port_id_t myport = (jack_port_id_t)port_aux;
715
643
    if (!CheckPort(myport)) {
716
644
        jack_error("jack_port_get_aliases called with an incorrect port %ld", myport);
726
654
#ifdef __CLIENTDEBUG__
727
655
    JackGlobals::CheckContext("jack_port_request_monitor");
728
656
#endif
729
 
#if defined(__x86_64__) || defined(__ppc64__)
730
 
    uint64_t port_aux = (uint64_t)port;
731
 
#else
732
 
    uint32_t port_aux = (uint32_t)port;
733
 
#endif
 
657
    uintptr_t port_aux = (uintptr_t)port;
734
658
    jack_port_id_t myport = (jack_port_id_t)port_aux;
735
659
    if (!CheckPort(myport)) {
736
660
        jack_error("jack_port_request_monitor called with an incorrect port %ld", myport);
769
693
#ifdef __CLIENTDEBUG__
770
694
    JackGlobals::CheckContext("jack_port_ensure_monitor");
771
695
#endif
772
 
 #if defined(__x86_64__) || defined(__ppc64__)
773
 
    uint64_t port_aux = (uint64_t)port;
774
 
#else
775
 
    uint32_t port_aux = (uint32_t)port;
776
 
#endif
 
696
    uintptr_t port_aux = (uintptr_t)port;
777
697
    jack_port_id_t myport = (jack_port_id_t)port_aux;
778
698
    if (!CheckPort(myport)) {
779
699
        jack_error("jack_port_ensure_monitor called with an incorrect port %ld", myport);
789
709
#ifdef __CLIENTDEBUG__
790
710
    JackGlobals::CheckContext("jack_port_monitoring_input");
791
711
#endif
792
 
#if defined(__x86_64__) || defined(__ppc64__)
793
 
    uint64_t port_aux = (uint64_t)port;
794
 
#else
795
 
    uint32_t port_aux = (uint32_t)port;
796
 
#endif
 
712
    uintptr_t port_aux = (uintptr_t)port;
797
713
    jack_port_id_t myport = (jack_port_id_t)port_aux;
798
714
    if (!CheckPort(myport)) {
799
715
        jack_error("jack_port_monitoring_input called with an incorrect port %ld", myport);
1128
1044
        jack_error("jack_port_register called with a NULL port name or a NULL port_type");
1129
1045
        return NULL;
1130
1046
    } else {
1131
 
#if defined(__x86_64__) || defined(__ppc64__)
1132
 
        return (jack_port_t *)((uint64_t)client->PortRegister(port_name, port_type, flags, buffer_size));
1133
 
#else
1134
 
        return (jack_port_t *)client->PortRegister(port_name, port_type, flags, buffer_size);
1135
 
#endif
 
1047
        return (jack_port_t *)((uintptr_t)client->PortRegister(port_name, port_type, flags, buffer_size));
1136
1048
    }
1137
1049
}
1138
1050
 
1146
1058
        jack_error("jack_port_unregister called with a NULL client");
1147
1059
        return -1;
1148
1060
    }
1149
 
#if defined(__x86_64__) || defined(__ppc64__)
1150
 
    uint64_t port_aux = (uint64_t)port;
1151
 
#else
1152
 
    uint32_t port_aux = (uint32_t)port;
1153
 
#endif
 
1061
    uintptr_t port_aux = (uintptr_t)port;
1154
1062
    jack_port_id_t myport = (jack_port_id_t)port_aux;
1155
1063
    if (!CheckPort(myport)) {
1156
1064
        jack_error("jack_port_unregister called with an incorrect port %ld", myport);
1169
1077
        jack_error("jack_port_is_mine called with a NULL client");
1170
1078
        return -1;
1171
1079
    }
1172
 
#if defined(__x86_64__) || defined(__ppc64__)
1173
 
    uint64_t port_aux = (uint64_t)port;
1174
 
#else
1175
 
    uint32_t port_aux = (uint32_t)port;
1176
 
#endif
 
1080
    uintptr_t port_aux = (uintptr_t)port;
1177
1081
    jack_port_id_t myport = (jack_port_id_t)port_aux;
1178
1082
    if (!CheckPort(myport)) {
1179
1083
        jack_error("jack_port_is_mine called with an incorrect port %ld", myport);
1187
1091
#ifdef __CLIENTDEBUG__
1188
1092
    JackGlobals::CheckContext("jack_port_get_connections");
1189
1093
#endif
1190
 
#if defined(__x86_64__) || defined(__ppc64__)
1191
 
    uint64_t port_aux = (uint64_t)port;
1192
 
#else
1193
 
    uint32_t port_aux = (uint32_t)port;
1194
 
#endif
 
1094
    uintptr_t port_aux = (uintptr_t)port;
1195
1095
    jack_port_id_t myport = (jack_port_id_t)port_aux;
1196
1096
    if (!CheckPort(myport)) {
1197
1097
        jack_error("jack_port_get_connections called with an incorrect port %ld", myport);
1215
1115
        return NULL;
1216
1116
    }
1217
1117
 
1218
 
#if defined(__x86_64__) || defined(__ppc64__)
1219
 
    uint64_t port_aux = (uint64_t)port;
1220
 
#else
1221
 
    uint32_t port_aux = (uint32_t)port;
1222
 
#endif
 
1118
    uintptr_t port_aux = (uintptr_t)port;
1223
1119
    jack_port_id_t myport = (jack_port_id_t)port_aux;
1224
1120
    if (!CheckPort(myport)) {
1225
1121
        jack_error("jack_port_get_all_connections called with an incorrect port %ld", myport);
1242
1138
        return 0;
1243
1139
    }
1244
1140
 
1245
 
#if defined(__x86_64__) || defined(__ppc64__)
1246
 
    uint64_t port_aux = (uint64_t)port;
1247
 
#else
1248
 
    uint32_t port_aux = (uint32_t)port;
1249
 
#endif
 
1141
    uintptr_t port_aux = (uintptr_t)port;
1250
1142
    jack_port_id_t myport = (jack_port_id_t)port_aux;
1251
1143
    if (!CheckPort(myport)) {
1252
1144
        jack_error("jack_port_get_total_latency called with an incorrect port %ld", myport);
1307
1199
        jack_error("jack_port_disconnect called with a NULL client");
1308
1200
        return -1;
1309
1201
    }
1310
 
#if defined(__x86_64__) || defined(__ppc64__)
1311
 
    uint64_t port_aux = (uint64_t)src;
1312
 
#else
1313
 
    uint32_t port_aux = (uint32_t)src;
1314
 
#endif
 
1202
    uintptr_t port_aux = (uintptr_t)src;
1315
1203
    jack_port_id_t myport = (jack_port_id_t)port_aux;
1316
1204
    if (!CheckPort(myport)) {
1317
1205
        jack_error("jack_port_disconnect called with an incorrect port %ld", myport);
1383
1271
        if (!manager)
1384
1272
            return NULL;
1385
1273
        int res = manager->GetPort(portname); // returns a port index at least > 1
1386
 
#if defined(__x86_64__) || defined(__ppc64__)
1387
 
        return (res == NO_PORT) ? NULL : (jack_port_t*)((uint64_t)res);
1388
 
#else
1389
 
        return (res == NO_PORT) ? NULL : (jack_port_t*)res;
1390
 
#endif
 
1274
        return (res == NO_PORT) ? NULL : (jack_port_t*)((uintptr_t)res);
1391
1275
    }
1392
1276
}
1393
1277
 
1397
1281
    JackGlobals::CheckContext("jack_port_by_id");
1398
1282
#endif
1399
1283
    /* jack_port_t* type is actually the port index */
1400
 
#if defined(__x86_64__) || defined(__ppc64__)
1401
 
    return (jack_port_t*)((uint64_t)id);
1402
 
#else
1403
 
    return (jack_port_t*)id;
1404
 
#endif
 
1284
    return (jack_port_t*)((uintptr_t)id);
1405
1285
}
1406
1286
 
1407
1287
EXPORT int jack_engine_takeover_timebase(jack_client_t* ext_client)