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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620
|
diff --git a/lib-src/portaudio-v19/include/pa_win_ds.h b/lib-src/portaudio-v19/include/pa_win_ds.h
index 5d38641..f8197e5 100644
--- a/lib-src/portaudio-v19/include/pa_win_ds.h
+++ b/lib-src/portaudio-v19/include/pa_win_ds.h
@@ -87,6 +87,22 @@ typedef struct PaWinDirectSoundStreamInfo{
}PaWinDirectSoundStreamInfo;
+/** Retrieve the GUID of the input device.
+
+ @param stream The stream to query.
+
+ @return A pointer to the GUID, or NULL if none.
+*/
+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
+
+/** Retrieve the GUID of the output device.
+
+ @param stream The stream to query.
+
+ @return A pointer to the GUID, or NULL if none.
+*/
+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
+
#ifdef __cplusplus
}
diff --git a/lib-src/portaudio-v19/include/pa_win_wasapi.h b/lib-src/portaudio-v19/include/pa_win_wasapi.h
index 40d3a09..1087157 100644
--- a/lib-src/portaudio-v19/include/pa_win_wasapi.h
+++ b/lib-src/portaudio-v19/include/pa_win_wasapi.h
@@ -1,433 +1,447 @@
-#ifndef PA_WIN_WASAPI_H
-#define PA_WIN_WASAPI_H
-/*
- * $Id: $
- * PortAudio Portable Real-Time Audio Library
- * DirectSound specific extensions
- *
- * Copyright (c) 1999-2007 Ross Bencina and Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however,
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
- * license above.
- */
-
-/** @file
- @ingroup public_header
- @brief WASAPI-specific PortAudio API extension header file.
-*/
-
-#include "portaudio.h"
-#include "pa_win_waveformat.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif /* __cplusplus */
-
-
-/* Setup flags */
-typedef enum PaWasapiFlags
-{
- /* puts WASAPI into exclusive mode */
- paWinWasapiExclusive = (1 << 0),
-
- /* allows to skip internal PA processing completely */
- paWinWasapiRedirectHostProcessor = (1 << 1),
-
- /* assigns custom channel mask */
- paWinWasapiUseChannelMask = (1 << 2),
-
- /* selects non-Event driven method of data read/write
- Note: WASAPI Event driven core is capable of 2ms latency!!!, but Polling
- method can only provide 15-20ms latency. */
- paWinWasapiPolling = (1 << 3),
-
- /* forces custom thread priority setting, must be used if PaWasapiStreamInfo::threadPriority
- is set to a custom value */
- paWinWasapiThreadPriority = (1 << 4)
-}
-PaWasapiFlags;
-#define paWinWasapiExclusive (paWinWasapiExclusive)
-#define paWinWasapiRedirectHostProcessor (paWinWasapiRedirectHostProcessor)
-#define paWinWasapiUseChannelMask (paWinWasapiUseChannelMask)
-#define paWinWasapiPolling (paWinWasapiPolling)
-#define paWinWasapiThreadPriority (paWinWasapiThreadPriority)
-
-
-/* Host processor. Allows to skip internal PA processing completely.
- You must set paWinWasapiRedirectHostProcessor flag to PaWasapiStreamInfo::flags member
- in order to have host processor redirected to your callback.
- Use with caution! inputFrames and outputFrames depend solely on final device setup.
- To query maximal values of inputFrames/outputFrames use PaWasapi_GetFramesPerHostBuffer.
-*/
-typedef void (*PaWasapiHostProcessorCallback) (void *inputBuffer, long inputFrames,
- void *outputBuffer, long outputFrames,
- void *userData);
-
-/* Device role. */
-typedef enum PaWasapiDeviceRole
-{
- eRoleRemoteNetworkDevice = 0,
- eRoleSpeakers,
- eRoleLineLevel,
- eRoleHeadphones,
- eRoleMicrophone,
- eRoleHeadset,
- eRoleHandset,
- eRoleUnknownDigitalPassthrough,
- eRoleSPDIF,
- eRoleHDMI,
- eRoleUnknownFormFactor
-}
-PaWasapiDeviceRole;
-
-
-/* Jack connection type. */
-typedef enum PaWasapiJackConnectionType
-{
- eJackConnTypeUnknown,
- eJackConnType3Point5mm,
- eJackConnTypeQuarter,
- eJackConnTypeAtapiInternal,
- eJackConnTypeRCA,
- eJackConnTypeOptical,
- eJackConnTypeOtherDigital,
- eJackConnTypeOtherAnalog,
- eJackConnTypeMultichannelAnalogDIN,
- eJackConnTypeXlrProfessional,
- eJackConnTypeRJ11Modem,
- eJackConnTypeCombination
-}
-PaWasapiJackConnectionType;
-
-
-/* Jack geometric location. */
-typedef enum PaWasapiJackGeoLocation
-{
- eJackGeoLocUnk = 0,
- eJackGeoLocRear = 0x1, /* matches EPcxGeoLocation::eGeoLocRear */
- eJackGeoLocFront,
- eJackGeoLocLeft,
- eJackGeoLocRight,
- eJackGeoLocTop,
- eJackGeoLocBottom,
- eJackGeoLocRearPanel,
- eJackGeoLocRiser,
- eJackGeoLocInsideMobileLid,
- eJackGeoLocDrivebay,
- eJackGeoLocHDMI,
- eJackGeoLocOutsideMobileLid,
- eJackGeoLocATAPI,
- eJackGeoLocReserved5,
- eJackGeoLocReserved6,
-}
-PaWasapiJackGeoLocation;
-
-
-/* Jack general location. */
-typedef enum PaWasapiJackGenLocation
-{
- eJackGenLocPrimaryBox = 0,
- eJackGenLocInternal,
- eJackGenLocSeparate,
- eJackGenLocOther
-}
-PaWasapiJackGenLocation;
-
-
-/* Jack's type of port. */
-typedef enum PaWasapiJackPortConnection
-{
- eJackPortConnJack = 0,
- eJackPortConnIntegratedDevice,
- eJackPortConnBothIntegratedAndJack,
- eJackPortConnUnknown
-}
-PaWasapiJackPortConnection;
-
-
-/* Thread priority. */
-typedef enum PaWasapiThreadPriority
-{
- eThreadPriorityNone = 0,
- eThreadPriorityAudio, //!< Default for Shared mode.
- eThreadPriorityCapture,
- eThreadPriorityDistribution,
- eThreadPriorityGames,
- eThreadPriorityPlayback,
- eThreadPriorityProAudio, //!< Default for Exclusive mode.
- eThreadPriorityWindowManager
-}
-PaWasapiThreadPriority;
-
-
-/* Stream descriptor. */
-typedef struct PaWasapiJackDescription
-{
- unsigned long channelMapping;
- unsigned long color; /* derived from macro: #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) */
- PaWasapiJackConnectionType connectionType;
- PaWasapiJackGeoLocation geoLocation;
- PaWasapiJackGenLocation genLocation;
- PaWasapiJackPortConnection portConnection;
- unsigned int isConnected;
-}
-PaWasapiJackDescription;
-
-
-/* Stream category.
- Note:
- - values are equal to WASAPI AUDIO_STREAM_CATEGORY enum
- - supported since Windows 8.0, noop on earler versions
- - values 1,2 are deprecated on Windows 10 and not included into enumeration
-*/
-typedef enum PaWasapiStreamCategory
-{
- eAudioCategoryOther = 0,
- eAudioCategoryCommunications = 3,
- eAudioCategoryAlerts = 4,
- eAudioCategorySoundEffects = 5,
- eAudioCategoryGameEffects = 6,
- eAudioCategoryGameMedia = 7,
- eAudioCategoryGameChat = 8,
- eAudioCategorySpeech = 9,
- eAudioCategoryMovie = 10,
- eAudioCategoryMedia = 11
-}
-PaWasapiStreamCategory;
-
-
-/* Stream option.
- Note:
- - values are equal to WASAPI AUDCLNT_STREAMOPTIONS enum
- - supported since Windows 8.1, noop on earler versions
-*/
-typedef enum PaWasapiStreamOption
-{
- eStreamOptionNone = 0, //!< default
- eStreamOptionRaw = 1, //!< bypass WASAPI Audio Engine DSP effects, supported since Windows 8.1
- eStreamOptionMatchFormat = 2 //!< force WASAPI Audio Engine into a stream format, supported since Windows 10
-}
-PaWasapiStreamOption;
-
-
-/* Stream descriptor. */
-typedef struct PaWasapiStreamInfo
-{
- unsigned long size; /**< sizeof(PaWasapiStreamInfo) */
- PaHostApiTypeId hostApiType; /**< paWASAPI */
- unsigned long version; /**< 1 */
-
- unsigned long flags; /**< collection of PaWasapiFlags */
-
- /* Support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
- paWinWasapiUseChannelMask this allows you to specify which speakers
- to address in a multichannel stream. Constants for channelMask
- are specified in pa_win_waveformat.h. Will be used only if
- paWinWasapiUseChannelMask flag is specified.
- */
- PaWinWaveFormatChannelMask channelMask;
-
- /* Delivers raw data to callback obtained from GetBuffer() methods skipping
- internal PortAudio processing inventory completely. userData parameter will
- be the same that was passed to Pa_OpenStream method. Will be used only if
- paWinWasapiRedirectHostProcessor flag is specified.
- */
- PaWasapiHostProcessorCallback hostProcessorOutput;
- PaWasapiHostProcessorCallback hostProcessorInput;
-
- /* Specifies thread priority explicitly. Will be used only if paWinWasapiThreadPriority flag
- is specified.
-
- Please note, if Input/Output streams are opened simultaniously (Full-Duplex mode)
- you shall specify same value for threadPriority or othervise one of the values will be used
- to setup thread priority.
- */
- PaWasapiThreadPriority threadPriority;
-
- /* Stream category. */
- PaWasapiStreamCategory streamCategory;
-
- /* Stream option. */
- PaWasapiStreamOption streamOption;
-}
-PaWasapiStreamInfo;
-
-
-/** Returns default sound format for device. Format is represented by PaWinWaveFormat or
- WAVEFORMATEXTENSIBLE structure.
-
- @param pFormat Pointer to PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
- @param nFormatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
- @param nDevice Device index.
-
- @return Non-negative value indicating the number of bytes copied into format decriptor
- or, a PaErrorCode (which are always negative) if PortAudio is not initialized
- or an error is encountered.
-*/
-int PaWasapi_GetDeviceDefaultFormat( void *pFormat, unsigned int nFormatSize, PaDeviceIndex nDevice );
-
-
-/** Returns device role (PaWasapiDeviceRole enum).
-
- @param nDevice device index.
-
- @return Non-negative value indicating device role or, a PaErrorCode (which are always negative)
- if PortAudio is not initialized or an error is encountered.
-*/
-int/*PaWasapiDeviceRole*/ PaWasapi_GetDeviceRole( PaDeviceIndex nDevice );
-
-
-/** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread
- which makes calls to Pa_WriteStream/Pa_ReadStream.
-
- @param hTask Handle to pointer to priority task. Must be used with PaWasapi_RevertThreadPriority
- method to revert thread priority to initial state.
-
- @param nPriorityClass Id of thread priority of PaWasapiThreadPriority type. Specifying
- eThreadPriorityNone does nothing.
-
- @return Error code indicating success or failure.
- @see PaWasapi_RevertThreadPriority
-*/
-PaError PaWasapi_ThreadPriorityBoost( void **hTask, PaWasapiThreadPriority nPriorityClass );
-
-
-/** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread
- which makes calls to Pa_WriteStream/Pa_ReadStream.
-
- @param hTask Task handle obtained by PaWasapi_BoostThreadPriority method.
- @return Error code indicating success or failure.
- @see PaWasapi_BoostThreadPriority
-*/
-PaError PaWasapi_ThreadPriorityRevert( void *hTask );
-
-
-/** Get number of frames per host buffer. This is maximal value of frames of WASAPI buffer which
- can be locked for operations. Use this method as helper to findout maximal values of
- inputFrames/outputFrames of PaWasapiHostProcessorCallback.
-
- @param pStream Pointer to PaStream to query.
- @param nInput Pointer to variable to receive number of input frames. Can be NULL.
- @param nOutput Pointer to variable to receive number of output frames. Can be NULL.
- @return Error code indicating success or failure.
- @see PaWasapiHostProcessorCallback
-*/
-PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *nInput, unsigned int *nOutput );
-
-
-/** Get number of jacks associated with a WASAPI device. Use this method to determine if
- there are any jacks associated with the provided WASAPI device. Not all audio devices
- will support this capability. This is valid for both input and output devices.
- @param nDevice device index.
- @param jcount Number of jacks is returned in this variable
- @return Error code indicating success or failure
- @see PaWasapi_GetJackDescription
- */
-PaError PaWasapi_GetJackCount(PaDeviceIndex nDevice, int *jcount);
-
-
-/** Get the jack description associated with a WASAPI device and jack number
- Before this function is called, use PaWasapi_GetJackCount to determine the
- number of jacks associated with device. If jcount is greater than zero, then
- each jack from 0 to jcount can be queried with this function to get the jack
- description.
- @param nDevice device index.
- @param jindex Which jack to return information
- @param KSJACK_DESCRIPTION This structure filled in on success.
- @return Error code indicating success or failure
- @see PaWasapi_GetJackCount
- */
-PaError PaWasapi_GetJackDescription(PaDeviceIndex nDevice, int jindex, PaWasapiJackDescription *pJackDescription);
-
-
-/*
- IMPORTANT:
-
- WASAPI is implemented for Callback and Blocking interfaces. It supports Shared and Exclusive
- share modes.
-
- Exclusive Mode:
-
- Exclusive mode allows to deliver audio data directly to hardware bypassing
- software mixing.
- Exclusive mode is specified by 'paWinWasapiExclusive' flag.
-
- Callback Interface:
-
- Provides best audio quality with low latency. Callback interface is implemented in
- two versions:
-
- 1) Event-Driven:
- This is the most powerful WASAPI implementation which provides glitch-free
- audio at around 3ms latency in Exclusive mode. Lowest possible latency for this mode is
- 3 ms for HD Audio class audio chips. For the Shared mode latency can not be
- lower than 20 ms.
-
- 2) Poll-Driven:
- Polling is another 2-nd method to operate with WASAPI. It is less efficient than Event-Driven
- and provides latency at around 10-13ms. Polling must be used to overcome a system bug
- under Windows Vista x64 when application is WOW64(32-bit) and Event-Driven method simply
- times out (event handle is never signalled on buffer completion). Please note, such WOW64 bug
- does not exist in Vista x86 or Windows 7.
- Polling can be setup by speciying 'paWinWasapiPolling' flag. Our WASAPI implementation detects
- WOW64 bug and sets 'paWinWasapiPolling' automatically.
-
- Thread priority:
-
- Normally thread priority is set automatically and does not require modification. Although
- if user wants some tweaking thread priority can be modified by setting 'paWinWasapiThreadPriority'
- flag and specifying 'PaWasapiStreamInfo::threadPriority' with value from PaWasapiThreadPriority
- enum.
-
- Blocking Interface:
-
- Blocking interface is implemented but due to above described Poll-Driven method can not
- deliver lowest possible latency. Specifying too low latency in Shared mode will result in
- distorted audio although Exclusive mode adds stability.
-
- Pa_IsFormatSupported:
-
- To check format with correct Share Mode (Exclusive/Shared) you must supply
- PaWasapiStreamInfo with flags paWinWasapiExclusive set through member of
- PaStreamParameters::hostApiSpecificStreamInfo structure.
-
- Pa_OpenStream:
-
- To set desired Share Mode (Exclusive/Shared) you must supply
- PaWasapiStreamInfo with flags paWinWasapiExclusive set through member of
- PaStreamParameters::hostApiSpecificStreamInfo structure.
-*/
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* PA_WIN_WASAPI_H */
+#ifndef PA_WIN_WASAPI_H
+#define PA_WIN_WASAPI_H
+/*
+ * $Id: $
+ * PortAudio Portable Real-Time Audio Library
+ * DirectSound specific extensions
+ *
+ * Copyright (c) 1999-2007 Ross Bencina and Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however,
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the
+ * license above.
+ */
+
+/** @file
+ @ingroup public_header
+ @brief WASAPI-specific PortAudio API extension header file.
+*/
+
+#include "portaudio.h"
+#include "pa_win_waveformat.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+/* Setup flags */
+typedef enum PaWasapiFlags
+{
+ /* puts WASAPI into exclusive mode */
+ paWinWasapiExclusive = (1 << 0),
+
+ /* allows to skip internal PA processing completely */
+ paWinWasapiRedirectHostProcessor = (1 << 1),
+
+ /* assigns custom channel mask */
+ paWinWasapiUseChannelMask = (1 << 2),
+
+ /* selects non-Event driven method of data read/write
+ Note: WASAPI Event driven core is capable of 2ms latency!!!, but Polling
+ method can only provide 15-20ms latency. */
+ paWinWasapiPolling = (1 << 3),
+
+ /* forces custom thread priority setting, must be used if PaWasapiStreamInfo::threadPriority
+ is set to a custom value */
+ paWinWasapiThreadPriority = (1 << 4)
+}
+PaWasapiFlags;
+#define paWinWasapiExclusive (paWinWasapiExclusive)
+#define paWinWasapiRedirectHostProcessor (paWinWasapiRedirectHostProcessor)
+#define paWinWasapiUseChannelMask (paWinWasapiUseChannelMask)
+#define paWinWasapiPolling (paWinWasapiPolling)
+#define paWinWasapiThreadPriority (paWinWasapiThreadPriority)
+
+
+/* Host processor. Allows to skip internal PA processing completely.
+ You must set paWinWasapiRedirectHostProcessor flag to PaWasapiStreamInfo::flags member
+ in order to have host processor redirected to your callback.
+ Use with caution! inputFrames and outputFrames depend solely on final device setup.
+ To query maximal values of inputFrames/outputFrames use PaWasapi_GetFramesPerHostBuffer.
+*/
+typedef void (*PaWasapiHostProcessorCallback) (void *inputBuffer, long inputFrames,
+ void *outputBuffer, long outputFrames,
+ void *userData);
+
+/* Device role. */
+typedef enum PaWasapiDeviceRole
+{
+ eRoleRemoteNetworkDevice = 0,
+ eRoleSpeakers,
+ eRoleLineLevel,
+ eRoleHeadphones,
+ eRoleMicrophone,
+ eRoleHeadset,
+ eRoleHandset,
+ eRoleUnknownDigitalPassthrough,
+ eRoleSPDIF,
+ eRoleHDMI,
+ eRoleUnknownFormFactor
+}
+PaWasapiDeviceRole;
+
+
+/* Jack connection type. */
+typedef enum PaWasapiJackConnectionType
+{
+ eJackConnTypeUnknown,
+ eJackConnType3Point5mm,
+ eJackConnTypeQuarter,
+ eJackConnTypeAtapiInternal,
+ eJackConnTypeRCA,
+ eJackConnTypeOptical,
+ eJackConnTypeOtherDigital,
+ eJackConnTypeOtherAnalog,
+ eJackConnTypeMultichannelAnalogDIN,
+ eJackConnTypeXlrProfessional,
+ eJackConnTypeRJ11Modem,
+ eJackConnTypeCombination
+}
+PaWasapiJackConnectionType;
+
+
+/* Jack geometric location. */
+typedef enum PaWasapiJackGeoLocation
+{
+ eJackGeoLocUnk = 0,
+ eJackGeoLocRear = 0x1, /* matches EPcxGeoLocation::eGeoLocRear */
+ eJackGeoLocFront,
+ eJackGeoLocLeft,
+ eJackGeoLocRight,
+ eJackGeoLocTop,
+ eJackGeoLocBottom,
+ eJackGeoLocRearPanel,
+ eJackGeoLocRiser,
+ eJackGeoLocInsideMobileLid,
+ eJackGeoLocDrivebay,
+ eJackGeoLocHDMI,
+ eJackGeoLocOutsideMobileLid,
+ eJackGeoLocATAPI,
+ eJackGeoLocReserved5,
+ eJackGeoLocReserved6,
+}
+PaWasapiJackGeoLocation;
+
+
+/* Jack general location. */
+typedef enum PaWasapiJackGenLocation
+{
+ eJackGenLocPrimaryBox = 0,
+ eJackGenLocInternal,
+ eJackGenLocSeparate,
+ eJackGenLocOther
+}
+PaWasapiJackGenLocation;
+
+
+/* Jack's type of port. */
+typedef enum PaWasapiJackPortConnection
+{
+ eJackPortConnJack = 0,
+ eJackPortConnIntegratedDevice,
+ eJackPortConnBothIntegratedAndJack,
+ eJackPortConnUnknown
+}
+PaWasapiJackPortConnection;
+
+
+/* Thread priority. */
+typedef enum PaWasapiThreadPriority
+{
+ eThreadPriorityNone = 0,
+ eThreadPriorityAudio, //!< Default for Shared mode.
+ eThreadPriorityCapture,
+ eThreadPriorityDistribution,
+ eThreadPriorityGames,
+ eThreadPriorityPlayback,
+ eThreadPriorityProAudio, //!< Default for Exclusive mode.
+ eThreadPriorityWindowManager
+}
+PaWasapiThreadPriority;
+
+
+/* Stream descriptor. */
+typedef struct PaWasapiJackDescription
+{
+ unsigned long channelMapping;
+ unsigned long color; /* derived from macro: #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) */
+ PaWasapiJackConnectionType connectionType;
+ PaWasapiJackGeoLocation geoLocation;
+ PaWasapiJackGenLocation genLocation;
+ PaWasapiJackPortConnection portConnection;
+ unsigned int isConnected;
+}
+PaWasapiJackDescription;
+
+
+/* Stream category.
+ Note:
+ - values are equal to WASAPI AUDIO_STREAM_CATEGORY enum
+ - supported since Windows 8.0, noop on earler versions
+ - values 1,2 are deprecated on Windows 10 and not included into enumeration
+*/
+typedef enum PaWasapiStreamCategory
+{
+ eAudioCategoryOther = 0,
+ eAudioCategoryCommunications = 3,
+ eAudioCategoryAlerts = 4,
+ eAudioCategorySoundEffects = 5,
+ eAudioCategoryGameEffects = 6,
+ eAudioCategoryGameMedia = 7,
+ eAudioCategoryGameChat = 8,
+ eAudioCategorySpeech = 9,
+ eAudioCategoryMovie = 10,
+ eAudioCategoryMedia = 11
+}
+PaWasapiStreamCategory;
+
+
+/* Stream option.
+ Note:
+ - values are equal to WASAPI AUDCLNT_STREAMOPTIONS enum
+ - supported since Windows 8.1, noop on earler versions
+*/
+typedef enum PaWasapiStreamOption
+{
+ eStreamOptionNone = 0, //!< default
+ eStreamOptionRaw = 1, //!< bypass WASAPI Audio Engine DSP effects, supported since Windows 8.1
+ eStreamOptionMatchFormat = 2 //!< force WASAPI Audio Engine into a stream format, supported since Windows 10
+}
+PaWasapiStreamOption;
+
+
+/* Stream descriptor. */
+typedef struct PaWasapiStreamInfo
+{
+ unsigned long size; /**< sizeof(PaWasapiStreamInfo) */
+ PaHostApiTypeId hostApiType; /**< paWASAPI */
+ unsigned long version; /**< 1 */
+
+ unsigned long flags; /**< collection of PaWasapiFlags */
+
+ /* Support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
+ paWinWasapiUseChannelMask this allows you to specify which speakers
+ to address in a multichannel stream. Constants for channelMask
+ are specified in pa_win_waveformat.h. Will be used only if
+ paWinWasapiUseChannelMask flag is specified.
+ */
+ PaWinWaveFormatChannelMask channelMask;
+
+ /* Delivers raw data to callback obtained from GetBuffer() methods skipping
+ internal PortAudio processing inventory completely. userData parameter will
+ be the same that was passed to Pa_OpenStream method. Will be used only if
+ paWinWasapiRedirectHostProcessor flag is specified.
+ */
+ PaWasapiHostProcessorCallback hostProcessorOutput;
+ PaWasapiHostProcessorCallback hostProcessorInput;
+
+ /* Specifies thread priority explicitly. Will be used only if paWinWasapiThreadPriority flag
+ is specified.
+
+ Please note, if Input/Output streams are opened simultaniously (Full-Duplex mode)
+ you shall specify same value for threadPriority or othervise one of the values will be used
+ to setup thread priority.
+ */
+ PaWasapiThreadPriority threadPriority;
+
+ /* Stream category. */
+ PaWasapiStreamCategory streamCategory;
+
+ /* Stream option. */
+ PaWasapiStreamOption streamOption;
+}
+PaWasapiStreamInfo;
+
+/** Returns Windows device ID for input stream
+
+ @param pStream Pointer to PaStream to query.
+
+ @return non-null value pointing to static device ID
+*/
+const wchar_t *PaWasapi_GetInputDeviceID( PaStream* s );
+
+/** Returns Windows device ID for output stream
+
+ @param pStream Pointer to PaStream to query.
+
+ @return non-null value pointing to static device ID
+*/
+const wchar_t *PaWasapi_GetOutputDeviceID( PaStream* s );
+
+/** Returns default sound format for device. Format is represented by PaWinWaveFormat or
+ WAVEFORMATEXTENSIBLE structure.
+
+ @param pFormat Pointer to PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
+ @param nFormatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
+ @param nDevice Device index.
+
+ @return Non-negative value indicating the number of bytes copied into format decriptor
+ or, a PaErrorCode (which are always negative) if PortAudio is not initialized
+ or an error is encountered.
+*/
+int PaWasapi_GetDeviceDefaultFormat( void *pFormat, unsigned int nFormatSize, PaDeviceIndex nDevice );
+
+/** Returns device role (PaWasapiDeviceRole enum).
+
+ @param nDevice device index.
+
+ @return Non-negative value indicating device role or, a PaErrorCode (which are always negative)
+ if PortAudio is not initialized or an error is encountered.
+*/
+int/*PaWasapiDeviceRole*/ PaWasapi_GetDeviceRole( PaDeviceIndex nDevice );
+
+
+/** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread
+ which makes calls to Pa_WriteStream/Pa_ReadStream.
+
+ @param hTask Handle to pointer to priority task. Must be used with PaWasapi_RevertThreadPriority
+ method to revert thread priority to initial state.
+
+ @param nPriorityClass Id of thread priority of PaWasapiThreadPriority type. Specifying
+ eThreadPriorityNone does nothing.
+
+ @return Error code indicating success or failure.
+ @see PaWasapi_RevertThreadPriority
+*/
+PaError PaWasapi_ThreadPriorityBoost( void **hTask, PaWasapiThreadPriority nPriorityClass );
+
+
+/** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread
+ which makes calls to Pa_WriteStream/Pa_ReadStream.
+
+ @param hTask Task handle obtained by PaWasapi_BoostThreadPriority method.
+ @return Error code indicating success or failure.
+ @see PaWasapi_BoostThreadPriority
+*/
+PaError PaWasapi_ThreadPriorityRevert( void *hTask );
+
+
+/** Get number of frames per host buffer. This is maximal value of frames of WASAPI buffer which
+ can be locked for operations. Use this method as helper to findout maximal values of
+ inputFrames/outputFrames of PaWasapiHostProcessorCallback.
+
+ @param pStream Pointer to PaStream to query.
+ @param nInput Pointer to variable to receive number of input frames. Can be NULL.
+ @param nOutput Pointer to variable to receive number of output frames. Can be NULL.
+ @return Error code indicating success or failure.
+ @see PaWasapiHostProcessorCallback
+*/
+PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *nInput, unsigned int *nOutput );
+
+
+/** Get number of jacks associated with a WASAPI device. Use this method to determine if
+ there are any jacks associated with the provided WASAPI device. Not all audio devices
+ will support this capability. This is valid for both input and output devices.
+ @param nDevice device index.
+ @param jcount Number of jacks is returned in this variable
+ @return Error code indicating success or failure
+ @see PaWasapi_GetJackDescription
+ */
+PaError PaWasapi_GetJackCount(PaDeviceIndex nDevice, int *jcount);
+
+
+/** Get the jack description associated with a WASAPI device and jack number
+ Before this function is called, use PaWasapi_GetJackCount to determine the
+ number of jacks associated with device. If jcount is greater than zero, then
+ each jack from 0 to jcount can be queried with this function to get the jack
+ description.
+ @param nDevice device index.
+ @param jindex Which jack to return information
+ @param KSJACK_DESCRIPTION This structure filled in on success.
+ @return Error code indicating success or failure
+ @see PaWasapi_GetJackCount
+ */
+PaError PaWasapi_GetJackDescription(PaDeviceIndex nDevice, int jindex, PaWasapiJackDescription *pJackDescription);
+
+
+/*
+ IMPORTANT:
+
+ WASAPI is implemented for Callback and Blocking interfaces. It supports Shared and Exclusive
+ share modes.
+
+ Exclusive Mode:
+
+ Exclusive mode allows to deliver audio data directly to hardware bypassing
+ software mixing.
+ Exclusive mode is specified by 'paWinWasapiExclusive' flag.
+
+ Callback Interface:
+
+ Provides best audio quality with low latency. Callback interface is implemented in
+ two versions:
+
+ 1) Event-Driven:
+ This is the most powerful WASAPI implementation which provides glitch-free
+ audio at around 3ms latency in Exclusive mode. Lowest possible latency for this mode is
+ 3 ms for HD Audio class audio chips. For the Shared mode latency can not be
+ lower than 20 ms.
+
+ 2) Poll-Driven:
+ Polling is another 2-nd method to operate with WASAPI. It is less efficient than Event-Driven
+ and provides latency at around 10-13ms. Polling must be used to overcome a system bug
+ under Windows Vista x64 when application is WOW64(32-bit) and Event-Driven method simply
+ times out (event handle is never signalled on buffer completion). Please note, such WOW64 bug
+ does not exist in Vista x86 or Windows 7.
+ Polling can be setup by speciying 'paWinWasapiPolling' flag. Our WASAPI implementation detects
+ WOW64 bug and sets 'paWinWasapiPolling' automatically.
+
+ Thread priority:
+
+ Normally thread priority is set automatically and does not require modification. Although
+ if user wants some tweaking thread priority can be modified by setting 'paWinWasapiThreadPriority'
+ flag and specifying 'PaWasapiStreamInfo::threadPriority' with value from PaWasapiThreadPriority
+ enum.
+
+ Blocking Interface:
+
+ Blocking interface is implemented but due to above described Poll-Driven method can not
+ deliver lowest possible latency. Specifying too low latency in Shared mode will result in
+ distorted audio although Exclusive mode adds stability.
+
+ Pa_IsFormatSupported:
+
+ To check format with correct Share Mode (Exclusive/Shared) you must supply
+ PaWasapiStreamInfo with flags paWinWasapiExclusive set through member of
+ PaStreamParameters::hostApiSpecificStreamInfo structure.
+
+ Pa_OpenStream:
+
+ To set desired Share Mode (Exclusive/Shared) you must supply
+ PaWasapiStreamInfo with flags paWinWasapiExclusive set through member of
+ PaStreamParameters::hostApiSpecificStreamInfo structure.
+*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* PA_WIN_WASAPI_H */
diff --git a/lib-src/portaudio-v19/include/portaudio.h b/lib-src/portaudio-v19/include/portaudio.h
index b8fa10a..f986e99 100644
--- a/lib-src/portaudio-v19/include/portaudio.h
+++ b/lib-src/portaudio-v19/include/portaudio.h
@@ -1180,6 +1180,15 @@ signed long Pa_GetStreamReadAvailable( PaStream* stream );
signed long Pa_GetStreamWriteAvailable( PaStream* stream );
+/** Retrieve the host type handling an open stream.
+
+ @return Returns a non-negative value representing the host API type
+ handling an open stream or, a PaErrorCode (which are always negative)
+ if PortAudio is not initialized or an error is encountered.
+*/
+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
+
+
/* Miscellaneous utilities */
diff --git a/lib-src/portaudio-v19/src/common/pa_front.c b/lib-src/portaudio-v19/src/common/pa_front.c
index fad9192..ae4ac52 100644
--- a/lib-src/portaudio-v19/src/common/pa_front.c
+++ b/lib-src/portaudio-v19/src/common/pa_front.c
@@ -1255,8 +1255,10 @@ PaError Pa_OpenStream( PaStream** stream,
hostApiInputParametersPtr, hostApiOutputParametersPtr,
sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
- if( result == paNoError )
+ if( result == paNoError ) {
AddOpenStream( *stream );
+ PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
+ }
PA_LOGAPI(("Pa_OpenStream returned:\n" ));
@@ -1768,6 +1770,32 @@ signed long Pa_GetStreamWriteAvailable( PaStream* stream )
return result;
}
+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
+{
+ PaError error = PaUtil_ValidateStreamPointer( stream );
+ PaHostApiTypeId result;
+
+#ifdef PA_LOG_API_CALLS
+ PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
+ PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
+#endif
+
+ if( error == paNoError )
+ {
+ result = PA_STREAM_REP(stream)->hostApiType;
+ }
+ else
+ {
+ result = (PaHostApiTypeId) error;
+ }
+
+#ifdef PA_LOG_API_CALLS
+ PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
+ PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
+#endif
+
+ return result;
+}
PaError Pa_GetSampleSize( PaSampleFormat format )
{
diff --git a/lib-src/portaudio-v19/src/common/pa_stream.c b/lib-src/portaudio-v19/src/common/pa_stream.c
index ea91821..a7a381e 100644
--- a/lib-src/portaudio-v19/src/common/pa_stream.c
+++ b/lib-src/portaudio-v19/src/common/pa_stream.c
@@ -93,6 +93,8 @@ void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRe
streamRepresentation->streamInfo.inputLatency = 0.;
streamRepresentation->streamInfo.outputLatency = 0.;
streamRepresentation->streamInfo.sampleRate = 0.;
+
+ streamRepresentation->hostApiType = 0;
}
diff --git a/lib-src/portaudio-v19/src/common/pa_stream.h b/lib-src/portaudio-v19/src/common/pa_stream.h
index 8d707b7..2f4abbc 100644
--- a/lib-src/portaudio-v19/src/common/pa_stream.h
+++ b/lib-src/portaudio-v19/src/common/pa_stream.h
@@ -152,6 +152,7 @@ typedef struct PaUtilStreamRepresentation {
PaStreamFinishedCallback *streamFinishedCallback;
void *userData;
PaStreamInfo streamInfo;
+ PaHostApiTypeId hostApiType;
} PaUtilStreamRepresentation;
diff --git a/lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c b/lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c
index ad63837..0ed0780 100644
--- a/lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c
+++ b/lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c
@@ -621,6 +621,7 @@ typedef struct
StreamDirection streamDir;
snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
+ int card;
} PaAlsaStreamComponent;
/* Implementation specific stream structure */
@@ -1874,6 +1875,7 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
PaError result = paNoError;
PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
assert( params->channelCount > 0 );
+ snd_pcm_info_t* pcmInfo;
/* Make sure things have an initial value */
memset( self, 0, sizeof (PaAlsaStreamComponent) );
@@ -1902,6 +1904,9 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
+ snd_pcm_info_alloca( &pcmInfo );
+ self->card = snd_pcm_info_get_card( pcmInfo );
+
PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
self->hostSampleFormat = hostSampleFormat;
@@ -4588,9 +4593,7 @@ PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
/* XXX: More descriptive error? */
PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
- alsa_snd_pcm_info_alloca( &pcmInfo );
- PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
- *card = alsa_snd_pcm_info_get_card( pcmInfo );
+ *card = stream->capture.card;
error:
return result;
@@ -4607,9 +4610,7 @@ PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
/* XXX: More descriptive error? */
PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
- alsa_snd_pcm_info_alloca( &pcmInfo );
- PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
- *card = alsa_snd_pcm_info_get_card( pcmInfo );
+ *card = stream->capture.card;
error:
return result;
diff --git a/lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c b/lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c
index 9dc95ac..d5f4636 100644
--- a/lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c
+++ b/lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c
@@ -257,6 +257,7 @@ typedef struct PaWinDsStream
#endif
/* Output */
+ LPGUID pOutputGuid;
LPDIRECTSOUND pDirectSound;
LPDIRECTSOUNDBUFFER pDirectSoundPrimaryBuffer;
LPDIRECTSOUNDBUFFER pDirectSoundOutputBuffer;
@@ -272,6 +273,7 @@ typedef struct PaWinDsStream
INT finalZeroBytesWritten; /* used to determine when we've flushed the whole buffer */
/* Input */
+ LPGUID pInputGuid;
LPDIRECTSOUNDCAPTURE pDirectSoundCapture;
LPDIRECTSOUNDCAPTUREBUFFER pDirectSoundInputBuffer;
INT inputFrameSizeBytes;
@@ -1882,8 +1884,8 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
PaWinDsDeviceInfo *inputWinDsDeviceInfo, *outputWinDsDeviceInfo;
PaDeviceInfo *inputDeviceInfo, *outputDeviceInfo;
int inputChannelCount, outputChannelCount;
- PaSampleFormat inputSampleFormat, outputSampleFormat;
- PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
+ PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0;
+ PaSampleFormat hostInputSampleFormat = 0, hostOutputSampleFormat = 0;
int userRequestedHostInputBufferSizeFrames = 0;
int userRequestedHostOutputBufferSizeFrames = 0;
unsigned long suggestedInputLatencyFrames, suggestedOutputLatencyFrames;
@@ -2174,6 +2176,13 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
goto error;
}
+ /* Portmixer support - fill in the GUID of the output stream */
+ stream->pOutputGuid = outputWinDsDeviceInfo->lpGUID;
+ if( stream->pOutputGuid == NULL )
+ {
+ stream->pOutputGuid = (GUID *) &DSDEVID_DefaultPlayback;
+ }
+
/* Calculate value used in latency calculation to avoid real-time divides. */
stream->secondsPerHostByte = 1.0 /
(stream->bufferProcessor.bytesPerHostOutputSample *
@@ -2215,6 +2224,13 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
result = paBufferTooBig;
goto error;
}
+
+ /* Portmixer support - store the GUID of the input stream */
+ stream->pInputGuid = inputWinDsDeviceInfo->lpGUID;
+ if( stream->pInputGuid == NULL )
+ {
+ stream->pInputGuid = (GUID *)&DSDEVID_DefaultCapture;
+ }
}
/* open/create the DirectSound buffers */
@@ -2258,6 +2274,12 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
if( outputParameters && !stream->pDirectSoundOutputBuffer )
{
+ stream->pOutputGuid = outputWinDsDeviceInfo->lpGUID;
+ if( stream->pOutputGuid == NULL )
+ {
+ stream->pOutputGuid = (GUID *) &DSDEVID_DefaultPlayback;
+ }
+
hr = InitOutputBuffer( stream,
(PaWinDsDeviceInfo*)hostApi->deviceInfos[outputParameters->device],
hostOutputSampleFormat,
@@ -3266,3 +3288,18 @@ static signed long GetStreamWriteAvailable( PaStream* s )
return 0;
}
+/***********************************************************************************/
+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s )
+{
+ PaWinDsStream *stream = (PaWinDsStream*)s;
+
+ return stream->pInputGuid;
+}
+
+/***********************************************************************************/
+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s )
+{
+ PaWinDsStream *stream = (PaWinDsStream*)s;
+
+ return stream->pOutputGuid;
+}
diff --git a/lib-src/portaudio-v19/src/hostapi/oss/pa_unix_oss.c b/lib-src/portaudio-v19/src/hostapi/oss/pa_unix_oss.c
index 96e8a4e..586eedd 100644
--- a/lib-src/portaudio-v19/src/hostapi/oss/pa_unix_oss.c
+++ b/lib-src/portaudio-v19/src/hostapi/oss/pa_unix_oss.c
@@ -2043,3 +2043,26 @@ error:
#endif
}
+const char *PaOSS_GetStreamInputDevice( PaStream* s )
+{
+ PaOssStream *stream = (PaOssStream*)s;
+
+ if( stream->capture )
+ {
+ return stream->capture->devName;
+ }
+
+ return NULL;
+}
+
+const char *PaOSS_GetStreamOutputDevice( PaStream* s )
+{
+ PaOssStream *stream = (PaOssStream*)s;
+
+ if( stream->playback )
+ {
+ return stream->playback->devName;
+ }
+
+ return NULL;
+}
diff --git a/lib-src/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c b/lib-src/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c
index 6e62a4a..de05d72 100644
--- a/lib-src/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c
+++ b/lib-src/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c
@@ -1662,6 +1662,32 @@ int PaWasapi_GetDeviceRole( PaDeviceIndex nDevice )
}
// ------------------------------------------------------------------------------------------
+const wchar_t *PaWasapi_GetInputDeviceID( PaStream* s )
+{
+ PaWasapiStream *stream = (PaWasapiStream *)s;
+ if (stream == NULL)
+ return NULL;
+
+ if (stream->in.params.device_info)
+ return stream->in.params.device_info->szDeviceID;
+
+ return NULL;
+}
+
+// ------------------------------------------------------------------------------------------
+const wchar_t *PaWasapi_GetOutputDeviceID( PaStream* s )
+{
+ PaWasapiStream *stream = (PaWasapiStream *)s;
+ if (stream == NULL)
+ return NULL;
+
+ if (stream->out.params.device_info)
+ return stream->out.params.device_info->szDeviceID;
+
+ return NULL;
+}
+
+// ------------------------------------------------------------------------------------------
PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *nInput, unsigned int *nOutput )
{
PaWasapiStream *stream = (PaWasapiStream *)pStream;
diff --git a/lib-src/portmixer/portaudio.patch b/lib-src/portmixer/portaudio.patch
index a776cc1..e69de29 100644
--- a/lib-src/portmixer/portaudio.patch
+++ b/lib-src/portmixer/portaudio.patch
@@ -1,398 +0,0 @@
-diff -wruN portaudio/include/pa_unix_oss.h portaudio-v19/include/pa_unix_oss.h
---- portaudio/include/pa_unix_oss.h 1969-12-31 18:00:00.000000000 -0600
-+++ portaudio-v19/include/pa_unix_oss.h 2012-12-14 22:34:14.290247100 -0600
-@@ -0,0 +1,52 @@
-+#ifndef PA_UNIX_OSS_H
-+#define PA_UNIX_OSS_H
-+
-+/*
-+ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
-+ * PortAudio Portable Real-Time Audio Library
-+ * OSS-specific extensions
-+ *
-+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining
-+ * a copy of this software and associated documentation files
-+ * (the "Software"), to deal in the Software without restriction,
-+ * including without limitation the rights to use, copy, modify, merge,
-+ * publish, distribute, sublicense, and/or sell copies of the Software,
-+ * and to permit persons to whom the Software is furnished to do so,
-+ * subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be
-+ * included in all copies or substantial portions of the Software.
-+ *
-+ * Any person wishing to distribute modifications to the Software is
-+ * requested to send the modifications to the original developer so that
-+ * they can be incorporated into the canonical version.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ *
-+ */
-+
-+/** @file
-+ * OSS-specific PortAudio API extension header file.
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+const char *PaOSS_GetStreamInputDevice( PaStream *s );
-+
-+const char *PaOSS_GetStreamOutputDevice( PaStream *s );
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-diff -wruN portaudio/include/pa_win_ds.h portaudio-v19/include/pa_win_ds.h
---- portaudio/include/pa_win_ds.h 2011-11-24 12:11:33.000000000 -0600
-+++ portaudio-v19/include/pa_win_ds.h 2012-12-14 22:35:51.384817600 -0600
-@@ -87,6 +87,22 @@
- }PaWinDirectSoundStreamInfo;
-
-
-+/** Retrieve the GUID of the input device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
-+
-+/** Retrieve the GUID of the output device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
-+
-
- #ifdef __cplusplus
- }
-diff -wruN portaudio/include/portaudio.h portaudio-v19/include/portaudio.h
---- portaudio/include/portaudio.h 2012-08-31 19:10:13.000000000 -0500
-+++ portaudio-v19/include/portaudio.h 2012-12-14 22:34:14.368247200 -0600
-@@ -1146,6 +1146,15 @@
- signed long Pa_GetStreamWriteAvailable( PaStream* stream );
-
-
-+/** Retrieve the host type handling an open stream.
-+
-+ @return Returns a non-negative value representing the host API type
-+ handling an open stream or, a PaErrorCode (which are always negative)
-+ if PortAudio is not initialized or an error is encountered.
-+*/
-+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
-+
-+
- /* Miscellaneous utilities */
-
-
-diff -wruN portaudio/src/common/pa_front.c portaudio-v19/src/common/pa_front.c
---- portaudio/src/common/pa_front.c 2012-12-04 12:39:48.000000000 -0600
-+++ portaudio-v19/src/common/pa_front.c 2012-12-14 09:44:34.604344800 -0600
-@@ -1216,8 +1216,10 @@
- hostApiInputParametersPtr, hostApiOutputParametersPtr,
- sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
-
-- if( result == paNoError )
-+ if( result == paNoError ) {
- AddOpenStream( *stream );
-+ PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
-+ }
-
-
- PA_LOGAPI(("Pa_OpenStream returned:\n" ));
-@@ -1729,6 +1731,32 @@
- return result;
- }
-
-+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
-+{
-+ PaError error = PaUtil_ValidateStreamPointer( stream );
-+ PaHostApiTypeId result;
-+
-+#ifdef PA_LOG_API_CALLS
-+ PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
-+ PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
-+#endif
-+
-+ if( error == paNoError )
-+ {
-+ result = PA_STREAM_REP(stream)->hostApiType;
-+ }
-+ else
-+ {
-+ result = (PaHostApiTypeId) error;
-+ }
-+
-+#ifdef PA_LOG_API_CALLS
-+ PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
-+ PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
-+#endif
-+
-+ return result;
-+}
-
- PaError Pa_GetSampleSize( PaSampleFormat format )
- {
-diff -wruN portaudio/src/common/pa_stream.c portaudio-v19/src/common/pa_stream.c
---- portaudio/src/common/pa_stream.c 2008-02-15 01:50:33.000000000 -0600
-+++ portaudio-v19/src/common/pa_stream.c 2012-12-14 09:44:34.607345000 -0600
-@@ -93,6 +93,8 @@
- streamRepresentation->streamInfo.inputLatency = 0.;
- streamRepresentation->streamInfo.outputLatency = 0.;
- streamRepresentation->streamInfo.sampleRate = 0.;
-+
-+ streamRepresentation->hostApiType = 0;
- }
-
-
-diff -wruN portaudio/src/common/pa_stream.h portaudio-v19/src/common/pa_stream.h
---- portaudio/src/common/pa_stream.h 2008-02-15 01:50:33.000000000 -0600
-+++ portaudio-v19/src/common/pa_stream.h 2012-12-14 09:44:34.610345200 -0600
-@@ -152,6 +152,7 @@
- PaStreamFinishedCallback *streamFinishedCallback;
- void *userData;
- PaStreamInfo streamInfo;
-+ PaHostApiTypeId hostApiType;
- } PaUtilStreamRepresentation;
-
-
-diff -wruN portaudio/src/hostapi/alsa/pa_linux_alsa.c portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c
---- portaudio/src/hostapi/alsa/pa_linux_alsa.c 2012-05-18 11:04:30.000000000 -0500
-+++ portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c 2012-12-14 10:00:12.133968500 -0600
-@@ -622,6 +622,7 @@
- StreamDirection streamDir;
-
- snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
-+ int card;
- } PaAlsaStreamComponent;
-
- /* Implementation specific stream structure */
-@@ -1840,6 +1841,7 @@
- PaError result = paNoError;
- PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
- assert( params->channelCount > 0 );
-+ snd_pcm_info_t* pcmInfo;
-
- /* Make sure things have an initial value */
- memset( self, 0, sizeof (PaAlsaStreamComponent) );
-@@ -1867,6 +1869,9 @@
- PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
- self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
-
-+ snd_pcm_info_alloca( &pcmInfo );
-+ self->card = snd_pcm_info_get_card( pcmInfo );
-+
- PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
-
- self->hostSampleFormat = hostSampleFormat;
-@@ -4559,9 +4564,7 @@
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->capture.card;
-
- error:
- return result;
-@@ -4578,9 +4581,7 @@
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->capture.card;
-
- error:
- return result;
-diff -wruN portaudio/src/hostapi/dsound/pa_win_ds.c portaudio-v19/src/hostapi/dsound/pa_win_ds.c
---- portaudio/src/hostapi/dsound/pa_win_ds.c 2012-11-09 20:55:20.000000000 -0600
-+++ portaudio-v19/src/hostapi/dsound/pa_win_ds.c 2012-12-14 10:14:29.062982000 -0600
-@@ -257,6 +257,7 @@
- #endif
-
- /* Output */
-+ LPGUID pOutputGuid;
- LPDIRECTSOUND pDirectSound;
- LPDIRECTSOUNDBUFFER pDirectSoundPrimaryBuffer;
- LPDIRECTSOUNDBUFFER pDirectSoundOutputBuffer;
-@@ -272,6 +273,7 @@
- INT finalZeroBytesWritten; /* used to determine when we've flushed the whole buffer */
-
- /* Input */
-+ LPGUID pInputGuid;
- LPDIRECTSOUNDCAPTURE pDirectSoundCapture;
- LPDIRECTSOUNDCAPTUREBUFFER pDirectSoundInputBuffer;
- INT inputFrameSizeBytes;
-@@ -1854,8 +1856,8 @@
- PaWinDsDeviceInfo *inputWinDsDeviceInfo, *outputWinDsDeviceInfo;
- PaDeviceInfo *inputDeviceInfo, *outputDeviceInfo;
- int inputChannelCount, outputChannelCount;
-- PaSampleFormat inputSampleFormat, outputSampleFormat;
-- PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
-+ PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0;
-+ PaSampleFormat hostInputSampleFormat = 0, hostOutputSampleFormat = 0;
- int userRequestedHostInputBufferSizeFrames = 0;
- int userRequestedHostOutputBufferSizeFrames = 0;
- unsigned long suggestedInputLatencyFrames, suggestedOutputLatencyFrames;
-@@ -2146,6 +2148,13 @@
- goto error;
- }
-
-+ /* Portmixer support - fill in the GUID of the output stream */
-+ stream->pOutputGuid = outputWinDsDeviceInfo->lpGUID;
-+ if( stream->pOutputGuid == NULL )
-+ {
-+ stream->pOutputGuid = (GUID *) &DSDEVID_DefaultPlayback;
-+ }
-+
- /* Calculate value used in latency calculation to avoid real-time divides. */
- stream->secondsPerHostByte = 1.0 /
- (stream->bufferProcessor.bytesPerHostOutputSample *
-@@ -2187,6 +2196,13 @@
- result = paBufferTooBig;
- goto error;
- }
-+
-+ /* Portmixer support - store the GUID of the input stream */
-+ stream->pInputGuid = inputWinDsDeviceInfo->lpGUID;
-+ if( stream->pInputGuid == NULL )
-+ {
-+ stream->pInputGuid = (GUID *)&DSDEVID_DefaultCapture;
-+ }
- }
-
- /* open/create the DirectSound buffers */
-@@ -2230,6 +2246,12 @@
-
- if( outputParameters && !stream->pDirectSoundOutputBuffer )
- {
-+ stream->pOutputGuid = outputWinDsDeviceInfo->lpGUID;
-+ if( stream->pOutputGuid == NULL )
-+ {
-+ stream->pOutputGuid = (GUID *) &DSDEVID_DefaultPlayback;
-+ }
-+
- hr = InitOutputBuffer( stream,
- (PaWinDsDeviceInfo*)hostApi->deviceInfos[outputParameters->device],
- hostOutputSampleFormat,
-@@ -3238,3 +3260,18 @@
- return 0;
- }
-
-+/***********************************************************************************/
-+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s )
-+{
-+ PaWinDsStream *stream = (PaWinDsStream*)s;
-+
-+ return stream->pInputGuid;
-+}
-+
-+/***********************************************************************************/
-+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s )
-+{
-+ PaWinDsStream *stream = (PaWinDsStream*)s;
-+
-+ return stream->pOutputGuid;
-+}
-diff -wruN portaudio/src/hostapi/oss/pa_unix_oss.c portaudio-v19/src/hostapi/oss/pa_unix_oss.c
---- portaudio/src/hostapi/oss/pa_unix_oss.c 2011-05-02 12:07:11.000000000 -0500
-+++ portaudio-v19/src/hostapi/oss/pa_unix_oss.c 2012-12-14 09:44:34.625346000 -0600
-@@ -2028,3 +2028,26 @@
- #endif
- }
-
-+const char *PaOSS_GetStreamInputDevice( PaStream* s )
-+{
-+ PaOssStream *stream = (PaOssStream*)s;
-+
-+ if( stream->capture )
-+ {
-+ return stream->capture->devName;
-+ }
-+
-+ return NULL;
-+}
-+
-+const char *PaOSS_GetStreamOutputDevice( PaStream* s )
-+{
-+ PaOssStream *stream = (PaOssStream*)s;
-+
-+ if( stream->playback )
-+ {
-+ return stream->playback->devName;
-+ }
-+
-+ return NULL;
-+}
-diff -wruN orig/portaudio-v19/include/pa_win_wasapi.h portaudio-v19/include/pa_win_wasapi.h
---- orig/portaudio-v19/include/pa_win_wasapi.h 2013-09-23 23:44:18.192843200 -0500
-+++ portaudio-v19/include/pa_win_wasapi.h 2013-09-23 23:47:03.705310000 -0500
-@@ -272,6 +272,15 @@
- */
- int PaWasapi_IsLoopback( PaDeviceIndex nDevice );
-
-+/** Returns Windows device ID.
-+
-+ @param nDevice device index.
-+
-+ @return 0 = Not loopback, 1 = loopback, < 0 = PaErrorCode
-+ if PortAudio is not initialized or an error is encountered.
-+*/
-+const wchar_t *PaWasapi_GetInputDeviceID( PaStream* s );
-+const wchar_t *PaWasapi_GetOutputDeviceID( PaStream* s );
-
- /** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread
- which makes calls to Pa_WriteStream/Pa_ReadStream.
-diff -wruN orig/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c
---- orig/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c 2013-09-23 23:44:15.266675900 -0500
-+++ portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c 2013-09-23 23:47:03.709310200 -0500
-@@ -1608,6 +1608,32 @@
- }
-
- // ------------------------------------------------------------------------------------------
-+const wchar_t *PaWasapi_GetInputDeviceID( PaStream* s )
-+{
-+ PaWasapiStream *stream = (PaWasapiStream *)s;
-+ if (stream == NULL)
-+ return NULL;
-+
-+ if (stream->in.params.device_info)
-+ return stream->in.params.device_info->szDeviceID;
-+
-+ return NULL;
-+}
-+
-+// ------------------------------------------------------------------------------------------
-+const wchar_t *PaWasapi_GetOutputDeviceID( PaStream* s )
-+{
-+ PaWasapiStream *stream = (PaWasapiStream *)s;
-+ if (stream == NULL)
-+ return NULL;
-+
-+ if (stream->out.params.device_info)
-+ return stream->out.params.device_info->szDeviceID;
-+
-+ return NULL;
-+}
-+
-+// ------------------------------------------------------------------------------------------
- PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *nInput, unsigned int *nOutput )
- {
- PaWasapiStream *stream = (PaWasapiStream *)pStream;
|