Update to upstream commit 3ebfacc
commit c5d2c51bd6fe354d0ee1119ba932bfebd3ebfacc
Merge: eb6b5e2 ab66573
Author: Phil Burk <burkphil@gmail.com>
Date: Fri Apr 26 16:48:28 2019 +0000
Merge branch 'removeasio' into 'master'
asio: remove unnecessary ASIO SDK files
+1: Phil Burk
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7559751
commit ab665735ad887dbfb7fdc6b4cbbec90d2124f011
Author: Phil Burk <philburk@mobileer.com>
Date: Fri Apr 26 09:43:52 2019 -0700
asio: remove unnecessary ASIO SDK files
These files should be obtained directly from Steinberg.
commit eb6b5e259850e067ed66698e084c248e0cd13f30
Merge: d7229de c40b969
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Fri Apr 5 07:42:43 2019 +0000
Merge branch 'winrt' into 'master'
WASAPI: Add paWinWasapiAutoConvert flag, which sets AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY for Shared mode streams.
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7481081
commit c40b969e1b5fc555d5876c466b39d463ae2a1c1d
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Fri Apr 5 10:38:44 2019 +0300
wasapi: some cleanup of Jörn Heusipp's patch
commit aa0748a5b59491ba2cfa9943825653cde6e1f748
Author: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Date: Mon Apr 1 09:05:18 2019 +0200
wasapi: Add paWinWasapiAutoConvert flag, which sets AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY for Shared mode streams.
AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM is required in order to allow for sample rates other than the system mixer configured sample rate. Otherwise, WASAPI is limited to a single system configured sample rate in Shared mode, which is a severe limitation compared to other APIs supported by PortAudio.
AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY is recommended to be used additionally.
See <https://docs.microsoft.com/en-us/windows/desktop/coreaudio/audclnt-streamflags-xxx-constants> for documentation.
GetClosestFormat is modified to exit early when paWinWasapiAutoConvert is set in Shared mode because we trust the WASAPI conversions to succeed.
We restrict these changes to Windows 7 (and later) because documentation does not clearly state the minimum required Windows version. Windows Vista was not available for testing.
This patch has been in production in OpenMPT (<https://openmpt.org/>) since version 1.27.01.00 (2017-09-27). PortAudio WASAPI Shared mode is the default output device type in OpenMPT for Windows 7 (and later) and also for Wine setups.
commit d7229de83beba7392c7195de653d517d8e57d35d
Merge: 7bfa11f d99940b
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Fri Apr 5 06:53:39 2019 +0000
Merge branch 'winrt' into 'master'
WASAPI: Fix failing with unsupported format error if PaWasapiStreamCategory is other than default
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7376301
commit d99940b26eb6a48d1a069b3195a50d06badabb46
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Sat Mar 9 12:43:14 2019 +0200
wasapi: set IAudioClient2+ properties before GetClosestFormat() in order to avoid failing with unsupported format error if PaWasapiStreamCategory is other than default, for example eAudioCategorySpeech
commit 7bfa11f463cfa943aced5ea2f3542f5307417afb
Merge: b7870b0 96f81c0
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Sat Feb 23 21:04:57 2019 +0000
Merge branch 'winrt' into 'master'
WASAPI: Improved audio output stability in Exclusive mode for some UAC2 DACs
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7327181
commit 96f81c0ec1f7bd50f29d7298d927bfeb503ac0f3
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Sat Feb 23 23:02:38 2019 +0200
wasapi: Improved audio output stability in Exclusive mode for some UAC2 DACs with custom USB Audio driver by calculating buffer periodicity being equal (or almost equal) to the requested user frames (Capturing is excluded from this implementation as it has not yet been tested but can be included if tests show the improvement), cleanup/refactor some code to make it better readable
commit b7870b08f770c1e84b754e662c08b6942ff7d021
Merge: 76e31c2 83ab55b
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Mon Dec 24 12:22:35 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: new API PaWasapi_SetStreamStateHandler(), header cleanup and minor fix
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7129721
commit 83ab55b62d707c11d18238b1928e0297d67e4767
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Dec 24 14:20:29 2018 +0200
wasapi: new API PaWasapi_SetStreamStateHandler() to be able to catch WASAPI error inside the rendering thread loop (and handle it gracefully, for example restart the stream), protect from dangling pointer during device list update, cleanup header
commit 76e31c2a24eebfa95a704f711dd707a2635af77e
Merge: dfd7803 95e86c3
Author: Etienne Dechamps <etienne@edechamps.fr>
Date: Sat Dec 15 15:06:22 2018 +0000
Merge branch 'winbuild' into 'master'
Improvements to CMake build system on Windows
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7040151
commit 95e86c307b9cd20180f3c1f52853c3424ce62ae5
Author: Etienne Dechamps <etienne@edechamps.fr>
Date: Sun Nov 25 12:16:21 2018 +0000
Install pa_win_waveformat.h with MME, DirectSound and WASAPI.
pa_win_wmme.h, pa_win_ds.h and pa_win_wasapi.h all include
pa_win_waveformat.h. If the latter is not installed, none of these
headers are usable.
commit 0baa1e2e31f37bac2883ea59e50b76037271426d
Author: Etienne Dechamps <etienne@edechamps.fr>
Date: Sun Nov 25 10:28:56 2018 +0000
Treat DirectSound just like any other standard Windows SDK library.
Currently the CMake build system goes through complicated logic to
find the DirectX SDK. This is completely unnecessary, because modern
versions of the Windows SDK include dsound.h and dsound.lib in the
standard paths, so it can be treated just like the other Windows OS
libraries and we can safely assume it is available.
This commit simplifies the logic and will allow the vcpkg portaudio
port to align with portaudio stream, by getting rid of this patch:
95f9ce56f3/ports/portaudio/find_dsound.patch
I have verified that PortAudio CMake still builds with this commit
with the following toolchains:
- Windows Visual Studio 2017 native CMake support
- mingw-w64 on Windows (msys2)
- mingw-w64 cross-compiling from Debian Unstable
commit dfd780389b235e7553df8d115f0875d63abe7ccd
Merge: b22a83a 7572245
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Wed Dec 12 21:39:57 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: relax latency check in Exclusive mode when switching from Event to Poll mode
+1: Etienne Dechamps
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7097201
commit 7572245aec09a7c3fc4cbd1c8e83b8c4667d1162
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Wed Dec 12 23:29:44 2018 +0200
wasapi: relax check for a latency range when deciding to switch from Event to Poll mode to have 1-21 ms range fine tuneable, add check for a min period when correcting period for UAC1 devices to avoid failure to initialize audio client due to invalid period error
commit b22a83a6006237071d7439e0f196e55d6f3e6651
Merge: 0cdb346 d74ea7b
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Mon Dec 10 08:52:59 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: fix rare case when Shared Mode format obtained by PKEY_AudioEngine_DeviceFormat not accepted by WASAPI
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7085071
commit d74ea7b610a6ae54582eb59c5d1b4c56a8e5e31b
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Dec 10 10:50:31 2018 +0200
wasapi: get channels count and sample rate from a mix format (IAudioClient::GetMixFormat) for a PaDeviceInfo to circumvent rare cases when WASAPI does not accept format provided PKEY_AudioEngine_DeviceFormat due to a wrong channel count (bug and solution reported by Etienne Dechamps (edechamps), discussion: http://app.assembla.com/spaces/portaudio/git/merge_requests/7024281), new PaWasapi_GetDeviceMixFormat API to get mix format provided by IAudioClient::GetMixFormat
commit 0cdb346fdca725cfc98da5cbe2d079096f91b624
Merge: 05994e0 57b98d5
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Sun Oct 21 10:24:52 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: fixed MonoToStereo converter could write beyond the allowed memory region if sample format is packed 24-bit integer, fixed DEF file by adding missing WASAPI API
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6928491
commit 57b98d5a8cebf8d5205a2654fd2d1a69d21c8955
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Sun Oct 21 13:21:28 2018 +0300
wasapi: fixed MonoToStereo converter could write beyond the allowed memory region if sample format is packed 24-bit integer, fixed DEF file by adding missing WASAPI API
commit 05994e022de42ea91d6b895764e05a70b36ac223
Merge: 4f6fd67 3651636
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Sun Oct 21 04:14:22 2018 +0000
Merge branch 'cmake_mingw_additions' into 'master'
commit Rainer's work and make some minor modifications to the top-level cmakelists to make visual studio happy
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/4858113
commit 365163674b8de5d3f0cffc38b303a5958c0665ec
Author: Nick Appleton <nick@appletonaudio.com>
Date: Fri Oct 12 22:43:17 2018 +1100
update cmake documentation
commit 294881a1b94ffe31dccd2111c28a3eaf7fd91d23
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Thu Oct 4 20:09:08 2018 +1000
fix typo
commit 495b303bbdabe49e1f6475db410e35588a1d4ea4
Merge: d3e0009 396c189
Author: Nick Appleton <nick@appletonaudio.com>
Date: Tue Oct 2 21:55:27 2018 +1000
Merge branch 'cmake_mingw_additions' of https://git.assembla.com/portaudio into cmake_mingw_additions
commit d3e00091c73d5784268909246259cd3fdf254d90
Author: Nick Appleton <nick@appletonaudio.com>
Date: Tue Oct 2 21:53:41 2018 +1000
create and install cmake export targets to make it easier for people to include portaudio in larger projects:
commit ea11061b20f637f8f707a4a225d37ff58ab54dc0
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Sun Apr 30 22:04:34 2017 +1000
commit Rainer's work and make some minor modifications to the top-level cmakelists to make visual studio happy
commit 396c189c01382f2fddc20c1e534100ce7282aca4
Author: Nick Appleton <nick@appletonaudio.com>
Date: Tue Oct 2 21:53:41 2018 +1000
create and install cmake export targets to make it easier for people to include portaudio in larger projects:
commit 4f6fd67c3f5321f07b7bead8ce9ab727ce6805e6
Merge: c0d2397 eb4a7d2
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Sun Sep 23 17:46:21 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: Fixed callback not called for Input stream if 1 channel format is requested.
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6838604
commit eb4a7d25dc15504ae3b4464bea36c1d8f3f51a86
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Sun Sep 23 20:44:21 2018 +0300
wasapi: fixed callback not called for Input stream if 1 channel format is requested
commit c0d239712d9afcd4b7ad58b6e1ba97a1d789d9eb
Merge: b2f6d82 5dec767
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Mon Sep 10 20:11:25 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: Fixed crash on NULL.
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6794444
commit 5dec767af1c35d1eb1422b51b477d7a0b18acdf3
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Sep 10 23:09:44 2018 +0300
wasapi: fixed crash on NULL
commit b2f6d82342f7f3b2f7a659b3a181c4bf092610aa
Merge: 9a8922d fe2c8e1
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Mon Sep 10 19:57:42 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: Fixed input device can not be opened in Exclusive mode (regression of previous commit).
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6794374
commit fe2c8e1f421df4f868d27b587eb90d1b74578fc5
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Sep 10 22:55:27 2018 +0300
wasapi: fixed input device can not be opened in Exclusive mode (regression of previous commit)
commit 9a8922da23342abb54a5c5fa09ac46d938e5d794
Merge: 8a8078a c3fee03
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Thu Sep 6 17:52:14 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: Support for Exclusive mode on UWP, private API extension, fixes.
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6785374
commit c3fee03ff143feca50dcbc53b89670f251bbce24
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Thu Sep 6 20:45:22 2018 +0300
wasapi: support Exclusive mode on UWP (use new function PaWasapi_SetDefaultInterfaceId to set device's interface id to make Exclusive mode work);
- support for explicit 8.24 format (24-bit inside 32-bit container) by specifying paCustomFormat (see IMPORTANT notes in the header file);
- new flag paWinWasapiExplicitSampleFormat to force explicit format and avoid fallback to a closest working;
- new function PaWasapi_GetDeviceCurrentFormat to get device format of the opened stream;
- support PaWasapi_ThreadPriorityXXX API on UWP to boot thread priority;
- improved selection of the closest format in Exclusive mode.
commit 8a8078a9ba873a00282e2dcc12c50e9f27f6cd88
Merge: 69d1b1e 6e3f6b7
Author: Phil Burk <burkphil@gmail.com>
Date: Sun Aug 19 21:16:00 2018 +0000
Merge branch 'ticket_274_xcode' into 'master'
configure: support SDK 10.13 in XCode
fixed #274
+1: Ryan Ollos
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6183813
commit 69d1b1e3cc817ab3a594ac66fec3b8f5d2feab31
Merge: 64ad96e d7a4cb4
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Thu Jul 19 18:47:52 2018 +0000
Merge branch 'winrt' into 'master'
WASAPI: Fixed compilation error of PaWasapi_GetAudioClient().
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6638133
commit d7a4cb482dc7470c1863bd0ff973ca2c6aefb70c
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Thu Jul 19 21:42:21 2018 +0300
wasapi: fixed compilation error of PaWasapi_GetAudioClient()
commit 64ad96ea3cf1853619d4827c049d87fe746bb584
Merge: 8dc6d59 a802290
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Sun Jul 1 10:04:03 2018 +0000
Merge branch 'winrt' into 'master'
New PaWasapi_GetAudioClient() API and workaround to get real Windows version and thus use correct AudioClient interface version.
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6574173
commit a802290e831cd8959801fcb1e634a5d28c0ea30d
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Sat Jun 30 12:21:59 2018 +0300
wasapi: new PaWasapi_GetAudioClient() API to get pointer to IAudioClient from PaStream, workaround to get real Windows version in order to be able to create correct version of IAudioClient interface (Windows 10 was reported as Windows 8 when using just GetVersion())
commit 8dc6d59877f2d102065871c3ef3020f3b98fd6b1
Author: Phil Burk <burkphil@gmail.com>
Date: Sat May 26 04:49:10 2018 +0000
Merge branch 'ticket_275_pass_void' into 'master'
Add void argument to Pa_GetVersionInfo()
+1: Anonymous
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6415893
commit c5e8f1dca7f2d1b9c3d5c92a3f6f174870c303d8
Author: DaShun <dashun.c@tc-gaming.com>
Date: Tue Apr 17 11:36:55 2018 +0800
Add asio lib.
commit 3215043f0dfcac9d1728a03086170d3dbe5984a3
Merge: 9923e1d d3e65ce
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Mon Apr 2 19:16:18 2018 +0000
Merge branch 'winrt' into 'master'
wasapi: new WASAPI specific API PaWasapi_UpdateDeviceList() which allows to update WASAPI device list dynamically without a need to call Pa_Terminate() and then Pa_Initialize()
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6241053
commit d3e65ce690c2cd55fd9d5df5a509d549eff17c1c
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Apr 2 22:15:49 2018 +0300
wasapi: correction to PaWasapi_UpdateDeviceList() API by making it unavailable by default unless PA_WASAPI_MAX_CONST_DEVICE_COUNT is explicitly defined
commit 9923e1dc318c57bb5d01c7d3a751b126ad4300c5
Merge: 1bdcb9e eb62287
Author: Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Date: Mon Apr 2 18:55:13 2018 +0000
Merge branch 'winrt' into 'master'
WinRT: fixed failure to initialize WASAPI when Capture device is not provided by OS, and additional minor corrections.
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/5913713
commit eb622874941be95ba27842f4373c6801092b2adb
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Apr 2 21:50:16 2018 +0300
wasapi: new WASAPI specific API PaWasapi_UpdateDeviceList() which allows to update WASAPI device list dynamically without a need to call Pa_Terminate() and then Pa_Initialize().
This new implementation overcomes current limitation of Pa_GetDeviceCount() API which gives constant device count by making WASAPI device list constant (32 devices by default) where 32 device slots can either be filled with a real device info or be empty for a future device changes.
Constant device list size can be altered by PA_WASAPI_MAX_CONST_DEVICE_COUNT define during a compile time. If PA_WASAPI_MAX_CONST_DEVICE_COUNT is set to 0 then PaWasapi_UpdateDeviceList() will be unavailable as well as dynamic device list update functionality.
This implementation also detects the audio device format change if user alters it via Windows Audio Controller GUI.
This implementation also makes WASAPI backend ready for a future implementation of device list updates via PortAudio public API. See internal PaError UpdateDeviceList().
commit 6e3f6b702f382905e3905682e7adaedf7e58958f
Author: Phil Burk <philburk@mobileer.com>
Date: Sun Mar 18 15:30:01 2018 -0700
configure: support SDK 10.13 in XCode
Updated configure.in
then ran autoconf to regenerate the configure script.
Fixes #274
commit a525c38289b8c98554952caae792c2d1794d589c
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Wed Jan 10 20:58:14 2018 +0200
wasapi: fixed failure to initialize when Capture device is not provided by OS, silenced warnings in log functions
commit 1bdcb9e41357ec76d8cf73f9ef278202a3ea1e3b
Merge: a1f61a9 bc40f42
Author: Ross Bencina <rossb@audiomulch.com>
Date: Mon Nov 13 06:42:49 2017 +0000
Merge branch 'winrt' into 'master'
WASAPI: corrections for Windows 10 UWP
+1: Ross Bencina, Anonymous, Roland Winklmeier
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/4995123
commit bc40f42cba713db3349bb1120b5d3475dd45e37e
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon May 29 22:44:36 2017 +0300
wasapi: corrected GetWindowsVersion() to return Windows 10 (was max Windows 8)
wasapi: use IAudioClient3 for Windows 10 for best compatibility
wasapi: fix compilation when Windows 10 SDK (10.0.15063.0) is used by removing SignalObjectAndWait() definition which creates duplicates with the system defined SignalObjectAndWait() (since 10.0.15063.0 it is supported by the OS again)
commit 72e319ad044e879a2cfe84d5929e9d7fb9ce7664
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Sun Apr 30 22:04:34 2017 +1000
commit Rainer's work and make some minor modifications to the top-level cmakelists to make visual studio happy
commit a1f61a9a2cb74d11cfe743d72763850aa246a092
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Sun Jan 15 21:30:35 2017 +1100
fix a tragic typo I made which prevented WASAPI being included with the CMake support.
commit 396fe4b6699ae929d3a685b3ef8a7e97396139a4
Merge: 49d0634 dde71d1
Author: Phil Burk <burkphil@gmail.com>
Date: Mon Oct 24 16:10:12 2016 +0000
Merge branch 'ticket_260_terminate' into 'master'
pa_front.c: fix initializationCount_ in Pa_Terminate()
+1: Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/4012103
commit dde71d1114813f2e9a34e7b80a05e04a33c948b3
Author: Phil Burk <philburk@mobileer.com>
Date: Sun Oct 23 14:50:01 2016 -0700
pa_front.c: fix initializationCount_ in Pa_Terminate()
Was decrementing too soon and causing Pa_CloseStream() to fail.
See ticket #260
commit 49d063418936d5edb70797b24f5ab7f00b3e5660
Merge: 037f18a e0947b7
Author: Ross Bencina <rossb@audiomulch.com>
Date: Mon Oct 10 00:56:01 2016 +0000
Merge branch 'cmake_mingw_fixes' into 'master'
CMakedLists.txt: Replicate the library dependencies in the configure script
+1: Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3915533
commit 037f18a2e4a2551847194c37a7d09f693a4d3652
Merge: 82773fe 18b2ab2
Author: Ross Bencina <rossb@audiomulch.com>
Date: Tue Oct 4 12:59:26 2016 +0000
Merge branch '257-wdmks-winioctl-include' into 'master'
Fix for ticket #257: MinGW-w64: Inclusion of <winioctl.h> triggers multiple redefinition errors.
+1: Phil Burk
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3915493
commit e0947b7d6a910315db989945177c99ed8f4c6ab7
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Sun Oct 2 21:50:42 2016 +1100
replicate the library dependencies in the configure script
commit 18b2ab2339b37616f969961fea3503f406c31f93
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Oct 2 20:34:04 2016 +1100
Fix for ticket #257: MinGW-w64: Inclusion of <winioctl.h> triggers multiple redefinition errors.
commit 82773feed7dc832d97c854a04cd1edf22b8eb9f5
Merge: 03eabbf f275c76
Author: Phil Burk <burkphil@gmail.com>
Date: Tue Sep 27 15:49:46 2016 +0000
Merge branch 'ticket_256_numchannels' into 'master'
paex_read_write_wire: fix crossed initialization
+1: Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3888083
commit f275c76ca96b17313af446902e4a5c98f4b38559
Author: Phil Burk <philburk@mobileer.com>
Date: Mon Sep 26 15:42:38 2016 -0700
paex_read_write_wire: fix crossed initialization
MinGW complained.
Fixes ticket #256
commit 03eabbf9cd12cba407194712d48dbe7458b80b1e
Merge: fcc15ae 2c0aed9
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 25 08:07:52 2016 +0000
Merge branch 'rb-doxygen-tweaks' into 'master'
Doxygen documentation: Fix Front Page formatting, fix broken links, link to MinGW build instructions on Wiki
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3876603
commit fcc15ae0538572ed30d0e6237bf8b8a53cc51bdc
Merge: 6dbb8a6 12f9673
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 25 08:07:41 2016 +0000
Merge branch 'rb-document-api-version' into 'master'
Document API Version Availability (e.g. `Available as of 19.5.0`).
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3881793
commit 12f967356ba0c6f03c471daba533cc44c7210d32
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 25 17:55:12 2016 +1000
Added `Available as of version 19.6.0` doc comments for new wasapi host-api-specific APIs.
commit e50b31bd406f51438513921b7daf0c950999f778
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 25 17:49:15 2016 +1000
Update doxygen comments for WDM/KS to indicate that new APIs are available in 19.5.0
commit d940dcb8b86c9bd88d7026ab3637e95bbf5310cb
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 25 17:34:16 2016 +1000
Fix formatting of version API doxygen comments in portaudio.h. Add additional documentation details, see also, and version information (e.g. `Available as of 19.5.0`).
commit 6dbb8a6d644453b426b6f8bb4d984b63bf894bfb
Merge: 3765e90 3f7248c
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 25 05:49:16 2016 +0000
Merge branch 'bump_version' into 'master'
pa_front: bump version to 19.6.0 for release
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3873413
commit 3765e908c24b8163e86c450924655237b010030c
Merge: b69214b 0c10cb6
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 25 05:48:45 2016 +0000
Merge branch 'cmake_updates' into 'master'
Update PortAudio CMake Support
+1: Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3751483
commit 3f7248cd00f1f37d6c738751b249720f102f1d97
Author: Phil Burk <philburk@mobileer.com>
Date: Sat Sep 24 09:02:56 2016 -0700
pa_front: bumped to 19.6.0
commit b69214bcb421798a9e8ff585060b7421063f1211
Merge: 5044381 339e875
Author: Phil Burk <burkphil@gmail.com>
Date: Sat Sep 24 16:01:14 2016 +0000
Merge branch 'ticket_252_nohang' into 'master'
pa_mac_core_blocking: fix hang when running stream stopped (fixed merge)
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3829453
commit 339e875f42727b759bf167fa0820e099bbd2fb93
Author: Phil Burk <philburk@mobileer.com>
Date: Sat Sep 24 08:53:28 2016 -0700
pa_mac_core: fix whitespace and missing semicolon
It compiled without the semicolon because it was followed by a VDBUG,
which was followed by a semicolon. The VDBUG was disabled so its
semicolon finished the line above.
commit 50443810682ff72f3a8f4d1cf1ead0a68b028af1
Merge: 8b7f390 c2326aa
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sat Sep 24 06:25:06 2016 +0000
Merge branch 'rb-version-doc-comment-cleanup' into 'master'
Updated doc comments in portaudio.h to reflect that versionControlRevision is now a git revision hash
+1: Phil Burk, Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3877593
commit c2326aa8f0ddb71307c414f15a674750720f743e
Author: Ross Bencina <rossb@audiomulch.com>
Date: Fri Sep 23 21:10:21 2016 +1000
updated doc comments to reflect that versionControlRevision is now a git revision hash
commit 2c0aed9d8f98eb5206c49c8337c28752217feaab
Author: Ross Bencina <rossb@audiomulch.com>
Date: Fri Sep 23 18:49:00 2016 +1000
Doxygen document tweaks: * Link to our Wiki for latest MinGW build information. * Fix for latest doxygen: non-displaying links on main page (add space before <br>). * Remove broken link to java binding docs (not compiled). * Update link to mailing list.
commit b2f937523723982519607d558b95d40860526efa
Author: Phil Burk <philburk@mobileer.com>
Date: Thu Sep 22 09:29:36 2016 -0700
pa_front: bump version to 19.5.1 for release
commit cacc5dc4ba848ce1aabed425ef9f465cd9e0babb
Author: Phil Burk <philburk@mobileer.com>
Date: Thu Sep 22 09:05:38 2016 -0700
pa_mac_core: use MAX(inputFrames,outputFrames)
Double-check whether the stream does ouput before draining the buffer.
commit 8b7f390907f09787f58e94445066f21c77ffcde6
Merge: 52bd2af 1cf10aa
Author: Ross Bencina <rossb@audiomulch.com>
Date: Thu Sep 22 12:12:47 2016 +0000
Merge branch 'remove-microsoft-include-files' into 'master'
Remove Microsoft copyright include files from src/hostapi/wasapi/mingw-include
+1: Phil Burk, Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3848293
commit a38df79293e937e1cdb8b99b20c615894aa73859
Author: Phil Burk <philburk@mobileer.com>
Date: Wed Sep 21 15:46:30 2016 -0700
pa_mac_core_blocking: Fix timeout.
Change alignment of comment.
commit 1cf10aa43f78679889948f05b00a9a2ca878abd8
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sat Sep 17 18:21:52 2016 +1000
remove Microsoft copyright include files from src/hostapi/wasapi/mingw-include
commit 52bd2afb1ddca18ba76bb35c4088c1208edf3f6f
Merge: 05da7a8 f17d549
Author: Phil Burk <burkphil@gmail.com>
Date: Fri Sep 16 15:50:33 2016 +0000
Merge branch 'ticket_251_alsacancel' into 'master'
pa_linux_alsa: fix hang in callback caused by abort
+1: Phil Burk
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3834073
commit 0c10cb6c0cd2b34ff35d8e5fb011ca7481c20a2a
Author: Nick Appleton <nick@appletonaudio.com>
Date: Thu Sep 15 22:52:44 2016 +1000
address all problems picked up by cmakelint except for line-length related comments. don't use min() in paex_record_file as it is a macro specific to windows.
commit 1389dee5f6414eaea5c02fc6865e8fab6beba08e
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Thu Sep 15 22:18:12 2016 +1000
get examples compiling with CMake on Windows again
commit f17d549093a9653285f81ff5a14f4a41d395fbce
Author: Phil Burk <philburk@mobileer.com>
Date: Wed Sep 14 08:50:33 2016 -0700
pa_linux_alsa: fix hang in callback caused by abort
The author of this patch is Alan Horstmann.
Fixes ticket #251
commit 0bc7cf94651c9174462505a2a6fbd783f728bcf0
Author: Phil Burk <philburk@mobileer.com>
Date: Sat Aug 27 13:53:10 2016 -0700
pa_mac_core_blocking: fix hang when running stream stopped
One thread was filling the buffer while
another thread was waiting for it to be empty.
Add thread safety warnings.
Fix ticket #252
commit 2251a120263fd37d96986e7fa2c5d3b665343878
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Tue Sep 13 22:16:55 2016 +1000
undo whitespace change to pa_win_wasapi.c and fix a CMake grumbling about an unmatched ENDIF() closing expression
commit 0fc163720c8c70325a83ae4477f7df6ab26f4fff
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Tue Sep 13 22:04:31 2016 +1000
supply pkg-config version via setting in CMakeLists.txt - allow installation when using MinGW
commit dc568d54a8cbbe0d0b90ff6d34b79a5cc14652a8
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Tue Sep 13 21:55:31 2016 +1000
only build x86 plain converters in Visual Studio due because of assembly syntax. add library dependencies for asio to get MinGW builds linking. disable WASAPI when using MinGW as I cannot get it to work.
commit 05da7a854db5e28794311a7ea4f394cbce2cd0e4
Merge: 9e2cf27 e1d4ec6
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Sep 11 17:38:12 2016 +0000
Merge branch 'winrt' into 'master'
Correction to WASAPI host API implementation for WinRT platform
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3772573
commit 9e2cf27ca73a8ded92baeb0005c7311b6db7224e
Merge: d0d5020 fc5de75
Author: Phil Burk <burkphil@gmail.com>
Date: Sat Sep 10 17:16:19 2016 +0000
Merge branch 'ticket_248_gitrevision' into 'master'
PA_GIT_REVISION: new scripts to replace SVN revision
+1: Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3790093
commit fc5de750f84cc43f23016f08751554c4273589a0
Author: Phil Burk <philburk@mobileer.com>
Date: Fri Sep 9 09:06:27 2016 -0700
Remove version printing from paex_sine.c
commit a553478d71f24bff6e0a72db66fc68e9a5b5847a
Author: Phil Burk <philburk@mobileer.com>
Date: Mon Sep 5 17:03:27 2016 -0700
PA_GIT_REVISION: new scripts to replace SVN revision
update_gitrevision.sh should be run before building on Mac or Linux.
commit e1d4ec666443ab16c25f06268ec4f86584463ca6
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Thu Sep 1 09:00:38 2016 +0300
wasapi: made ActivateAudioInterface_WINRT more universal in terms of getting other audio interfaces, for example IAudioEndpointVolume
commit d0d5020ddfc1155e2782b203079dde1a9301c077
Merge: 0648f7e 037e260
Author: Ross Bencina <rossb@audiomulch.com>
Date: Thu Sep 1 00:36:17 2016 +0000
Merge branch 'rb-fix-pa-front-c99isms' into 'master'
Don't use C99 designated initializer syntax it's not C89 compatible
+1: Phil Burk
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3747023
commit 72dd5db968c95200beab2c44cbaa1e9e44ea7782
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Aug 29 09:54:49 2016 +0300
wasapi: return E_NOINTERFACE in PaActivateAudioInterfaceCompletionHandler::QueryInterface, use C-style API for calling interface functions (in order to be unified with the rest of WASAPI code)
commit 0648f7e63b2c7039a5830c8ef8a142b2695e93d4
Merge: 7edc5cb 319b192
Author: Ross Bencina <rossb@audiomulch.com>
Date: Sun Aug 28 00:14:32 2016 +0000
Merge branch 'winrt' into 'master'
WASAPI: ported to WinRT (UWP) platform, compatibility fixes to compile PortAudio as Windows Store library
+1: Phil Burk, Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3643753
commit cdbc78e54f1103cf9abceaed676cee763c9e83da
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Sat Aug 27 10:43:42 2016 +1000
change the compiler flags into a compiler definitions list as we never modify the flags - add some documentation
commit 983a853635cdd550ebc83386df47ab6f6afbd695
Author: Nicholas Appleton <nick@appletonaudio.com>
Date: Sat Aug 27 09:52:57 2016 +1000
move changes to cmake lists made in my personal github space into the assembla branch. I will work in here from this point.
commit 319b19203aca10c0f241faf2ff89ec300c3aba4c
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Fri Aug 26 22:31:45 2016 +0300
wasapi: replaced InterlockedCompareExchange with InterlockedOr and added clarifying comment why Interlocked API is used
commit 037e260d64ed982638333beb572303ed9be588fa
Author: Ross Bencina <rossb@audiomulch.com>
Date: Fri Aug 26 19:42:09 2016 +1000
comment out C99 designated initializer syntax for versionInfo_ initializer. not C89 compatible
commit fce3367c2393fcc241fca45b7f0a73fc0c549ad1
Author: Ross Bencina <rossb@audiomulch.com>
Date: Fri Aug 26 19:33:31 2016 +1000
remove trailing whitespace from end of lines
commit dae0d7f8e7e91940d4327b7a0c5e4a6abad328ed
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Fri Aug 26 09:43:50 2016 +0300
wasapi: reverted the usage of Interlocked APIs for PaWasapiStream::running
commit 46bce3c39fac3c747e41adb89607b4487b047f18
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Wed Aug 24 22:04:17 2016 +0300
wasapi: use InterlockedXXX APIs to secure inter-thread r/w access to variables to avoid possible deadlocks or logic corruption
commit ef449bb5bff4fb8d8219984d515628469b65dc3e
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Sun Aug 14 19:01:20 2016 +0300
wasapi: more cleanup - normalized WIN32_WINRT to PA_WINRT, removed excessive declarations from SignalObjectAndWait, ActivateAudioInterfaceCompletionHandler set of functions
commit 326549c55ee09bcb3cd95540d870540aefc43c3d
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Sun Aug 14 10:52:36 2016 +0300
wasapi: use Windows common Sleep() API instead of PA_Sleep()
use GetTickCount64() API which is awailable for Windows Store app instead of _ftime_s()
remove WAVEFORMAT and WAVEFORMATEX declaration and use the corresponding Windows include file instead
commit 26c0dc4458d7e3acd24c948f5e8355cf3d0ecba3
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Mon Aug 8 21:09:15 2016 +0300
wasapi: code cleanup, removed compiler warnings
commit 2e7545f17fc7f0ed4a85d0ae21361f091e607cc0
Author: dmitrykos <dmitrykos@neutroncode.com>
Date: Wed Aug 3 22:39:41 2016 +0300
wasapi: ported to WinRT (UWP)
os: compatibility fixes for compilation of PortAudio as Windows Store library (only WASAPI hostapi is compatible with Windows Store APIs)
commit 7edc5cb655810c6eb5e57c2b2bdbd24a760abf2c
Merge: e111b3a cf4ef2c
Author: Phil Burk <burkphil@gmail.com>
Date: Wed Aug 3 00:53:41 2016 +0000
Merge branch 'loopback' into 'master'
Loopback: fix warnings that prevent compilation
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3604853
commit cf4ef2ce1907e71179facb4107769df70cf8559e
Author: Phil Burk <philburk@mobileer.com>
Date: Tue Jul 26 19:10:23 2016 -0700
Loopback: fix warnings that prevent compilation
Add newline in biquad_filter.c
Add integer assert with tolerance.
commit e111b3a269ae69c8c083ca4a2a3e3d66828d9ddc
Merge: 21d185f e89441f
Author: Phil Burk <burkphil@gmail.com>
Date: Sun May 29 19:22:24 2016 +0000
Merge branch 'ticket_229' into 'master'
Fix assert when reading or writing with non-power of 2 channels.
fixed #229
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3299213
commit e89441f968ca36bdf487454122fef9bbb2c72a36
Author: Phil Burk <philburk@mobileer.com>
Date: Sat May 21 17:31:53 2016 -0700
Restore paqa_devs
commit 36a6c92caac08319443254d13a10b89616777039
Author: Phil Burk <philburk@mobileer.com>
Date: Sat May 21 17:30:21 2016 -0700
Revert paqa_devs
commit 315309f60e8f77531a4e2d14d52b3fc46ee8196f
Author: Phil Burk <philburk@mobileer.com>
Date: Sat May 21 17:25:18 2016 -0700
Mac: test adjustable number of channels.
commit 110043f84225aa12750d299152addd295184619c
Author: Phil Burk <philburk@mobileer.com>
Date: Wed May 18 21:41:01 2016 -0700
Fix assert when reading or writing with non-power of 2 channels.
commit 21d185f815949b0258b49f743478a82f68f3e2d5
Merge: 89d1761 ed463ba
Author: Phil Burk <burkphil@gmail.com>
Date: Thu May 19 05:20:42 2016 +0000
Merge branch 'fixeol' into 'master'
Add .gitattributes to fix EOL
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3299183
commit ed463ba658e593602a0aed549336bb0ecadc59d7
Author: Phil Burk <philburk@mobileer.com>
Date: Wed May 18 22:13:20 2016 -0700
Normalize all the line endings
commit b99790cb7ca69b1fce5b1abf33f69e712e2de9f8
Author: Phil Burk <philburk@mobileer.com>
Date: Wed May 18 22:05:13 2016 -0700
Add .gitattributes to fix EOL
commit 89d176178b1e23e32d34b504fd60e1276e3a57fc
Merge: 06ff140 e18ea33
Author: Phil Burk <burkphil@gmail.com>
Date: Wed May 18 03:42:26 2016 +0000
Merge branch 'noassert' into 'master'
pa_mac_core: stop stream instead of asserting
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3218623
commit e18ea33d22837ee13bff5280a26df41a327e1535
Author: Phil Burk <philburk@mobileer.com>
Date: Mon May 16 22:30:28 2016 -0700
pa_mac_core.c: Removed some comments. Cleaned up logic.
commit 06ff140a61c5841b78f022c72472827e54fc9f18
Merge: 6c11a00 cc1908f
Author: Phil Burk <burkphil@gmail.com>
Date: Tue May 3 01:26:54 2016 +0000
Merge branch 'testgit2' into 'master'
test git changesets
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3221493
commit cc1908fafb6fe43d73bfd533d77caa6690ceb3d8
Author: Phil Burk <philburk@mobileer.com>
Date: Mon May 2 09:13:22 2016 -0700
Another change and commit to the same branch
commit 274a2899111f096464b954a162c5f212bb44254e
Author: Phil Burk <philburk@mobileer.com>
Date: Mon May 2 09:12:05 2016 -0700
test git changesets
commit 09588cc5d6f62571d540048fee5e8a4346441fe4
Author: Phil Burk <philburk@mobileer.com>
Date: Sun May 1 18:08:38 2016 -0700
pa_mac_core: stop stream instead of asserting
Bug: 158
commit 6c11a007c590b8dbab5f2846f4aca88939ee32ad
Merge: a68bacd 83891bf
Author: Phil Burk <burkphil@gmail.com>
Date: Sun May 1 22:42:50 2016 +0000
Merge branch 'ignorebin' into 'master'
gitignore: add more files from configure and make
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3218493
commit 83891bff3f341a356bc440d6456765fdbcf36f5d
Author: Phil Burk <philburk@mobileer.com>
Date: Sun May 1 15:39:03 2016 -0700
gitignore: add more files from configure and make
commit a68bacd2cf98569ee2b6d58ae945818ddd8b7090
Merge: 13b2159 faff433
Author: Phil Burk <burkphil@gmail.com>
Date: Sun May 1 19:59:13 2016 +0000
Merge branch 'ignore' into 'master'
Add .gitignore for C++
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3218363
commit faff433ba62673567a23a2cb8d19b791a9eeead1
Author: Phil Burk <philburk@mobileer.com>
Date: Sun May 1 12:54:03 2016 -0700
Add .gitignore for C++
commit 13b21598210ced77d5b147ed6db6804bcfba7947
Author: philburk <philburk@0f58301d-fd10-0410-b4af-bbb618454e57>
Date: Sun Apr 10 18:12:03 2016 +0000
patest_out_underflow: cleanup
Replace some tabs.
Print overflow under stress.
Prevent accidental overrange of phases array.
This commit is contained in:
parent
a3bda5be97
commit
ff8053e7e8
|
@ -0,0 +1,43 @@
|
|||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.c text
|
||||
*.h text
|
||||
*.cpp text
|
||||
*.hpp text
|
||||
*.fth text
|
||||
*.java text
|
||||
*.f text
|
||||
*.txt text
|
||||
*.dox text
|
||||
*.m text
|
||||
|
||||
# Declare files that will always have CRLF line endings on checkout.
|
||||
*.sln text eol=crlf
|
||||
*.def text eol=crlf
|
||||
*.dsp text eol=crlf
|
||||
*.dsw text eol=crlf
|
||||
*.vcproj text eol=crlf
|
||||
*.sln text eol=crlf
|
||||
*.doc text eol=crlf
|
||||
*.bat text eol=crlf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.dic binary
|
||||
*.odt binary
|
||||
*.pdf binary
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.wav binary
|
||||
*.la binary
|
||||
config.guess binary
|
||||
config.status binary
|
||||
config.sub binary
|
||||
configure binary
|
||||
depcomp binary
|
||||
install-sh binary
|
||||
libtool binary
|
||||
missing binary
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# annoying files
|
||||
**/.DS_Store
|
||||
|
||||
# Generated by configure and make
|
||||
Makefile
|
||||
bin-stamp
|
||||
bin/*
|
||||
config.log
|
||||
config.status
|
||||
lib-stamp
|
||||
lib/*
|
||||
libtool
|
||||
portaudio-2.0.pc
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
|
@ -3,234 +3,77 @@
|
|||
# For a "How-To" please refer to the Portaudio documentation at:
|
||||
# http://www.portaudio.com/trac/wiki/TutorialDir/Compile/CMake
|
||||
#
|
||||
PROJECT( portaudio )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
# Check if the user is building PortAudio stand-alone or as part of a larger
|
||||
# project. If this is part of a larger project (i.e. the CMakeLists.txt has
|
||||
# been imported by some other CMakeLists.txt), we don't want to trump over
|
||||
# the top of that project's global settings.
|
||||
IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_LIST_DIR})
|
||||
PROJECT(portaudio)
|
||||
|
||||
OPTION(PA_CONFIG_LIB_OUTPUT_PATH "Make sure that output paths are kept neat" OFF)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(TARGET_POSTFIX x64)
|
||||
IF(PA_CONFIG_LIB_OUTPUT_PATH)
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin/x64)
|
||||
ENDIF(PA_CONFIG_LIB_OUTPUT_PATH)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(TARGET_POSTFIX x86)
|
||||
IF(PA_CONFIG_LIB_OUTPUT_PATH)
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin/Win32)
|
||||
ENDIF(PA_CONFIG_LIB_OUTPUT_PATH)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
# CMAKE_CONFIGURATION_TYPES only exists for multi-config generators (like
|
||||
# Visual Studio or Xcode). For these projects, we won't define
|
||||
# CMAKE_BUILD_TYPE as it does not make sense.
|
||||
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
MESSAGE(STATUS "Setting CMAKE_BUILD_TYPE type to 'Debug' as none was specified.")
|
||||
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
||||
ENDIF()
|
||||
|
||||
OPTION(PA_ENABLE_DEBUG_OUTPUT "Enable debug output for Portaudio" OFF)
|
||||
IF(PA_ENABLE_DEBUG_OUTPUT)
|
||||
ADD_DEFINITIONS(-DPA_ENABLE_DEBUG_OUTPUT)
|
||||
ENDIF(PA_ENABLE_DEBUG_OUTPUT)
|
||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
IF(WIN32 AND MSVC)
|
||||
OPTION(PA_DLL_LINK_WITH_STATIC_RUNTIME "Link with static runtime libraries (minimizes runtime dependencies)" ON)
|
||||
IF(PA_DLL_LINK_WITH_STATIC_RUNTIME)
|
||||
FOREACH(flag_var
|
||||
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
IF(${flag_var} MATCHES "/MD")
|
||||
STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
ENDIF(${flag_var} MATCHES "/MD")
|
||||
ENDFOREACH(flag_var)
|
||||
ENDIF(PA_DLL_LINK_WITH_STATIC_RUNTIME)
|
||||
IF(WIN32 AND MSVC)
|
||||
OPTION(PA_DLL_LINK_WITH_STATIC_RUNTIME "Link with static runtime libraries (minimizes runtime dependencies)" ON)
|
||||
IF(PA_DLL_LINK_WITH_STATIC_RUNTIME)
|
||||
FOREACH(flag_var
|
||||
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
IF(${flag_var} MATCHES "/MD")
|
||||
STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDIF(WIN32 AND MSVC)
|
||||
SET(PA_VERSION 19)
|
||||
SET(PA_PKGCONFIG_VERSION ${PA_VERSION})
|
||||
SET(PA_SOVERSION "${PA_VERSION}.0")
|
||||
|
||||
IF(WIN32)
|
||||
OPTION(PA_UNICODE_BUILD "Enable Portaudio Unicode build" ON)
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_support)
|
||||
# Try to find DirectX SDK
|
||||
FIND_PACKAGE(DXSDK)
|
||||
# Try to find ASIO SDK (assumes that portaudio and asiosdk folders are side-by-side, see
|
||||
# http://www.portaudio.com/trac/wiki/TutorialDir/Compile/WindowsASIOMSVC)
|
||||
FIND_PACKAGE(ASIOSDK)
|
||||
# Try to find JACK SDK
|
||||
FIND_PACKAGE(JACKSDK)
|
||||
|
||||
IF(ASIOSDK_FOUND)
|
||||
OPTION(PA_USE_ASIO "Enable support for ASIO" ON)
|
||||
ELSE(ASIOSDK_FOUND)
|
||||
OPTION(PA_USE_ASIO "Enable support for ASIO" OFF)
|
||||
ENDIF(ASIOSDK_FOUND)
|
||||
IF(DXSDK_FOUND)
|
||||
OPTION(PA_USE_DS "Enable support for DirectSound" ON)
|
||||
ELSE(DXSDK_FOUND)
|
||||
OPTION(PA_USE_DS "Enable support for DirectSound" OFF)
|
||||
ENDIF(DXSDK_FOUND)
|
||||
OPTION(PA_USE_WMME "Enable support for MME" ON)
|
||||
OPTION(PA_USE_WASAPI "Enable support for WASAPI" ON)
|
||||
OPTION(PA_USE_WDMKS "Enable support for WDMKS" ON)
|
||||
OPTION(PA_USE_WDMKS_DEVICE_INFO "Use WDM/KS API for device info" ON)
|
||||
MARK_AS_ADVANCED(PA_USE_WDMKS_DEVICE_INFO)
|
||||
IF(PA_USE_DS)
|
||||
OPTION(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE "Use DirectSound full duplex create" ON)
|
||||
MARK_AS_ADVANCED(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE)
|
||||
ENDIF(PA_USE_DS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Set variables for DEF file expansion
|
||||
IF(NOT PA_USE_ASIO)
|
||||
SET(DEF_EXCLUDE_ASIO_SYMBOLS ";")
|
||||
ENDIF(NOT PA_USE_ASIO)
|
||||
|
||||
IF(NOT PA_USE_WASAPI)
|
||||
SET(DEF_EXCLUDE_WASAPI_SYMBOLS ";")
|
||||
ENDIF(NOT PA_USE_WASAPI)
|
||||
|
||||
IF(PA_USE_WDMKS_DEVICE_INFO)
|
||||
ADD_DEFINITIONS(-DPAWIN_USE_WDMKS_DEVICE_INFO)
|
||||
ENDIF(PA_USE_WDMKS_DEVICE_INFO)
|
||||
|
||||
IF(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE)
|
||||
ADD_DEFINITIONS(-DPAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE)
|
||||
ENDIF(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE)
|
||||
|
||||
#######################################
|
||||
IF(WIN32)
|
||||
INCLUDE_DIRECTORIES(src/os/win)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(PA_USE_ASIO)
|
||||
INCLUDE_DIRECTORIES(${ASIOSDK_ROOT_DIR}/common)
|
||||
INCLUDE_DIRECTORIES(${ASIOSDK_ROOT_DIR}/host)
|
||||
INCLUDE_DIRECTORIES(${ASIOSDK_ROOT_DIR}/host/pc)
|
||||
|
||||
SET(PA_ASIO_INCLUDES
|
||||
include/pa_asio.h
|
||||
)
|
||||
|
||||
SET(PA_ASIO_SOURCES
|
||||
src/hostapi/asio/pa_asio.cpp
|
||||
)
|
||||
|
||||
SET(PA_ASIOSDK_SOURCES
|
||||
${ASIOSDK_ROOT_DIR}/common/asio.cpp
|
||||
${ASIOSDK_ROOT_DIR}/host/pc/asiolist.cpp
|
||||
${ASIOSDK_ROOT_DIR}/host/asiodrivers.cpp
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\ASIO" FILES
|
||||
${PA_ASIO_SOURCES}
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\ASIO\\ASIOSDK" FILES
|
||||
${PA_ASIOSDK_SOURCES}
|
||||
)
|
||||
ENDIF(PA_USE_ASIO)
|
||||
|
||||
IF(PA_USE_DS)
|
||||
INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
|
||||
INCLUDE_DIRECTORIES(src/os/win)
|
||||
|
||||
SET(PA_DS_INCLUDES
|
||||
include/pa_win_ds.h
|
||||
src/hostapi/dsound/pa_win_ds_dynlink.h
|
||||
)
|
||||
|
||||
SET(PA_DS_SOURCES
|
||||
src/hostapi/dsound/pa_win_ds.c
|
||||
src/hostapi/dsound/pa_win_ds_dynlink.c
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\dsound" FILES
|
||||
${PA_DS_INCLUDES}
|
||||
${PA_DS_SOURCES}
|
||||
)
|
||||
ENDIF(PA_USE_DS)
|
||||
|
||||
IF(PA_USE_WMME)
|
||||
|
||||
SET(PA_WMME_INCLUDES
|
||||
include/pa_win_wmme.h
|
||||
)
|
||||
|
||||
SET(PA_WMME_SOURCES
|
||||
src/hostapi/wmme/pa_win_wmme.c
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\wmme" FILES
|
||||
${PA_WMME_SOURCES}
|
||||
)
|
||||
ENDIF(PA_USE_WMME)
|
||||
|
||||
IF(PA_USE_WASAPI)
|
||||
|
||||
SET(PA_WASAPI_INCLUDES
|
||||
include/pa_win_wasapi.h
|
||||
)
|
||||
|
||||
SET(PA_WASAPI_SOURCES
|
||||
src/hostapi/wasapi/pa_win_wasapi.c
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\wasapi" FILES
|
||||
${PA_WASAPI_SOURCES}
|
||||
)
|
||||
ENDIF(PA_USE_WASAPI)
|
||||
|
||||
IF(PA_USE_WDMKS)
|
||||
|
||||
SET(PA_WDMKS_INCLUDES
|
||||
include/pa_win_wdmks.h
|
||||
)
|
||||
|
||||
SET(PA_WDMKS_SOURCES
|
||||
src/hostapi/wdmks/pa_win_wdmks.c
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\wdmks" FILES
|
||||
${PA_WDMKS_SOURCES}
|
||||
)
|
||||
ENDIF(PA_USE_WDMKS)
|
||||
|
||||
IF(PA_USE_JACK)
|
||||
|
||||
SET(PA_JACK_INCLUDES
|
||||
include/pa_jack.h
|
||||
src/hostapi/jack/pa_jack_dynload.h
|
||||
)
|
||||
|
||||
SET(PA_JACK_SOURCES
|
||||
src/hostapi/jack/pa_jack.c
|
||||
src/hostapi/jack/pa_jack_dynload.h
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\jack" FILES
|
||||
${PA_WASAPI_SOURCES}
|
||||
)
|
||||
ENDIF(PA_USE_JACK)
|
||||
|
||||
SET(PA_SKELETON_SOURCES
|
||||
src/hostapi/skeleton/pa_hostapi_skeleton.c
|
||||
)
|
||||
|
||||
SOURCE_GROUP("hostapi\\skeleton"
|
||||
${PA_SKELETON_SOURCES})
|
||||
|
||||
#######################################
|
||||
IF(WIN32)
|
||||
SET(PA_INCLUDES
|
||||
include/portaudio.h
|
||||
${PA_ASIO_INCLUDES}
|
||||
${PA_DS_INCLUDES}
|
||||
${PA_WMME_INCLUDES}
|
||||
${PA_WASAPI_INCLUDES}
|
||||
${PA_WDMKS_INCLUDES}
|
||||
${PA_JACK_INCLUDES}
|
||||
)
|
||||
ENDIF(WIN32)
|
||||
|
||||
SOURCE_GROUP("include" FILES
|
||||
${PA_INCLUDES}
|
||||
)
|
||||
# Most of the code from this point onwards is related to populating the
|
||||
# following variables:
|
||||
# PA_PUBLIC_INCLUDES - This contains the list of public PortAudio header
|
||||
# files. These files will be copied into /include paths on Unix'y
|
||||
# systems when "make install" is invoked.
|
||||
# PA_PRIVATE_INCLUDES - This contains the list of header files which
|
||||
# are not part of PortAudio, but are required by the various hostapis.
|
||||
# It is only used by CMake IDE generators (like Visual Studio) to
|
||||
# provide quick-links to useful headers. It has no impact on build
|
||||
# output.
|
||||
# PA_PRIVATE_INCLUDE_PATHS - This contains the list of include paths which
|
||||
# will be passed to the compiler while PortAudio is being built which
|
||||
# are not required by applications using the PortAudio API.
|
||||
# PA_PRIVATE_COMPILE_DEFINITIONS - This contains a list of preprocessor
|
||||
# macro definitions which will be set when compiling PortAudio source
|
||||
# files.
|
||||
# PA_SOURCES - This contains the list of source files which will be built
|
||||
# into the static and shared PortAudio libraries.
|
||||
# PA_NON_UNICODE_SOURCES - This also contains a list of source files which
|
||||
# will be build into the static and shared PortAudio libraries. However,
|
||||
# these sources will not have any unicode compiler definitions added
|
||||
# to them. This list should only contain external source dependencies.
|
||||
# PA_EXTRA_SHARED_SOURCES - Contains a list of extra files which will be
|
||||
# associated only with the shared PortAudio library. This only seems
|
||||
# relevant for Windows shared libraries which require a list of export
|
||||
# symbols.
|
||||
# Where other PA_* variables are set, these are almost always only used to
|
||||
# preserve the historic SOURCE_GROUP behavior (which again only has an impact
|
||||
# on IDE-style generators for visual appearance) or store the output of
|
||||
# find_library() calls.
|
||||
|
||||
SET(PA_COMMON_INCLUDES
|
||||
src/common/pa_allocation.h
|
||||
|
@ -238,7 +81,6 @@ SET(PA_COMMON_INCLUDES
|
|||
src/common/pa_cpuload.h
|
||||
src/common/pa_debugprint.h
|
||||
src/common/pa_dither.h
|
||||
src/common/pa_dynload.h
|
||||
src/common/pa_endianness.h
|
||||
src/common/pa_hostapi.h
|
||||
src/common/pa_memorybarrier.h
|
||||
|
@ -256,7 +98,6 @@ SET(PA_COMMON_SOURCES
|
|||
src/common/pa_cpuload.c
|
||||
src/common/pa_debugprint.c
|
||||
src/common/pa_dither.c
|
||||
src/common/pa_dynload.c
|
||||
src/common/pa_front.c
|
||||
src/common/pa_process.c
|
||||
src/common/pa_ringbuffer.c
|
||||
|
@ -264,113 +105,375 @@ SET(PA_COMMON_SOURCES
|
|||
src/common/pa_trace.c
|
||||
)
|
||||
|
||||
SOURCE_GROUP("common" FILES
|
||||
${PA_COMMON_INCLUDES}
|
||||
${PA_COMMON_SOURCES}
|
||||
)
|
||||
SOURCE_GROUP("common" FILES ${PA_COMMON_INCLUDES} ${PA_COMMON_SOURCES})
|
||||
|
||||
SOURCE_GROUP("cmake_generated" FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/portaudio_cmake.def
|
||||
${CMAKE_CURRENT_BINARY_DIR}/options_cmake.h
|
||||
)
|
||||
SET(PA_PUBLIC_INCLUDES include/portaudio.h)
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake_support)
|
||||
|
||||
SET(PA_SKELETON_SOURCES src/hostapi/skeleton/pa_hostapi_skeleton.c)
|
||||
SOURCE_GROUP("hostapi\\skeleton" ${PA_SKELETON_SOURCES})
|
||||
SET(PA_SOURCES ${PA_COMMON_SOURCES} ${PA_SKELETON_SOURCES})
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS src/common ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
IF(WIN32)
|
||||
SET(PA_PLATFORM_SOURCES
|
||||
src/os/win/pa_win_hostapis.c
|
||||
src/os/win/pa_win_util.c
|
||||
src/os/win/pa_win_waveformat.c
|
||||
src/os/win/pa_win_wdmks_utils.c
|
||||
src/os/win/pa_win_coinitialize.c
|
||||
src/os/win/pa_x86_plain_converters.c
|
||||
)
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} _CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
SOURCE_GROUP("os\\win" FILES
|
||||
${PA_PLATFORM_SOURCES}
|
||||
)
|
||||
ENDIF(WIN32)
|
||||
SET(PA_PLATFORM_SOURCES
|
||||
src/os/win/pa_win_hostapis.c
|
||||
src/os/win/pa_win_util.c
|
||||
src/os/win/pa_win_waveformat.c
|
||||
src/os/win/pa_win_wdmks_utils.c
|
||||
src/os/win/pa_win_coinitialize.c)
|
||||
SET(PA_PLATFORM_INCLUDES
|
||||
src/os/win/pa_win_coinitialize.h
|
||||
src/os/win/pa_win_wdmks_utils.h)
|
||||
|
||||
INCLUDE_DIRECTORIES( include )
|
||||
INCLUDE_DIRECTORIES( src/common )
|
||||
IF(MSVC)
|
||||
SET(PA_PLATFORM_SOURCES ${PA_PLATFORM_SOURCES} src/os/win/pa_x86_plain_converters.c)
|
||||
SET(PA_PLATFORM_INCLUDES ${PA_PLATFORM_INCLUDES} src/os/win/pa_x86_plain_converters.h)
|
||||
ELSE()
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} _WIN32_WINNT=0x0501 WINVER=0x0501)
|
||||
SET(DEF_EXCLUDE_X86_PLAIN_CONVERTERS ";")
|
||||
ENDIF()
|
||||
|
||||
SOURCE_GROUP("os\\win" FILES ${PA_PLATFORM_SOURCES} ${PA_PLATFORM_INCLUDES})
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_PLATFORM_SOURCES})
|
||||
SET(PA_PRIVATE_INCLUDES ${PA_PRIVATE_INCLUDES} ${PA_PLATFORM_INCLUDES})
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} src/os/win)
|
||||
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} winmm)
|
||||
|
||||
# Try to find ASIO SDK (assumes that portaudio and asiosdk folders are side-by-side, see
|
||||
# http://www.portaudio.com/trac/wiki/TutorialDir/Compile/WindowsASIOMSVC)
|
||||
FIND_PACKAGE(ASIOSDK)
|
||||
IF(ASIOSDK_FOUND)
|
||||
OPTION(PA_USE_ASIO "Enable support for ASIO" ON)
|
||||
ELSE()
|
||||
OPTION(PA_USE_ASIO "Enable support for ASIO" OFF)
|
||||
ENDIF()
|
||||
IF(PA_USE_ASIO)
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} ${ASIOSDK_ROOT_DIR}/common)
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} ${ASIOSDK_ROOT_DIR}/host)
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} ${ASIOSDK_ROOT_DIR}/host/pc)
|
||||
SET(PA_ASIO_SOURCES src/hostapi/asio/pa_asio.cpp src/hostapi/asio/iasiothiscallresolver.cpp)
|
||||
SET(PA_ASIOSDK_SOURCES ${ASIOSDK_ROOT_DIR}/common/asio.cpp ${ASIOSDK_ROOT_DIR}/host/pc/asiolist.cpp ${ASIOSDK_ROOT_DIR}/host/asiodrivers.cpp)
|
||||
SOURCE_GROUP("hostapi\\ASIO" FILES ${PA_ASIO_SOURCES})
|
||||
SOURCE_GROUP("hostapi\\ASIO\\ASIOSDK" FILES ${PA_ASIOSDK_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_asio.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_ASIO_SOURCES})
|
||||
SET(PA_NON_UNICODE_SOURCES ${PA_NON_UNICODE_SOURCES} ${PA_ASIOSDK_SOURCES})
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ole32 uuid)
|
||||
ELSE()
|
||||
# Set variables for DEF file expansion
|
||||
SET(DEF_EXCLUDE_ASIO_SYMBOLS ";")
|
||||
ENDIF()
|
||||
|
||||
OPTION(PA_USE_DS "Enable support for DirectSound" ON)
|
||||
IF(PA_USE_DS)
|
||||
IF(MINGW)
|
||||
MESSAGE(STATUS "DirectSound support will be built with DSound provided by MinGW.")
|
||||
OPTION(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE "Use DirectSound full duplex create" OFF)
|
||||
ELSE(MINGW)
|
||||
OPTION(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE "Use DirectSound full duplex create" ON)
|
||||
ENDIF(MINGW)
|
||||
MARK_AS_ADVANCED(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE)
|
||||
IF(PA_USE_DIRECTSOUNDFULLDUPLEXCREATE)
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE)
|
||||
ENDIF()
|
||||
SET(PA_DS_INCLUDES src/hostapi/dsound/pa_win_ds_dynlink.h)
|
||||
SET(PA_DS_SOURCES src/hostapi/dsound/pa_win_ds.c src/hostapi/dsound/pa_win_ds_dynlink.c)
|
||||
SOURCE_GROUP("hostapi\\dsound" FILES ${PA_DS_INCLUDES} ${PA_DS_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_win_ds.h include/pa_win_waveformat.h)
|
||||
SET(PA_PRIVATE_INCLUDES ${PA_PRIVATE_INCLUDES} ${PA_DS_INCLUDES})
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_DS_SOURCES})
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} dsound)
|
||||
ENDIF(PA_USE_DS)
|
||||
|
||||
OPTION(PA_USE_WMME "Enable support for MME" ON)
|
||||
IF(PA_USE_WMME)
|
||||
SET(PA_WMME_SOURCES src/hostapi/wmme/pa_win_wmme.c)
|
||||
SOURCE_GROUP("hostapi\\wmme" FILES ${PA_WMME_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_win_wmme.h include/pa_win_waveformat.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_WMME_SOURCES})
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ole32 uuid)
|
||||
ENDIF()
|
||||
|
||||
# MinGW versions below 4.93, especially non MinGW-w64 distributions may
|
||||
# break in the wasapi build. If an older MinGW version is required, WASAPI-
|
||||
# support needs to be disabled.
|
||||
OPTION(PA_USE_WASAPI "Enable support for WASAPI" ON)
|
||||
IF(PA_USE_WASAPI)
|
||||
SET(PA_WASAPI_SOURCES src/hostapi/wasapi/pa_win_wasapi.c)
|
||||
SOURCE_GROUP("hostapi\\wasapi" FILES ${PA_WASAPI_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_win_wasapi.h include/pa_win_waveformat.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_WASAPI_SOURCES})
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ole32 uuid)
|
||||
ELSE()
|
||||
SET(DEF_EXCLUDE_WASAPI_SYMBOLS ";")
|
||||
ENDIF()
|
||||
|
||||
OPTION(PA_USE_WDMKS "Enable support for WDMKS" ON)
|
||||
IF(PA_USE_WDMKS)
|
||||
SET(PA_WDMKS_SOURCES src/hostapi/wdmks/pa_win_wdmks.c)
|
||||
SOURCE_GROUP("hostapi\\wdmks" FILES ${PA_WDMKS_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_win_wdmks.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_WDMKS_SOURCES})
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} setupapi ole32 uuid)
|
||||
ENDIF()
|
||||
|
||||
OPTION(PA_USE_WDMKS_DEVICE_INFO "Use WDM/KS API for device info" ON)
|
||||
MARK_AS_ADVANCED(PA_USE_WDMKS_DEVICE_INFO)
|
||||
IF(PA_USE_WDMKS_DEVICE_INFO)
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PAWIN_USE_WDMKS_DEVICE_INFO)
|
||||
ENDIF()
|
||||
|
||||
SET(GENERATED_MESSAGE "CMake generated file, do NOT edit! Use CMake-GUI to change configuration instead.")
|
||||
CONFIGURE_FILE(cmake_support/template_portaudio.def ${CMAKE_CURRENT_BINARY_DIR}/portaudio_cmake.def @ONLY)
|
||||
CONFIGURE_FILE(cmake_support/options_cmake.h.in ${CMAKE_CURRENT_BINARY_DIR}/options_cmake.h @ONLY)
|
||||
SET(PA_PRIVATE_INCLUDES ${PA_PRIVATE_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/options_cmake.h)
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PORTAUDIO_CMAKE_GENERATED)
|
||||
SOURCE_GROUP("cmake_generated" FILES ${CMAKE_CURRENT_BINARY_DIR}/portaudio_cmake.def ${CMAKE_CURRENT_BINARY_DIR}/options_cmake.h)
|
||||
|
||||
SET(PA_EXTRA_SHARED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/portaudio_cmake.def)
|
||||
|
||||
ELSE()
|
||||
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} src/os/unix)
|
||||
SET(PA_PLATFORM_SOURCES src/os/unix/pa_unix_hostapis.c src/os/unix/pa_unix_util.c)
|
||||
SOURCE_GROUP("os\\unix" FILES ${PA_PLATFORM_SOURCES})
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_PLATFORM_SOURCES})
|
||||
|
||||
IF(APPLE)
|
||||
|
||||
SET(CMAKE_MACOSX_RPATH 1)
|
||||
OPTION(PA_USE_COREAUDIO "Enable support for CoreAudio" ON)
|
||||
IF(PA_USE_COREAUDIO)
|
||||
SET(PA_COREAUDIO_SOURCES
|
||||
src/hostapi/coreaudio/pa_mac_core.c
|
||||
src/hostapi/coreaudio/pa_mac_core_blocking.c
|
||||
src/hostapi/coreaudio/pa_mac_core_utilities.c)
|
||||
SET(PA_COREAUDIO_INCLUDES
|
||||
src/hostapi/coreaudio/pa_mac_core_blocking.h
|
||||
src/hostapi/coreaudio/pa_mac_core_utilities.h)
|
||||
SOURCE_GROUP("hostapi\\coreaudio" FILES ${PA_COREAUDIO_SOURCES} ${PA_COREAUDIO_INCLUDES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_mac_core.h)
|
||||
SET(PA_PRIVATE_INCLUDES ${PA_PRIVATE_INCLUDES} ${PA_COREAUDIO_INCLUDES})
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_COREAUDIO_SOURCES})
|
||||
|
||||
FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio REQUIRED)
|
||||
FIND_LIBRARY(AUDIOTOOLBOX_LIBRARY AudioToolbox REQUIRED)
|
||||
FIND_LIBRARY(AUDIOUNIT_LIBRARY AudioUnit REQUIRED)
|
||||
FIND_LIBRARY(CARBON_LIBRARY Carbon REQUIRED)
|
||||
MARK_AS_ADVANCED(COREAUDIO_LIBRARY AUDIOTOOLBOX_LIBRARY AUDIOUNIT_LIBRARY CARBON_LIBRARY)
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ${COREAUDIO_LIBRARY} ${AUDIOTOOLBOX_LIBRARY} ${AUDIOUNIT_LIBRARY} ${CARBON_LIBRARY})
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PA_USE_COREAUDIO)
|
||||
SET(PA_PKGCONFIG_LDFLAGS "${PA_PKGCONFIG_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon")
|
||||
ENDIF()
|
||||
|
||||
ELSEIF(UNIX)
|
||||
|
||||
FIND_PACKAGE(Jack)
|
||||
IF(JACK_FOUND)
|
||||
OPTION(PA_USE_JACK "Enable support for Jack" ON)
|
||||
ELSE()
|
||||
OPTION(PA_USE_JACK "Enable support for Jack" OFF)
|
||||
ENDIF()
|
||||
IF(PA_USE_JACK)
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} ${JACK_INCLUDE_DIRS})
|
||||
SET(PA_JACK_SOURCES src/hostapi/jack/pa_jack.c)
|
||||
SOURCE_GROUP("hostapi\\JACK" FILES ${PA_JACK_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_jack.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_JACK_SOURCES})
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PA_USE_JACK)
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ${JACK_LIBRARIES})
|
||||
SET(PA_PKGCONFIG_LDFLAGS "${PA_PKGCONFIG_LDFLAGS} -ljack")
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(ALSA)
|
||||
IF(ALSA_FOUND)
|
||||
OPTION(PA_USE_ALSA "Enable support for ALSA" ON)
|
||||
ELSE()
|
||||
OPTION(PA_USE_ALSA "Enable support for ALSA" OFF)
|
||||
ENDIF()
|
||||
IF(PA_USE_ALSA)
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} ${ALSA_INCLUDE_DIRS})
|
||||
SET(PA_ALSA_SOURCES src/hostapi/alsa/pa_linux_alsa.c)
|
||||
SOURCE_GROUP("hostapi\\ALSA" FILES ${PA_ALSA_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_linux_alsa.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_ALSA_SOURCES})
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PA_USE_ALSA)
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ${ALSA_LIBRARIES})
|
||||
SET(PA_PKGCONFIG_LDFLAGS "${PA_PKGCONFIG_LDFLAGS} -lasound")
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
|
||||
SET(PA_PKGCONFIG_LDFLAGS "${PA_PKGCONFIG_LDFLAGS} -lm -lpthread")
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} m pthread)
|
||||
|
||||
ENDIF()
|
||||
|
||||
SOURCE_GROUP("include" FILES ${PA_PUBLIC_INCLUDES})
|
||||
|
||||
SET(PA_INCLUDES ${PA_PRIVATE_INCLUDES} ${PA_PUBLIC_INCLUDES})
|
||||
|
||||
IF(WIN32)
|
||||
OPTION(PA_UNICODE_BUILD "Enable Portaudio Unicode build" ON)
|
||||
IF(PA_UNICODE_BUILD)
|
||||
SET_SOURCE_FILES_PROPERTIES(${PA_SOURCES} PROPERTIES COMPILE_DEFINITIONS "UNICODE;_UNICODE")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
OPTION(PA_ENABLE_DEBUG_OUTPUT "Enable debug output for Portaudio" OFF)
|
||||
IF(PA_ENABLE_DEBUG_OUTPUT)
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PA_ENABLE_DEBUG_OUTPUT)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
|
||||
IF(IS_BIG_ENDIAN)
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PA_BIG_ENDIAN)
|
||||
ELSE()
|
||||
SET(PA_PRIVATE_COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS} PA_LITTLE_ENDIAN)
|
||||
ENDIF()
|
||||
|
||||
OPTION(PA_BUILD_STATIC "Build static library" ON)
|
||||
OPTION(PA_BUILD_SHARED "Build shared/dynamic library" ON)
|
||||
|
||||
IF(MSVC)
|
||||
OPTION(PA_LIBNAME_ADD_SUFFIX "Add suffix _static to static library name" ON)
|
||||
ELSE()
|
||||
OPTION(PA_LIBNAME_ADD_SUFFIX "Add suffix _static to static library name" OFF)
|
||||
ENDIF()
|
||||
|
||||
# MSVC: if PA_LIBNAME_ADD_SUFFIX is not used, and both static and shared libraries are
|
||||
# built, one, of import- and static libraries, will overwrite the other. In
|
||||
# embedded builds this is not an issue as they will only build the configuration
|
||||
# used in the host application.
|
||||
MARK_AS_ADVANCED(PA_LIBNAME_ADD_SUFFIX)
|
||||
IF(MSVC AND PA_BUILD_STATIC AND PA_BUILD_SHARED AND NOT PA_LIBNAME_ADD_SUFFIX)
|
||||
MESSAGE(WARNING "Building both shared and static libraries, and avoiding the suffix _static will lead to a name conflict")
|
||||
SET(PA_LIBNAME_ADD_SUFFIX ON CACHE BOOL "Forcing use of suffix _static to avoid name conflict between static and import library" FORCE)
|
||||
MESSAGE(WARNING "PA_LIBNAME_ADD_SUFFIX was set to ON")
|
||||
ENDIF()
|
||||
|
||||
SET(PA_TARGETS "")
|
||||
|
||||
IF(PA_BUILD_SHARED)
|
||||
LIST(APPEND PA_TARGETS portaudio)
|
||||
ADD_LIBRARY(portaudio SHARED ${PA_INCLUDES} ${PA_COMMON_INCLUDES} ${PA_SOURCES} ${PA_NON_UNICODE_SOURCES} ${PA_EXTRA_SHARED_SOURCES})
|
||||
SET_PROPERTY(TARGET portaudio APPEND_STRING PROPERTY COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio PRIVATE ${PA_PRIVATE_INCLUDE_PATHS})
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
|
||||
TARGET_LINK_LIBRARIES(portaudio ${PA_LIBRARY_DEPENDENCIES})
|
||||
ENDIF()
|
||||
|
||||
IF(PA_BUILD_STATIC)
|
||||
LIST(APPEND PA_TARGETS portaudio_static)
|
||||
ADD_LIBRARY(portaudio_static STATIC ${PA_INCLUDES} ${PA_COMMON_INCLUDES} ${PA_SOURCES} ${PA_NON_UNICODE_SOURCES})
|
||||
SET_PROPERTY(TARGET portaudio_static APPEND_STRING PROPERTY COMPILE_DEFINITIONS ${PA_PRIVATE_COMPILE_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio_static PRIVATE ${PA_PRIVATE_INCLUDE_PATHS})
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio_static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
|
||||
TARGET_LINK_LIBRARIES(portaudio_static ${PA_LIBRARY_DEPENDENCIES})
|
||||
IF(NOT PA_LIBNAME_ADD_SUFFIX)
|
||||
SET_PROPERTY(TARGET portaudio_static PROPERTY OUTPUT_NAME portaudio)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32 AND MSVC)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF(WIN32 AND MSVC)
|
||||
OPTION(PA_CONFIG_LIB_OUTPUT_PATH "Make sure that output paths are kept neat" OFF)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(TARGET_POSTFIX x64)
|
||||
IF(PA_CONFIG_LIB_OUTPUT_PATH)
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin/x64)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(TARGET_POSTFIX x86)
|
||||
IF(PA_CONFIG_LIB_OUTPUT_PATH)
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin/Win32)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(PA_BUILD_SHARED)
|
||||
IF(PA_LIBNAME_ADD_SUFFIX)
|
||||
SET_TARGET_PROPERTIES(portaudio PROPERTIES OUTPUT_NAME portaudio_${TARGET_POSTFIX})
|
||||
ELSE()
|
||||
SET_TARGET_PROPERTIES(portaudio PROPERTIES OUTPUT_NAME portaudio)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(PA_BUILD_STATIC)
|
||||
IF(PA_LIBNAME_ADD_SUFFIX)
|
||||
SET_TARGET_PROPERTIES(portaudio_static PROPERTIES OUTPUT_NAME portaudio_static_${TARGET_POSTFIX})
|
||||
ELSE()
|
||||
SET_TARGET_PROPERTIES(portaudio_static PROPERTIES OUTPUT_NAME portaudio)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE()
|
||||
IF(APPLE AND CMAKE_VERSION VERSION_GREATER 3.4.2)
|
||||
OPTION(PA_OUTPUT_OSX_FRAMEWORK "Generate an OS X framework instead of the simple library" OFF)
|
||||
IF(PA_OUTPUT_OSX_FRAMEWORK)
|
||||
SET_TARGET_PROPERTIES(portaudio PROPERTIES
|
||||
FRAMEWORK TRUE
|
||||
MACOSX_FRAMEWORK_IDENTIFIER com.portaudio
|
||||
FRAMEWORK_VERSION A
|
||||
PUBLIC_HEADER "${PA_PUBLIC_INCLUDES}"
|
||||
VERSION ${PA_SOVERSION}
|
||||
SOVERSION ${PA_SOVERSION})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ADD_DEFINITIONS(-DPORTAUDIO_CMAKE_GENERATED)
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
# At least on Windows in embedded builds, portaudio's install target should likely
|
||||
# not be executed, as the library would usually already be installed as part of, and
|
||||
# by means of the host application.
|
||||
# The option below offers the option to avoid executing the portaudio install target
|
||||
# for cases in which the host-application executes install, but no independent install
|
||||
# of portaudio is wished.
|
||||
OPTION(PA_DISABLE_INSTALL "Disable targets install and uninstall (for embedded builds)" OFF)
|
||||
|
||||
SET(SOURCES_LESS_ASIO_SDK
|
||||
${PA_COMMON_SOURCES}
|
||||
${PA_ASIO_SOURCES}
|
||||
${PA_DS_SOURCES}
|
||||
${PA_WMME_SOURCES}
|
||||
${PA_WASAPI_SOURCES}
|
||||
${PA_WDMKS_SOURCES}
|
||||
${PA_JACK_SOURCES}
|
||||
${PA_SKELETON_SOURCES}
|
||||
${PA_PLATFORM_SOURCES}
|
||||
)
|
||||
IF(NOT PA_OUTPUT_OSX_FRAMEWORK AND NOT PA_DISABLE_INSTALL)
|
||||
INCLUDE(CMakePackageConfigHelpers)
|
||||
|
||||
IF(PA_UNICODE_BUILD)
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${SOURCES_LESS_ASIO_SDK}
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "UNICODE;_UNICODE"
|
||||
)
|
||||
ENDIF(PA_UNICODE_BUILD)
|
||||
CONFIGURE_PACKAGE_CONFIG_FILE(cmake_support/portaudioConfig.cmake.in ${CMAKE_BINARY_DIR}/cmake/portaudio/portaudioConfig.cmake
|
||||
INSTALL_DESTINATION "lib/cmake/portaudio"
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
|
||||
WRITE_BASIC_PACKAGE_VERSION_FILE(${CMAKE_BINARY_DIR}/cmake/portaudio/portaudioConfigVersion.cmake
|
||||
VERSION ${PA_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
CONFIGURE_FILE(cmake_support/portaudio-2.0.pc.in ${CMAKE_CURRENT_BINARY_DIR}/portaudio-2.0.pc @ONLY)
|
||||
INSTALL(FILES README.txt DESTINATION share/doc/portaudio)
|
||||
INSTALL(FILES LICENSE.txt DESTINATION share/doc/portaudio)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/portaudio-2.0.pc DESTINATION lib/pkgconfig)
|
||||
INSTALL(FILES ${PA_PUBLIC_INCLUDES} DESTINATION include)
|
||||
INSTALL(TARGETS ${PA_TARGETS}
|
||||
EXPORT portaudio-targets
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
INSTALL(EXPORT portaudio-targets FILE "portaudioTargets.cmake" DESTINATION "lib/cmake/portaudio")
|
||||
EXPORT(TARGETS ${PA_TARGETS} FILE "${PROJECT_BINARY_DIR}/cmake/portaudio/portaudioTargets.cmake")
|
||||
INSTALL(FILES "${CMAKE_BINARY_DIR}/cmake/portaudio/portaudioConfig.cmake"
|
||||
"${CMAKE_BINARY_DIR}/cmake/portaudio/portaudioConfigVersion.cmake"
|
||||
DESTINATION "lib/cmake/portaudio")
|
||||
|
||||
ADD_LIBRARY(portaudio SHARED
|
||||
${PA_INCLUDES}
|
||||
${PA_COMMON_INCLUDES}
|
||||
${SOURCES_LESS_ASIO_SDK}
|
||||
${PA_ASIOSDK_SOURCES}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/portaudio_cmake.def
|
||||
${CMAKE_CURRENT_BINARY_DIR}/options_cmake.h
|
||||
)
|
||||
|
||||
ADD_LIBRARY(portaudio_static STATIC
|
||||
${PA_INCLUDES}
|
||||
${PA_COMMON_INCLUDES}
|
||||
${SOURCES_LESS_ASIO_SDK}
|
||||
${PA_ASIOSDK_SOURCES}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/options_cmake.h
|
||||
)
|
||||
|
||||
# Configure the exports file according to settings
|
||||
SET(GENERATED_MESSAGE "CMake generated file, do NOT edit! Use CMake-GUI to change configuration instead.")
|
||||
CONFIGURE_FILE( cmake_support/template_portaudio.def ${CMAKE_CURRENT_BINARY_DIR}/portaudio_cmake.def @ONLY )
|
||||
# Configure header for options (PA_USE_xxx)
|
||||
CONFIGURE_FILE( cmake_support/options_cmake.h.in ${CMAKE_CURRENT_BINARY_DIR}/options_cmake.h @ONLY )
|
||||
|
||||
IF(WIN32)
|
||||
# If we use DirectSound, we need this for the library to be found (if not in VS project settings)
|
||||
IF(PA_USE_DS AND DXSDK_FOUND)
|
||||
TARGET_LINK_LIBRARIES(portaudio ${DXSDK_DSOUND_LIBRARY})
|
||||
ENDIF(PA_USE_DS AND DXSDK_FOUND)
|
||||
|
||||
# If we use WDM/KS we need setupapi.lib
|
||||
IF(PA_USE_WDMKS)
|
||||
TARGET_LINK_LIBRARIES(portaudio setupapi)
|
||||
ENDIF(PA_USE_WDMKS)
|
||||
|
||||
SET_TARGET_PROPERTIES(portaudio PROPERTIES OUTPUT_NAME portaudio_${TARGET_POSTFIX}
|
||||
FOLDER "Portaudio")
|
||||
SET_TARGET_PROPERTIES(portaudio_static PROPERTIES OUTPUT_NAME portaudio_static_${TARGET_POSTFIX}
|
||||
FOLDER "Portaudio")
|
||||
ENDIF(WIN32)
|
||||
IF (NOT TARGET uninstall)
|
||||
CONFIGURE_FILE(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_support/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
ADD_CUSTOM_TARGET(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Prepared for inclusion of test files
|
||||
OPTION(PA_BUILD_TESTS "Include test projects" OFF)
|
||||
OPTION(PA_BUILD_EXAMPLES "Include example projects" OFF)
|
||||
|
||||
# Prepared for inclusion of test files
|
||||
IF(PA_BUILD_TESTS)
|
||||
SUBDIRS(test)
|
||||
ENDIF(PA_BUILD_TESTS)
|
||||
SUBDIRS(test)
|
||||
ENDIF()
|
||||
|
||||
# Prepared for inclusion of test files
|
||||
OPTION(PA_BUILD_EXAMPLES "Include example projects" OFF)
|
||||
IF(PA_BUILD_EXAMPLES)
|
||||
SUBDIRS(examples)
|
||||
ENDIF(PA_BUILD_EXAMPLES)
|
||||
|
||||
#################################
|
||||
|
||||
SUBDIRS(examples)
|
||||
ENDIF()
|
||||
|
|
|
@ -52,11 +52,9 @@ COMMON_OBJS = \
|
|||
src/common/pa_converters.o \
|
||||
src/common/pa_cpuload.o \
|
||||
src/common/pa_dither.o \
|
||||
src/common/pa_dynload.o \
|
||||
src/common/pa_debugprint.o \
|
||||
src/common/pa_front.o \
|
||||
src/common/pa_process.o \
|
||||
src/common/pa_ringbuffer.o \
|
||||
src/common/pa_stream.o \
|
||||
src/common/pa_trace.o \
|
||||
src/hostapi/skeleton/pa_hostapi_skeleton.o
|
||||
|
@ -157,10 +155,7 @@ SRC_DIRS = \
|
|||
SUBDIRS =
|
||||
@ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp
|
||||
|
||||
prep:
|
||||
mkdir -p qa/loopback/src/ src/hostapi/skeleton/ $(SRC_DIRS)
|
||||
|
||||
all: prep lib/$(PALIB) all-recursive tests examples selftests
|
||||
all: lib/$(PALIB) all-recursive tests examples selftests
|
||||
|
||||
tests: bin-stamp $(TESTS)
|
||||
|
||||
|
|
|
@ -41,10 +41,16 @@ PaUtil_InitializeX86PlainConverters @52
|
|||
PaAsio_GetInputChannelName @53
|
||||
PaAsio_GetOutputChannelName @54
|
||||
PaUtil_SetDebugPrintFunction @55
|
||||
PaWasapi_GetDeviceDefaultFormat @56
|
||||
PaWasapi_GetDeviceRole @57
|
||||
PaWasapi_ThreadPriorityBoost @58
|
||||
PaWasapi_ThreadPriorityRevert @59
|
||||
PaWasapi_GetFramesPerHostBuffer @60
|
||||
PaWasapi_GetJackDescription @61
|
||||
PaWasapi_GetJackCount @62
|
||||
PaWasapi_GetAudioClient @56
|
||||
PaWasapi_UpdateDeviceList @57
|
||||
PaWasapi_GetDeviceCurrentFormat @58
|
||||
PaWasapi_GetDeviceDefaultFormat @59
|
||||
PaWasapi_GetDeviceMixFormat @60
|
||||
PaWasapi_GetDeviceRole @61
|
||||
PaWasapi_ThreadPriorityBoost @62
|
||||
PaWasapi_ThreadPriorityRevert @63
|
||||
PaWasapi_GetFramesPerHostBuffer @64
|
||||
PaWasapi_GetJackCount @65
|
||||
PaWasapi_GetJackDescription @66
|
||||
PaWasapi_SetDefaultInterfaceId @67
|
||||
PaWasapi_SetStreamStateHandler @68
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Clear the Git commit SHA in the include file.
|
||||
# This should be run before checking in code to Git.
|
||||
#
|
||||
revision_filename=src/common/pa_gitrevision.h
|
||||
|
||||
# Update the include file with the current GIT revision.
|
||||
echo "#define PA_GIT_REVISION unknown" > ${revision_filename}
|
||||
|
||||
echo ${revision_filename} now contains
|
||||
cat ${revision_filename}
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Clear the SVN revision in the include file.
|
||||
# This should be run before checking in code to SVN.
|
||||
#
|
||||
revision_filename=src/common/pa_svnrevision.h
|
||||
|
||||
# Update the include file with the current SVN revision.
|
||||
echo "#define PA_SVN_REVISION unknown" > ${revision_filename}
|
||||
|
||||
echo ${revision_filename} now contains
|
||||
cat ${revision_filename}
|
|
@ -1,59 +0,0 @@
|
|||
# $Id: $
|
||||
#
|
||||
# - Try to find the DirectX SDK
|
||||
# Once done this will define
|
||||
#
|
||||
# DXSDK_FOUND - system has DirectX SDK
|
||||
# DXSDK_ROOT_DIR - path to the DirectX SDK base directory
|
||||
# DXSDK_INCLUDE_DIR - the DirectX SDK include directory
|
||||
# DXSDK_LIBRARY_DIR - DirectX SDK libraries path
|
||||
#
|
||||
# DXSDK_DSOUND_LIBRARY - Path to dsound.lib
|
||||
#
|
||||
|
||||
if(WIN32)
|
||||
else(WIN32)
|
||||
message(FATAL_ERROR "FindDXSDK.cmake: Unsupported platform ${CMAKE_SYSTEM_NAME}" )
|
||||
endif(WIN32)
|
||||
|
||||
find_path(DXSDK_ROOT_DIR
|
||||
include/dxsdkver.h
|
||||
HINTS
|
||||
$ENV{DXSDK_DIR}
|
||||
)
|
||||
|
||||
find_path(DXSDK_INCLUDE_DIR
|
||||
dxsdkver.h
|
||||
PATHS
|
||||
${DXSDK_ROOT_DIR}/include
|
||||
)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
find_path(DXSDK_LIBRARY_DIR
|
||||
dsound.lib
|
||||
PATHS
|
||||
${DXSDK_ROOT_DIR}/lib/x64
|
||||
)
|
||||
ELSE(CMAKE_CL_64)
|
||||
find_path(DXSDK_LIBRARY_DIR
|
||||
dsound.lib
|
||||
PATHS
|
||||
${DXSDK_ROOT_DIR}/lib/x86
|
||||
)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
find_library(DXSDK_DSOUND_LIBRARY
|
||||
dsound.lib
|
||||
PATHS
|
||||
${DXSDK_LIBRARY_DIR}
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DXSDK DEFAULT_MSG DXSDK_ROOT_DIR DXSDK_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
DXSDK_ROOT_DIR DXSDK_INCLUDE_DIR
|
||||
DXSDK_LIBRARY_DIR DXSDK_DSOUND_LIBRARY
|
||||
)
|
|
@ -0,0 +1,41 @@
|
|||
# - Try to find jack
|
||||
# Once done this will define
|
||||
# JACK_FOUND - System has jack
|
||||
# JACK_INCLUDE_DIRS - The jack include directories
|
||||
# JACK_LIBRARIES - The libraries needed to use jack
|
||||
# JACK_DEFINITIONS - Compiler switches required for using jack
|
||||
|
||||
if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
|
||||
# in cache already
|
||||
set(JACK_FOUND TRUE)
|
||||
|
||||
else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
|
||||
set(JACK_DEFINITIONS "")
|
||||
|
||||
# Look for pkg-config and use it (if available) to find package
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_search_module(JACK QUIET jack)
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
|
||||
if (NOT JACK_FOUND)
|
||||
|
||||
find_path(JACK_INCLUDE_DIR jack/jack.h HINTS ${JACK_INCLUDEDIR} ${JACK_INCLUDE_DIRS} PATH_SUFFIXES jack)
|
||||
find_library(JACK_LIBRARY NAMES jack HINTS ${JACK_LIBDIR} ${JACK_LIBRARY_DIRS})
|
||||
|
||||
set(JACK_LIBRARIES ${JACK_LIBRARY})
|
||||
set(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# Set JACK_FOUND if the library and include paths were found
|
||||
find_package_handle_standard_args(jack DEFAULT_MSG JACK_LIBRARY JACK_INCLUDE_DIR)
|
||||
|
||||
# Don't show include/library paths in cmake GUI
|
||||
mark_as_advanced(JACK_INCLUDE_DIR JACK_LIBRARY)
|
||||
|
||||
endif (NOT JACK_FOUND)
|
||||
|
||||
endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
|
@ -0,0 +1,21 @@
|
|||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif(NOT "${rm_retval}" STREQUAL 0)
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
|
@ -26,7 +26,6 @@
|
|||
#cmakedefine01 PA_USE_WMME
|
||||
#cmakedefine01 PA_USE_WASAPI
|
||||
#cmakedefine01 PA_USE_WDMKS
|
||||
#cmakedefine01 PA_USE_JACK
|
||||
#else
|
||||
#error "Platform currently not supported by CMake script"
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: PortAudio
|
||||
Description: Portable audio I/O
|
||||
Requires:
|
||||
Version: @PA_PKGCONFIG_VERSION@
|
||||
|
||||
Libs: -L${libdir} -lportaudio @PA_PKGCONFIG_LDFLAGS@
|
||||
Cflags: -I${includedir} @PA_PKGCONFIG_CFLAGS@
|
|
@ -0,0 +1 @@
|
|||
include("${CMAKE_CURRENT_LIST_DIR}/portaudioTargets.cmake")
|
|
@ -40,7 +40,7 @@ Pa_GetSampleSize @33
|
|||
Pa_Sleep @34
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_GetAvailableBufferSizes @50
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_ShowControlPanel @51
|
||||
PaUtil_InitializeX86PlainConverters @52
|
||||
@DEF_EXCLUDE_X86_PLAIN_CONVERTERS@PaUtil_InitializeX86PlainConverters @52
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_GetInputChannelName @53
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_GetOutputChannelName @54
|
||||
PaUtil_SetDebugPrintFunction @55
|
||||
|
@ -51,5 +51,3 @@ PaUtil_SetDebugPrintFunction @55
|
|||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetFramesPerHostBuffer @60
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetJackDescription @61
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetJackCount @62
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaJack_SetClientName @63
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaJack_GetClientName @64
|
||||
|
|
|
@ -15863,8 +15863,11 @@ case "${host_os}" in
|
|||
elif xcodebuild -version -sdk macosx10.12 Path >/dev/null 2>&1 ; then
|
||||
mac_version_min="-mmacosx-version-min=10.4"
|
||||
mac_sysroot="-isysroot `xcodebuild -version -sdk macosx10.12 Path`"
|
||||
elif xcodebuild -version -sdk macosx10.13 Path >/dev/null 2>&1 ; then
|
||||
mac_version_min="-mmacosx-version-min=10.4"
|
||||
mac_sysroot="-isysroot `xcodebuild -version -sdk macosx10.13 Path`"
|
||||
else
|
||||
as_fn_error $? "Could not find 10.5 to 10.12 SDK." "$LINENO" 5
|
||||
as_fn_error $? "Could not find 10.5 to 10.13 SDK." "$LINENO" 5
|
||||
fi
|
||||
esac
|
||||
|
||||
|
@ -16188,7 +16191,7 @@ fi
|
|||
if [ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ] ; then
|
||||
DLL_LIBS="$DLL_LIBS $JACK_LIBS"
|
||||
CFLAGS="$CFLAGS $JACK_CFLAGS"
|
||||
OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/hostapi/jack/pa_jack_dynload.o src/common/pa_ringbuffer.o"
|
||||
OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o"
|
||||
INCLUDES="$INCLUDES pa_jack.h"
|
||||
$as_echo "#define PA_USE_JACK 1" >>confdefs.h
|
||||
|
||||
|
|
|
@ -258,8 +258,11 @@ case "${host_os}" in
|
|||
elif xcodebuild -version -sdk macosx10.12 Path >/dev/null 2>&1 ; then
|
||||
mac_version_min="-mmacosx-version-min=10.4"
|
||||
mac_sysroot="-isysroot `xcodebuild -version -sdk macosx10.12 Path`"
|
||||
elif xcodebuild -version -sdk macosx10.13 Path >/dev/null 2>&1 ; then
|
||||
mac_version_min="-mmacosx-version-min=10.4"
|
||||
mac_sysroot="-isysroot `xcodebuild -version -sdk macosx10.13 Path`"
|
||||
else
|
||||
AC_MSG_ERROR([Could not find 10.5 to 10.12 SDK.])
|
||||
AC_MSG_ERROR([Could not find 10.5 to 10.13 SDK.])
|
||||
fi
|
||||
esac
|
||||
|
||||
|
@ -346,7 +349,7 @@ case "${host_os}" in
|
|||
add_objects src/hostapi/wasapi/pa_win_wasapi.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o
|
||||
LIBS="${LIBS} -lwinmm -lm -lole32 -luuid"
|
||||
DLL_LIBS="${DLL_LIBS} -lwinmm -lole32"
|
||||
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
|
||||
CFLAGS="$CFLAGS -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
@ -409,7 +412,7 @@ case "${host_os}" in
|
|||
if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
|
||||
DLL_LIBS="$DLL_LIBS $JACK_LIBS"
|
||||
CFLAGS="$CFLAGS $JACK_CFLAGS"
|
||||
OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/hostapi/jack/pa_jack_dynload.o src/common/pa_ringbuffer.o"
|
||||
OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o"
|
||||
INCLUDES="$INCLUDES pa_jack.h"
|
||||
AC_DEFINE(PA_USE_JACK,1)
|
||||
fi
|
||||
|
|
|
@ -8,16 +8,16 @@ The library provides functions that allow your software to acquire and output re
|
|||
|
||||
@section start_here Start here
|
||||
|
||||
- @ref api_overview<br>
|
||||
- @ref api_overview <br>
|
||||
A top-down view of the PortAudio API, its capabilities, functions and data structures
|
||||
|
||||
- @ref tutorial_start<br>
|
||||
- @ref tutorial_start <br>
|
||||
Get started writing code with PortAudio tutorials
|
||||
|
||||
- @ref examples_src "Examples"<br>
|
||||
Simple example programs demonstrating PortAudio usage
|
||||
|
||||
- @ref License<br>
|
||||
- @ref License <br>
|
||||
PortAudio is licenced under the MIT Expat open source licence. We make a non-binding request for you to contribute your changes back to the project.
|
||||
|
||||
|
||||
|
@ -34,13 +34,10 @@ Documentation for non-portable platform-specific host API extensions
|
|||
|
||||
- <a href="http://www.portaudio.com">The PortAudio website</a>
|
||||
|
||||
- <a href="http://music.columbia.edu/mailman/listinfo/portaudio/">Our mailing list for users and developers</a><br>
|
||||
- <a href="http://lists.columbia.edu/mailman/listinfo/portaudio/">Our mailing list for users and developers</a><br>
|
||||
|
||||
- <a href="http://www.assembla.com/spaces/portaudio/wiki">The PortAudio wiki</a>
|
||||
|
||||
- @ref java_binding<br>
|
||||
Documentation for the Java JNI interface to PortAudio
|
||||
|
||||
@section developer_resources Developer Resources
|
||||
|
||||
@if INTERNAL
|
||||
|
|
|
@ -1,29 +1,57 @@
|
|||
/** @page compile_cmake Creating MSVC Build Files via CMake
|
||||
/** @page compile_cmake PortAudio on Windows, OS X or Linux via. CMake
|
||||
@ingroup tutorial
|
||||
|
||||
This is a simple "How-to" for creating build files for Microsoft Visual C++ via CMake and the CMakeLists.txt file
|
||||
@section cmake_building Building PortAudio stand-alone on Windows, OS X or Linux
|
||||
|
||||
1. Install CMake if you haven't got it already ([http://www.cmake.org], minimum version required is 2.8).
|
||||
CMake can be used to generate Visual Studio solutions on Windows, Makefiles (on Linux and OS X) and build metadata for other build systems for PortAudio. You should obtain a recent version of CMake from [http://www.cmake.org] if you do not have one already. If you are unfamiliar with CMake, this section will provide some information on using CMake to build PortAudio.
|
||||
|
||||
2. If you want ASIO support you need to D/L the ASIO2 SDK from Steinberg, and place it according to \ref compile_windows_asio_msvc
|
||||
On Linux, CMake serves a very similar purpose to an autotools "configure" script - except it can generate build metadata apart from Makefiles. The equivalent of the following on POSIX'y systems:
|
||||
|
||||
3. Run the CMake GUI application and browse to <b>source files</b> directory and <b>build</b> directory:
|
||||
a. The <b>source files</b> directory (<i>"Where is the source code"</i>) is where the portaudio CMakeLists.txt file is located.
|
||||
b. The <b>build</b> directory (<i>"Where to build the binaries"</i>) is pretty much anywhere you like. A common practice though is to have the build directory located <b>outside</b> the
|
||||
source files tree (a so called "out-of-source build")
|
||||
build_path> {portaudio path}/configure --prefix=/install_location
|
||||
build_path> make
|
||||
build_path> make install
|
||||
|
||||
4. Click <i>Configure</i>. This will prompt you to select which build files to generate. <b>Note</b> Only Microsoft Visual C++ build files currently supported!
|
||||
Would be:
|
||||
|
||||
5. In the CMake option list, enable the PORTAUDIO_xxx options you need, then click <i>Configure</i> again (Note that after this there are no options marked with red color)
|
||||
build_path> cmake {portaudio path} -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/install_location
|
||||
build_path> make
|
||||
build_path> make install
|
||||
|
||||
6. Click <i>Generate</i> and you'll now (hopefully) have your VS build files in your previously defined <b>build</b> directory.
|
||||
The "-G" option specifies the type of build metadata which will be generated. You can obtain a list of supported build metadata formats by invoking (on any platform):
|
||||
|
||||
Both ASIO and DirectX SDK are automatically searched for by the CMake script, so if you have DirectX SDK installed and have placed the ASIO2 SDK according to point 2 above, you should be able to build portaudio with !DirectSound and ASIO support.
|
||||
cmake -G
|
||||
|
||||
Should you later on decide to change a portaudio option, just jump in at step 5 above (MSVC will then prompt you to reload projects/solutions/workspace)
|
||||
"make install" should install the same set of files that are installed using the usual configure script included with PortAudio along with a few extra files (similar to pkg-config metadata files) which make it easier for other CMake projects to use the installed libraries.
|
||||
|
||||
--- Robert Bielik
|
||||
On Windows, you can use CMake to generate Visual Studio project files which can be used to create the PortAudio libraries. The following serves as an example (and should be done from a directory outside the PortAudio tree) which will create Visual Studio 2015 project files targetting a 64-bit build:
|
||||
|
||||
Back to the Tutorial: \ref tutorial_start
|
||||
C:\PABUILD> cmake {portaudio path} -G "Visual Studio 14 2015 Win64"
|
||||
|
||||
After executing the above, you can either open the generated solution with Visual Studio or use CMake to invoke the build process. The following shows an example of how to build a release configuration (assuming the above command was executed previously in the same directory):
|
||||
|
||||
C:\PABUILD> cmake --build . --config Release
|
||||
|
||||
If you want ASIO support you need to obtain the ASIO2 SDK from Steinberg and place it according to \ref compile_windows_asio_msvc. Both ASIO and the DirectX SDK are automatically searched for by the CMake script - if they are found, they will be enabled by default.
|
||||
|
||||
@section cmake_using Using PortAudio in your CMake project
|
||||
|
||||
PortAudio defines the following CMake targets:
|
||||
|
||||
- "portaudio_static" for a static library and
|
||||
- "portaudio" for a dynamic library
|
||||
|
||||
If you installed PortAudio as described above in \ref cmake_building and the install prefix you used (CMAKE_INSTALL_PREFIX) is in your system PATH or CMAKE_MODULE_PATH CMake variable, you should be able to use:
|
||||
|
||||
find_package(portaudio)
|
||||
|
||||
To define the "portaudio_static" and "portaudio" targets in your CMake project.
|
||||
|
||||
If you do not want to install portaudio into your system but would rather just have it get built as part of your own project (which may be particularly convenient on Windows), you may also use:
|
||||
|
||||
add_subdirectory("path to PortAudio location" "some binary directory" EXCLUDE_FROM_ALL)
|
||||
|
||||
EXCLUDE_FROM_ALL is not strictly necessary, but will ensure that targets which you don't use in your project won't get built.
|
||||
|
||||
Back to \ref tutorial_start
|
||||
|
||||
*/
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@section comp_mingw1 Portaudio for Windows With MinGW
|
||||
|
||||
<i>The following document is still being reviewed</i>
|
||||
<strong>This document contains old or out-of-date information. Please see a draft of new MinGW information on our Wiki: <a href="https://app.assembla.com/spaces/portaudio/wiki/Notes_about_building_PortAudio_with_MinGW">PortAudio Wiki: Notes about building PortAudio with MinGW</a></strong>
|
||||
|
||||
= MinGW/MSYS =
|
||||
|
||||
|
|
|
@ -15,12 +15,13 @@ Once you've downloaded PortAudio you'll need to compile it, which of course, dep
|
|||
- \ref compile_windows
|
||||
- \ref compile_windows_mingw
|
||||
- \ref compile_windows_asio_msvc
|
||||
- \ref compile_cmake
|
||||
- Mac OS X
|
||||
- \ref compile_mac_coreaudio
|
||||
- POSIX
|
||||
- \ref compile_linux
|
||||
|
||||
You can also use CMake to generate project files for PortAudio on Windows, OS X or Linux or include PortAudio easily in your own CMake project. See \ref compile_cmake.
|
||||
|
||||
Many platforms with GCC/make can use the simple ./configure && make combination and simply use the resulting libraries in their code.
|
||||
|
||||
@section tut_start3 Programming with PortAudio
|
||||
|
|
|
@ -1,35 +1,41 @@
|
|||
# Example projects
|
||||
|
||||
MACRO(ADD_EXAMPLE appl_name)
|
||||
ADD_EXECUTABLE(${appl_name} "${appl_name}.c")
|
||||
TARGET_LINK_LIBRARIES(${appl_name} portaudio_static)
|
||||
SET_TARGET_PROPERTIES(${appl_name}
|
||||
PROPERTIES
|
||||
FOLDER "Examples C"
|
||||
)
|
||||
ADD_EXECUTABLE(${appl_name} "${appl_name}.c")
|
||||
TARGET_LINK_LIBRARIES(${appl_name} portaudio_static)
|
||||
SET_TARGET_PROPERTIES(${appl_name} PROPERTIES FOLDER "Examples C")
|
||||
IF(WIN32)
|
||||
SET_PROPERTY(TARGET ${appl_name} APPEND_STRING PROPERTY COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF()
|
||||
ENDMACRO(ADD_EXAMPLE)
|
||||
|
||||
MACRO(ADD_EXAMPLE_CPP appl_name)
|
||||
ADD_EXECUTABLE(${appl_name} "${appl_name}.cpp")
|
||||
TARGET_LINK_LIBRARIES(${appl_name} portaudio_static)
|
||||
SET_TARGET_PROPERTIES(${appl_name}
|
||||
PROPERTIES
|
||||
FOLDER "Examples C++"
|
||||
)
|
||||
ADD_EXECUTABLE(${appl_name} "${appl_name}.cpp")
|
||||
TARGET_LINK_LIBRARIES(${appl_name} portaudio_static)
|
||||
SET_TARGET_PROPERTIES(${appl_name} PROPERTIES FOLDER "Examples C++")
|
||||
IF(WIN32)
|
||||
SET_PROPERTY(TARGET ${appl_name} APPEND_STRING PROPERTY COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF()
|
||||
ENDMACRO(ADD_EXAMPLE_CPP)
|
||||
|
||||
ADD_EXAMPLE(pa_devs)
|
||||
ADD_EXAMPLE(pa_fuzz)
|
||||
ADD_EXAMPLE(paex_mono_asio_channel_select)
|
||||
IF(PA_USE_ASIO AND WIN32)
|
||||
ADD_EXAMPLE(paex_mono_asio_channel_select)
|
||||
ENDIF()
|
||||
ADD_EXAMPLE(paex_ocean_shore)
|
||||
TARGET_INCLUDE_DIRECTORIES(paex_ocean_shore PRIVATE ../src/common)
|
||||
ADD_EXAMPLE(paex_pink)
|
||||
ADD_EXAMPLE(paex_read_write_wire)
|
||||
ADD_EXAMPLE(paex_record)
|
||||
ADD_EXAMPLE(paex_record_file)
|
||||
TARGET_INCLUDE_DIRECTORIES(paex_record_file PRIVATE ../src/common)
|
||||
ADD_EXAMPLE(paex_saw)
|
||||
ADD_EXAMPLE(paex_sine)
|
||||
ADD_EXAMPLE_CPP(paex_sine_c++)
|
||||
ADD_EXAMPLE(paex_wmme_ac3)
|
||||
ADD_EXAMPLE(paex_wmme_surround)
|
||||
IF(PA_USE_WMME AND WIN32)
|
||||
ADD_EXAMPLE(paex_wmme_ac3)
|
||||
ADD_EXAMPLE(paex_wmme_surround)
|
||||
ENDIF()
|
||||
ADD_EXAMPLE(paex_write_sine)
|
||||
ADD_EXAMPLE(paex_write_sine_nonint)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
ASIO support.
|
||||
*/
|
||||
/*
|
||||
* $Id: pa_devs.c 1953 2015-04-10 04:00:09Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@author Phil Burk http://www.softsynth.com
|
||||
*/
|
||||
/*
|
||||
* $Id: pa_fuzz.c 1752 2011-09-08 03:21:55Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@author Phil Burk <philburk@softsynth.com>
|
||||
*/
|
||||
/*
|
||||
* $Id: paex_mono_asio_channel_select.c 1756 2011-09-08 06:09:29Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* Authors:
|
||||
* Ross Bencina <rossb@audiomulch.com>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
Robert Bielik
|
||||
*/
|
||||
/*
|
||||
* $Id: paex_ocean_shore.c 1946 2015-01-21 06:30:53Z rbencina $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
@author Phil Burk http://www.softsynth.com
|
||||
*/
|
||||
/*
|
||||
* $Id: paex_pink.c 1752 2011-09-08 03:21:55Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* 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
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
|
@ -49,56 +49,40 @@
|
|||
#include "portaudio.h"
|
||||
|
||||
/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */
|
||||
#define SAMPLE_RATE (44100)
|
||||
#define FRAMES_PER_BUFFER (1024)
|
||||
#define NUM_CHANNELS (2)
|
||||
#define NUM_SECONDS (15)
|
||||
#define SAMPLE_RATE (44100)
|
||||
#define FRAMES_PER_BUFFER (512)
|
||||
#define NUM_SECONDS (10)
|
||||
/* #define DITHER_FLAG (paDitherOff) */
|
||||
#define DITHER_FLAG (0) /**/
|
||||
|
||||
/* @todo Underflow and overflow is disabled until we fix priming of blocking write. */
|
||||
#define CHECK_OVERFLOW (0)
|
||||
#define CHECK_UNDERFLOW (0)
|
||||
|
||||
#define DITHER_FLAG (0)
|
||||
|
||||
/* Select sample format. */
|
||||
#if 0
|
||||
#if 1
|
||||
#define PA_SAMPLE_TYPE paFloat32
|
||||
#define SAMPLE_SIZE (4)
|
||||
#define SAMPLE_SILENCE (0.0f)
|
||||
#define CLEAR(a) memset( (a), 0, FRAMES_PER_BUFFER * NUM_CHANNELS * SAMPLE_SIZE )
|
||||
#define PRINTF_S_FORMAT "%.8f"
|
||||
#elif 0
|
||||
#define PA_SAMPLE_TYPE paInt16
|
||||
#define SAMPLE_SIZE (2)
|
||||
#define SAMPLE_SILENCE (0)
|
||||
#define CLEAR(a) memset( (a), 0, FRAMES_PER_BUFFER * NUM_CHANNELS * SAMPLE_SIZE )
|
||||
#define PRINTF_S_FORMAT "%d"
|
||||
#elif 1
|
||||
#elif 0
|
||||
#define PA_SAMPLE_TYPE paInt24
|
||||
#define SAMPLE_SIZE (3)
|
||||
#define SAMPLE_SILENCE (0)
|
||||
#define CLEAR(a) memset( (a), 0, FRAMES_PER_BUFFER * NUM_CHANNELS * SAMPLE_SIZE )
|
||||
#define PRINTF_S_FORMAT "%d"
|
||||
#elif 0
|
||||
#define PA_SAMPLE_TYPE paInt8
|
||||
#define SAMPLE_SIZE (1)
|
||||
#define SAMPLE_SILENCE (0)
|
||||
#define CLEAR(a) memset( (a), 0, FRAMES_PER_BUFFER * NUM_CHANNELS * SAMPLE_SIZE )
|
||||
#define PRINTF_S_FORMAT "%d"
|
||||
#else
|
||||
#define PA_SAMPLE_TYPE paUInt8
|
||||
#define SAMPLE_SIZE (1)
|
||||
#define SAMPLE_SILENCE (128)
|
||||
#define CLEAR( a ) { \
|
||||
int i; \
|
||||
for( i=0; i<FRAMES_PER_BUFFER*NUM_CHANNELS; i++ ) \
|
||||
((unsigned char *)a)[i] = (SAMPLE_SILENCE); \
|
||||
}
|
||||
#define PRINTF_S_FORMAT "%d"
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
int main(void);
|
||||
int main(void)
|
||||
|
@ -106,46 +90,51 @@ int main(void)
|
|||
PaStreamParameters inputParameters, outputParameters;
|
||||
PaStream *stream = NULL;
|
||||
PaError err;
|
||||
char *sampleBlock;
|
||||
const PaDeviceInfo* inputInfo;
|
||||
const PaDeviceInfo* outputInfo;
|
||||
char *sampleBlock = NULL;
|
||||
int i;
|
||||
int numBytes;
|
||||
|
||||
|
||||
printf("patest_read_write_wire.c\n"); fflush(stdout);
|
||||
int numChannels;
|
||||
|
||||
numBytes = FRAMES_PER_BUFFER * NUM_CHANNELS * SAMPLE_SIZE ;
|
||||
sampleBlock = (char *) malloc( numBytes );
|
||||
if( sampleBlock == NULL )
|
||||
{
|
||||
printf("Could not allocate record array.\n");
|
||||
exit(1);
|
||||
}
|
||||
CLEAR( sampleBlock );
|
||||
printf("patest_read_write_wire.c\n"); fflush(stdout);
|
||||
printf("sizeof(int) = %lu\n", sizeof(int)); fflush(stdout);
|
||||
printf("sizeof(long) = %lu\n", sizeof(long)); fflush(stdout);
|
||||
|
||||
err = Pa_Initialize();
|
||||
if( err != paNoError ) goto error;
|
||||
if( err != paNoError ) goto error2;
|
||||
|
||||
inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */
|
||||
printf( "Input device # %d.\n", inputParameters.device );
|
||||
printf( "Input LL: %g s\n", Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency );
|
||||
printf( "Input HL: %g s\n", Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency );
|
||||
inputParameters.channelCount = NUM_CHANNELS;
|
||||
inputParameters.sampleFormat = PA_SAMPLE_TYPE;
|
||||
inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency ;
|
||||
inputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
inputInfo = Pa_GetDeviceInfo( inputParameters.device );
|
||||
printf( " Name: %s\n", inputInfo->name );
|
||||
printf( " LL: %g s\n", inputInfo->defaultLowInputLatency );
|
||||
printf( " HL: %g s\n", inputInfo->defaultHighInputLatency );
|
||||
|
||||
outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
|
||||
printf( "Output device # %d.\n", outputParameters.device );
|
||||
printf( "Output LL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency );
|
||||
printf( "Output HL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency );
|
||||
outputParameters.channelCount = NUM_CHANNELS;
|
||||
outputInfo = Pa_GetDeviceInfo( outputParameters.device );
|
||||
printf( " Name: %s\n", outputInfo->name );
|
||||
printf( " LL: %g s\n", outputInfo->defaultLowOutputLatency );
|
||||
printf( " HL: %g s\n", outputInfo->defaultHighOutputLatency );
|
||||
|
||||
numChannels = inputInfo->maxInputChannels < outputInfo->maxOutputChannels
|
||||
? inputInfo->maxInputChannels : outputInfo->maxOutputChannels;
|
||||
printf( "Num channels = %d.\n", numChannels );
|
||||
|
||||
inputParameters.channelCount = numChannels;
|
||||
inputParameters.sampleFormat = PA_SAMPLE_TYPE;
|
||||
inputParameters.suggestedLatency = inputInfo->defaultHighInputLatency ;
|
||||
inputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
outputParameters.channelCount = numChannels;
|
||||
outputParameters.sampleFormat = PA_SAMPLE_TYPE;
|
||||
outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
|
||||
outputParameters.suggestedLatency = outputInfo->defaultHighOutputLatency;
|
||||
outputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
/* -- setup -- */
|
||||
|
||||
err = Pa_OpenStream(
|
||||
err = Pa_OpenStream(
|
||||
&stream,
|
||||
&inputParameters,
|
||||
&outputParameters,
|
||||
|
@ -154,46 +143,41 @@ int main(void)
|
|||
paClipOff, /* we won't output out of range samples so don't bother clipping them */
|
||||
NULL, /* no callback, use blocking API */
|
||||
NULL ); /* no callback, so no callback userData */
|
||||
if( err != paNoError ) goto error;
|
||||
if( err != paNoError ) goto error2;
|
||||
|
||||
numBytes = FRAMES_PER_BUFFER * numChannels * SAMPLE_SIZE ;
|
||||
sampleBlock = (char *) malloc( numBytes );
|
||||
if( sampleBlock == NULL )
|
||||
{
|
||||
printf("Could not allocate record array.\n");
|
||||
goto error1;
|
||||
}
|
||||
memset( sampleBlock, SAMPLE_SILENCE, numBytes );
|
||||
|
||||
err = Pa_StartStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
if( err != paNoError ) goto error1;
|
||||
printf("Wire on. Will run %d seconds.\n", NUM_SECONDS); fflush(stdout);
|
||||
|
||||
for( i=0; i<(NUM_SECONDS*SAMPLE_RATE)/FRAMES_PER_BUFFER; ++i )
|
||||
{
|
||||
err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER );
|
||||
if( err && CHECK_UNDERFLOW ) goto xrun;
|
||||
err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER );
|
||||
if( err && CHECK_OVERFLOW ) goto xrun;
|
||||
// You may get underruns or overruns if the output is not primed by PortAudio.
|
||||
err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER );
|
||||
if( err ) goto xrun;
|
||||
err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER );
|
||||
if( err ) goto xrun;
|
||||
}
|
||||
printf("Wire off.\n"); fflush(stdout);
|
||||
|
||||
err = Pa_StopStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
if( err != paNoError ) goto error1;
|
||||
|
||||
CLEAR( sampleBlock );
|
||||
/*
|
||||
err = Pa_StartStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
printf("Wire on. Interrupt to stop.\n"); fflush(stdout);
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER );
|
||||
if( err ) goto xrun;
|
||||
err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER );
|
||||
if( err ) goto xrun;
|
||||
}
|
||||
err = Pa_StopStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
|
||||
Pa_CloseStream( stream );
|
||||
*/
|
||||
free( sampleBlock );
|
||||
|
||||
Pa_Terminate();
|
||||
return 0;
|
||||
|
||||
xrun:
|
||||
printf("err = %d\n", err); fflush(stdout);
|
||||
if( stream ) {
|
||||
Pa_AbortStream( stream );
|
||||
Pa_CloseStream( stream );
|
||||
|
@ -205,13 +189,13 @@ xrun:
|
|||
if( err & paOutputUnderflow )
|
||||
fprintf( stderr, "Output Underflow.\n" );
|
||||
return -2;
|
||||
|
||||
error:
|
||||
error1:
|
||||
free( sampleBlock );
|
||||
error2:
|
||||
if( stream ) {
|
||||
Pa_AbortStream( stream );
|
||||
Pa_CloseStream( stream );
|
||||
}
|
||||
free( sampleBlock );
|
||||
Pa_Terminate();
|
||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
||||
fprintf( stderr, "Error number: %d\n", err );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@author Phil Burk http://www.softsynth.com
|
||||
*/
|
||||
/*
|
||||
* $Id: paex_record.c 1752 2011-09-08 03:21:55Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -52,6 +52,11 @@
|
|||
#include <process.h>
|
||||
#endif
|
||||
|
||||
static ring_buffer_size_t rbs_min(ring_buffer_size_t a, ring_buffer_size_t b)
|
||||
{
|
||||
return (a < b) ? a : b;
|
||||
}
|
||||
|
||||
/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */
|
||||
#define FILE_NAME "audio_data.raw"
|
||||
#define SAMPLE_RATE (44100)
|
||||
|
@ -243,7 +248,7 @@ static int recordCallback( const void *inputBuffer, void *outputBuffer,
|
|||
{
|
||||
paTestData *data = (paTestData*)userData;
|
||||
ring_buffer_size_t elementsWriteable = PaUtil_GetRingBufferWriteAvailable(&data->ringBuffer);
|
||||
ring_buffer_size_t elementsToWrite = min(elementsWriteable, (ring_buffer_size_t)(framesPerBuffer * NUM_CHANNELS));
|
||||
ring_buffer_size_t elementsToWrite = rbs_min(elementsWriteable, (ring_buffer_size_t)(framesPerBuffer * NUM_CHANNELS));
|
||||
const SAMPLE *rptr = (const SAMPLE*)inputBuffer;
|
||||
|
||||
(void) outputBuffer; /* Prevent unused variable warnings. */
|
||||
|
@ -268,7 +273,7 @@ static int playCallback( const void *inputBuffer, void *outputBuffer,
|
|||
{
|
||||
paTestData *data = (paTestData*)userData;
|
||||
ring_buffer_size_t elementsToPlay = PaUtil_GetRingBufferReadAvailable(&data->ringBuffer);
|
||||
ring_buffer_size_t elementsToRead = min(elementsToPlay, (ring_buffer_size_t)(framesPerBuffer * NUM_CHANNELS));
|
||||
ring_buffer_size_t elementsToRead = rbs_min(elementsToPlay, (ring_buffer_size_t)(framesPerBuffer * NUM_CHANNELS));
|
||||
SAMPLE* wptr = (SAMPLE*)outputBuffer;
|
||||
|
||||
(void) inputBuffer; /* Prevent unused variable warnings. */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@author Phil Burk http://www.softsynth.com
|
||||
*/
|
||||
/*
|
||||
* $Id: paex_saw.c 1752 2011-09-08 03:21:55Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@author Phil Burk <philburk@softsynth.com>
|
||||
*/
|
||||
/*
|
||||
* $Id: paex_sine.c 1752 2011-09-08 03:21:55Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com/
|
||||
|
@ -113,9 +113,8 @@ int main(void)
|
|||
paTestData data;
|
||||
int i;
|
||||
|
||||
|
||||
printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER);
|
||||
|
||||
|
||||
/* initialise sinusoidal wavetable */
|
||||
for( i=0; i<TABLE_SIZE; i++ )
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@author Phil Burk <philburk@softsynth.com>
|
||||
*/
|
||||
/*
|
||||
* $Id: paex_write_sine.c 1865 2012-09-01 21:16:25Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_ASIO_H
|
||||
#define PA_ASIO_H
|
||||
/*
|
||||
* $Id: pa_asio.h 1667 2011-05-02 15:49:20Z rossb $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* ASIO specific extensions
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define PA_LINUX_ALSA_H
|
||||
|
||||
/*
|
||||
* $Id: pa_linux_alsa.h 1597 2011-02-11 00:15:51Z dmitrykos $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* ALSA-specific extensions
|
||||
*
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
#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
|
|
@ -87,22 +87,6 @@ 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
|
||||
}
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
/*
|
||||
* $Id: $
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* DirectSound specific extensions
|
||||
* WASAPI specific extensions
|
||||
*
|
||||
* Copyright (c) 1999-2007 Ross Bencina and Phil Burk
|
||||
* Copyright (c) 1999-2018 Ross Bencina and Phil Burk
|
||||
* Copyright (c) 2006-2010 David Viens
|
||||
* Copyright (c) 2010-2018 Dmitry Kostjuchenko
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files
|
||||
|
@ -28,13 +30,13 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* 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
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
|
@ -52,26 +54,37 @@ extern "C"
|
|||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* Setup flags */
|
||||
/* Stream setup flags. */
|
||||
typedef enum PaWasapiFlags
|
||||
{
|
||||
/* puts WASAPI into exclusive mode */
|
||||
/* put WASAPI into exclusive mode */
|
||||
paWinWasapiExclusive = (1 << 0),
|
||||
|
||||
/* allows to skip internal PA processing completely */
|
||||
/* allow to skip internal PA processing completely */
|
||||
paWinWasapiRedirectHostProcessor = (1 << 1),
|
||||
|
||||
/* assigns custom channel mask */
|
||||
/* assign custom channel mask */
|
||||
paWinWasapiUseChannelMask = (1 << 2),
|
||||
|
||||
/* selects non-Event driven method of data read/write
|
||||
/* select 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
|
||||
/* force custom thread priority setting, must be used if PaWasapiStreamInfo::threadPriority
|
||||
is set to a custom value */
|
||||
paWinWasapiThreadPriority = (1 << 4)
|
||||
paWinWasapiThreadPriority = (1 << 4),
|
||||
|
||||
/* force explicit sample format and do not allow PA to select suitable working format, API will
|
||||
fail if provided sample format is not supported by audio hardware in Exclusive mode
|
||||
or system mixer in Shared mode */
|
||||
paWinWasapiExplicitSampleFormat = (1 << 5),
|
||||
|
||||
/* allow API to insert system-level channel matrix mixer and sample rate converter to allow
|
||||
playback formats that do not match the current configured system settings.
|
||||
this is in particular required for streams not matching the system mixer sample rate.
|
||||
only applies in Shared mode. */
|
||||
paWinWasapiAutoConvert = (1 << 6)
|
||||
}
|
||||
PaWasapiFlags;
|
||||
#define paWinWasapiExclusive (paWinWasapiExclusive)
|
||||
|
@ -79,17 +92,66 @@ PaWasapiFlags;
|
|||
#define paWinWasapiUseChannelMask (paWinWasapiUseChannelMask)
|
||||
#define paWinWasapiPolling (paWinWasapiPolling)
|
||||
#define paWinWasapiThreadPriority (paWinWasapiThreadPriority)
|
||||
#define paWinWasapiExplicitSampleFormat (paWinWasapiExplicitSampleFormat)
|
||||
#define paWinWasapiAutoConvert (paWinWasapiAutoConvert)
|
||||
|
||||
|
||||
/* 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.
|
||||
/* Stream state.
|
||||
|
||||
@note Multiple states can be united into a bitmask.
|
||||
@see PaWasapiStreamStateCallback, PaWasapi_SetStreamStateHandler
|
||||
*/
|
||||
typedef void (*PaWasapiHostProcessorCallback) (void *inputBuffer, long inputFrames,
|
||||
void *outputBuffer, long outputFrames,
|
||||
void *userData);
|
||||
typedef enum PaWasapiStreamState
|
||||
{
|
||||
/* state change was caused by the error:
|
||||
|
||||
Example:
|
||||
1) If thread execution stopped due to AUDCLNT_E_RESOURCES_INVALIDATED then state
|
||||
value will contain paWasapiStreamStateError|paWasapiStreamStateThreadStop.
|
||||
*/
|
||||
paWasapiStreamStateError = (1 << 0),
|
||||
|
||||
/* processing thread is preparing to start execution */
|
||||
paWasapiStreamStateThreadPrepare = (1 << 1),
|
||||
|
||||
/* processing thread started execution (enters its loop) */
|
||||
paWasapiStreamStateThreadStart = (1 << 2),
|
||||
|
||||
/* processing thread stopped execution */
|
||||
paWasapiStreamStateThreadStop = (1 << 3)
|
||||
}
|
||||
PaWasapiStreamState;
|
||||
#define paWasapiStreamStateError (paWasapiStreamStateError)
|
||||
#define paWasapiStreamStateThreadPrepare (paWasapiStreamStateThreadPrepare)
|
||||
#define paWasapiStreamStateThreadStart (paWasapiStreamStateThreadStart)
|
||||
#define paWasapiStreamStateThreadStop (paWasapiStreamStateThreadStop)
|
||||
|
||||
|
||||
/* Host processor.
|
||||
|
||||
Allows to skip internal PA processing completely. paWinWasapiRedirectHostProcessor flag
|
||||
must be set to the PaWasapiStreamInfo::flags member in order to have host processor
|
||||
redirected to this callback.
|
||||
|
||||
Use with caution! inputFrames and outputFrames depend solely on final device setup.
|
||||
To query max values of inputFrames/outputFrames use PaWasapi_GetFramesPerHostBuffer.
|
||||
*/
|
||||
typedef void (*PaWasapiHostProcessorCallback) (void *inputBuffer, long inputFrames,
|
||||
void *outputBuffer, long outputFrames, void *userData);
|
||||
|
||||
|
||||
/* Stream state handler.
|
||||
|
||||
@param pStream Pointer to PaStream object.
|
||||
@param stateFlags State flags, a collection of values from PaWasapiStreamState enum.
|
||||
@param errorId Error id provided by system API (HRESULT).
|
||||
@param userData Pointer to user data.
|
||||
|
||||
@see PaWasapiStreamState
|
||||
*/
|
||||
typedef void (*PaWasapiStreamStateCallback) (PaStream *pStream, unsigned int stateFlags,
|
||||
unsigned int errorId, void *pUserData);
|
||||
|
||||
|
||||
/* Device role. */
|
||||
typedef enum PaWasapiDeviceRole
|
||||
|
@ -124,7 +186,7 @@ typedef enum PaWasapiJackConnectionType
|
|||
eJackConnTypeXlrProfessional,
|
||||
eJackConnTypeRJ11Modem,
|
||||
eJackConnTypeCombination
|
||||
}
|
||||
}
|
||||
PaWasapiJackConnectionType;
|
||||
|
||||
|
||||
|
@ -147,7 +209,7 @@ typedef enum PaWasapiJackGeoLocation
|
|||
eJackGeoLocATAPI,
|
||||
eJackGeoLocReserved5,
|
||||
eJackGeoLocReserved6,
|
||||
}
|
||||
}
|
||||
PaWasapiJackGeoLocation;
|
||||
|
||||
|
||||
|
@ -158,7 +220,7 @@ typedef enum PaWasapiJackGenLocation
|
|||
eJackGenLocInternal,
|
||||
eJackGenLocSeparate,
|
||||
eJackGenLocOther
|
||||
}
|
||||
}
|
||||
PaWasapiJackGenLocation;
|
||||
|
||||
|
||||
|
@ -169,7 +231,7 @@ typedef enum PaWasapiJackPortConnection
|
|||
eJackPortConnIntegratedDevice,
|
||||
eJackPortConnBothIntegratedAndJack,
|
||||
eJackPortConnUnknown
|
||||
}
|
||||
}
|
||||
PaWasapiJackPortConnection;
|
||||
|
||||
|
||||
|
@ -177,7 +239,7 @@ PaWasapiJackPortConnection;
|
|||
typedef enum PaWasapiThreadPriority
|
||||
{
|
||||
eThreadPriorityNone = 0,
|
||||
eThreadPriorityAudio, //!< Default for Shared mode.
|
||||
eThreadPriorityAudio, //!< Default for Shared mode.
|
||||
eThreadPriorityCapture,
|
||||
eThreadPriorityDistribution,
|
||||
eThreadPriorityGames,
|
||||
|
@ -189,7 +251,7 @@ PaWasapiThreadPriority;
|
|||
|
||||
|
||||
/* Stream descriptor. */
|
||||
typedef struct PaWasapiJackDescription
|
||||
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))) */
|
||||
|
@ -202,11 +264,13 @@ typedef struct PaWasapiJackDescription
|
|||
PaWasapiJackDescription;
|
||||
|
||||
|
||||
/* Stream category.
|
||||
/** 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
|
||||
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
typedef enum PaWasapiStreamCategory
|
||||
{
|
||||
|
@ -224,10 +288,12 @@ typedef enum PaWasapiStreamCategory
|
|||
PaWasapiStreamCategory;
|
||||
|
||||
|
||||
/* Stream option.
|
||||
/** Stream option.
|
||||
Note:
|
||||
- values are equal to WASAPI AUDCLNT_STREAMOPTIONS enum
|
||||
- supported since Windows 8.1, noop on earler versions
|
||||
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
typedef enum PaWasapiStreamOption
|
||||
{
|
||||
|
@ -239,7 +305,7 @@ PaWasapiStreamOption;
|
|||
|
||||
|
||||
/* Stream descriptor. */
|
||||
typedef struct PaWasapiStreamInfo
|
||||
typedef struct PaWasapiStreamInfo
|
||||
{
|
||||
unsigned long size; /**< sizeof(PaWasapiStreamInfo) */
|
||||
PaHostApiTypeId hostApiType; /**< paWASAPI */
|
||||
|
@ -247,23 +313,23 @@ typedef struct PaWasapiStreamInfo
|
|||
|
||||
unsigned long flags; /**< collection of PaWasapiFlags */
|
||||
|
||||
/* Support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
|
||||
paWinWasapiUseChannelMask this allows you to specify which speakers
|
||||
/** 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
|
||||
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
|
||||
/** 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
|
||||
/** 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)
|
||||
|
@ -272,132 +338,223 @@ typedef struct PaWasapiStreamInfo
|
|||
*/
|
||||
PaWasapiThreadPriority threadPriority;
|
||||
|
||||
/* Stream category. */
|
||||
/** Stream category.
|
||||
@see PaWasapiStreamCategory
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
PaWasapiStreamCategory streamCategory;
|
||||
|
||||
/* Stream option. */
|
||||
/** Stream option.
|
||||
@see PaWasapiStreamOption
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
PaWasapiStreamOption streamOption;
|
||||
}
|
||||
}
|
||||
PaWasapiStreamInfo;
|
||||
|
||||
/** Returns Windows device ID for input stream
|
||||
|
||||
@param pStream Pointer to PaStream to query.
|
||||
/** Returns pointer to WASAPI's IAudioClient object of the stream.
|
||||
|
||||
@return non-null value pointing to static device ID
|
||||
@param pStream Pointer to PaStream object.
|
||||
@param pAudioClient Pointer to pointer of IAudioClient.
|
||||
@param bOutput TRUE (1) for output stream, FALSE (0) for input stream.
|
||||
|
||||
@return Error code indicating success or failure.
|
||||
*/
|
||||
const wchar_t *PaWasapi_GetInputDeviceID( PaStream* s );
|
||||
PaError PaWasapi_GetAudioClient( PaStream *pStream, void **pAudioClient, int bOutput );
|
||||
|
||||
/** Returns Windows device ID for output stream
|
||||
|
||||
@param pStream Pointer to PaStream to query.
|
||||
/** Update device list.
|
||||
|
||||
@return non-null value pointing to static device ID
|
||||
This function is available if PA_WASAPI_MAX_CONST_DEVICE_COUNT is defined during compile time
|
||||
with maximum constant WASAPI device count (recommended value - 32).
|
||||
If PA_WASAPI_MAX_CONST_DEVICE_COUNT is set to 0 (or not defined) during compile time the implementation
|
||||
will not define PaWasapi_UpdateDeviceList() and thus updating device list can only be possible by calling
|
||||
Pa_Terminate() and then Pa_Initialize().
|
||||
|
||||
@return Error code indicating success or failure.
|
||||
*/
|
||||
const wchar_t *PaWasapi_GetOutputDeviceID( PaStream* s );
|
||||
PaError PaWasapi_UpdateDeviceList();
|
||||
|
||||
/** 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.
|
||||
/** Get current audio format of the device assigned to the opened stream.
|
||||
|
||||
Format is represented by PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
|
||||
Use this function to reconfirm format if PA's processor is overriden and
|
||||
paWinWasapiRedirectHostProcessor flag is specified.
|
||||
|
||||
@param pStream Pointer to PaStream object.
|
||||
@param pFormat Pointer to PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
|
||||
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
||||
@param bOutput TRUE (1) for output stream, FALSE (0) for input stream.
|
||||
|
||||
@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, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
||||
or an error is encountered.
|
||||
*/
|
||||
int PaWasapi_GetDeviceDefaultFormat( void *pFormat, unsigned int nFormatSize, PaDeviceIndex nDevice );
|
||||
int PaWasapi_GetDeviceCurrentFormat( PaStream *pStream, void *pFormat, unsigned int formatSize, int bOutput );
|
||||
|
||||
/** Returns device role (PaWasapiDeviceRole enum).
|
||||
|
||||
@param nDevice device index.
|
||||
/** Get default audio format for the device in Shared Mode.
|
||||
|
||||
@return Non-negative value indicating device role or, a PaErrorCode (which are always negative)
|
||||
Format is represented by PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure and obtained
|
||||
by getting the device property with a PKEY_AudioEngine_DeviceFormat key.
|
||||
|
||||
@param pFormat Pointer to PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
|
||||
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
||||
@param device Device index.
|
||||
|
||||
@return Non-negative value indicating the number of bytes copied into format decriptor
|
||||
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
||||
or an error is encountered.
|
||||
*/
|
||||
int PaWasapi_GetDeviceDefaultFormat( void *pFormat, unsigned int formatSize, PaDeviceIndex device );
|
||||
|
||||
|
||||
/** Get mix audio format for the device in Shared Mode.
|
||||
|
||||
Format is represented by PaWinWaveFormat or WAVEFORMATEXTENSIBLE structureand obtained by
|
||||
IAudioClient::GetMixFormat.
|
||||
|
||||
@param pFormat Pointer to PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
|
||||
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
||||
@param device Device index.
|
||||
|
||||
@return Non-negative value indicating the number of bytes copied into format decriptor
|
||||
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
||||
or an error is encountered.
|
||||
*/
|
||||
int PaWasapi_GetDeviceMixFormat( void *pFormat, unsigned int formatSize, PaDeviceIndex device );
|
||||
|
||||
|
||||
/** Get device role (PaWasapiDeviceRole enum).
|
||||
|
||||
@param device Device index.
|
||||
|
||||
@return Non-negative value indicating device role or, a PaErrorCode (which is always negative)
|
||||
if PortAudio is not initialized or an error is encountered.
|
||||
*/
|
||||
int/*PaWasapiDeviceRole*/ PaWasapi_GetDeviceRole( PaDeviceIndex nDevice );
|
||||
int/*PaWasapiDeviceRole*/ PaWasapi_GetDeviceRole( PaDeviceIndex device );
|
||||
|
||||
|
||||
/** Returns device loopback indicator.
|
||||
/** Boost thread priority of calling thread (MMCSS).
|
||||
|
||||
@param nDevice device index.
|
||||
Use it for Blocking Interface only inside the thread which makes calls to Pa_WriteStream/Pa_ReadStream.
|
||||
|
||||
@return 0 = Not loopback, 1 = loopback, < 0 = PaErrorCode
|
||||
if PortAudio is not initialized or an error is encountered.
|
||||
*/
|
||||
int PaWasapi_IsLoopback( PaDeviceIndex nDevice );
|
||||
@param pTask Handle to pointer to priority task. Must be used with PaWasapi_RevertThreadPriority
|
||||
method to revert thread priority to initial state.
|
||||
|
||||
|
||||
/** 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.
|
||||
@param priorityClass 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 );
|
||||
PaError PaWasapi_ThreadPriorityBoost( void **pTask, PaWasapiThreadPriority priorityClass );
|
||||
|
||||
|
||||
/** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread
|
||||
which makes calls to Pa_WriteStream/Pa_ReadStream.
|
||||
/** Boost thread priority of calling thread (MMCSS).
|
||||
|
||||
Use it for Blocking Interface only inside the thread which makes calls to Pa_WriteStream/Pa_ReadStream.
|
||||
|
||||
@param pTask Task handle obtained by PaWasapi_BoostThreadPriority method.
|
||||
|
||||
@param hTask Task handle obtained by PaWasapi_BoostThreadPriority method.
|
||||
@return Error code indicating success or failure.
|
||||
@see PaWasapi_BoostThreadPriority
|
||||
*/
|
||||
PaError PaWasapi_ThreadPriorityRevert( void *hTask );
|
||||
PaError PaWasapi_ThreadPriorityRevert( void *pTask );
|
||||
|
||||
|
||||
/** 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.
|
||||
/** Get number of frames per host buffer.
|
||||
|
||||
It is max value of frames of WASAPI buffer which can be locked for operations.
|
||||
Use this method as helper to findout max values of inputFrames/outputFrames
|
||||
of PaWasapiHostProcessorCallback.
|
||||
|
||||
@param pStream Pointer to PaStream object.
|
||||
@param pInput Pointer to variable to receive number of input frames. Can be NULL.
|
||||
@param pOutput Pointer to variable to receive number of output frames. Can be NULL.
|
||||
|
||||
@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 );
|
||||
PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *pInput, unsigned int *pOutput );
|
||||
|
||||
|
||||
/** 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
|
||||
/** 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.
|
||||
|
||||
@note Not available on UWP platform.
|
||||
|
||||
@param device Device index.
|
||||
@param pJackCount Pointer to variable to receive number of jacks.
|
||||
|
||||
@return Error code indicating success or failure.
|
||||
@see PaWasapi_GetJackDescription
|
||||
*/
|
||||
PaError PaWasapi_GetJackCount(PaDeviceIndex nDevice, int *jcount);
|
||||
PaError PaWasapi_GetJackCount( PaDeviceIndex device, int *pJackCount );
|
||||
|
||||
|
||||
/** Get the jack description associated with a WASAPI device and jack number
|
||||
/** 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
|
||||
|
||||
@note Not available on UWP platform.
|
||||
|
||||
@param device Device index.
|
||||
@param jackIndex Jack index.
|
||||
@param pJackDescription Pointer to PaWasapiJackDescription.
|
||||
|
||||
@return Error code indicating success or failure.
|
||||
@see PaWasapi_GetJackCount
|
||||
*/
|
||||
PaError PaWasapi_GetJackDescription(PaDeviceIndex nDevice, int jindex, PaWasapiJackDescription *pJackDescription);
|
||||
PaError PaWasapi_GetJackDescription( PaDeviceIndex device, int jackIndex, PaWasapiJackDescription *pJackDescription );
|
||||
|
||||
|
||||
/** Set default interface Id.
|
||||
|
||||
By default PA implementation will use DEVINTERFACE_AUDIO_RENDER and
|
||||
DEVINTERFACE_AUDIO_CAPTURE if device Id is not provided explicitly. These default Ids
|
||||
will not allow to use Exclusive mode on UWP platform and thus you must provide
|
||||
device Id explicitly via this API before calling Pa_OpenStream().
|
||||
Device Ids on UWP platform are obtainable via
|
||||
Windows::Media::Devices::MediaDevice::GetDefaultAudioRenderId() or
|
||||
Windows::Media::Devices::MediaDevice::GetDefaultAudioCaptureId() API.
|
||||
|
||||
@note UWP platform only.
|
||||
|
||||
@param pId Interface Id, pointer to the 16-bit Unicode string (WCHAR). If NULL then device Id
|
||||
will be reset to the default, e.g. DEVINTERFACE_AUDIO_RENDER or DEVINTERFACE_AUDIO_CAPTURE.
|
||||
@param bOutput TRUE (1) for output (render), FALSE (0) for input (capture).
|
||||
|
||||
@return Error code indicating success or failure. Will return paIncompatibleStreamHostApi if PA is not compiled
|
||||
for UWP platform. If Id is longer than 4096 characters paBufferTooBig will be returned.
|
||||
*/
|
||||
PaError PaWasapi_SetDefaultInterfaceId( unsigned short *pId, int bOutput );
|
||||
|
||||
|
||||
/** Set stream state handler.
|
||||
|
||||
@param pStream Pointer to PaStream object.
|
||||
@param fnStateHandler Pointer to state handling function.
|
||||
@param pUserData Pointer to user data.
|
||||
|
||||
@return Error code indicating success or failure.
|
||||
*/
|
||||
PaError PaWasapi_SetStreamStateHandler( PaStream *pStream, PaWasapiStreamStateCallback fnStateHandler, void *pUserData );
|
||||
|
||||
|
||||
/*
|
||||
IMPORTANT:
|
||||
|
||||
WASAPI is implemented for Callback and Blocking interfaces. It supports Shared and Exclusive
|
||||
share modes.
|
||||
|
||||
share modes.
|
||||
|
||||
Exclusive Mode:
|
||||
|
||||
Exclusive mode allows to deliver audio data directly to hardware bypassing
|
||||
|
@ -406,20 +563,20 @@ PaError PaWasapi_GetJackDescription(PaDeviceIndex nDevice, int jindex, PaWasapiJ
|
|||
|
||||
Callback Interface:
|
||||
|
||||
Provides best audio quality with low latency. Callback interface is implemented in
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
@ -428,30 +585,51 @@ PaError PaWasapi_GetJackDescription(PaDeviceIndex nDevice, int jindex, PaWasapiJ
|
|||
|
||||
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
|
||||
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
|
||||
deliver lowest possible latency. Specifying too low latency in Shared mode will result in
|
||||
distorted audio although Exclusive mode adds stability.
|
||||
|
||||
8.24 format:
|
||||
|
||||
If paCustomFormat is specified as sample format then the implementation will understand it
|
||||
as valid 24-bits inside 32-bit container (e.g. wBitsPerSample = 32, Samples.wValidBitsPerSample = 24).
|
||||
|
||||
By using paCustomFormat there will be small optimization when samples are be copied
|
||||
with Copy_24_To_24 by PA processor instead of conversion from packed 3-byte (24-bit) data
|
||||
with Int24_To_Int32.
|
||||
|
||||
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.
|
||||
To check format with correct Share Mode (Exclusive/Shared) you must supply PaWasapiStreamInfo
|
||||
with flags paWinWasapiExclusive set through member of PaStreamParameters::hostApiSpecificStreamInfo
|
||||
structure.
|
||||
|
||||
If paWinWasapiExplicitSampleFormat flag is provided then implementation will not try to select
|
||||
suitable close format and will return an error instead of paFormatIsSupported. By specifying
|
||||
paWinWasapiExplicitSampleFormat flag it is possible to find out what sample formats are
|
||||
supported by Exclusive or Shared modes.
|
||||
|
||||
Pa_OpenStream:
|
||||
|
||||
To set desired Share Mode (Exclusive/Shared) you must supply
|
||||
PaWasapiStreamInfo with flags paWinWasapiExclusive set through member of
|
||||
PaWasapiStreamInfo with flags paWinWasapiExclusive set through member of
|
||||
PaStreamParameters::hostApiSpecificStreamInfo structure.
|
||||
|
||||
Coding style for parameters and structure members of the public API:
|
||||
|
||||
1) bXXX - boolean, [1 (TRUE), 0 (FALSE)]
|
||||
2) pXXX - pointer
|
||||
3) fnXXX - pointer to function
|
||||
4) structure members are never prefixed with a type distinguisher
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* PA_WIN_WASAPI_H */
|
||||
#endif /* PA_WIN_WASAPI_H */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_WIN_WDMKS_H
|
||||
#define PA_WIN_WDMKS_H
|
||||
/*
|
||||
* $Id: pa_win_wdmks.h 1924 2014-04-09 14:27:21Z robiwan $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* WDM/KS specific extensions
|
||||
*
|
||||
|
@ -53,14 +53,20 @@ extern "C"
|
|||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Setup flags */
|
||||
/** Flags to indicate valid fields in PaWinWDMKSInfo.
|
||||
@see PaWinWDMKSInfo
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
typedef enum PaWinWDMKSFlags
|
||||
{
|
||||
/* Makes WDMKS use the supplied latency figures instead of relying on the frame size reported
|
||||
by the WaveCyclic device. Use at own risk! */
|
||||
/** Makes WDMKS use the supplied latency figures instead of relying on the frame size reported
|
||||
by the WaveCyclic device. Use at own risk!
|
||||
*/
|
||||
paWinWDMKSOverrideFramesize = (1 << 0),
|
||||
|
||||
/* Makes WDMKS (output stream) use the given channelMask instead of the default */
|
||||
/** Makes WDMKS (output stream) use the given channelMask instead of the default.
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
paWinWDMKSUseGivenChannelMask = (1 << 1),
|
||||
|
||||
} PaWinWDMKSFlags;
|
||||
|
@ -69,11 +75,20 @@ extern "C"
|
|||
unsigned long size; /**< sizeof(PaWinWDMKSInfo) */
|
||||
PaHostApiTypeId hostApiType; /**< paWDMKS */
|
||||
unsigned long version; /**< 1 */
|
||||
|
||||
/** Flags indicate which fields are valid.
|
||||
@see PaWinWDMKSFlags
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
unsigned long flags;
|
||||
|
||||
/* The number of packets to use for WaveCyclic devices, range is [2, 8]. Set to zero for default value of 2. */
|
||||
/** The number of packets to use for WaveCyclic devices, range is [2, 8]. Set to zero for default value of 2. */
|
||||
unsigned noOfPackets;
|
||||
/* If paWinWDMKSUseGivenChannelMask bit is set in flags, use this as channelMask instead of default */
|
||||
|
||||
/** If paWinWDMKSUseGivenChannelMask bit is set in flags, use this as channelMask instead of default.
|
||||
@see PaWinWDMKSFlags
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
unsigned channelMask;
|
||||
} PaWinWDMKSInfo;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_WIN_WMME_H
|
||||
#define PA_WIN_WMME_H
|
||||
/*
|
||||
* $Id: pa_win_wmme.h 1592 2011-02-04 10:41:58Z rossb $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* MME specific extensions
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PORTAUDIO_H
|
||||
#define PORTAUDIO_H
|
||||
/*
|
||||
* $Id: portaudio.h 1953 2015-04-10 04:00:09Z philburk $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* PortAudio API Header File
|
||||
* Latest version available at: http://www.portaudio.com/
|
||||
|
@ -51,51 +51,68 @@ extern "C"
|
|||
#endif /* __cplusplus */
|
||||
|
||||
/** Retrieve the release number of the currently running PortAudio build.
|
||||
* For example, for version "19.5.1" this will return 0x00130501.
|
||||
*/
|
||||
For example, for version "19.5.1" this will return 0x00130501.
|
||||
|
||||
@see paMakeVersionNumber
|
||||
*/
|
||||
int Pa_GetVersion( void );
|
||||
|
||||
/** Retrieve a textual description of the current PortAudio build,
|
||||
* eg "PortAudio V19.5.0-devel, revision 1952M".
|
||||
* The format of the text may change so do not try to parse the returned string.
|
||||
* @deprecated use PaVersionInfo() instead
|
||||
*/
|
||||
e.g. "PortAudio V19.5.0-devel, revision 1952M".
|
||||
The format of the text may change in the future. Do not try to parse the
|
||||
returned string.
|
||||
|
||||
@deprecated As of 19.5.0, use Pa_GetVersionInfo()->versionText instead.
|
||||
*/
|
||||
const char* Pa_GetVersionText( void );
|
||||
|
||||
/**
|
||||
* Generate a packed integer version number in the same format used
|
||||
* by Pa_GetVersion(). Use this to compare a specified version number with
|
||||
* the currently running version. For example:
|
||||
*
|
||||
* if (Pa_GetVersion() < paMakeVersionNumber(19,5,1)) {}
|
||||
*/
|
||||
Generate a packed integer version number in the same format used
|
||||
by Pa_GetVersion(). Use this to compare a specified version number with
|
||||
the currently running version. For example:
|
||||
|
||||
@code
|
||||
if( Pa_GetVersion() < paMakeVersionNumber(19,5,1) ) {}
|
||||
@endcode
|
||||
|
||||
@see Pa_GetVersion, Pa_GetVersionInfo
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
#define paMakeVersionNumber(major, minor, subminor) \
|
||||
(((major)&0xFF)<<16 | ((minor)&0xFF)<<8 | ((subminor)&0xFF))
|
||||
|
||||
|
||||
/**
|
||||
* A structure containing the components of the version numbers.
|
||||
*/
|
||||
A structure containing PortAudio API version information.
|
||||
@see Pa_GetVersionInfo, paMakeVersionNumber
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
typedef struct PaVersionInfo {
|
||||
int versionMajor;
|
||||
int versionMinor;
|
||||
int versionSubMinor;
|
||||
/**
|
||||
* This is currently the SVN revision but may change in the future.
|
||||
* The versionControlRevision is updated by running a script before compiling code.
|
||||
* If the update does not occur then this value may be less
|
||||
* than the actual SVN revision number.
|
||||
*/
|
||||
This is currently the Git revision hash but may change in the future.
|
||||
The versionControlRevision is updated by running a script before compiling the library.
|
||||
If the update does not occur, this value may refer to an earlier revision.
|
||||
*/
|
||||
const char *versionControlRevision;
|
||||
/** Version as a string, for example "PortAudio V19.5.0-devel, revision 1952M" */
|
||||
const char *versionText;
|
||||
} PaVersionInfo;
|
||||
|
||||
/**
|
||||
* The structure that this points to is statically allocated.
|
||||
* Do not attempt to free it or modify it.
|
||||
*/
|
||||
const PaVersionInfo* Pa_GetVersionInfo();
|
||||
/** Retrieve version information for the currently running PortAudio build.
|
||||
@return A pointer to an immutable PaVersionInfo structure.
|
||||
|
||||
@note This function can be called at any time. It does not require PortAudio
|
||||
to be initialized. The structure pointed to is statically allocated. Do not
|
||||
attempt to free it or modify it.
|
||||
|
||||
@see PaVersionInfo, paMakeVersionNumber
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
const PaVersionInfo* Pa_GetVersionInfo( void );
|
||||
|
||||
|
||||
/** Error codes returned by PortAudio functions.
|
||||
Note that with the exception of paNoError, all PaErrorCodes are negative.
|
||||
|
@ -934,7 +951,7 @@ PaError Pa_CloseStream( PaStream *stream );
|
|||
(ie once a call to Pa_StopStream() will not block).
|
||||
A stream will become inactive after the stream callback returns non-zero,
|
||||
or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio
|
||||
output, if the stream callback returns paComplete, or Pa_StopStream is called,
|
||||
output, if the stream callback returns paComplete, or Pa_StopStream() is called,
|
||||
the stream finished callback will not be called until all generated sample data
|
||||
has been played.
|
||||
|
||||
|
@ -1132,7 +1149,7 @@ PaError Pa_ReadStream( PaStream* stream,
|
|||
|
||||
|
||||
/** Write samples to an output stream. This function doesn't return until the
|
||||
entire buffer has been consumed - this may involve waiting for the operating
|
||||
entire buffer has been written - this may involve waiting for the operating
|
||||
system to consume the data.
|
||||
|
||||
@param stream A pointer to an open stream previously created with Pa_OpenStream.
|
||||
|
@ -1180,15 +1197,6 @@ 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 */
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pablio.c 1151 2006-11-29 02:11:16Z leland_lucius $
|
||||
* $Id$
|
||||
* pablio.c
|
||||
* Portable Audio Blocking Input/Output utility.
|
||||
*
|
||||
|
|
|
@ -7,7 +7,7 @@ extern "C"
|
|||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* $Id: pablio.h 1854 2012-07-09 15:53:00Z philburk $
|
||||
* $Id$
|
||||
* PABLIO.h
|
||||
* Portable Audio Blocking read/write utility.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: test_rw.c 1083 2006-08-23 07:30:49Z rossb $
|
||||
* $Id$
|
||||
* test_rw.c
|
||||
* Read input from one stream and write it to another.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: test_rw_echo.c 1083 2006-08-23 07:30:49Z rossb $
|
||||
* $Id$
|
||||
* test_rw_echo.c
|
||||
* Echo delayed input to output.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: test_w_saw.c 1083 2006-08-23 07:30:49Z rossb $
|
||||
* $Id$
|
||||
* test_w_saw.c
|
||||
* Generate stereo sawtooth waveforms.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: test_w_saw8.c 1083 2006-08-23 07:30:49Z rossb $
|
||||
* $Id$
|
||||
* test_w_saw8.c
|
||||
* Generate stereo 8 bit sawtooth waveforms.
|
||||
*
|
||||
|
|
|
@ -119,4 +119,4 @@ void BiquadFilter_Filter( BiquadFilter *filter, float *inputs, float *outputs, i
|
|||
filter->xn2 = xn2;
|
||||
filter->yn1 = yn1;
|
||||
filter->yn2 = yn2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -890,10 +890,10 @@ static int PaQa_SingleLoopBackTest( UserOptions *userOptions, TestParameters *te
|
|||
{
|
||||
printf( "OK" );
|
||||
}
|
||||
|
||||
printf( "\n" );
|
||||
|
||||
|
||||
|
||||
// Print the # errors so far to make it easier to see where the error occured.
|
||||
printf( " - #errs = %d\n", g_testsFailed );
|
||||
|
||||
PaQa_TeardownLoopbackContext( &loopbackContext );
|
||||
if( numBadChannels > 0 )
|
||||
{
|
||||
|
@ -1376,25 +1376,25 @@ int TestSampleFormatConversion( void )
|
|||
PaQa_ConvertFromFloat( floatInput, 4, paUInt8, ucharOutput );
|
||||
for( i=0; i<4; i++ )
|
||||
{
|
||||
QA_ASSERT_CLOSE( "paFloat32 -> paUInt8 -> error", ucharInput[i], ucharOutput[i], 1 );
|
||||
QA_ASSERT_CLOSE_INT( "paFloat32 -> paUInt8 -> error", ucharInput[i], ucharOutput[i], 1 );
|
||||
}
|
||||
|
||||
PaQa_ConvertFromFloat( floatInput, 4, paInt8, charOutput );
|
||||
for( i=0; i<4; i++ )
|
||||
{
|
||||
QA_ASSERT_CLOSE( "paFloat32 -> paInt8 -> error", charInput[i], charOutput[i], 1 );
|
||||
QA_ASSERT_CLOSE_INT( "paFloat32 -> paInt8 -> error", charInput[i], charOutput[i], 1 );
|
||||
}
|
||||
|
||||
PaQa_ConvertFromFloat( floatInput, 4, paInt16, shortOutput );
|
||||
for( i=0; i<4; i++ )
|
||||
{
|
||||
QA_ASSERT_CLOSE( "paFloat32 -> paInt16 error", shortInput[i], shortOutput[i], 1 );
|
||||
QA_ASSERT_CLOSE_INT( "paFloat32 -> paInt16 error", shortInput[i], shortOutput[i], 1 );
|
||||
}
|
||||
|
||||
PaQa_ConvertFromFloat( floatInput, 4, paInt32, intOutput );
|
||||
for( i=0; i<4; i++ )
|
||||
{
|
||||
QA_ASSERT_CLOSE( "paFloat32 -> paInt32 error", intInput[i], intOutput[i], 0x00010000 );
|
||||
QA_ASSERT_CLOSE_INT( "paFloat32 -> paInt32 error", intInput[i], intOutput[i], 0x00010000 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -70,5 +70,14 @@ extern int g_testsFailed;
|
|||
} \
|
||||
else g_testsPassed++;
|
||||
|
||||
#define QA_ASSERT_CLOSE_INT( message, expected, actual, tolerance ) \
|
||||
if (abs((expected)-(actual))>(tolerance)) \
|
||||
{ \
|
||||
printf( "%s:%d - ERROR - %s, expected %d, got %d, tol=%d\n", __FILE__, __LINE__, message, ((int)(expected)), ((int)(actual)), ((int)(tolerance)) ); \
|
||||
g_testsFailed++; \
|
||||
goto error; \
|
||||
} \
|
||||
else g_testsPassed++;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
as in test pa_devs.c.
|
||||
*/
|
||||
/*
|
||||
* $Id: paqa_devs.c 1910 2013-09-07 10:14:52Z gineera $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
Pieter Suurmond adapted to V19 API.
|
||||
*/
|
||||
/*
|
||||
* $Id: paqa_errs.c 1756 2011-09-08 06:09:29Z philburk $
|
||||
* $Id$
|
||||
*
|
||||
* This program uses the PortAudio Portable Audio Library.
|
||||
* For more information see: http://www.portaudio.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_allocation.c 1097 2006-08-26 08:27:53Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library allocation group implementation
|
||||
* memory allocation group for tracking allocation groups
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_ALLOCATION_H
|
||||
#define PA_ALLOCATION_H
|
||||
/*
|
||||
* $Id: pa_allocation.h 1339 2008-02-15 07:50:33Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library allocation context header
|
||||
* memory allocation context for tracking allocation groups
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_converters.c 1748 2011-09-01 22:08:32Z philburk $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library sample conversion mechanism
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_CONVERTERS_H
|
||||
#define PA_CONVERTERS_H
|
||||
/*
|
||||
* $Id: pa_converters.h 1097 2006-08-26 08:27:53Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library sample conversion mechanism
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_cpuload.c 1577 2011-02-01 13:03:45Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library CPU Load measurement functions
|
||||
* Portable CPU load measurement facility.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_CPULOAD_H
|
||||
#define PA_CPULOAD_H
|
||||
/*
|
||||
* $Id: pa_cpuload.h 1097 2006-08-26 08:27:53Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library CPU Load measurement functions
|
||||
* Portable CPU load measurement facility.
|
||||
*
|
||||
|
|
|
@ -71,7 +71,7 @@ void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb)
|
|||
}
|
||||
|
||||
/*
|
||||
If your platform doesn't have vsnprintf, you are stuck with a
|
||||
If your platform doesn’t have vsnprintf, you are stuck with a
|
||||
VERY dangerous alternative, vsprintf (with no n)
|
||||
*/
|
||||
#if _MSC_VER
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_dither.c 1418 2009-10-12 21:00:53Z philburk $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library triangular dither generator
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_DITHER_H
|
||||
#define PA_DITHER_H
|
||||
/*
|
||||
* $Id: pa_dither.h 1418 2009-10-12 21:00:53Z philburk $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library triangular dither generator
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
|
|
|
@ -1,108 +0,0 @@
|
|||
/*
|
||||
* $Id: pa_dynlink.c 1339 2008-02-15 07:50:33Z rossb $
|
||||
* Portable Audio I/O Library
|
||||
* dynamic library helper
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
* Copyright (c) 2008 Ross Bencina
|
||||
*
|
||||
* 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 common_src
|
||||
|
||||
@brief dynamic library helper functions.
|
||||
*/
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "pa_debugprint.h"
|
||||
#include "pa_dynload.h"
|
||||
|
||||
#if !defined(NULL)
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
paDynamicLib PaDL_Load( char *name )
|
||||
{
|
||||
paDynamicLib lib;
|
||||
|
||||
#if defined(WIN32)
|
||||
lib = LoadLibrary(name);
|
||||
#else
|
||||
lib = dlopen(name, RTLD_LAZY);
|
||||
#endif
|
||||
|
||||
if (!lib) {
|
||||
#if defined(WIN32)
|
||||
PA_DEBUG(("Couldn't load %s, error code: %d\n", name, GetLastError()));
|
||||
#else
|
||||
PA_DEBUG(("Couldn't load %s, error: %s\n", name, dlerror()));
|
||||
#endif
|
||||
}
|
||||
|
||||
return lib;
|
||||
}
|
||||
|
||||
void PaDL_Unload( paDynamicLib lib )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
FreeLibrary(lib);
|
||||
#else
|
||||
dlclose(lib);
|
||||
#endif
|
||||
}
|
||||
|
||||
void *PaDL_FindSymbol( paDynamicLib lib, char *name )
|
||||
{
|
||||
void *addr;
|
||||
|
||||
#if defined(WIN32)
|
||||
addr = (void *) GetProcAddress(lib, name);
|
||||
#else
|
||||
addr = dlsym(lib, name);
|
||||
#endif
|
||||
|
||||
if (addr == NULL) {
|
||||
#if defined(WIN32)
|
||||
PA_DEBUG(("Couldn't find %s function, error code: %d\n", name, GetLastError()));
|
||||
#else
|
||||
PA_DEBUG(("Couldn't find %s function, error: %s\n", name, dlerror()));
|
||||
#endif
|
||||
}
|
||||
|
||||
return addr;
|
||||
}
|
|
@ -1,136 +0,0 @@
|
|||
#ifndef PA_DYNLINK_H
|
||||
#define PA_DYNLINK_H
|
||||
/*
|
||||
* $Id: pa_dynlink.h 1339 2008-02-15 07:50:33Z rossb $
|
||||
* Portable Audio I/O Library
|
||||
* Dynamic library helper
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
* Copyright (c) 1999-2008 Ross Bencina, 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 common_src
|
||||
|
||||
@brief Dynamic library helper functions.
|
||||
*/
|
||||
|
||||
|
||||
#include "pa_debugprint.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if defined(WIN32)
|
||||
typedef HANDLE paDynamicLib;
|
||||
#define PADL_INLINE __inline
|
||||
#else
|
||||
typedef void * paDynamicLib;
|
||||
#define PADL_INLINE inline
|
||||
#endif
|
||||
|
||||
paDynamicLib PaDL_Load( char *name );
|
||||
void PaDL_Unload( paDynamicLib lib );
|
||||
void *PaDL_FindSymbol( paDynamicLib lib, char *name );
|
||||
|
||||
/* A little explanation of what's going on here.
|
||||
*
|
||||
* Only one source file should define PADL_DEFINE_POINTERS before including the header which
|
||||
* defines the functions. This will cause the compiler to dump all of the function pointers
|
||||
* to a single object file and prevent duplicate symbol definitions during link.
|
||||
*
|
||||
* The PADL_FUNC_WITH_RETURN and PADL_FUNC_NO_RETURN macros do two things each:
|
||||
* 1) Define or reference the variable that contains the actual function pointer
|
||||
* 2) Define an inline function to pass control to the real function
|
||||
*
|
||||
* Since the macros redefine the real functions of the same name, the compiler will make
|
||||
* sure that the definitions are the same. If not, it will complain. For this to occur,
|
||||
* the functions MUST be defined in an extern "C" block otherwise the compiler just thinks the
|
||||
* functions are being overloaded.
|
||||
*
|
||||
* The compiler should optimize away the inline function since it just passes control to the real
|
||||
* function and we should wind up with about the same function call we had before, only now it is
|
||||
* safer due to the validation.
|
||||
*
|
||||
* The PADL_FUNC_WITH_RETURN takes 4 arguments:
|
||||
* 1) The return type <---|
|
||||
* 2) The function name | Taken from the real funciton prototype
|
||||
* 3) The function arguments <---|
|
||||
* 4) The argument list to pass to the real function
|
||||
*
|
||||
* The PADL_FUNC_NO_RETURN takes 3 arguments:
|
||||
* 1) The function name <---| Taken from the FFmpeg funciton prototype
|
||||
* 2) The function arguments <---|
|
||||
* 3) The argument list to pass to the real function
|
||||
*
|
||||
* The PADL_FINDSYMBOL macro is responsible for retrieving the address of the real function
|
||||
* and storing that address in the function pointer variable.
|
||||
*/
|
||||
#if defined(PADL_DEFINE_POINTERS)
|
||||
#define FFX
|
||||
#else
|
||||
#define FFX extern
|
||||
#endif
|
||||
|
||||
#define PADL_FUNC_WITH_RETURN(r, n, a, p) \
|
||||
FFX r (*paDynFunc_ ## n ## _fp) a; \
|
||||
PADL_INLINE r n a \
|
||||
{ \
|
||||
return paDynFunc_ ## n ## _fp p; \
|
||||
} \
|
||||
|
||||
#define PADL_FUNC_NO_RETURN(n, a, p) \
|
||||
FFX void (*paDynFunc_ ## n ## _fp) a; \
|
||||
PADL_INLINE void n a \
|
||||
{ \
|
||||
paDynFunc_ ## n ## _fp p; \
|
||||
} \
|
||||
|
||||
#define PADL_FINDSYMBOL(l, f, e) \
|
||||
*(void**)& paDynFunc_ ## f ## _fp = PaDL_FindSymbol(l, #f); \
|
||||
if (!paDynFunc_ ## f ## _fp) \
|
||||
{ \
|
||||
PA_DEBUG(("Could not locate address of %s\n", #f)); \
|
||||
e; \
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* PA_DYNLINK_H */
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_ENDIANNESS_H
|
||||
#define PA_ENDIANNESS_H
|
||||
/*
|
||||
* $Id: pa_endianness.h 1324 2008-01-27 02:03:30Z bjornroche $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library current platform endianness macros
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_front.c 1953 2015-04-10 04:00:09Z philburk $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library Multi-Host API front end
|
||||
* Validate function parameters and manage multiple host APIs.
|
||||
*
|
||||
|
@ -27,26 +27,26 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* 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
|
||||
* 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 common_src
|
||||
|
||||
@brief Implements PortAudio API functions defined in portaudio.h, checks
|
||||
@brief Implements PortAudio API functions defined in portaudio.h, checks
|
||||
some errors, delegates platform-specific behavior to host API implementations.
|
||||
|
||||
Implements the functions defined in the PortAudio API (portaudio.h),
|
||||
validates some parameters and checks for state inconsistencies before
|
||||
forwarding API requests to specific Host API implementations (via the
|
||||
interface declared in pa_hostapi.h), and Streams (via the interface
|
||||
|
||||
Implements the functions defined in the PortAudio API (portaudio.h),
|
||||
validates some parameters and checks for state inconsistencies before
|
||||
forwarding API requests to specific Host API implementations (via the
|
||||
interface declared in pa_hostapi.h), and Streams (via the interface
|
||||
declared in pa_stream.h).
|
||||
|
||||
This file manages initialization and termination of Host API
|
||||
|
@ -77,8 +77,8 @@
|
|||
#include "pa_trace.h" /* still usefull?*/
|
||||
#include "pa_debugprint.h"
|
||||
|
||||
#ifndef PA_SVN_REVISION
|
||||
#include "pa_svnrevision.h"
|
||||
#ifndef PA_GIT_REVISION
|
||||
#include "pa_gitrevision.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -91,7 +91,7 @@
|
|||
* This is incremented when we add functionality in a backwards-compatible manner.
|
||||
* Or it is set to zero when paVersionMajor is incremented.
|
||||
*/
|
||||
#define paVersionMinor 5
|
||||
#define paVersionMinor 6
|
||||
|
||||
/**
|
||||
* This is incremented when we make backwards-compatible bug fixes.
|
||||
|
@ -101,7 +101,7 @@
|
|||
|
||||
/**
|
||||
* This is a combination of paVersionMajor, paVersionMinor and paVersionSubMinor.
|
||||
* It will always increase so that version numbers can be compared as integers to
|
||||
* It will always increase so that version numbers can be compared as integers to
|
||||
* see which is later.
|
||||
*/
|
||||
#define paVersion paMakeVersionNumber(paVersionMajor, paVersionMinor, paVersionSubMinor)
|
||||
|
@ -110,7 +110,7 @@
|
|||
#define TOSTRING(x) STRINGIFY(x)
|
||||
|
||||
#define PA_VERSION_STRING_ TOSTRING(paVersionMajor) "." TOSTRING(paVersionMinor) "." TOSTRING(paVersionSubMinor)
|
||||
#define PA_VERSION_TEXT_ "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_SVN_REVISION)
|
||||
#define PA_VERSION_TEXT_ "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_GIT_REVISION)
|
||||
|
||||
int Pa_GetVersion( void )
|
||||
{
|
||||
|
@ -123,14 +123,14 @@ const char* Pa_GetVersionText( void )
|
|||
}
|
||||
|
||||
static PaVersionInfo versionInfo_ = {
|
||||
.versionMajor = paVersionMajor,
|
||||
.versionMinor = paVersionMinor,
|
||||
.versionSubMinor = paVersionSubMinor,
|
||||
.versionControlRevision = TOSTRING(PA_SVN_REVISION),
|
||||
.versionText = PA_VERSION_TEXT_
|
||||
/*.versionMajor =*/ paVersionMajor,
|
||||
/*.versionMinor =*/ paVersionMinor,
|
||||
/*.versionSubMinor =*/ paVersionSubMinor,
|
||||
/*.versionControlRevision =*/ TOSTRING(PA_GIT_REVISION),
|
||||
/*.versionText =*/ PA_VERSION_TEXT_
|
||||
};
|
||||
|
||||
const PaVersionInfo* Pa_GetVersionInfo()
|
||||
const PaVersionInfo* Pa_GetVersionInfo( void )
|
||||
{
|
||||
return &versionInfo_;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ static PaError InitializeHostApis( void )
|
|||
if( !hostApis_ )
|
||||
{
|
||||
result = paInsufficientMemory;
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
|
||||
hostApisCount_ = 0;
|
||||
|
@ -235,11 +235,11 @@ static PaError InitializeHostApis( void )
|
|||
assert( hostApi->info.defaultInputDevice < hostApi->info.deviceCount );
|
||||
assert( hostApi->info.defaultOutputDevice < hostApi->info.deviceCount );
|
||||
|
||||
/* the first successfully initialized host API with a default input *or*
|
||||
/* the first successfully initialized host API with a default input *or*
|
||||
output device is used as the default host API.
|
||||
*/
|
||||
if( (defaultHostApiIndex_ == -1) &&
|
||||
( hostApi->info.defaultInputDevice != paNoDevice
|
||||
( hostApi->info.defaultInputDevice != paNoDevice
|
||||
|| hostApi->info.defaultOutputDevice != paNoDevice ) )
|
||||
{
|
||||
defaultHostApiIndex_ = hostApisCount_;
|
||||
|
@ -277,7 +277,7 @@ error:
|
|||
<device> belongs and returns it. if <hostSpecificDeviceIndex> is
|
||||
non-null, the host specific device index is returned in it.
|
||||
returns -1 if <device> is out of range.
|
||||
|
||||
|
||||
*/
|
||||
static int FindHostApi( PaDeviceIndex device, int *hostSpecificDeviceIndex )
|
||||
{
|
||||
|
@ -367,7 +367,7 @@ PaError Pa_Initialize( void )
|
|||
{
|
||||
PA_VALIDATE_TYPE_SIZES;
|
||||
PA_VALIDATE_ENDIANNESS;
|
||||
|
||||
|
||||
PaUtil_InitializeClock();
|
||||
PaUtil_ResetTraceMessages();
|
||||
|
||||
|
@ -390,7 +390,8 @@ PaError Pa_Terminate( void )
|
|||
|
||||
if( PA_IS_INITIALISED_ )
|
||||
{
|
||||
if( --initializationCount_ == 0 )
|
||||
// leave initializationCount_>0 so that Pa_CloseStream() can execute
|
||||
if( initializationCount_ == 1 )
|
||||
{
|
||||
CloseOpenStreams();
|
||||
|
||||
|
@ -398,6 +399,7 @@ PaError Pa_Terminate( void )
|
|||
|
||||
PaUtil_DumpTraceMessages();
|
||||
}
|
||||
--initializationCount_;
|
||||
result = paNoError;
|
||||
}
|
||||
else
|
||||
|
@ -454,11 +456,11 @@ const char *Pa_GetErrorText( PaError errorCode )
|
|||
case paCanNotWriteToAnInputOnlyStream: result = "Can't write to an input only stream"; break;
|
||||
case paIncompatibleStreamHostApi: result = "Incompatible stream host API"; break;
|
||||
case paBadBufferPtr: result = "Bad buffer pointer"; break;
|
||||
default:
|
||||
default:
|
||||
if( errorCode > 0 )
|
||||
result = "Invalid error code (value greater than zero)";
|
||||
result = "Invalid error code (value greater than zero)";
|
||||
else
|
||||
result = "Invalid error code";
|
||||
result = "Invalid error code";
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
|
@ -469,7 +471,7 @@ PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type )
|
|||
{
|
||||
PaHostApiIndex result;
|
||||
int i;
|
||||
|
||||
|
||||
PA_LOGAPI_ENTER_PARAMS( "Pa_HostApiTypeIdToHostApiIndex" );
|
||||
PA_LOGAPI(("\tPaHostApiTypeId type: %d\n", type ));
|
||||
|
||||
|
@ -480,14 +482,14 @@ PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type )
|
|||
else
|
||||
{
|
||||
result = paHostApiNotFound;
|
||||
|
||||
|
||||
for( i=0; i < hostApisCount_; ++i )
|
||||
{
|
||||
if( hostApis_[i]->info.type == type )
|
||||
{
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -502,7 +504,7 @@ PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **ho
|
|||
{
|
||||
PaError result;
|
||||
int i;
|
||||
|
||||
|
||||
if( !PA_IS_INITIALISED_ )
|
||||
{
|
||||
result = paNotInitialized;
|
||||
|
@ -510,7 +512,7 @@ PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **ho
|
|||
else
|
||||
{
|
||||
result = paHostApiNotFound;
|
||||
|
||||
|
||||
for( i=0; i < hostApisCount_; ++i )
|
||||
{
|
||||
if( hostApis_[i]->info.type == type )
|
||||
|
@ -531,7 +533,7 @@ PaError PaUtil_DeviceIndexToHostApiDeviceIndex(
|
|||
{
|
||||
PaError result;
|
||||
PaDeviceIndex x;
|
||||
|
||||
|
||||
x = device - hostApi->privatePaFrontInfo.baseDeviceIndex;
|
||||
|
||||
if( x < 0 || x >= hostApi->info.deviceCount )
|
||||
|
@ -616,7 +618,7 @@ const PaHostApiInfo* Pa_GetHostApiInfo( PaHostApiIndex hostApi )
|
|||
else if( hostApi < 0 || hostApi >= hostApisCount_ )
|
||||
{
|
||||
info = NULL;
|
||||
|
||||
|
||||
PA_LOGAPI(("Pa_GetHostApiInfo returned:\n" ));
|
||||
PA_LOGAPI(("\tPaHostApiInfo*: NULL [ hostApi out of range ]\n" ));
|
||||
|
||||
|
@ -725,7 +727,7 @@ PaDeviceIndex Pa_GetDefaultOutputDevice( void )
|
|||
{
|
||||
PaHostApiIndex hostApi;
|
||||
PaDeviceIndex result;
|
||||
|
||||
|
||||
PA_LOGAPI_ENTER( "Pa_GetDefaultOutputDevice" );
|
||||
|
||||
hostApi = Pa_GetDefaultHostApi();
|
||||
|
@ -809,7 +811,7 @@ static int SampleFormatIsValid( PaSampleFormat format )
|
|||
ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream()
|
||||
conform to the expected values as described below. This function is
|
||||
also designed to be used with the proposed Pa_IsFormatSupported() function.
|
||||
|
||||
|
||||
There are basically two types of validation that could be performed:
|
||||
Generic conformance validation, and device capability mismatch
|
||||
validation. This function performs only generic conformance validation.
|
||||
|
@ -818,21 +820,21 @@ static int SampleFormatIsValid( PaSampleFormat format )
|
|||
combinations of parameters - for example, even if the sampleRate
|
||||
seems ok, it might not be for a duplex stream - we have no way of
|
||||
checking this in an API-neutral way, so we don't try.
|
||||
|
||||
|
||||
On success the function returns PaNoError and fills in hostApi,
|
||||
hostApiInputDeviceID, and hostApiOutputDeviceID fields. On failure
|
||||
the function returns an error code indicating the first encountered
|
||||
parameter error.
|
||||
|
||||
|
||||
|
||||
|
||||
If ValidateOpenStreamParameters() returns paNoError, the following
|
||||
assertions are guaranteed to be true.
|
||||
|
||||
|
||||
- at least one of inputParameters & outputParmeters is valid (not NULL)
|
||||
|
||||
- if inputParameters & outputParameters are both valid, that
|
||||
inputParameters->device & outputParameters->device both use the same host api
|
||||
|
||||
|
||||
PaDeviceIndex inputParameters->device
|
||||
- is within range (0 to Pa_GetDeviceCount-1) Or:
|
||||
- is paUseHostApiSpecificDeviceSpecification and
|
||||
|
@ -842,30 +844,30 @@ static int SampleFormatIsValid( PaSampleFormat format )
|
|||
int inputParameters->channelCount
|
||||
- if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, channelCount is > 0
|
||||
- upper bound is NOT validated against device capabilities
|
||||
|
||||
|
||||
PaSampleFormat inputParameters->sampleFormat
|
||||
- is one of the sample formats defined in portaudio.h
|
||||
|
||||
void *inputParameters->hostApiSpecificStreamInfo
|
||||
- if supplied its hostApi field matches the input device's host Api
|
||||
|
||||
|
||||
PaDeviceIndex outputParmeters->device
|
||||
- is within range (0 to Pa_GetDeviceCount-1)
|
||||
|
||||
|
||||
int outputParmeters->channelCount
|
||||
- if inputDevice is valid, channelCount is > 0
|
||||
- upper bound is NOT validated against device capabilities
|
||||
|
||||
|
||||
PaSampleFormat outputParmeters->sampleFormat
|
||||
- is one of the sample formats defined in portaudio.h
|
||||
|
||||
|
||||
void *outputParmeters->hostApiSpecificStreamInfo
|
||||
- if supplied its hostApi field matches the output device's host Api
|
||||
|
||||
|
||||
double sampleRate
|
||||
- is not an 'absurd' rate (less than 1000. or greater than 384000.)
|
||||
- sampleRate is NOT validated against device capabilities
|
||||
|
||||
|
||||
PaStreamFlags streamFlags
|
||||
- unused platform neutral flags are zero
|
||||
- paNeverDropInput is only used for full-duplex callback streams with
|
||||
|
@ -992,7 +994,7 @@ static PaError ValidateOpenStreamParameters(
|
|||
!= (*hostApi)->info.type )
|
||||
return paIncompatibleHostApiSpecificStreamInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( (inputParameters != NULL) && (outputParameters != NULL) )
|
||||
{
|
||||
|
@ -1001,8 +1003,8 @@ static PaError ValidateOpenStreamParameters(
|
|||
return paBadIODeviceCombination;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Check for absurd sample rates. */
|
||||
if( (sampleRate < 1000.0) || (sampleRate > 384000.0) )
|
||||
return paInvalidSampleRate;
|
||||
|
@ -1024,7 +1026,7 @@ static PaError ValidateOpenStreamParameters(
|
|||
if( framesPerBuffer != paFramesPerBufferUnspecified )
|
||||
return paInvalidFlag;
|
||||
}
|
||||
|
||||
|
||||
return paNoError;
|
||||
}
|
||||
|
||||
|
@ -1064,7 +1066,7 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
|
|||
PA_LOGAPI(("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ));
|
||||
PA_LOGAPI(("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ));
|
||||
}
|
||||
|
||||
|
||||
PA_LOGAPI(("\tdouble sampleRate: %g\n", sampleRate ));
|
||||
#endif
|
||||
|
||||
|
@ -1087,7 +1089,7 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
|
|||
PA_LOGAPI_EXIT_PAERROR( "Pa_IsFormatSupported", result );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( inputParameters )
|
||||
{
|
||||
|
@ -1174,7 +1176,7 @@ PaError Pa_OpenStream( PaStream** stream,
|
|||
PA_LOGAPI(("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ));
|
||||
PA_LOGAPI(("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ));
|
||||
}
|
||||
|
||||
|
||||
PA_LOGAPI(("\tdouble sampleRate: %g\n", sampleRate ));
|
||||
PA_LOGAPI(("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ));
|
||||
PA_LOGAPI(("\tPaStreamFlags streamFlags: 0x%x\n", streamFlags ));
|
||||
|
@ -1221,7 +1223,7 @@ PaError Pa_OpenStream( PaStream** stream,
|
|||
PA_LOGAPI(("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) ));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( inputParameters )
|
||||
{
|
||||
|
@ -1255,10 +1257,8 @@ 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" ));
|
||||
|
@ -1297,8 +1297,8 @@ PaError Pa_OpenDefaultStream( PaStream** stream,
|
|||
{
|
||||
hostApiInputParameters.device = Pa_GetDefaultInputDevice();
|
||||
if( hostApiInputParameters.device == paNoDevice )
|
||||
return paDeviceUnavailable;
|
||||
|
||||
return paDeviceUnavailable;
|
||||
|
||||
hostApiInputParameters.channelCount = inputChannelCount;
|
||||
hostApiInputParameters.sampleFormat = sampleFormat;
|
||||
/* defaultHighInputLatency is used below instead of
|
||||
|
@ -1306,7 +1306,7 @@ PaError Pa_OpenDefaultStream( PaStream** stream,
|
|||
stream to work reliably than it is for it to work with the lowest
|
||||
latency.
|
||||
*/
|
||||
hostApiInputParameters.suggestedLatency =
|
||||
hostApiInputParameters.suggestedLatency =
|
||||
Pa_GetDeviceInfo( hostApiInputParameters.device )->defaultHighInputLatency;
|
||||
hostApiInputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
hostApiInputParametersPtr = &hostApiInputParameters;
|
||||
|
@ -1320,7 +1320,7 @@ PaError Pa_OpenDefaultStream( PaStream** stream,
|
|||
{
|
||||
hostApiOutputParameters.device = Pa_GetDefaultOutputDevice();
|
||||
if( hostApiOutputParameters.device == paNoDevice )
|
||||
return paDeviceUnavailable;
|
||||
return paDeviceUnavailable;
|
||||
|
||||
hostApiOutputParameters.channelCount = outputChannelCount;
|
||||
hostApiOutputParameters.sampleFormat = sampleFormat;
|
||||
|
@ -1704,7 +1704,7 @@ PaError Pa_WriteStream( PaStream* stream,
|
|||
else if( result == 1 )
|
||||
{
|
||||
result = paStreamIsStopped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1770,32 +1770,6 @@ 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 )
|
||||
{
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#define PA_GIT_REVISION unknown
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_HOSTAPI_H
|
||||
#define PA_HOSTAPI_H
|
||||
/*
|
||||
* $Id: pa_hostapi.h 1880 2012-12-04 18:39:48Z rbencina $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* host api representation
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_process.c 1954 2015-04-19 18:48:38Z gineera $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* streamCallback <-> host buffer processing adapter
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_PROCESS_H
|
||||
#define PA_PROCESS_H
|
||||
/*
|
||||
* $Id: pa_process.h 1668 2011-05-02 17:07:11Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library callback buffer processing adapters
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_ringbuffer.c 1738 2011-08-18 11:47:28Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* Ring Buffer utility.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_RINGBUFFER_H
|
||||
#define PA_RINGBUFFER_H
|
||||
/*
|
||||
* $Id: pa_ringbuffer.h 1873 2012-10-07 19:00:11Z philburk $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* Ring Buffer utility.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_stream.c 1339 2008-02-15 07:50:33Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* stream interface
|
||||
*
|
||||
|
@ -93,8 +93,6 @@ void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRe
|
|||
streamRepresentation->streamInfo.inputLatency = 0.;
|
||||
streamRepresentation->streamInfo.outputLatency = 0.;
|
||||
streamRepresentation->streamInfo.sampleRate = 0.;
|
||||
|
||||
streamRepresentation->hostApiType = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_STREAM_H
|
||||
#define PA_STREAM_H
|
||||
/*
|
||||
* $Id: pa_stream.h 1339 2008-02-15 07:50:33Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* stream interface
|
||||
*
|
||||
|
@ -152,7 +152,6 @@ typedef struct PaUtilStreamRepresentation {
|
|||
PaStreamFinishedCallback *streamFinishedCallback;
|
||||
void *userData;
|
||||
PaStreamInfo streamInfo;
|
||||
PaHostApiTypeId hostApiType;
|
||||
} PaUtilStreamRepresentation;
|
||||
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#define PA_SVN_REVISION unknown
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_trace.c 1916 2014-01-17 03:45:15Z philburk $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library Trace Facility
|
||||
* Store trace information in real-time for later printing.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_TRACE_H
|
||||
#define PA_TRACE_H
|
||||
/*
|
||||
* $Id: pa_trace.h 1812 2012-02-14 09:32:57Z robiwan $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library Trace Facility
|
||||
* Store trace information in real-time for later printing.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PA_UTIL_H
|
||||
#define PA_UTIL_H
|
||||
/*
|
||||
* $Id: pa_util.h 1584 2011-02-02 18:58:17Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library implementation utilities header
|
||||
* common implementation utilities and interfaces
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_linux_alsa.c 1911 2013-10-17 12:44:09Z gineera $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* Latest Version at: http://www.portaudio.com
|
||||
* ALSA implementation by Joshua Haberman and Arve Knudsen
|
||||
|
@ -621,7 +621,6 @@ typedef struct
|
|||
StreamDirection streamDir;
|
||||
|
||||
snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
|
||||
int card;
|
||||
} PaAlsaStreamComponent;
|
||||
|
||||
/* Implementation specific stream structure */
|
||||
|
@ -1875,7 +1874,6 @@ 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) );
|
||||
|
@ -1904,9 +1902,6 @@ 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;
|
||||
|
@ -3810,8 +3805,23 @@ static PaError PaAlsaStream_WaitForFrames( PaAlsaStream *self, unsigned long *fr
|
|||
totalFds += self->playback.nfds;
|
||||
}
|
||||
|
||||
#ifdef PTHREAD_CANCELED
|
||||
if( self->callbackMode )
|
||||
{
|
||||
/* To allow 'Abort' to terminate the callback thread, enable cancelability just for poll() (& disable after) */
|
||||
pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, NULL );
|
||||
}
|
||||
#endif
|
||||
|
||||
pollResults = poll( self->pfds, totalFds, pollTimeout );
|
||||
|
||||
#ifdef PTHREAD_CANCELED
|
||||
if( self->callbackMode )
|
||||
{
|
||||
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, NULL );
|
||||
}
|
||||
#endif
|
||||
|
||||
if( pollResults < 0 )
|
||||
{
|
||||
/* XXX: Depend on preprocessor condition? */
|
||||
|
@ -4180,12 +4190,18 @@ static void *CallbackThreadFunc( void *userData )
|
|||
int streamStarted = 0;
|
||||
|
||||
assert( stream );
|
||||
/* Not implemented */
|
||||
assert( !stream->primeBuffers );
|
||||
|
||||
/* Execute OnExit when exiting */
|
||||
pthread_cleanup_push( &OnExit, stream );
|
||||
|
||||
/* Not implemented */
|
||||
assert( !stream->primeBuffers );
|
||||
#ifdef PTHREAD_CANCELED
|
||||
/* 'Abort' will use thread cancellation to terminate the callback thread, but the Alsa-lib functions
|
||||
* are NOT cancel-safe, (and can end up in an inconsistent state). So, disable cancelability for
|
||||
* the thread here, and just re-enable it for the poll() in PaAlsaStream_WaitForFrames(). */
|
||||
pthread_testcancel();
|
||||
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, NULL );
|
||||
#endif
|
||||
|
||||
/* @concern StreamStart If the output is being primed the output pcm needs to be prepared, otherwise the
|
||||
* stream is started immediately. The latter involves signaling the waiting main thread.
|
||||
|
@ -4270,10 +4286,6 @@ static void *CallbackThreadFunc( void *userData )
|
|||
{
|
||||
xrun = 0;
|
||||
|
||||
#ifdef PTHREAD_CANCELED
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/** @concern Xruns Under/overflows are to be reported to the callback */
|
||||
if( stream->underrun > 0.0 )
|
||||
{
|
||||
|
@ -4304,11 +4316,12 @@ static void *CallbackThreadFunc( void *userData )
|
|||
#if 0
|
||||
CallbackUpdate( &stream->threading );
|
||||
#endif
|
||||
|
||||
CalculateTimeInfo( stream, &timeInfo );
|
||||
PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, cbFlags );
|
||||
cbFlags = 0;
|
||||
|
||||
/* CPU load measurement should include processing activivity external to the stream callback */
|
||||
/* CPU load measurement should include processing activity external to the stream callback */
|
||||
PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer );
|
||||
|
||||
framesGot = framesAvail;
|
||||
|
@ -4339,7 +4352,6 @@ static void *CallbackThreadFunc( void *userData )
|
|||
{
|
||||
/* Go back to polling for more frames */
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if( paContinue != callbackResult )
|
||||
|
@ -4593,7 +4605,9 @@ PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
|
|||
/* XXX: More descriptive error? */
|
||||
PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
|
||||
|
||||
*card = stream->capture.card;
|
||||
alsa_snd_pcm_info_alloca( &pcmInfo );
|
||||
PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
|
||||
*card = alsa_snd_pcm_info_get_card( pcmInfo );
|
||||
|
||||
error:
|
||||
return result;
|
||||
|
@ -4610,7 +4624,9 @@ PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
|
|||
/* XXX: More descriptive error? */
|
||||
PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
|
||||
|
||||
*card = stream->capture.card;
|
||||
alsa_snd_pcm_info_alloca( &pcmInfo );
|
||||
PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
|
||||
*card = alsa_snd_pcm_info_get_card( pcmInfo );
|
||||
|
||||
error:
|
||||
return result;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_asio.cpp 1890 2013-05-02 01:06:01Z rbencina $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library for ASIO Drivers
|
||||
*
|
||||
* Author: Stephane Letz
|
||||
|
|
|
@ -1921,14 +1921,13 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
|
||||
/*
|
||||
* If input and output devs are different or we are doing SR conversion,
|
||||
* we also need a
|
||||
* ring buffer to store inpt data while waiting for output
|
||||
* data.
|
||||
* we also need a ring buffer to store input data while waiting for
|
||||
* output data.
|
||||
*/
|
||||
if( (stream->outputUnit && (stream->inputUnit != stream->outputUnit))
|
||||
|| stream->inputSRConverter )
|
||||
{
|
||||
/* May want the ringSize ot initial position in
|
||||
/* May want the ringSize or initial position in
|
||||
ring buffer to depend somewhat on sample rate change */
|
||||
|
||||
void *data;
|
||||
|
@ -1951,7 +1950,15 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
}
|
||||
|
||||
/* now we can initialize the ring buffer */
|
||||
PaUtil_InitializeRingBuffer( &stream->inputRingBuffer, szfl*inputParameters->channelCount, ringSize, data ) ;
|
||||
result = PaUtil_InitializeRingBuffer( &stream->inputRingBuffer, szfl*inputParameters->channelCount, ringSize, data );
|
||||
if( result != 0 )
|
||||
{
|
||||
/* The only reason this should fail is if ringSize is not a power of 2, which we do not anticipate happening. */
|
||||
result = paUnanticipatedHostError;
|
||||
free(data);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* advance the read point a little, so we are reading from the
|
||||
middle of the buffer */
|
||||
if( stream->outputUnit )
|
||||
|
@ -1973,12 +1980,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
stream->outputFramesPerBuffer,
|
||||
sampleRate );
|
||||
result = initializeBlioRingBuffers( &stream->blio,
|
||||
inputParameters?inputParameters->sampleFormat:0 ,
|
||||
outputParameters?outputParameters->sampleFormat:0 ,
|
||||
MAX(stream->inputFramesPerBuffer,stream->outputFramesPerBuffer),
|
||||
inputParameters ? inputParameters->sampleFormat : 0,
|
||||
outputParameters ? outputParameters->sampleFormat : 0,
|
||||
ringSize,
|
||||
inputParameters?inputChannelCount:0 ,
|
||||
outputParameters?outputChannelCount:0 ) ;
|
||||
inputParameters ? inputChannelCount : 0,
|
||||
outputParameters ? outputChannelCount : 0 ) ;
|
||||
if( result != paNoError )
|
||||
goto error;
|
||||
|
||||
|
@ -2277,9 +2283,10 @@ static OSStatus AudioIOProc( void *inRefCon,
|
|||
INPUT_ELEMENT,
|
||||
inNumberFrames,
|
||||
&stream->inputAudioBufferList );
|
||||
/* FEEDBACK: I'm not sure what to do when this call fails. There's nothing in the PA API to
|
||||
* do about failures in the callback system. */
|
||||
assert( !err );
|
||||
if(err != noErr)
|
||||
{
|
||||
goto stop_stream;
|
||||
}
|
||||
|
||||
PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames );
|
||||
PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor),
|
||||
|
@ -2359,7 +2366,7 @@ static OSStatus AudioIOProc( void *inRefCon,
|
|||
&size,
|
||||
(void *)&data );
|
||||
if( err == RING_BUFFER_EMPTY )
|
||||
{ /*the ring buffer callback underflowed */
|
||||
{ /* the ring buffer callback underflowed */
|
||||
err = 0;
|
||||
bzero( ((char *)data) + size, sizeof(data)-size );
|
||||
/* The ring buffer can underflow normally when the stream is stopping.
|
||||
|
@ -2370,8 +2377,11 @@ static OSStatus AudioIOProc( void *inRefCon,
|
|||
}
|
||||
}
|
||||
ERR( err );
|
||||
assert( !err );
|
||||
|
||||
if(err != noErr)
|
||||
{
|
||||
goto stop_stream;
|
||||
}
|
||||
|
||||
PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames );
|
||||
PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor),
|
||||
0,
|
||||
|
@ -2477,9 +2487,12 @@ static OSStatus AudioIOProc( void *inRefCon,
|
|||
if( err == -10874 )
|
||||
inNumberFrames /= 2;
|
||||
} while( err == -10874 && inNumberFrames > 1 );
|
||||
/* FEEDBACK: I'm not sure what to do when this call fails */
|
||||
ERR( err );
|
||||
assert( !err );
|
||||
if(err != noErr)
|
||||
{
|
||||
goto stop_stream;
|
||||
}
|
||||
|
||||
if( stream->inputSRConverter || stream->outputUnit )
|
||||
{
|
||||
/* If this is duplex or we use a converter, put the data
|
||||
|
@ -2522,11 +2535,11 @@ static OSStatus AudioIOProc( void *inRefCon,
|
|||
* chunks, and let the BufferProcessor deal with the rest.
|
||||
*
|
||||
*/
|
||||
/*This might be too big or small depending on SR conversion*/
|
||||
/* This might be too big or small depending on SR conversion. */
|
||||
float data[ chan * inNumberFrames ];
|
||||
OSStatus err;
|
||||
do
|
||||
{ /*Run the buffer processor until we are out of data*/
|
||||
{ /* Run the buffer processor until we are out of data. */
|
||||
UInt32 size;
|
||||
long f;
|
||||
|
||||
|
@ -2539,7 +2552,11 @@ static OSStatus AudioIOProc( void *inRefCon,
|
|||
(void *)data );
|
||||
if( err != RING_BUFFER_EMPTY )
|
||||
ERR( err );
|
||||
assert( err == 0 || err == RING_BUFFER_EMPTY );
|
||||
if( err != noErr && err != RING_BUFFER_EMPTY )
|
||||
{
|
||||
goto stop_stream;
|
||||
}
|
||||
|
||||
|
||||
f = size / ( chan * sizeof(float) );
|
||||
PaUtil_SetInputFrameCount( &(stream->bufferProcessor), f );
|
||||
|
@ -2562,24 +2579,24 @@ static OSStatus AudioIOProc( void *inRefCon,
|
|||
}
|
||||
}
|
||||
|
||||
switch( callbackResult )
|
||||
{
|
||||
case paContinue: break;
|
||||
case paComplete:
|
||||
case paAbort:
|
||||
stream->state = CALLBACK_STOPPED ;
|
||||
if( stream->outputUnit )
|
||||
AudioOutputUnitStop(stream->outputUnit);
|
||||
if( stream->inputUnit )
|
||||
AudioOutputUnitStop(stream->inputUnit);
|
||||
break;
|
||||
}
|
||||
// Should we return successfully or fall through to stopping the stream?
|
||||
if( callbackResult == paContinue )
|
||||
{
|
||||
PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
|
||||
return noErr;
|
||||
}
|
||||
|
||||
PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
|
||||
return noErr;
|
||||
stop_stream:
|
||||
stream->state = CALLBACK_STOPPED ;
|
||||
if( stream->outputUnit )
|
||||
AudioOutputUnitStop(stream->outputUnit);
|
||||
if( stream->inputUnit )
|
||||
AudioOutputUnitStop(stream->inputUnit);
|
||||
|
||||
PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
|
||||
return noErr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
When CloseStream() is called, the multi-api layer ensures that
|
||||
the stream has already been stopped or aborted.
|
||||
|
@ -2707,18 +2724,10 @@ static ComponentResult BlockWhileAudioUnitIsRunning( AudioUnit audioUnit, AudioU
|
|||
return noErr;
|
||||
}
|
||||
|
||||
static PaError StopStream( PaStream *s )
|
||||
static PaError FinishStoppingStream( PaMacCoreStream *stream )
|
||||
{
|
||||
PaMacCoreStream *stream = (PaMacCoreStream*)s;
|
||||
OSStatus result = noErr;
|
||||
PaError paErr;
|
||||
VVDBUG(("StopStream()\n"));
|
||||
|
||||
VDBUG( ("Waiting for BLIO.\n") );
|
||||
waitUntilBlioWriteBufferIsFlushed( &stream->blio );
|
||||
VDBUG( ( "Stopping stream.\n" ) );
|
||||
|
||||
stream->state = STOPPING;
|
||||
|
||||
#define ERR_WRAP(mac_err) do { result = mac_err ; if ( result != noErr ) return ERR(result) ; } while(0)
|
||||
/* -- stop and reset -- */
|
||||
|
@ -2770,12 +2779,34 @@ static PaError StopStream( PaStream *s )
|
|||
#undef ERR_WRAP
|
||||
}
|
||||
|
||||
/* Block until buffer is empty then stop the stream. */
|
||||
static PaError StopStream( PaStream *s )
|
||||
{
|
||||
PaError paErr;
|
||||
PaMacCoreStream *stream = (PaMacCoreStream*)s;
|
||||
VVDBUG(("StopStream()\n"));
|
||||
|
||||
/* Tell WriteStream to stop filling the buffer. */
|
||||
stream->state = STOPPING;
|
||||
|
||||
if( stream->userOutChan > 0 ) /* Does this stream do output? */
|
||||
{
|
||||
size_t maxHostFrames = MAX( stream->inputFramesPerBuffer, stream->outputFramesPerBuffer );
|
||||
VDBUG( ("Waiting for write buffer to be drained.\n") );
|
||||
paErr = waitUntilBlioWriteBufferIsEmpty( &stream->blio, stream->sampleRate,
|
||||
maxHostFrames );
|
||||
VDBUG( ( "waitUntilBlioWriteBufferIsEmpty returned %d\n", paErr ) );
|
||||
}
|
||||
return FinishStoppingStream( stream );
|
||||
}
|
||||
|
||||
/* Immediately stop the stream. */
|
||||
static PaError AbortStream( PaStream *s )
|
||||
{
|
||||
VVDBUG(("AbortStream()->StopStream()\n"));
|
||||
VDBUG( ( "Aborting stream.\n" ) );
|
||||
/* We have nothing faster than StopStream. */
|
||||
return StopStream(s);
|
||||
PaMacCoreStream *stream = (PaMacCoreStream*)s;
|
||||
VDBUG( ( "AbortStream()\n" ) );
|
||||
stream->state = STOPPING;
|
||||
return FinishStoppingStream( stream );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -108,14 +108,16 @@ static size_t computeSampleSizeFromFormatPow2( PaSampleFormat format )
|
|||
*
|
||||
*/
|
||||
|
||||
/* This should be called with the relevant info when initializing a stream for
|
||||
callback. */
|
||||
/**
|
||||
* This should be called with the relevant info when initializing a stream for callback.
|
||||
*
|
||||
* @param ringBufferSizeInFrames must be a power of 2
|
||||
*/
|
||||
PaError initializeBlioRingBuffers(
|
||||
PaMacBlio *blio,
|
||||
PaSampleFormat inputSampleFormat,
|
||||
PaSampleFormat outputSampleFormat,
|
||||
size_t framesPerBuffer,
|
||||
long ringBufferSize,
|
||||
long ringBufferSizeInFrames,
|
||||
int inChan,
|
||||
int outChan )
|
||||
{
|
||||
|
@ -126,20 +128,19 @@ PaError initializeBlioRingBuffers(
|
|||
/* zeroify things */
|
||||
bzero( blio, sizeof( PaMacBlio ) );
|
||||
/* this is redundant, but the buffers are used to check
|
||||
if the bufffers have been initialized, so we do it explicitly. */
|
||||
if the buffers have been initialized, so we do it explicitly. */
|
||||
blio->inputRingBuffer.buffer = NULL;
|
||||
blio->outputRingBuffer.buffer = NULL;
|
||||
|
||||
/* initialize simple data */
|
||||
blio->ringBufferFrames = ringBufferSize;
|
||||
blio->ringBufferFrames = ringBufferSizeInFrames;
|
||||
blio->inputSampleFormat = inputSampleFormat;
|
||||
blio->inputSampleSizeActual = computeSampleSizeFromFormat(inputSampleFormat);
|
||||
blio->inputSampleSizePow2 = computeSampleSizeFromFormatPow2(inputSampleFormat);
|
||||
blio->inputSampleSizePow2 = computeSampleSizeFromFormatPow2(inputSampleFormat); // FIXME: WHY?
|
||||
blio->outputSampleFormat = outputSampleFormat;
|
||||
blio->outputSampleSizeActual = computeSampleSizeFromFormat(outputSampleFormat);
|
||||
blio->outputSampleSizePow2 = computeSampleSizeFromFormatPow2(outputSampleFormat);
|
||||
|
||||
blio->framesPerBuffer = framesPerBuffer;
|
||||
blio->inChan = inChan;
|
||||
blio->outChan = outChan;
|
||||
blio->statusFlags = 0;
|
||||
|
@ -163,7 +164,7 @@ PaError initializeBlioRingBuffers(
|
|||
result = UNIX_ERR( pthread_cond_init( &(blio->outputCond), NULL ) );
|
||||
#endif
|
||||
if( inChan ) {
|
||||
data = calloc( ringBufferSize, blio->inputSampleSizePow2*inChan );
|
||||
data = calloc( ringBufferSizeInFrames, blio->inputSampleSizePow2 * inChan );
|
||||
if( !data )
|
||||
{
|
||||
result = paInsufficientMemory;
|
||||
|
@ -172,12 +173,13 @@ PaError initializeBlioRingBuffers(
|
|||
|
||||
err = PaUtil_InitializeRingBuffer(
|
||||
&blio->inputRingBuffer,
|
||||
1, ringBufferSize*blio->inputSampleSizePow2*inChan,
|
||||
blio->inputSampleSizePow2 * inChan,
|
||||
ringBufferSizeInFrames,
|
||||
data );
|
||||
assert( !err );
|
||||
}
|
||||
if( outChan ) {
|
||||
data = calloc( ringBufferSize, blio->outputSampleSizePow2*outChan );
|
||||
data = calloc( ringBufferSizeInFrames, blio->outputSampleSizePow2 * outChan );
|
||||
if( !data )
|
||||
{
|
||||
result = paInsufficientMemory;
|
||||
|
@ -186,7 +188,8 @@ PaError initializeBlioRingBuffers(
|
|||
|
||||
err = PaUtil_InitializeRingBuffer(
|
||||
&blio->outputRingBuffer,
|
||||
1, ringBufferSize*blio->outputSampleSizePow2*outChan,
|
||||
blio->outputSampleSizePow2 * outChan,
|
||||
ringBufferSizeInFrames,
|
||||
data );
|
||||
assert( !err );
|
||||
}
|
||||
|
@ -266,12 +269,11 @@ PaError resetBlioRingBuffers( PaMacBlio *blio )
|
|||
#endif
|
||||
blio->statusFlags = 0;
|
||||
if( blio->outputRingBuffer.buffer ) {
|
||||
PaUtil_FlushRingBuffer( &blio->outputRingBuffer );
|
||||
bzero( blio->outputRingBuffer.buffer,
|
||||
blio->outputRingBuffer.bufferSize );
|
||||
/* Advance buffer */
|
||||
PaUtil_AdvanceRingBufferWriteIndex( &blio->outputRingBuffer, blio->ringBufferFrames*blio->outputSampleSizeActual*blio->outChan );
|
||||
//PaUtil_AdvanceRingBufferWriteIndex( &blio->outputRingBuffer, blio->outputRingBuffer.bufferSize );
|
||||
PaUtil_FlushRingBuffer( &blio->outputRingBuffer );
|
||||
/* Fill the buffer with zeros. */
|
||||
bzero( blio->outputRingBuffer.buffer,
|
||||
blio->outputRingBuffer.bufferSize * blio->outputRingBuffer.elementSizeBytes );
|
||||
PaUtil_AdvanceRingBufferWriteIndex( &blio->outputRingBuffer, blio->ringBufferFrames );
|
||||
|
||||
/* Update isOutputFull. */
|
||||
#ifdef PA_MAC__BLIO_MUTEX
|
||||
|
@ -280,16 +282,14 @@ PaError resetBlioRingBuffers( PaMacBlio *blio )
|
|||
goto error;
|
||||
#endif
|
||||
/*
|
||||
printf( "------%d\n" , blio->framesPerBuffer );
|
||||
printf( "------%d\n" , blio->outChan );
|
||||
printf( "------%d\n" , blio->outputSampleSize );
|
||||
printf( "------%d\n" , blio->framesPerBuffer*blio->outChan*blio->outputSampleSize );
|
||||
*/
|
||||
}
|
||||
if( blio->inputRingBuffer.buffer ) {
|
||||
PaUtil_FlushRingBuffer( &blio->inputRingBuffer );
|
||||
bzero( blio->inputRingBuffer.buffer,
|
||||
blio->inputRingBuffer.bufferSize );
|
||||
blio->inputRingBuffer.bufferSize * blio->inputRingBuffer.elementSizeBytes );
|
||||
/* Update isInputEmpty. */
|
||||
#ifdef PA_MAC__BLIO_MUTEX
|
||||
result = blioSetIsInputEmpty( blio, true );
|
||||
|
@ -344,30 +344,32 @@ int BlioCallback( const void *input, void *output, unsigned long frameCount,
|
|||
void *userData )
|
||||
{
|
||||
PaMacBlio *blio = (PaMacBlio*)userData;
|
||||
long avail;
|
||||
long toRead;
|
||||
long toWrite;
|
||||
long read;
|
||||
long written;
|
||||
ring_buffer_size_t framesAvailable;
|
||||
ring_buffer_size_t framesToTransfer;
|
||||
ring_buffer_size_t framesTransferred;
|
||||
|
||||
/* set flags returned by OS: */
|
||||
OSAtomicOr32( statusFlags, &blio->statusFlags ) ;
|
||||
|
||||
/* --- Handle Input Buffer --- */
|
||||
if( blio->inChan ) {
|
||||
avail = PaUtil_GetRingBufferWriteAvailable( &blio->inputRingBuffer );
|
||||
framesAvailable = PaUtil_GetRingBufferWriteAvailable( &blio->inputRingBuffer );
|
||||
|
||||
/* check for underflow */
|
||||
if( avail < frameCount * blio->inputSampleSizeActual * blio->inChan )
|
||||
if( framesAvailable < frameCount )
|
||||
{
|
||||
OSAtomicOr32( paInputOverflow, &blio->statusFlags );
|
||||
OSAtomicOr32( paInputOverflow, &blio->statusFlags );
|
||||
framesToTransfer = framesAvailable;
|
||||
}
|
||||
else
|
||||
{
|
||||
framesToTransfer = (ring_buffer_size_t)frameCount;
|
||||
}
|
||||
toRead = MIN( avail, frameCount * blio->inputSampleSizeActual * blio->inChan );
|
||||
|
||||
/* copy the data */
|
||||
/* Copy the data from the audio input to the application ring buffer. */
|
||||
/*printf( "reading %d\n", toRead );*/
|
||||
read = PaUtil_WriteRingBuffer( &blio->inputRingBuffer, input, toRead );
|
||||
assert( toRead == read );
|
||||
framesTransferred = PaUtil_WriteRingBuffer( &blio->inputRingBuffer, input, framesToTransfer );
|
||||
assert( framesToTransfer == framesTransferred );
|
||||
#ifdef PA_MAC__BLIO_MUTEX
|
||||
/* Priority inversion. See notes below. */
|
||||
blioSetIsInputEmpty( blio, false );
|
||||
|
@ -377,21 +379,31 @@ int BlioCallback( const void *input, void *output, unsigned long frameCount,
|
|||
|
||||
/* --- Handle Output Buffer --- */
|
||||
if( blio->outChan ) {
|
||||
avail = PaUtil_GetRingBufferReadAvailable( &blio->outputRingBuffer );
|
||||
framesAvailable = PaUtil_GetRingBufferReadAvailable( &blio->outputRingBuffer );
|
||||
|
||||
/* check for underflow */
|
||||
if( avail < frameCount * blio->outputSampleSizeActual * blio->outChan )
|
||||
OSAtomicOr32( paOutputUnderflow, &blio->statusFlags );
|
||||
if( framesAvailable < frameCount )
|
||||
{
|
||||
/* zero out the end of the output buffer that we do not have data for */
|
||||
framesToTransfer = framesAvailable;
|
||||
|
||||
toWrite = MIN( avail, frameCount * blio->outputSampleSizeActual * blio->outChan );
|
||||
size_t bytesPerFrame = blio->outputSampleSizeActual * blio->outChan;
|
||||
size_t offsetInBytes = framesToTransfer * bytesPerFrame;
|
||||
size_t countInBytes = (frameCount - framesToTransfer) * bytesPerFrame;
|
||||
bzero( ((char *)output) + offsetInBytes, countInBytes );
|
||||
|
||||
OSAtomicOr32( paOutputUnderflow, &blio->statusFlags );
|
||||
framesToTransfer = framesAvailable;
|
||||
}
|
||||
else
|
||||
{
|
||||
framesToTransfer = (ring_buffer_size_t)frameCount;
|
||||
}
|
||||
|
||||
if( toWrite != frameCount * blio->outputSampleSizeActual * blio->outChan )
|
||||
bzero( ((char *)output)+toWrite,
|
||||
frameCount * blio->outputSampleSizeActual * blio->outChan - toWrite );
|
||||
/* copy the data */
|
||||
/*printf( "writing %d\n", toWrite );*/
|
||||
written = PaUtil_ReadRingBuffer( &blio->outputRingBuffer, output, toWrite );
|
||||
assert( toWrite == written );
|
||||
framesTransferred = PaUtil_ReadRingBuffer( &blio->outputRingBuffer, output, framesToTransfer );
|
||||
assert( framesToTransfer == framesTransferred );
|
||||
#ifdef PA_MAC__BLIO_MUTEX
|
||||
/* We have a priority inversion here. However, we will only have to
|
||||
wait if this was true and is now false, which means we've got
|
||||
|
@ -406,24 +418,25 @@ int BlioCallback( const void *input, void *output, unsigned long frameCount,
|
|||
|
||||
PaError ReadStream( PaStream* stream,
|
||||
void *buffer,
|
||||
unsigned long frames )
|
||||
unsigned long framesRequested )
|
||||
{
|
||||
PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
|
||||
char *cbuf = (char *) buffer;
|
||||
PaError ret = paNoError;
|
||||
VVDBUG(("ReadStream()\n"));
|
||||
|
||||
while( frames > 0 ) {
|
||||
long avail;
|
||||
long toRead;
|
||||
while( framesRequested > 0 ) {
|
||||
ring_buffer_size_t framesAvailable;
|
||||
ring_buffer_size_t framesToTransfer;
|
||||
ring_buffer_size_t framesTransferred;
|
||||
do {
|
||||
avail = PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer );
|
||||
framesAvailable = PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer );
|
||||
/*
|
||||
printf( "Read Buffer is %%%g full: %ld of %ld.\n",
|
||||
100 * (float)avail / (float) blio->inputRingBuffer.bufferSize,
|
||||
avail, blio->inputRingBuffer.bufferSize );
|
||||
framesAvailable, blio->inputRingBuffer.bufferSize );
|
||||
*/
|
||||
if( avail == 0 ) {
|
||||
if( framesAvailable == 0 ) {
|
||||
#ifdef PA_MAC_BLIO_MUTEX
|
||||
/**block when empty*/
|
||||
ret = UNIX_ERR( pthread_mutex_lock( &blio->inputMutex ) );
|
||||
|
@ -441,14 +454,13 @@ PaError ReadStream( PaStream* stream,
|
|||
Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
|
||||
#endif
|
||||
}
|
||||
} while( avail == 0 );
|
||||
toRead = MIN( avail, frames * blio->inputSampleSizeActual * blio->inChan );
|
||||
toRead -= toRead % blio->inputSampleSizeActual * blio->inChan ;
|
||||
PaUtil_ReadRingBuffer( &blio->inputRingBuffer, (void *)cbuf, toRead );
|
||||
cbuf += toRead;
|
||||
frames -= toRead / ( blio->inputSampleSizeActual * blio->inChan );
|
||||
} while( framesAvailable == 0 );
|
||||
framesToTransfer = (ring_buffer_size_t) MIN( framesAvailable, framesRequested );
|
||||
framesTransferred = PaUtil_ReadRingBuffer( &blio->inputRingBuffer, (void *)cbuf, framesToTransfer );
|
||||
cbuf += framesTransferred * blio->inputSampleSizeActual * blio->inChan;
|
||||
framesRequested -= framesTransferred;
|
||||
|
||||
if( toRead == avail ) {
|
||||
if( framesToTransfer == framesAvailable ) {
|
||||
#ifdef PA_MAC_BLIO_MUTEX
|
||||
/* we just emptied the buffer, so we need to mark it as empty. */
|
||||
ret = blioSetIsInputEmpty( blio, true );
|
||||
|
@ -457,8 +469,10 @@ PaError ReadStream( PaStream* stream,
|
|||
/* of course, in the meantime, the callback may have put some sats
|
||||
in, so
|
||||
so check for that, too, to avoid a race condition. */
|
||||
/* FIXME - this does not seem to fix any race condition. */
|
||||
if( PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer ) ) {
|
||||
blioSetIsInputEmpty( blio, false );
|
||||
/* FIXME - why check? ret has not been set? */
|
||||
if( ret )
|
||||
return ret;
|
||||
}
|
||||
|
@ -468,6 +482,7 @@ PaError ReadStream( PaStream* stream,
|
|||
|
||||
/* Report either paNoError or paInputOverflowed. */
|
||||
/* may also want to report other errors, but this is non-standard. */
|
||||
/* FIXME should not clobber ret, use if(blio->statusFlags & paInputOverflow) */
|
||||
ret = blio->statusFlags & paInputOverflow;
|
||||
|
||||
/* report underflow only once: */
|
||||
|
@ -482,25 +497,27 @@ PaError ReadStream( PaStream* stream,
|
|||
|
||||
PaError WriteStream( PaStream* stream,
|
||||
const void *buffer,
|
||||
unsigned long frames )
|
||||
unsigned long framesRequested )
|
||||
{
|
||||
PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
|
||||
PaMacCoreStream *macStream = (PaMacCoreStream*)stream;
|
||||
PaMacBlio *blio = &macStream->blio;
|
||||
char *cbuf = (char *) buffer;
|
||||
PaError ret = paNoError;
|
||||
VVDBUG(("WriteStream()\n"));
|
||||
|
||||
while( frames > 0 ) {
|
||||
long avail = 0;
|
||||
long toWrite;
|
||||
while( framesRequested > 0 && macStream->state != STOPPING ) {
|
||||
ring_buffer_size_t framesAvailable;
|
||||
ring_buffer_size_t framesToTransfer;
|
||||
ring_buffer_size_t framesTransferred;
|
||||
|
||||
do {
|
||||
avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
|
||||
framesAvailable = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
|
||||
/*
|
||||
printf( "Write Buffer is %%%g full: %ld of %ld.\n",
|
||||
100 - 100 * (float)avail / (float) blio->outputRingBuffer.bufferSize,
|
||||
avail, blio->outputRingBuffer.bufferSize );
|
||||
framesAvailable, blio->outputRingBuffer.bufferSize );
|
||||
*/
|
||||
if( avail == 0 ) {
|
||||
if( framesAvailable == 0 ) {
|
||||
#ifdef PA_MAC_BLIO_MUTEX
|
||||
/*block while full*/
|
||||
ret = UNIX_ERR( pthread_mutex_lock( &blio->outputMutex ) );
|
||||
|
@ -518,16 +535,20 @@ PaError WriteStream( PaStream* stream,
|
|||
Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
|
||||
#endif
|
||||
}
|
||||
} while( avail == 0 );
|
||||
} while( framesAvailable == 0 && macStream->state != STOPPING );
|
||||
|
||||
toWrite = MIN( avail, frames * blio->outputSampleSizeActual * blio->outChan );
|
||||
toWrite -= toWrite % blio->outputSampleSizeActual * blio->outChan ;
|
||||
PaUtil_WriteRingBuffer( &blio->outputRingBuffer, (void *)cbuf, toWrite );
|
||||
cbuf += toWrite;
|
||||
frames -= toWrite / ( blio->outputSampleSizeActual * blio->outChan );
|
||||
if( macStream->state == STOPPING )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
framesToTransfer = MIN( framesAvailable, framesRequested );
|
||||
framesTransferred = PaUtil_WriteRingBuffer( &blio->outputRingBuffer, (void *)cbuf, framesToTransfer );
|
||||
cbuf += framesTransferred * blio->outputSampleSizeActual * blio->outChan;
|
||||
framesRequested -= framesTransferred;
|
||||
|
||||
#ifdef PA_MAC_BLIO_MUTEX
|
||||
if( toWrite == avail ) {
|
||||
if( framesToTransfer == framesAvailable ) {
|
||||
/* we just filled up the buffer, so we need to mark it as filled. */
|
||||
ret = blioSetIsOutputFull( blio, true );
|
||||
if( ret )
|
||||
|
@ -536,6 +557,7 @@ PaError WriteStream( PaStream* stream,
|
|||
so check for that, too, to avoid a race condition. */
|
||||
if( PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer ) ) {
|
||||
blioSetIsOutputFull( blio, false );
|
||||
/* FIXME remove or review this code, does not fix race, ret not set! */
|
||||
if( ret )
|
||||
return ret;
|
||||
}
|
||||
|
@ -543,42 +565,65 @@ PaError WriteStream( PaStream* stream,
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Report either paNoError or paOutputUnderflowed. */
|
||||
/* may also want to report other errors, but this is non-standard. */
|
||||
ret = blio->statusFlags & paOutputUnderflow;
|
||||
if ( macStream->state == STOPPING )
|
||||
{
|
||||
ret = paInternalError;
|
||||
}
|
||||
else if (ret == paNoError )
|
||||
{
|
||||
/* Test for underflow. */
|
||||
ret = blio->statusFlags & paOutputUnderflow;
|
||||
|
||||
/* report underflow only once: */
|
||||
if( ret ) {
|
||||
OSAtomicAnd32( (uint32_t)(~paOutputUnderflow), &blio->statusFlags );
|
||||
ret = paOutputUnderflowed;
|
||||
/* report underflow only once: */
|
||||
if( ret )
|
||||
{
|
||||
OSAtomicAnd32( (uint32_t)(~paOutputUnderflow), &blio->statusFlags );
|
||||
ret = paOutputUnderflowed;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Wait until the data in the buffer has finished playing.
|
||||
*/
|
||||
void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio )
|
||||
PaError waitUntilBlioWriteBufferIsEmpty( PaMacBlio *blio, double sampleRate,
|
||||
size_t framesPerBuffer )
|
||||
{
|
||||
PaError result = paNoError;
|
||||
if( blio->outputRingBuffer.buffer ) {
|
||||
long avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
|
||||
while( avail != blio->outputRingBuffer.bufferSize ) {
|
||||
if( avail == 0 )
|
||||
Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
|
||||
avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
|
||||
}
|
||||
}
|
||||
}
|
||||
ring_buffer_size_t framesLeft = PaUtil_GetRingBufferReadAvailable( &blio->outputRingBuffer );
|
||||
|
||||
/* Calculate when we should give up waiting. To be safe wait for two extra periods. */
|
||||
PaTime now = PaUtil_GetTime();
|
||||
PaTime startTime = now;
|
||||
PaTime timeoutTime = startTime + (framesLeft + (2 * framesPerBuffer)) / sampleRate;
|
||||
|
||||
long msecPerBuffer = 1 + (long)( 1000.0 * framesPerBuffer / sampleRate);
|
||||
while( framesLeft > 0 && now < timeoutTime ) {
|
||||
VDBUG(( "waitUntilBlioWriteBufferIsFlushed: framesLeft = %d, framesPerBuffer = %ld\n",
|
||||
framesLeft, framesPerBuffer ));
|
||||
Pa_Sleep( msecPerBuffer );
|
||||
framesLeft = PaUtil_GetRingBufferReadAvailable( &blio->outputRingBuffer );
|
||||
now = PaUtil_GetTime();
|
||||
}
|
||||
|
||||
if( framesLeft > 0 )
|
||||
{
|
||||
VDBUG(( "waitUntilBlioWriteBufferIsFlushed: TIMED OUT - framesLeft = %d\n", framesLeft ));
|
||||
result = paTimedOut;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
signed long GetStreamReadAvailable( PaStream* stream )
|
||||
{
|
||||
PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
|
||||
VVDBUG(("GetStreamReadAvailable()\n"));
|
||||
|
||||
return PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer )
|
||||
/ ( blio->inputSampleSizeActual * blio->inChan );
|
||||
return PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer );
|
||||
}
|
||||
|
||||
|
||||
|
@ -587,7 +632,6 @@ signed long GetStreamWriteAvailable( PaStream* stream )
|
|||
PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
|
||||
VVDBUG(("GetStreamWriteAvailable()\n"));
|
||||
|
||||
return PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer )
|
||||
/ ( blio->outputSampleSizeActual * blio->outChan );
|
||||
return PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
#include "pa_mac_core_utilities.h"
|
||||
|
||||
/*
|
||||
* Number of miliseconds to busy wait whil waiting for data in blocking calls.
|
||||
* Number of milliseconds to busy wait while waiting for data in blocking calls.
|
||||
*/
|
||||
#define PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL (5)
|
||||
/*
|
||||
|
@ -79,7 +79,7 @@
|
|||
typedef struct {
|
||||
PaUtilRingBuffer inputRingBuffer;
|
||||
PaUtilRingBuffer outputRingBuffer;
|
||||
size_t ringBufferFrames;
|
||||
ring_buffer_size_t ringBufferFrames;
|
||||
PaSampleFormat inputSampleFormat;
|
||||
size_t inputSampleSizeActual;
|
||||
size_t inputSampleSizePow2;
|
||||
|
@ -87,8 +87,6 @@ typedef struct {
|
|||
size_t outputSampleSizeActual;
|
||||
size_t outputSampleSizePow2;
|
||||
|
||||
size_t framesPerBuffer;
|
||||
|
||||
int inChan;
|
||||
int outChan;
|
||||
|
||||
|
@ -117,8 +115,7 @@ PaError initializeBlioRingBuffers(
|
|||
PaMacBlio *blio,
|
||||
PaSampleFormat inputSampleFormat,
|
||||
PaSampleFormat outputSampleFormat,
|
||||
size_t framesPerBuffer,
|
||||
long ringBufferSize,
|
||||
long ringBufferSizeInFrames,
|
||||
int inChan,
|
||||
int outChan );
|
||||
PaError destroyBlioRingBuffers( PaMacBlio *blio );
|
||||
|
@ -131,6 +128,7 @@ int BlioCallback(
|
|||
PaStreamCallbackFlags statusFlags,
|
||||
void *userData );
|
||||
|
||||
void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio );
|
||||
PaError waitUntilBlioWriteBufferIsEmpty( PaMacBlio *blio, double sampleRate,
|
||||
size_t framesPerBuffer );
|
||||
|
||||
#endif /*PA_MAC_CORE_BLOCKING_H_*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_mac_core_old.c 1083 2006-08-23 07:30:49Z rossb $
|
||||
* $Id$
|
||||
* pa_mac_core.c
|
||||
* Implementation of PortAudio for Mac OS X CoreAudio
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_win_ds.c 1945 2015-01-21 06:24:32Z rbencina $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library DirectSound implementation
|
||||
*
|
||||
* Authors: Phil Burk, Robert Marsanyi & Ross Bencina
|
||||
|
@ -257,7 +257,6 @@ typedef struct PaWinDsStream
|
|||
#endif
|
||||
|
||||
/* Output */
|
||||
LPGUID pOutputGuid;
|
||||
LPDIRECTSOUND pDirectSound;
|
||||
LPDIRECTSOUNDBUFFER pDirectSoundPrimaryBuffer;
|
||||
LPDIRECTSOUNDBUFFER pDirectSoundOutputBuffer;
|
||||
|
@ -273,7 +272,6 @@ typedef struct PaWinDsStream
|
|||
INT finalZeroBytesWritten; /* used to determine when we've flushed the whole buffer */
|
||||
|
||||
/* Input */
|
||||
LPGUID pInputGuid;
|
||||
LPDIRECTSOUNDCAPTURE pDirectSoundCapture;
|
||||
LPDIRECTSOUNDCAPTUREBUFFER pDirectSoundInputBuffer;
|
||||
INT inputFrameSizeBytes;
|
||||
|
@ -906,6 +904,9 @@ static PaError AddOutputDeviceInfoFromDirectSound(
|
|||
case DSSPEAKER_STEREO: count = 2; break;
|
||||
case DSSPEAKER_SURROUND: count = 4; break;
|
||||
case DSSPEAKER_5POINT1: count = 6; break;
|
||||
#ifndef DSSPEAKER_7POINT1
|
||||
#define DSSPEAKER_7POINT1 0x00000007
|
||||
#endif
|
||||
case DSSPEAKER_7POINT1: count = 8; break;
|
||||
#ifndef DSSPEAKER_7POINT1_SURROUND
|
||||
#define DSSPEAKER_7POINT1_SURROUND 0x00000008
|
||||
|
@ -1884,8 +1885,8 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
PaWinDsDeviceInfo *inputWinDsDeviceInfo, *outputWinDsDeviceInfo;
|
||||
PaDeviceInfo *inputDeviceInfo, *outputDeviceInfo;
|
||||
int inputChannelCount, outputChannelCount;
|
||||
PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0;
|
||||
PaSampleFormat hostInputSampleFormat = 0, hostOutputSampleFormat = 0;
|
||||
PaSampleFormat inputSampleFormat, outputSampleFormat;
|
||||
PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
|
||||
int userRequestedHostInputBufferSizeFrames = 0;
|
||||
int userRequestedHostOutputBufferSizeFrames = 0;
|
||||
unsigned long suggestedInputLatencyFrames, suggestedOutputLatencyFrames;
|
||||
|
@ -2046,18 +2047,9 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
if( inputParameters )
|
||||
{
|
||||
/* IMPLEMENT ME - establish which host formats are available */
|
||||
/* JKC: CAN'T IMPLEMENT. DirectSound does not have a way */
|
||||
/* to interrogate for formats */
|
||||
PaSampleFormat nativeInputFormats = paInt16;
|
||||
/* PaSampleFormat nativeFormats = paUInt8 | paInt16 | paInt24 | paInt32 | paFloat32; */
|
||||
|
||||
/* July 2016 (Carsten and Uwe)
|
||||
* http://bugzilla.audacityteam.org/show_bug.cgi?id=193
|
||||
* Now we may over ride the paInt16.
|
||||
*/
|
||||
if (userData && *((int*)userData) == 24)
|
||||
nativeInputFormats = paInt24;
|
||||
|
||||
hostInputSampleFormat =
|
||||
PaUtil_SelectClosestAvailableFormat( nativeInputFormats, inputParameters->sampleFormat );
|
||||
}
|
||||
|
@ -2147,7 +2139,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
}
|
||||
else
|
||||
{
|
||||
CalculateBufferSettings( &stream->hostBufferSizeFrames, &pollingPeriodFrames,
|
||||
CalculateBufferSettings( (unsigned long*)&stream->hostBufferSizeFrames, &pollingPeriodFrames,
|
||||
/* isFullDuplex = */ (inputParameters && outputParameters),
|
||||
suggestedInputLatencyFrames,
|
||||
suggestedOutputLatencyFrames,
|
||||
|
@ -2185,13 +2177,6 @@ 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 *
|
||||
|
@ -2233,13 +2218,6 @@ 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 */
|
||||
|
@ -2283,12 +2261,6 @@ 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,
|
||||
|
@ -3297,18 +3269,3 @@ 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;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_jack.c 1912 2013-11-15 12:27:07Z gineera $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* Latest Version at: http://www.portaudio.com
|
||||
* JACK Implementation by Joshua Haberman
|
||||
|
@ -48,22 +48,16 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <regex.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <errno.h> /* EBUSY */
|
||||
#include <signal.h> /* sig_atomic_t */
|
||||
#include <math.h>
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <semaphore.h>
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include <jack/types.h>
|
||||
#include <jack/jack.h>
|
||||
|
@ -77,13 +71,7 @@
|
|||
#include "pa_ringbuffer.h"
|
||||
#include "pa_debugprint.h"
|
||||
|
||||
#include "pa_jack_dynload.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
static DWORD mainThread_;
|
||||
#else
|
||||
static pthread_t mainThread_;
|
||||
#endif
|
||||
static char *jackErr_ = NULL;
|
||||
static const char* clientName_ = "PortAudio";
|
||||
|
||||
|
@ -96,7 +84,7 @@ static const char* clientName_ = "PortAudio";
|
|||
PaError paErr; \
|
||||
if( (paErr = (expr)) < paNoError ) \
|
||||
{ \
|
||||
if( (paErr) == paUnanticipatedHostError && PaJack_IsOnMainThread() ) \
|
||||
if( (paErr) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \
|
||||
{ \
|
||||
const char *err = jackErr_; \
|
||||
if (! err ) err = "unknown error"; \
|
||||
|
@ -112,7 +100,7 @@ static const char* clientName_ = "PortAudio";
|
|||
do { \
|
||||
if( (expr) == 0 ) \
|
||||
{ \
|
||||
if( (code) == paUnanticipatedHostError && PaJack_IsOnMainThread() ) \
|
||||
if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \
|
||||
{ \
|
||||
const char *err = jackErr_; \
|
||||
if (!err) err = "unknown error"; \
|
||||
|
@ -178,13 +166,8 @@ typedef struct
|
|||
int jack_buffer_size;
|
||||
PaHostApiIndex hostApiIndex;
|
||||
|
||||
#if defined(WIN32)
|
||||
HANDLE mtx;
|
||||
HANDLE cond;
|
||||
#else
|
||||
pthread_mutex_t mtx;
|
||||
pthread_cond_t cond;
|
||||
#endif
|
||||
unsigned long inputBase, outputBase;
|
||||
|
||||
/* For dealing with the process thread */
|
||||
|
@ -241,11 +224,7 @@ typedef struct PaJackStream
|
|||
PaUtilRingBuffer inFIFO;
|
||||
PaUtilRingBuffer outFIFO;
|
||||
volatile sig_atomic_t data_available;
|
||||
#if defined(WIN32)
|
||||
HANDLE data_event;
|
||||
#else
|
||||
sem_t data_semaphore;
|
||||
#endif
|
||||
int bytesPerFrame;
|
||||
int samplesPerFrame;
|
||||
|
||||
|
@ -273,178 +252,6 @@ static int JackCallback( jack_nframes_t frames, void *userData );
|
|||
*
|
||||
*/
|
||||
|
||||
static void PaJack_InitMainThread( void )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
mainThread_ = GetCurrentThreadId();
|
||||
#else
|
||||
mainThread_ = pthread_self();
|
||||
#endif
|
||||
}
|
||||
|
||||
static int PaJack_IsOnMainThread( void )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
return GetCurrentThreadId() == mainThread_;
|
||||
#else
|
||||
return pthread_self() == mainThread_;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_InitHostApiMutex( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
ASSERT_CALL( (hostApi->mtx = CreateMutex( NULL, FALSE, NULL )) == NULL, 0 );
|
||||
#else
|
||||
ASSERT_CALL( pthread_mutex_init( &hostApi->mtx, NULL ), 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_TerminateHostApiMutex( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
CloseHandle( hostApi->mtx );
|
||||
hostApi->mtx = NULL;
|
||||
#else
|
||||
ASSERT_CALL( pthread_mutex_destroy( &hostApi->mtx ), 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_LockHostAPI( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
ASSERT_CALL( WaitForSingleObject( hostApi->mtx, INFINITE ), 0 );
|
||||
#else
|
||||
ASSERT_CALL( pthread_mutex_lock( &hostApi->mtx ), 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
/* returns 0 on success, -1 on failure ??? or similar. document make sure it's correct etc */
|
||||
static int PaJack_TryLockHostAPI( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
return WaitForSingleObject( hostApi->mtx, 0 ) == WAIT_OBJECT_0 ? 0 : -1;
|
||||
#else
|
||||
return ( pthread_mutex_trylock( &hostApi->mtx ) == 0 ? 0 : -1 );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_UnlockHostAPI( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
ReleaseMutex( hostApi->mtx );
|
||||
#else
|
||||
ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_InitCommandSync( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
hostApi->cond = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
assert( hostApi->cond );
|
||||
#else
|
||||
ASSERT_CALL( pthread_cond_init( &hostApi->cond, NULL ), 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_TerminateCommandSync( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
CloseHandle( hostApi->cond );
|
||||
hostApi->cond = NULL;
|
||||
#else
|
||||
ASSERT_CALL( pthread_cond_init( &hostApi->cond, NULL ), 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_SignalCommandCompleted( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
ASSERT_CALL( !SetEvent( hostApi->cond ), 0 );
|
||||
#else
|
||||
ASSERT_CALL( pthread_cond_signal( &hostApi->cond ), 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
static PaError WaitForCommandToComplete( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
PaError result = paNoError;
|
||||
|
||||
#if defined(WIN32)
|
||||
switch( SignalObjectAndWait( hostApi->mtx, hostApi->cond, 10 * 60 * 1000, FALSE ) )
|
||||
{
|
||||
case WAIT_OBJECT_0:
|
||||
result = paNoError;
|
||||
break;
|
||||
case WAIT_TIMEOUT:
|
||||
result = paTimedOut;
|
||||
break;
|
||||
default:
|
||||
result = paInternalError;
|
||||
break;
|
||||
}
|
||||
PaJack_LockHostAPI( hostApi );
|
||||
#else
|
||||
int err = 0;
|
||||
PaTime pt = PaUtil_GetTime();
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = (time_t) floor( pt + 10 * 60 /* 10 minutes */ );
|
||||
ts.tv_nsec = (long) ((pt - floor( pt )) * 1000000000);
|
||||
/* XXX: Best enclose in loop, in case of spurious wakeups? */
|
||||
err = pthread_cond_timedwait( &hostApi->cond, &hostApi->mtx, &ts );
|
||||
|
||||
/* Make sure we didn't time out */
|
||||
UNLESS( err != ETIMEDOUT, paTimedOut );
|
||||
UNLESS( !err, paInternalError );
|
||||
error:
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void PaJack_InitStreamDataSync( PaJackStream *stream )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
stream->data_event = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
assert( stream->data_event );
|
||||
#else
|
||||
ASSERT_CALL( sem_init( &stream->data_semaphore, 0, 0 ) == -1, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_TerminateStreamDataSync( PaJackStream *stream )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
CloseHandle( stream->data_event );
|
||||
#else
|
||||
sem_destroy( &stream->data_semaphore );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_SignalStreamDataAvailable( PaJackStream *stream )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
SetEvent( stream->data_event );
|
||||
#else
|
||||
sem_post( &stream->data_semaphore );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PaJack_WaitForStreamDataToBecomeAvailable( PaJackStream *stream )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
WaitForSingleObject( stream->data_event, INFINITE );
|
||||
#else
|
||||
sem_wait( &stream->data_semaphore );
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(WIN32) && _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
/* ---- blocking emulation layer ---- */
|
||||
|
||||
/* Allocate buffer. */
|
||||
|
@ -491,7 +298,7 @@ BlockingCallback( const void *inputBuffer,
|
|||
if( !stream->data_available )
|
||||
{
|
||||
stream->data_available = 1;
|
||||
PaJack_SignalStreamDataAvailable( stream );
|
||||
sem_post( &stream->data_semaphore );
|
||||
}
|
||||
return paContinue;
|
||||
}
|
||||
|
@ -530,7 +337,7 @@ BlockingBegin( PaJackStream *stream, int minimum_buffer_size )
|
|||
}
|
||||
|
||||
stream->data_available = 0;
|
||||
PaJack_InitStreamDataSync( stream );
|
||||
sem_init( &stream->data_semaphore, 0, 0 );
|
||||
|
||||
error:
|
||||
return result;
|
||||
|
@ -542,7 +349,7 @@ BlockingEnd( PaJackStream *stream )
|
|||
BlockingTermFIFO( &stream->inFIFO );
|
||||
BlockingTermFIFO( &stream->outFIFO );
|
||||
|
||||
PaJack_TerminateStreamDataSync( stream );
|
||||
sem_destroy( &stream->data_semaphore );
|
||||
}
|
||||
|
||||
static PaError BlockingReadStream( PaStream* s, void *data, unsigned long numFrames )
|
||||
|
@ -564,7 +371,7 @@ static PaError BlockingReadStream( PaStream* s, void *data, unsigned long numFra
|
|||
if( stream->data_available )
|
||||
stream->data_available = 0;
|
||||
else
|
||||
PaJack_WaitForStreamDataToBecomeAvailable( stream );
|
||||
sem_wait( &stream->data_semaphore );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -602,7 +409,7 @@ static PaError BlockingWriteStream( PaStream* s, const void *data, unsigned long
|
|||
if( stream->data_available )
|
||||
stream->data_available = 0;
|
||||
else
|
||||
PaJack_WaitForStreamDataToBecomeAvailable( stream );
|
||||
sem_wait( &stream->data_semaphore );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -635,7 +442,7 @@ BlockingWaitEmpty( PaStream *s )
|
|||
while( PaUtil_GetRingBufferReadAvailable( &stream->outFIFO ) > 0 )
|
||||
{
|
||||
stream->data_available = 0;
|
||||
PaJack_WaitForStreamDataToBecomeAvailable( stream );
|
||||
sem_wait( &stream->data_semaphore );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -666,6 +473,7 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
|
|||
char *regex_pattern = NULL;
|
||||
int port_index, client_index, i;
|
||||
double globalSampleRate;
|
||||
regex_t port_regex;
|
||||
unsigned long numClients = 0, numPorts = 0;
|
||||
char *tmp_client_name = NULL;
|
||||
|
||||
|
@ -673,6 +481,9 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
|
|||
commonApi->info.defaultOutputDevice = paNoDevice;
|
||||
commonApi->info.deviceCount = 0;
|
||||
|
||||
/* Parse the list of ports, using a regex to grab the client names */
|
||||
ASSERT_CALL( regcomp( &port_regex, "^[^:]*", REG_EXTENDED ), 0 );
|
||||
|
||||
/* since we are rebuilding the list of devices, free all memory
|
||||
* associated with the previous list */
|
||||
PaUtil_FreeAllAllocations( jackApi->deviceInfoMemory );
|
||||
|
@ -685,7 +496,7 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
|
|||
* according to the client_name:port_name convention (which is
|
||||
* enforced by jackd)
|
||||
* A: If jack_get_ports returns NULL, there's nothing for us to do */
|
||||
UNLESS( (jack_ports = jack_get_ports( jackApi->jack_client, "^[^:]*", JACK_PORT_TYPE_FILTER, 0 )) && jack_ports[0], paNoError );
|
||||
UNLESS( (jack_ports = jack_get_ports( jackApi->jack_client, "", JACK_PORT_TYPE_FILTER, 0 )) && jack_ports[0], paNoError );
|
||||
/* Find number of ports */
|
||||
while( jack_ports[numPorts] )
|
||||
++numPorts;
|
||||
|
@ -697,15 +508,16 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
|
|||
for( numClients = 0, port_index = 0; jack_ports[port_index] != NULL; port_index++ )
|
||||
{
|
||||
int client_seen = FALSE;
|
||||
regmatch_t match_info;
|
||||
const char *port = jack_ports[port_index];
|
||||
const char *colon;
|
||||
|
||||
/* extract the client name from the port name, using a regex
|
||||
* that parses the clientname:portname syntax */
|
||||
UNLESS( colon = strchr(port, ':'), paInternalError );
|
||||
assert(colon - port < jack_client_name_size());
|
||||
memcpy( tmp_client_name, port, colon - port );
|
||||
tmp_client_name[colon - port] = '\0';
|
||||
UNLESS( !regexec( &port_regex, port, 1, &match_info, 0 ), paInternalError );
|
||||
assert(match_info.rm_eo - match_info.rm_so < jack_client_name_size());
|
||||
memcpy( tmp_client_name, port + match_info.rm_so,
|
||||
match_info.rm_eo - match_info.rm_so );
|
||||
tmp_client_name[match_info.rm_eo - match_info.rm_so] = '\0';
|
||||
|
||||
/* do we know about this port's client yet? */
|
||||
for( i = 0; i < numClients; i++ )
|
||||
|
@ -791,7 +603,7 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
|
|||
* We don't care what they are, we just care how many */
|
||||
curDevInfo->maxInputChannels++;
|
||||
}
|
||||
jack_free(clientPorts);
|
||||
free(clientPorts);
|
||||
}
|
||||
|
||||
/* ... what are your input ports (that we could output to)? */
|
||||
|
@ -812,7 +624,7 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
|
|||
* We don't care what they are, we just care how many */
|
||||
curDevInfo->maxOutputChannels++;
|
||||
}
|
||||
jack_free(clientPorts);
|
||||
free(clientPorts);
|
||||
}
|
||||
|
||||
/* Add this client to the list of devices */
|
||||
|
@ -825,7 +637,8 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
|
|||
}
|
||||
|
||||
error:
|
||||
jack_free( jack_ports );
|
||||
regfree( &port_regex );
|
||||
free( jack_ports );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -838,7 +651,7 @@ static void UpdateSampleRate( PaJackStream *stream, double sampleRate )
|
|||
|
||||
static void JackErrorCallback( const char *msg )
|
||||
{
|
||||
if( PaJack_IsOnMainThread() )
|
||||
if( pthread_self() == mainThread_ )
|
||||
{
|
||||
assert( msg );
|
||||
jackErr_ = realloc( jackErr_, strlen( msg ) + 1 );
|
||||
|
@ -858,10 +671,11 @@ static void JackOnShutdown( void *arg )
|
|||
}
|
||||
|
||||
/* Make sure that the main thread doesn't get stuck waiting on the condition */
|
||||
PaJack_LockHostAPI( jackApi );
|
||||
ASSERT_CALL( pthread_mutex_lock( &jackApi->mtx ), 0 );
|
||||
jackApi->jackIsDown = 1;
|
||||
PaJack_SignalCommandCompleted( jackApi );
|
||||
PaJack_UnlockHostAPI( jackApi );
|
||||
ASSERT_CALL( pthread_cond_signal( &jackApi->cond ), 0 );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &jackApi->mtx ), 0 );
|
||||
|
||||
}
|
||||
|
||||
static int JackSrCb( jack_nframes_t nframes, void *arg )
|
||||
|
@ -896,20 +710,18 @@ PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi,
|
|||
PaHostApiIndex hostApiIndex )
|
||||
{
|
||||
PaError result = paNoError;
|
||||
PaJackHostApiRepresentation *jackHostApi = NULL;
|
||||
PaJackHostApiRepresentation *jackHostApi;
|
||||
int activated = 0;
|
||||
jack_status_t jackStatus = 0;
|
||||
*hostApi = NULL; /* Initialize to NULL */
|
||||
|
||||
UNLESS( PaJack_Load(), paNoError );
|
||||
|
||||
UNLESS( jackHostApi = (PaJackHostApiRepresentation*)
|
||||
PaUtil_AllocateMemory( sizeof(PaJackHostApiRepresentation) ), paInsufficientMemory );
|
||||
UNLESS( jackHostApi->deviceInfoMemory = PaUtil_CreateAllocationGroup(), paInsufficientMemory );
|
||||
|
||||
PaJack_InitMainThread();
|
||||
PaJack_InitHostApiMutex( jackHostApi );
|
||||
PaJack_InitCommandSync( jackHostApi );
|
||||
mainThread_ = pthread_self();
|
||||
ASSERT_CALL( pthread_mutex_init( &jackHostApi->mtx, NULL ), 0 );
|
||||
ASSERT_CALL( pthread_cond_init( &jackHostApi->cond, NULL ), 0 );
|
||||
|
||||
/* Try to become a client of the JACK server. If we cannot do
|
||||
* this, then this API cannot be used.
|
||||
|
@ -995,9 +807,6 @@ error:
|
|||
|
||||
PaUtil_FreeMemory( jackHostApi );
|
||||
}
|
||||
|
||||
PaJack_Unload();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1010,8 +819,8 @@ static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
|
|||
* client is not allowed to have any ports connected */
|
||||
ASSERT_CALL( jack_deactivate( jackHostApi->jack_client ), 0 );
|
||||
|
||||
PaJack_TerminateHostApiMutex( jackHostApi );
|
||||
PaJack_TerminateCommandSync( jackHostApi );
|
||||
ASSERT_CALL( pthread_mutex_destroy( &jackHostApi->mtx ), 0 );
|
||||
ASSERT_CALL( pthread_cond_destroy( &jackHostApi->cond ), 0 );
|
||||
|
||||
ASSERT_CALL( jack_client_close( jackHostApi->jack_client ), 0 );
|
||||
|
||||
|
@ -1025,8 +834,6 @@ static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
|
|||
|
||||
free( jackErr_ );
|
||||
jackErr_ = NULL;
|
||||
|
||||
PaJack_Unload();
|
||||
}
|
||||
|
||||
static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
|
||||
|
@ -1194,19 +1001,39 @@ static void CleanUpStream( PaJackStream *stream, int terminateStreamRepresentati
|
|||
PaUtil_FreeMemory( stream );
|
||||
}
|
||||
|
||||
static PaError WaitCondition( PaJackHostApiRepresentation *hostApi )
|
||||
{
|
||||
PaError result = paNoError;
|
||||
int err = 0;
|
||||
PaTime pt = PaUtil_GetTime();
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = (time_t) floor( pt + 10 * 60 /* 10 minutes */ );
|
||||
ts.tv_nsec = (long) ((pt - floor( pt )) * 1000000000);
|
||||
/* XXX: Best enclose in loop, in case of spurious wakeups? */
|
||||
err = pthread_cond_timedwait( &hostApi->cond, &hostApi->mtx, &ts );
|
||||
|
||||
/* Make sure we didn't time out */
|
||||
UNLESS( err != ETIMEDOUT, paTimedOut );
|
||||
UNLESS( !err, paInternalError );
|
||||
|
||||
error:
|
||||
return result;
|
||||
}
|
||||
|
||||
static PaError AddStream( PaJackStream *stream )
|
||||
{
|
||||
PaError result = paNoError;
|
||||
PaJackHostApiRepresentation *hostApi = stream->hostApi;
|
||||
/* Add to queue of streams that should be processed */
|
||||
PaJack_LockHostAPI( hostApi );
|
||||
ASSERT_CALL( pthread_mutex_lock( &hostApi->mtx ), 0 );
|
||||
if( !hostApi->jackIsDown )
|
||||
{
|
||||
hostApi->toAdd = stream;
|
||||
/* Unlock mutex and await signal from processing thread */
|
||||
result = WaitForCommandToComplete( stream->hostApi );
|
||||
result = WaitCondition( stream->hostApi );
|
||||
}
|
||||
PaJack_UnlockHostAPI( hostApi );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 );
|
||||
ENSURE_PA( result );
|
||||
|
||||
UNLESS( !hostApi->jackIsDown, paDeviceUnavailable );
|
||||
|
@ -1222,14 +1049,14 @@ static PaError RemoveStream( PaJackStream *stream )
|
|||
PaJackHostApiRepresentation *hostApi = stream->hostApi;
|
||||
|
||||
/* Add to queue over streams that should be processed */
|
||||
PaJack_LockHostAPI( hostApi );
|
||||
ASSERT_CALL( pthread_mutex_lock( &hostApi->mtx ), 0 );
|
||||
if( !hostApi->jackIsDown )
|
||||
{
|
||||
hostApi->toRemove = stream;
|
||||
/* Unlock mutex and await signal from processing thread */
|
||||
result = WaitForCommandToComplete( stream->hostApi );
|
||||
result = WaitCondition( stream->hostApi );
|
||||
}
|
||||
PaJack_UnlockHostAPI( hostApi );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 );
|
||||
ENSURE_PA( result );
|
||||
|
||||
error:
|
||||
|
@ -1342,7 +1169,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
stream->isBlockingStream = !streamCallback;
|
||||
if( stream->isBlockingStream )
|
||||
{
|
||||
PaTime latency = 0.001f; /* 1ms is the absolute minimum we support */
|
||||
float latency = 0.001; /* 1ms is the absolute minimum we support */
|
||||
int minimum_buffer_frames = 0;
|
||||
|
||||
if( inputParameters && inputParameters->suggestedLatency > latency )
|
||||
|
@ -1422,7 +1249,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
break;
|
||||
}
|
||||
}
|
||||
jack_free( jack_ports );
|
||||
free( jack_ports );
|
||||
UNLESS( !err, paInsufficientMemory );
|
||||
|
||||
/* Fewer ports than expected? */
|
||||
|
@ -1446,7 +1273,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
break;
|
||||
}
|
||||
}
|
||||
jack_free( jack_ports );
|
||||
free( jack_ports );
|
||||
UNLESS( !err , paInsufficientMemory );
|
||||
|
||||
/* Fewer ports than expected? */
|
||||
|
@ -1600,9 +1427,9 @@ static PaError UpdateQueue( PaJackHostApiRepresentation *hostApi )
|
|||
const double jackSr = jack_get_sample_rate( hostApi->jack_client );
|
||||
int err;
|
||||
|
||||
if( (err = PaJack_TryLockHostAPI( hostApi )) != 0 )
|
||||
if( (err = pthread_mutex_trylock( &hostApi->mtx )) != 0 )
|
||||
{
|
||||
assert( err );
|
||||
assert( err == EBUSY );
|
||||
return paNoError;
|
||||
}
|
||||
|
||||
|
@ -1661,11 +1488,11 @@ static PaError UpdateQueue( PaJackHostApiRepresentation *hostApi )
|
|||
if( queueModified )
|
||||
{
|
||||
/* Signal that we've done what was asked of us */
|
||||
PaJack_SignalCommandCompleted( hostApi );
|
||||
ASSERT_CALL( pthread_cond_signal( &hostApi->cond ), 0 );
|
||||
}
|
||||
|
||||
error:
|
||||
PaJack_UnlockHostAPI( hostApi );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -1694,7 +1521,7 @@ static int JackCallback( jack_nframes_t frames, void *userData )
|
|||
if( stream->doStart )
|
||||
{
|
||||
/* If we can't obtain a lock, we'll try next time */
|
||||
int err = PaJack_TryLockHostAPI( stream->hostApi );
|
||||
int err = pthread_mutex_trylock( &stream->hostApi->mtx );
|
||||
if( !err )
|
||||
{
|
||||
if( stream->doStart ) /* Could potentially change before obtaining the lock */
|
||||
|
@ -1702,12 +1529,12 @@ static int JackCallback( jack_nframes_t frames, void *userData )
|
|||
stream->is_active = 1;
|
||||
stream->doStart = 0;
|
||||
PA_DEBUG(( "%s: Starting stream\n", __FUNCTION__ ));
|
||||
PaJack_SignalCommandCompleted( hostApi );
|
||||
ASSERT_CALL( pthread_cond_signal( &stream->hostApi->cond ), 0 );
|
||||
stream->callbackResult = paContinue;
|
||||
stream->isSilenced = 0;
|
||||
}
|
||||
|
||||
PaJack_UnlockHostAPI( stream->hostApi );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 );
|
||||
}
|
||||
else
|
||||
assert( err == EBUSY );
|
||||
|
@ -1745,15 +1572,15 @@ static int JackCallback( jack_nframes_t frames, void *userData )
|
|||
if( !stream->is_active ) /* Ok, signal to the main thread that we've carried out the operation */
|
||||
{
|
||||
/* If we can't obtain a lock, we'll try next time */
|
||||
int err = PaJack_TryLockHostAPI( stream->hostApi );
|
||||
int err = pthread_mutex_trylock( &stream->hostApi->mtx );
|
||||
if( !err )
|
||||
{
|
||||
stream->doStop = stream->doAbort = 0;
|
||||
PaJack_SignalCommandCompleted( stream->hostApi );
|
||||
PaJack_UnlockHostAPI( stream->hostApi );
|
||||
ASSERT_CALL( pthread_cond_signal( &stream->hostApi->cond ), 0 );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 );
|
||||
}
|
||||
else
|
||||
assert( err );
|
||||
assert( err == EBUSY );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1799,11 +1626,11 @@ static PaError StartStream( PaStream *s )
|
|||
|
||||
/* Enable processing */
|
||||
|
||||
PaJack_LockHostAPI( stream->hostApi );
|
||||
ASSERT_CALL( pthread_mutex_lock( &stream->hostApi->mtx ), 0 );
|
||||
stream->doStart = 1;
|
||||
|
||||
/* Wait for stream to be started */
|
||||
result = WaitForCommandToComplete( stream->hostApi );
|
||||
result = WaitCondition( stream->hostApi );
|
||||
/*
|
||||
do
|
||||
{
|
||||
|
@ -1815,7 +1642,7 @@ static PaError StartStream( PaStream *s )
|
|||
stream->doStart = 0;
|
||||
stream->is_active = 0; /* Cancel any processing */
|
||||
}
|
||||
PaJack_UnlockHostAPI( stream->hostApi );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 );
|
||||
|
||||
ENSURE_PA( result );
|
||||
|
||||
|
@ -1834,15 +1661,15 @@ static PaError RealStop( PaJackStream *stream, int abort )
|
|||
if( stream->isBlockingStream )
|
||||
BlockingWaitEmpty ( stream );
|
||||
|
||||
PaJack_LockHostAPI( stream->hostApi );
|
||||
ASSERT_CALL( pthread_mutex_lock( &stream->hostApi->mtx ), 0 );
|
||||
if( abort )
|
||||
stream->doAbort = 1;
|
||||
else
|
||||
stream->doStop = 1;
|
||||
|
||||
/* Wait for stream to be stopped */
|
||||
result = WaitForCommandToComplete( stream->hostApi );
|
||||
PaJack_UnlockHostAPI( stream->hostApi );
|
||||
result = WaitCondition( stream->hostApi );
|
||||
ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 );
|
||||
ENSURE_PA( result );
|
||||
|
||||
UNLESS( !stream->is_active, paInternalError );
|
||||
|
|
|
@ -1,162 +0,0 @@
|
|||
/*
|
||||
* $Id: pa_jack.c 1668 2011-05-02 17:07:11Z rossb $
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* Latest Version at: http://www.portaudio.com
|
||||
* JACK Implementation by Joshua Haberman
|
||||
*
|
||||
* Copyright (c) 2004 Stefan Westerfeld <stefan@space.twc.de>
|
||||
* Copyright (c) 2004 Arve Knudsen <aknuds-1@broadpark.no>
|
||||
* Copyright (c) 2002 Joshua Haberman <joshua@haberman.com>
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
* Copyright (c) 1999-2002 Ross Bencina, 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 hostapi_src
|
||||
*/
|
||||
|
||||
#define PADL_DEFINE_POINTERS
|
||||
#include "pa_dynload.h"
|
||||
#include "pa_jack_dynload.h"
|
||||
|
||||
#if defined(PA_DYNAMIC_JACK)
|
||||
static paDynamicLib jacklib = NULL;
|
||||
#endif
|
||||
|
||||
int PaJack_Load(void)
|
||||
{
|
||||
#if !defined(PA_DYNAMIC_JACK)
|
||||
return 1;
|
||||
#else
|
||||
|
||||
#if defined(__APPLE__)
|
||||
jacklib = PaDL_Load("libjack.dylib");
|
||||
#elif defined(_WIN64)
|
||||
jacklib = PaDL_Load("libjack64.dll");
|
||||
#elif defined(WIN32)
|
||||
jacklib = PaDL_Load("libjack.dll");
|
||||
#else
|
||||
jacklib = PaDL_Load("libjack.so");
|
||||
#endif
|
||||
|
||||
if (!jacklib) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PADL_FINDSYMBOL(jacklib, jack_client_name_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_client_name_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_ports, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_sample_rate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_ports, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_by_name, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_latency, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_free, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_ports, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_by_name, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_latency, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_free, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_client_open, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_on_shutdown, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_set_error_function, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_buffer_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_set_sample_rate_callback, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_set_xrun_callback, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_set_process_callback, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_activate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_deactivate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_client_close, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_deactivate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_client_close, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_sample_rate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_unregister, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_unregister, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_name_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_client_name_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_sample_rate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_sample_rate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_name_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_register, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_name_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_register, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_ports, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_by_name, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_free, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_ports, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_by_name, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_free, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_latency, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_buffer_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_latency, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_buffer_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_frame_time, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_sample_rate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_frame_time, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_latency, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_latency, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_buffer, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_buffer, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_sample_rate, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_get_buffer, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_connect, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_name, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_connect, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_name, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_connected, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_disconnect, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_connected, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_port_disconnect, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_frame_time, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_client_name_size, goto error);
|
||||
PADL_FINDSYMBOL(jacklib, jack_get_client_name, goto error);
|
||||
|
||||
return 1;
|
||||
|
||||
error:
|
||||
|
||||
PaJack_Unload();
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void PaJack_Unload(void)
|
||||
{
|
||||
#if defined(PA_DYNAMIC_JACK)
|
||||
if (jacklib) {
|
||||
PaDL_Unload(jacklib);
|
||||
jacklib = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -1,224 +0,0 @@
|
|||
/*
|
||||
* $Id: pa_jack.c 1668 2011-05-02 17:07:11Z rossb $
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* Latest Version at: http://www.portaudio.com
|
||||
* JACK Implementation by Joshua Haberman
|
||||
*
|
||||
* Copyright (c) 2004 Stefan Westerfeld <stefan@space.twc.de>
|
||||
* Copyright (c) 2004 Arve Knudsen <aknuds-1@broadpark.no>
|
||||
* Copyright (c) 2002 Joshua Haberman <joshua@haberman.com>
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
* Copyright (c) 1999-2002 Ross Bencina, 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 hostapi_src
|
||||
*/
|
||||
#ifndef INCLUDED_PA_JACK_DYNLINK_H
|
||||
#define INCLUDED_PA_JACK_DYNLINK_H
|
||||
|
||||
#include <jack/jack.h>
|
||||
|
||||
#include "pa_dynload.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if defined(PA_DYNAMIC_JACK)
|
||||
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_activate,
|
||||
(jack_client_t *client),
|
||||
(client)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_client_close,
|
||||
(jack_client_t *client),
|
||||
(client)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_client_name_size,
|
||||
(void),
|
||||
()
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
jack_client_t *,
|
||||
jack_client_open,
|
||||
(const char *client_name, jack_options_t options, jack_status_t *status, ...),
|
||||
(client_name, options, status)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_connect,
|
||||
(jack_client_t *client, const char *source_port, const char *destination_port),
|
||||
(client, source_port, destination_port)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_deactivate,
|
||||
(jack_client_t *client),
|
||||
(client)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
jack_nframes_t,
|
||||
jack_frame_time,
|
||||
(const jack_client_t *client),
|
||||
(client)
|
||||
);
|
||||
PADL_FUNC_NO_RETURN(
|
||||
jack_free,
|
||||
(void *ptr),
|
||||
(ptr)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
jack_nframes_t,
|
||||
jack_get_buffer_size,
|
||||
(jack_client_t *client),
|
||||
(client)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
char *,
|
||||
jack_get_client_name,
|
||||
(jack_client_t *client),
|
||||
(client)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
const char **,
|
||||
jack_get_ports,
|
||||
(jack_client_t *client, const char *port_name_pattern, const char *type_name_pattern, unsigned long flags),
|
||||
(client, port_name_pattern, type_name_pattern, flags)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
jack_nframes_t,
|
||||
jack_get_sample_rate,
|
||||
(jack_client_t *client),
|
||||
(client)
|
||||
);
|
||||
PADL_FUNC_NO_RETURN(
|
||||
jack_on_shutdown,
|
||||
(jack_client_t *client, JackShutdownCallback shutdown_callback, void *arg),
|
||||
(client, shutdown_callback, arg)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
jack_port_t *,
|
||||
jack_port_by_name,
|
||||
(jack_client_t *client, const char *port_name),
|
||||
(client, port_name)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_port_connected,
|
||||
(const jack_port_t *port),
|
||||
(port)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_port_disconnect,
|
||||
(jack_client_t *client, jack_port_t *port),
|
||||
(client, port)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
void *,
|
||||
jack_port_get_buffer,
|
||||
(jack_port_t *port, jack_nframes_t frames),
|
||||
(port, frames)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
jack_nframes_t,
|
||||
jack_port_get_latency,
|
||||
(jack_port_t *port),
|
||||
(port)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
const char *,
|
||||
jack_port_name,
|
||||
(const jack_port_t *port),
|
||||
(port)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_port_name_size,
|
||||
(void),
|
||||
()
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
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),
|
||||
(client, port_name, port_type, flags, buffer_size)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_port_unregister,
|
||||
(jack_client_t *client, jack_port_t *port),
|
||||
(client, port)
|
||||
);
|
||||
PADL_FUNC_NO_RETURN(
|
||||
jack_set_error_function,
|
||||
(void (*func)(const char *)),
|
||||
(func)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_set_process_callback,
|
||||
(jack_client_t *client, JackProcessCallback process_callback, void *arg),
|
||||
(client, process_callback, arg)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_set_sample_rate_callback,
|
||||
(jack_client_t *client, JackSampleRateCallback srate_callback, void *arg),
|
||||
(client, srate_callback, arg)
|
||||
);
|
||||
PADL_FUNC_WITH_RETURN(
|
||||
int,
|
||||
jack_set_xrun_callback,
|
||||
(jack_client_t *client, JackXRunCallback xrun_callback, void *arg),
|
||||
(client, xrun_callback, arg)
|
||||
);
|
||||
#endif /* PA_DYNAMIC_JACK */
|
||||
|
||||
int PaJack_Load(void);
|
||||
void PaJack_Unload(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* INCLUDED_PA_JACK_DYNLINK_H */
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_unix_oss.c 1894 2013-06-08 19:30:41Z gineera $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* Latest Version at: http://www.portaudio.com
|
||||
* OSS implementation by:
|
||||
|
@ -2043,26 +2043,3 @@ 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;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_hostapi_skeleton.c 1668 2011-05-02 17:07:11Z rossb $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library skeleton implementation
|
||||
* demonstrates how to use the common functions to implement support
|
||||
* for a host API
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
//
|
||||
// AudioSessionTypes.h -- Copyright Microsoft Corporation, All Rights Reserved.
|
||||
//
|
||||
// Description: Type definitions used by the audio session manager RPC/COM interfaces
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#ifndef __AUDIOSESSIONTYPES__
|
||||
#define __AUDIOSESSIONTYPES__
|
||||
|
||||
#if defined(__midl)
|
||||
#define MIDL_SIZE_IS(x) [size_is(x)]
|
||||
#define MIDL_STRING [string]
|
||||
#define MIDL_ANYSIZE_ARRAY
|
||||
#else // !defined(__midl)
|
||||
#define MIDL_SIZE_IS(x)
|
||||
#define MIDL_STRING
|
||||
#define MIDL_ANYSIZE_ARRAY ANYSIZE_ARRAY
|
||||
#endif // defined(__midl)
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Description: AudioClient share mode
|
||||
//
|
||||
// AUDCLNT_SHAREMODE_SHARED - The device will be opened in shared mode and use the
|
||||
// WAS format.
|
||||
// AUDCLNT_SHAREMODE_EXCLUSIVE - The device will be opened in exclusive mode and use the
|
||||
// application specified format.
|
||||
//
|
||||
typedef enum _AUDCLNT_SHAREMODE
|
||||
{
|
||||
AUDCLNT_SHAREMODE_SHARED,
|
||||
AUDCLNT_SHAREMODE_EXCLUSIVE
|
||||
} AUDCLNT_SHAREMODE;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Description: AudioClient stream flags
|
||||
//
|
||||
// Can be a combination of AUDCLNT_STREAMFLAGS and AUDCLNT_SYSFXFLAGS:
|
||||
//
|
||||
// AUDCLNT_STREAMFLAGS (this group of flags uses the high word, w/exception of high-bit which is reserved, 0x7FFF0000):
|
||||
//
|
||||
// AUDCLNT_STREAMFLAGS_CROSSPROCESS - Audio policy control for this stream will be shared with
|
||||
// with other process sessions that use the same audio session
|
||||
// GUID.
|
||||
// AUDCLNT_STREAMFLAGS_LOOPBACK - Initializes a renderer endpoint for a loopback audio application.
|
||||
// In this mode, a capture stream will be opened on the specified
|
||||
// renderer endpoint. Shared mode and a renderer endpoint is required.
|
||||
// Otherwise the IAudioClient::Initialize call will fail. If the
|
||||
// initialize is successful, a capture stream will be available
|
||||
// from the IAudioClient object.
|
||||
//
|
||||
// AUDCLNT_STREAMFLAGS_EVENTCALLBACK - An exclusive mode client will supply an event handle that will be
|
||||
// signaled when an IRP completes (or a waveRT buffer completes) telling
|
||||
// it to fill the next buffer
|
||||
//
|
||||
// AUDCLNT_STREAMFLAGS_NOPERSIST - Session state will not be persisted
|
||||
//
|
||||
// AUDCLNT_SYSFXFLAGS (these flags use low word 0x0000FFFF):
|
||||
//
|
||||
// none defined currently
|
||||
//
|
||||
#define AUDCLNT_STREAMFLAGS_CROSSPROCESS 0x00010000
|
||||
#define AUDCLNT_STREAMFLAGS_LOOPBACK 0x00020000
|
||||
#define AUDCLNT_STREAMFLAGS_EVENTCALLBACK 0x00040000
|
||||
#define AUDCLNT_STREAMFLAGS_NOPERSIST 0x00080000
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Description: Device share mode - sharing mode for the audio device.
|
||||
//
|
||||
// DeviceShared - The device can be shared with other processes.
|
||||
// DeviceExclusive - The device will only be used by this process.
|
||||
//
|
||||
typedef enum _DeviceShareMode
|
||||
{
|
||||
DeviceShared,
|
||||
DeviceExclusive
|
||||
} DeviceShareMode;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Description: AudioSession State.
|
||||
//
|
||||
// AudioSessionStateInactive - The session has no active audio streams.
|
||||
// AudioSessionStateActive - The session has active audio streams.
|
||||
// AudioSessionStateExpired - The session is dormant.
|
||||
typedef enum _AudioSessionState
|
||||
{
|
||||
AudioSessionStateInactive = 0,
|
||||
AudioSessionStateActive = 1,
|
||||
AudioSessionStateExpired = 2
|
||||
} AudioSessionState;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,186 +0,0 @@
|
|||
|
||||
/*++
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
|
||||
devpkey.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Defines property keys for the Plug and Play Device Property API.
|
||||
|
||||
Author:
|
||||
|
||||
Jim Cavalaris (jamesca) 10-14-2003
|
||||
|
||||
Environment:
|
||||
|
||||
User-mode only.
|
||||
|
||||
Revision History:
|
||||
|
||||
14-October-2003 jamesca
|
||||
|
||||
Creation and initial implementation.
|
||||
|
||||
20-June-2006 dougb
|
||||
|
||||
Copied Jim's version replaced "DEFINE_DEVPROPKEY(DEVPKEY_" with "DEFINE_PROPERTYKEY(PKEY_"
|
||||
|
||||
--*/
|
||||
|
||||
//#include <devpropdef.h>
|
||||
|
||||
//
|
||||
// _NAME
|
||||
//
|
||||
|
||||
DEFINE_PROPERTYKEY(PKEY_NAME, 0xb725f130, 0x47ef, 0x101a, 0xa5, 0xf1, 0x02, 0x60, 0x8c, 0x9e, 0xeb, 0xac, 10); // DEVPROP_TYPE_STRING
|
||||
|
||||
//
|
||||
// Device properties
|
||||
// These PKEYs correspond to the old setupapi SPDRP_XXX properties
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DeviceDesc, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 2); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_HardwareIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 3); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_CompatibleIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 4); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Service, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 6); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Class, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 9); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_ClassGuid, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 10); // DEVPROP_TYPE_GUID
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Driver, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 11); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_ConfigFlags, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 12); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Manufacturer, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 13); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_LocationInfo, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 15); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_PDOName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 16); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Capabilities, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 17); // DEVPROP_TYPE_UNINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_UINumber, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 18); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_UpperFilters, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 19); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_LowerFilters, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 20); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_BusTypeGuid, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 21); // DEVPROP_TYPE_GUID
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_LegacyBusType, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 22); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_BusNumber, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 23); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_EnumeratorName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 24); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Security, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 25); // DEVPROP_TYPE_SECURITY_DESCRIPTOR
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_SecuritySDS, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 26); // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DevType, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 27); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Exclusive, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 28); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Characteristics, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 29); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Address, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 30); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_UINumberDescFormat, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 31); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_PowerData, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 32); // DEVPROP_TYPE_BINARY
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicy, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 33); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicyDefault, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 34); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicyOverride, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 35); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_InstallState, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 36); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_LocationPaths, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 37); // DEVPROP_TYPE_STRING_LIST
|
||||
|
||||
//
|
||||
// Device properties
|
||||
// These PKEYs correspond to a device's status and problem code
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DevNodeStatus, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 2); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_ProblemCode, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 3); // DEVPROP_TYPE_UINT32
|
||||
|
||||
//
|
||||
// Device properties
|
||||
// These PKEYs correspond to device relations
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_EjectionRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 4); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_RemovalRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 5); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_PowerRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 6); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_BusRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 7); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Parent, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 8); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Children, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 9); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Siblings, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 10); // DEVPROP_TYPE_STRING_LIST
|
||||
|
||||
//
|
||||
// Other Device properties
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Reported, 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 2); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_Legacy, 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 3); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_InstanceId, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 256); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Numa_Proximity_Domain, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 1); // DEVPROP_TYPE_UINT32
|
||||
|
||||
//
|
||||
// Device driver properties
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 2); // DEVPROP_TYPE_FILETIME
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverDesc, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 4); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverInfPath, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 5); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverInfSection, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 6); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverInfSectionExt, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 7); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_MatchingDeviceId, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 8); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverProvider, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 9); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverPropPageProvider, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 10); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverCoInstallers, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 11); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_ResourcePickerTags, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 12); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_ResourcePickerExceptions, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 13); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverRank, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 14); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_DriverLogoLevel, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 15); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_NoConnectSound, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 17); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_GenericDriverInstalled, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 18); // DEVPROP_TYPE_BOOLEAN
|
||||
|
||||
|
||||
//
|
||||
// Device properties that were set by the driver package that was installed
|
||||
// on the device.
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_DrvPkg_Model, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 2); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DrvPkg_VendorWebSite, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 3); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DrvPkg_DetailedDescription, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 4); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DrvPkg_DocumentationLink, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 5); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DrvPkg_Icon, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 6); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_DrvPkg_BrandingIcon, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 7); // DEVPROP_TYPE_STRING_LIST
|
||||
|
||||
//
|
||||
// Device setup class properties
|
||||
// These PKEYs correspond to the old setupapi SPCRP_XXX properties
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_UpperFilters, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 19); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_LowerFilters, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 20); // DEVPROP_TYPE_STRING_LIST
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Security, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 25); // DEVPROP_TYPE_SECURITY_DESCRIPTOR
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_SecuritySDS, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 26); // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_DevType, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 27); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Exclusive, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 28); // DEVPROP_TYPE_UINT32
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Characteristics, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 29); // DEVPROP_TYPE_UINT32
|
||||
|
||||
//
|
||||
// Device setup class properties
|
||||
// These PKEYs correspond to registry values under the device class GUID key
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Name, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 2); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassName, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 3); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Icon, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 4); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassInstaller, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 5); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_PropPageProvider, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 6); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoInstallClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 7); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoDisplayClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 8); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_SilentInstall, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 9); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoUseClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 10); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_DefaultService, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 11); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_IconPath, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 12); // DEVPROP_TYPE_STRING_LIST
|
||||
|
||||
//
|
||||
// Other Device setup class properties
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassCoInstallers, 0x713d1703, 0xa2e2, 0x49f5, 0x92, 0x14, 0x56, 0x47, 0x2e, 0xf3, 0xda, 0x5c, 2); // DEVPROP_TYPE_STRING_LIST
|
||||
|
||||
//
|
||||
// Device interface properties
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceInterface_FriendlyName, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 2); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceInterface_Enabled, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 3); // DEVPROP_TYPE_BOOLEAN
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceInterface_ClassGuid, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 4); // DEVPROP_TYPE_GUID
|
||||
|
||||
//
|
||||
// Device interface class properties
|
||||
//
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceInterfaceClass_DefaultInterface, 0x14c83a99, 0x0b3f, 0x44b7, 0xbe, 0x4c, 0xa1, 0x78, 0xd3, 0x99, 0x05, 0x64, 2); // DEVPROP_TYPE_STRING
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,225 +0,0 @@
|
|||
/*
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
|
||||
sdkddkver.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Master include file for versioning windows SDK/DDK.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _INC_SDKDDKVER
|
||||
#define _INC_SDKDDKVER
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// _WIN32_WINNT version constants
|
||||
//
|
||||
#define _WIN32_WINNT_NT4 0x0400
|
||||
#define _WIN32_WINNT_WIN2K 0x0500
|
||||
#define _WIN32_WINNT_WINXP 0x0501
|
||||
#define _WIN32_WINNT_WS03 0x0502
|
||||
#define _WIN32_WINNT_LONGHORN 0x0600
|
||||
|
||||
//
|
||||
// _WIN32_IE_ version constants
|
||||
//
|
||||
#define _WIN32_IE_IE20 0x0200
|
||||
#define _WIN32_IE_IE30 0x0300
|
||||
#define _WIN32_IE_IE302 0x0302
|
||||
#define _WIN32_IE_IE40 0x0400
|
||||
#define _WIN32_IE_IE401 0x0401
|
||||
#define _WIN32_IE_IE50 0x0500
|
||||
#define _WIN32_IE_IE501 0x0501
|
||||
#define _WIN32_IE_IE55 0x0550
|
||||
#define _WIN32_IE_IE60 0x0600
|
||||
#define _WIN32_IE_IE60SP1 0x0601
|
||||
#define _WIN32_IE_IE60SP2 0x0603
|
||||
#define _WIN32_IE_IE70 0x0700
|
||||
|
||||
//
|
||||
// IE <-> OS version mapping
|
||||
//
|
||||
// NT4 supports IE versions 2.0 -> 6.0 SP1
|
||||
#define _WIN32_IE_NT4 _WIN32_IE_IE20
|
||||
#define _WIN32_IE_NT4SP1 _WIN32_IE_IE20
|
||||
#define _WIN32_IE_NT4SP2 _WIN32_IE_IE20
|
||||
#define _WIN32_IE_NT4SP3 _WIN32_IE_IE302
|
||||
#define _WIN32_IE_NT4SP4 _WIN32_IE_IE401
|
||||
#define _WIN32_IE_NT4SP5 _WIN32_IE_IE401
|
||||
#define _WIN32_IE_NT4SP6 _WIN32_IE_IE50
|
||||
// Win98 supports IE versions 4.01 -> 6.0 SP1
|
||||
#define _WIN32_IE_WIN98 _WIN32_IE_IE401
|
||||
// Win98SE supports IE versions 5.0 -> 6.0 SP1
|
||||
#define _WIN32_IE_WIN98SE _WIN32_IE_IE50
|
||||
// WinME supports IE versions 5.5 -> 6.0 SP1
|
||||
#define _WIN32_IE_WINME _WIN32_IE_IE55
|
||||
// Win2k supports IE versions 5.01 -> 6.0 SP1
|
||||
#define _WIN32_IE_WIN2K _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP1 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP2 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP3 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP4 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_XP _WIN32_IE_IE60
|
||||
#define _WIN32_IE_XPSP1 _WIN32_IE_IE60SP1
|
||||
#define _WIN32_IE_XPSP2 _WIN32_IE_IE60SP2
|
||||
#define _WIN32_IE_WS03 0x0602
|
||||
#define _WIN32_IE_WS03SP1 _WIN32_IE_IE60SP2
|
||||
#define _WIN32_IE_LONGHORN _WIN32_IE_IE70
|
||||
|
||||
|
||||
//
|
||||
// NTDDI version constants
|
||||
//
|
||||
#define NTDDI_WIN2K 0x05000000
|
||||
#define NTDDI_WIN2KSP1 0x05000100
|
||||
#define NTDDI_WIN2KSP2 0x05000200
|
||||
#define NTDDI_WIN2KSP3 0x05000300
|
||||
#define NTDDI_WIN2KSP4 0x05000400
|
||||
|
||||
#define NTDDI_WINXP 0x05010000
|
||||
#define NTDDI_WINXPSP1 0x05010100
|
||||
#define NTDDI_WINXPSP2 0x05010200
|
||||
|
||||
#define NTDDI_WS03 0x05020000
|
||||
#define NTDDI_WS03SP1 0x05020100
|
||||
|
||||
#define NTDDI_LONGHORN 0x06000000
|
||||
|
||||
//
|
||||
// masks for version macros
|
||||
//
|
||||
#define OSVERSION_MASK 0xFFFF0000
|
||||
#define SPVERSION_MASK 0x0000FF00
|
||||
#define SUBVERSION_MASK 0x000000FF
|
||||
|
||||
|
||||
//
|
||||
// macros to extract various version fields from the NTDDI version
|
||||
//
|
||||
#define OSVER(Version) ((Version) & OSVERSION_MASK)
|
||||
#define SPVER(Version) (((Version) & SPVERSION_MASK) >> 8)
|
||||
#define SUBVER(Version) (((Version) & SUBVERSION_MASK) )
|
||||
|
||||
|
||||
#if defined(DECLSPEC_DEPRECATED_DDK)
|
||||
|
||||
// deprecate in 2k or later
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2K DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2K
|
||||
#endif
|
||||
|
||||
// deprecate in XP or later
|
||||
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
||||
#define DECLSPEC_DEPRECATED_DDK_WINXP DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_WINXP
|
||||
#endif
|
||||
|
||||
// deprecate in WS03 or later
|
||||
#if (NTDDI_VERSION >= NTDDI_WS03)
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2003 DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2003
|
||||
#endif
|
||||
|
||||
// deprecate in WS03 or later
|
||||
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
|
||||
#define DECLSPEC_DEPRECATED_DDK_LONGHORN DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_LONGHORN
|
||||
#endif
|
||||
|
||||
#endif // defined(DECLSPEC_DEPRECATED_DDK)
|
||||
|
||||
|
||||
//
|
||||
// if versions aren't already defined, default to most current
|
||||
//
|
||||
|
||||
#define NTDDI_VERSION_FROM_WIN32_WINNT2(ver) ver##0000
|
||||
#define NTDDI_VERSION_FROM_WIN32_WINNT(ver) NTDDI_VERSION_FROM_WIN32_WINNT2(ver)
|
||||
|
||||
#if !defined(_WIN32_WINNT) && !defined(_CHICAGO_)
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif
|
||||
|
||||
#ifndef NTDDI_VERSION
|
||||
#ifdef _WIN32_WINNT
|
||||
// set NTDDI_VERSION based on _WIN32_WINNT
|
||||
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
|
||||
#else
|
||||
#define NTDDI_VERSION 0x06000000
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef WINVER
|
||||
#ifdef _WIN32_WINNT
|
||||
// set WINVER based on _WIN32_WINNT
|
||||
#define WINVER _WIN32_WINNT
|
||||
#else
|
||||
#define WINVER 0x0600
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_IE
|
||||
#ifdef _WIN32_WINNT
|
||||
// set _WIN32_IE based on _WIN32_WINNT
|
||||
#if (_WIN32_WINNT <= _WIN32_WINNT_NT4)
|
||||
#define _WIN32_IE _WIN32_IE_IE50
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WIN2K)
|
||||
#define _WIN32_IE _WIN32_IE_IE501
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WINXP)
|
||||
#define _WIN32_IE _WIN32_IE_IE60
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WS03)
|
||||
#define _WIN32_IE 0x0602
|
||||
#else
|
||||
#define _WIN32_IE 0x0700
|
||||
#endif
|
||||
#else
|
||||
#define _WIN32_IE 0x0700
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Sanity check for compatible versions
|
||||
//
|
||||
#if defined(_WIN32_WINNT) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
|
||||
|
||||
#if (defined(WINVER) && (WINVER < 0x0400) && (_WIN32_WINNT > 0x0400))
|
||||
#error WINVER setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WIN2K) && (_WIN32_WINNT != _WIN32_WINNT_WIN2K))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WINXP) && (_WIN32_WINNT != _WIN32_WINNT_WINXP))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WS03) && (_WIN32_WINNT != _WIN32_WINNT_WS03))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_LONGHORN) && (_WIN32_WINNT != _WIN32_WINNT_LONGHORN))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if ((_WIN32_WINNT < _WIN32_WINNT_WIN2K) && (_WIN32_IE > _WIN32_IE_IE60SP1))
|
||||
#error _WIN32_WINNT settings conflicts with _WIN32_IE setting
|
||||
#endif
|
||||
|
||||
#endif // defined(_WIN32_WINNT) && !defined(MIDL_PASS) && !defined(_WINRESRC_)
|
||||
|
||||
|
||||
#endif // !_INC_SDKDDKVER
|
||||
|
||||
|
|
@ -1,468 +0,0 @@
|
|||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 7.00.0499 */
|
||||
/* Compiler settings for shtypes.idl:
|
||||
Oicf, W1, Zp8, env=Win32 (32b run)
|
||||
protocol : dce , ms_ext, c_ext, robust
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
VC __declspec() decoration level:
|
||||
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
|
||||
DECLSPEC_UUID(), MIDL_INTERFACE()
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
|
||||
#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#define __REQUIRED_RPCSAL_H_VERSION__ 100
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
|
||||
#ifndef __shtypes_h__
|
||||
#define __shtypes_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
/* header files for imported files */
|
||||
#include "wtypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
/* interface __MIDL_itf_shtypes_0000_0000 */
|
||||
/* [local] */
|
||||
|
||||
//+-------------------------------------------------------------------------
|
||||
//
|
||||
// Microsoft Windows
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
//===========================================================================
|
||||
//
|
||||
// Object identifiers in the explorer's name space (ItemID and IDList)
|
||||
//
|
||||
// All the items that the user can browse with the explorer (such as files,
|
||||
// directories, servers, work-groups, etc.) has an identifier which is unique
|
||||
// among items within the parent folder. Those identifiers are called item
|
||||
// IDs (SHITEMID). Since all its parent folders have their own item IDs,
|
||||
// any items can be uniquely identified by a list of item IDs, which is called
|
||||
// an ID list (ITEMIDLIST).
|
||||
//
|
||||
// ID lists are almost always allocated by the task allocator (see some
|
||||
// description below as well as OLE 2.0 SDK) and may be passed across
|
||||
// some of shell interfaces (such as IShellFolder). Each item ID in an ID list
|
||||
// is only meaningful to its parent folder (which has generated it), and all
|
||||
// the clients must treat it as an opaque binary data except the first two
|
||||
// bytes, which indicates the size of the item ID.
|
||||
//
|
||||
// When a shell extension -- which implements the IShellFolder interace --
|
||||
// generates an item ID, it may put any information in it, not only the data
|
||||
// with that it needs to identifies the item, but also some additional
|
||||
// information, which would help implementing some other functions efficiently.
|
||||
// For example, the shell's IShellFolder implementation of file system items
|
||||
// stores the primary (long) name of a file or a directory as the item
|
||||
// identifier, but it also stores its alternative (short) name, size and date
|
||||
// etc.
|
||||
//
|
||||
// When an ID list is passed to one of shell APIs (such as SHGetPathFromIDList),
|
||||
// it is always an absolute path -- relative from the root of the name space,
|
||||
// which is the desktop folder. When an ID list is passed to one of IShellFolder
|
||||
// member function, it is always a relative path from the folder (unless it
|
||||
// is explicitly specified).
|
||||
//
|
||||
//===========================================================================
|
||||
//
|
||||
// SHITEMID -- Item ID (mkid)
|
||||
// USHORT cb; // Size of the ID (including cb itself)
|
||||
// BYTE abID[]; // The item ID (variable length)
|
||||
//
|
||||
#include <pshpack1.h>
|
||||
typedef struct _SHITEMID
|
||||
{
|
||||
USHORT cb;
|
||||
BYTE abID[ 1 ];
|
||||
} SHITEMID;
|
||||
|
||||
#include <poppack.h>
|
||||
#if defined(_M_IX86)
|
||||
#define __unaligned
|
||||
#endif // __unaligned
|
||||
typedef SHITEMID __unaligned *LPSHITEMID;
|
||||
|
||||
typedef const SHITEMID __unaligned *LPCSHITEMID;
|
||||
|
||||
//
|
||||
// ITEMIDLIST -- List if item IDs (combined with 0-terminator)
|
||||
//
|
||||
#include <pshpack1.h>
|
||||
typedef struct _ITEMIDLIST
|
||||
{
|
||||
SHITEMID mkid;
|
||||
} ITEMIDLIST;
|
||||
|
||||
#if defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)
|
||||
typedef struct _ITEMIDLIST_RELATIVE : ITEMIDLIST {} ITEMIDLIST_RELATIVE;
|
||||
typedef struct _ITEMID_CHILD : ITEMIDLIST_RELATIVE {} ITEMID_CHILD;
|
||||
typedef struct _ITEMIDLIST_ABSOLUTE : ITEMIDLIST_RELATIVE {} ITEMIDLIST_ABSOLUTE;
|
||||
#else // !(defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus))
|
||||
typedef ITEMIDLIST ITEMIDLIST_RELATIVE;
|
||||
|
||||
typedef ITEMIDLIST ITEMID_CHILD;
|
||||
|
||||
typedef ITEMIDLIST ITEMIDLIST_ABSOLUTE;
|
||||
|
||||
#endif // defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)
|
||||
#include <poppack.h>
|
||||
typedef /* [unique] */ __RPC_unique_pointer BYTE_BLOB *wirePIDL;
|
||||
|
||||
typedef /* [wire_marshal] */ ITEMIDLIST __unaligned *LPITEMIDLIST;
|
||||
|
||||
typedef /* [wire_marshal] */ const ITEMIDLIST __unaligned *LPCITEMIDLIST;
|
||||
|
||||
#if defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)
|
||||
typedef /* [wire_marshal] */ ITEMIDLIST_ABSOLUTE *PIDLIST_ABSOLUTE;
|
||||
|
||||
typedef /* [wire_marshal] */ const ITEMIDLIST_ABSOLUTE *PCIDLIST_ABSOLUTE;
|
||||
|
||||
typedef /* [wire_marshal] */ const ITEMIDLIST_ABSOLUTE __unaligned *PCUIDLIST_ABSOLUTE;
|
||||
|
||||
typedef /* [wire_marshal] */ ITEMIDLIST_RELATIVE *PIDLIST_RELATIVE;
|
||||
|
||||
typedef /* [wire_marshal] */ const ITEMIDLIST_RELATIVE *PCIDLIST_RELATIVE;
|
||||
|
||||
typedef /* [wire_marshal] */ ITEMIDLIST_RELATIVE __unaligned *PUIDLIST_RELATIVE;
|
||||
|
||||
typedef /* [wire_marshal] */ const ITEMIDLIST_RELATIVE __unaligned *PCUIDLIST_RELATIVE;
|
||||
|
||||
typedef /* [wire_marshal] */ ITEMID_CHILD *PITEMID_CHILD;
|
||||
|
||||
typedef /* [wire_marshal] */ const ITEMID_CHILD *PCITEMID_CHILD;
|
||||
|
||||
typedef /* [wire_marshal] */ ITEMID_CHILD __unaligned *PUITEMID_CHILD;
|
||||
|
||||
typedef /* [wire_marshal] */ const ITEMID_CHILD __unaligned *PCUITEMID_CHILD;
|
||||
|
||||
typedef const PCUITEMID_CHILD *PCUITEMID_CHILD_ARRAY;
|
||||
|
||||
typedef const PCUIDLIST_RELATIVE *PCUIDLIST_RELATIVE_ARRAY;
|
||||
|
||||
typedef const PCIDLIST_ABSOLUTE *PCIDLIST_ABSOLUTE_ARRAY;
|
||||
|
||||
typedef const PCUIDLIST_ABSOLUTE *PCUIDLIST_ABSOLUTE_ARRAY;
|
||||
|
||||
#else // !(defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus))
|
||||
#define PIDLIST_ABSOLUTE LPITEMIDLIST
|
||||
#define PCIDLIST_ABSOLUTE LPCITEMIDLIST
|
||||
#define PCUIDLIST_ABSOLUTE LPCITEMIDLIST
|
||||
#define PIDLIST_RELATIVE LPITEMIDLIST
|
||||
#define PCIDLIST_RELATIVE LPCITEMIDLIST
|
||||
#define PUIDLIST_RELATIVE LPITEMIDLIST
|
||||
#define PCUIDLIST_RELATIVE LPCITEMIDLIST
|
||||
#define PITEMID_CHILD LPITEMIDLIST
|
||||
#define PCITEMID_CHILD LPCITEMIDLIST
|
||||
#define PUITEMID_CHILD LPITEMIDLIST
|
||||
#define PCUITEMID_CHILD LPCITEMIDLIST
|
||||
#define PCUITEMID_CHILD_ARRAY LPCITEMIDLIST *
|
||||
#define PCUIDLIST_RELATIVE_ARRAY LPCITEMIDLIST *
|
||||
#define PCIDLIST_ABSOLUTE_ARRAY LPCITEMIDLIST *
|
||||
#define PCUIDLIST_ABSOLUTE_ARRAY LPCITEMIDLIST *
|
||||
#endif // defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)
|
||||
#ifdef MIDL_PASS
|
||||
typedef struct _WIN32_FIND_DATAA
|
||||
{
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
DWORD dwReserved0;
|
||||
DWORD dwReserved1;
|
||||
CHAR cFileName[ 260 ];
|
||||
CHAR cAlternateFileName[ 14 ];
|
||||
} WIN32_FIND_DATAA;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAA *PWIN32_FIND_DATAA;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAA *LPWIN32_FIND_DATAA;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAW
|
||||
{
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
DWORD dwReserved0;
|
||||
DWORD dwReserved1;
|
||||
WCHAR cFileName[ 260 ];
|
||||
WCHAR cAlternateFileName[ 14 ];
|
||||
} WIN32_FIND_DATAW;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAW *PWIN32_FIND_DATAW;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAW *LPWIN32_FIND_DATAW;
|
||||
|
||||
#endif // MIDL_PASS
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// struct STRRET
|
||||
//
|
||||
// structure for returning strings from IShellFolder member functions
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// uType indicate which union member to use
|
||||
// STRRET_WSTR Use STRRET.pOleStr must be freed by caller of GetDisplayNameOf
|
||||
// STRRET_OFFSET Use STRRET.uOffset Offset into SHITEMID for ANSI string
|
||||
// STRRET_CSTR Use STRRET.cStr ANSI Buffer
|
||||
//
|
||||
typedef /* [v1_enum] */
|
||||
enum tagSTRRET_TYPE
|
||||
{ STRRET_WSTR = 0,
|
||||
STRRET_OFFSET = 0x1,
|
||||
STRRET_CSTR = 0x2
|
||||
} STRRET_TYPE;
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201) /* nonstandard extension used : nameless struct/union */
|
||||
#pragma once
|
||||
#endif
|
||||
#include <pshpack8.h>
|
||||
typedef struct _STRRET
|
||||
{
|
||||
UINT uType;
|
||||
union
|
||||
{
|
||||
LPWSTR pOleStr;
|
||||
UINT uOffset;
|
||||
char cStr[ 260 ];
|
||||
} DUMMYUNIONNAME;
|
||||
} STRRET;
|
||||
|
||||
#include <poppack.h>
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
typedef STRRET *LPSTRRET;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// struct SHELLDETAILS
|
||||
//
|
||||
// structure for returning strings from IShellDetails
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// fmt; // LVCFMT_* value (header only)
|
||||
// cxChar; // Number of 'average' characters (header only)
|
||||
// str; // String information
|
||||
//
|
||||
#include <pshpack1.h>
|
||||
typedef struct _SHELLDETAILS
|
||||
{
|
||||
int fmt;
|
||||
int cxChar;
|
||||
STRRET str;
|
||||
} SHELLDETAILS;
|
||||
|
||||
typedef struct _SHELLDETAILS *LPSHELLDETAILS;
|
||||
|
||||
#include <poppack.h>
|
||||
|
||||
#if (_WIN32_IE >= _WIN32_IE_IE60SP2)
|
||||
typedef /* [v1_enum] */
|
||||
enum tagPERCEIVED
|
||||
{ PERCEIVED_TYPE_FIRST = -3,
|
||||
PERCEIVED_TYPE_CUSTOM = -3,
|
||||
PERCEIVED_TYPE_UNSPECIFIED = -2,
|
||||
PERCEIVED_TYPE_FOLDER = -1,
|
||||
PERCEIVED_TYPE_UNKNOWN = 0,
|
||||
PERCEIVED_TYPE_TEXT = 1,
|
||||
PERCEIVED_TYPE_IMAGE = 2,
|
||||
PERCEIVED_TYPE_AUDIO = 3,
|
||||
PERCEIVED_TYPE_VIDEO = 4,
|
||||
PERCEIVED_TYPE_COMPRESSED = 5,
|
||||
PERCEIVED_TYPE_DOCUMENT = 6,
|
||||
PERCEIVED_TYPE_SYSTEM = 7,
|
||||
PERCEIVED_TYPE_APPLICATION = 8,
|
||||
PERCEIVED_TYPE_GAMEMEDIA = 9,
|
||||
PERCEIVED_TYPE_CONTACTS = 10,
|
||||
PERCEIVED_TYPE_LAST = 10
|
||||
} PERCEIVED;
|
||||
|
||||
#define PERCEIVEDFLAG_UNDEFINED 0x0000
|
||||
#define PERCEIVEDFLAG_SOFTCODED 0x0001
|
||||
#define PERCEIVEDFLAG_HARDCODED 0x0002
|
||||
#define PERCEIVEDFLAG_NATIVESUPPORT 0x0004
|
||||
#define PERCEIVEDFLAG_GDIPLUS 0x0010
|
||||
#define PERCEIVEDFLAG_WMSDK 0x0020
|
||||
#define PERCEIVEDFLAG_ZIPFOLDER 0x0040
|
||||
typedef DWORD PERCEIVEDFLAG;
|
||||
|
||||
#endif // _WIN32_IE_IE60SP2
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
|
||||
typedef struct _COMDLG_FILTERSPEC
|
||||
{
|
||||
LPCWSTR pszName;
|
||||
LPCWSTR pszSpec;
|
||||
} COMDLG_FILTERSPEC;
|
||||
|
||||
typedef struct tagMACHINE_ID
|
||||
{
|
||||
char szName[ 16 ];
|
||||
} MACHINE_ID;
|
||||
|
||||
typedef struct tagDOMAIN_RELATIVE_OBJECTID
|
||||
{
|
||||
GUID guidVolume;
|
||||
GUID guidObject;
|
||||
} DOMAIN_RELATIVE_OBJECTID;
|
||||
|
||||
typedef GUID KNOWNFOLDERID;
|
||||
|
||||
#if 0
|
||||
typedef KNOWNFOLDERID *REFKNOWNFOLDERID;
|
||||
|
||||
#endif // 0
|
||||
#ifdef __cplusplus
|
||||
#define REFKNOWNFOLDERID const KNOWNFOLDERID &
|
||||
#else // !__cplusplus
|
||||
#define REFKNOWNFOLDERID const KNOWNFOLDERID * __MIDL_CONST
|
||||
#endif // __cplusplus
|
||||
#endif // NTDDI_LONGHORN
|
||||
typedef GUID FOLDERTYPEID;
|
||||
|
||||
#if 0
|
||||
typedef FOLDERTYPEID *REFFOLDERTYPEID;
|
||||
|
||||
#endif // 0
|
||||
#ifdef __cplusplus
|
||||
#define REFFOLDERTYPEID const FOLDERTYPEID &
|
||||
#else // !__cplusplus
|
||||
#define REFFOLDERTYPEID const FOLDERTYPEID * __MIDL_CONST
|
||||
#endif // __cplusplus
|
||||
typedef GUID TASKOWNERID;
|
||||
|
||||
#if 0
|
||||
typedef TASKOWNERID *REFTASKOWNERID;
|
||||
|
||||
#endif // 0
|
||||
#ifdef __cplusplus
|
||||
#define REFTASKOWNERID const TASKOWNERID &
|
||||
#else // !__cplusplus
|
||||
#define REFTASKOWNERID const TASKOWNERID * __MIDL_CONST
|
||||
#endif // __cplusplus
|
||||
#ifndef LF_FACESIZE
|
||||
typedef struct tagLOGFONTA
|
||||
{
|
||||
LONG lfHeight;
|
||||
LONG lfWidth;
|
||||
LONG lfEscapement;
|
||||
LONG lfOrientation;
|
||||
LONG lfWeight;
|
||||
BYTE lfItalic;
|
||||
BYTE lfUnderline;
|
||||
BYTE lfStrikeOut;
|
||||
BYTE lfCharSet;
|
||||
BYTE lfOutPrecision;
|
||||
BYTE lfClipPrecision;
|
||||
BYTE lfQuality;
|
||||
BYTE lfPitchAndFamily;
|
||||
CHAR lfFaceName[ 32 ];
|
||||
} LOGFONTA;
|
||||
|
||||
typedef struct tagLOGFONTW
|
||||
{
|
||||
LONG lfHeight;
|
||||
LONG lfWidth;
|
||||
LONG lfEscapement;
|
||||
LONG lfOrientation;
|
||||
LONG lfWeight;
|
||||
BYTE lfItalic;
|
||||
BYTE lfUnderline;
|
||||
BYTE lfStrikeOut;
|
||||
BYTE lfCharSet;
|
||||
BYTE lfOutPrecision;
|
||||
BYTE lfClipPrecision;
|
||||
BYTE lfQuality;
|
||||
BYTE lfPitchAndFamily;
|
||||
WCHAR lfFaceName[ 32 ];
|
||||
} LOGFONTW;
|
||||
|
||||
typedef LOGFONTA LOGFONT;
|
||||
|
||||
#endif // LF_FACESIZE
|
||||
typedef /* [v1_enum] */
|
||||
enum tagSHCOLSTATE
|
||||
{ SHCOLSTATE_TYPE_STR = 0x1,
|
||||
SHCOLSTATE_TYPE_INT = 0x2,
|
||||
SHCOLSTATE_TYPE_DATE = 0x3,
|
||||
SHCOLSTATE_TYPEMASK = 0xf,
|
||||
SHCOLSTATE_ONBYDEFAULT = 0x10,
|
||||
SHCOLSTATE_SLOW = 0x20,
|
||||
SHCOLSTATE_EXTENDED = 0x40,
|
||||
SHCOLSTATE_SECONDARYUI = 0x80,
|
||||
SHCOLSTATE_HIDDEN = 0x100,
|
||||
SHCOLSTATE_PREFER_VARCMP = 0x200,
|
||||
SHCOLSTATE_PREFER_FMTCMP = 0x400,
|
||||
SHCOLSTATE_NOSORTBYFOLDERNESS = 0x800,
|
||||
SHCOLSTATE_VIEWONLY = 0x10000,
|
||||
SHCOLSTATE_BATCHREAD = 0x20000,
|
||||
SHCOLSTATE_NO_GROUPBY = 0x40000,
|
||||
SHCOLSTATE_FIXED_WIDTH = 0x1000,
|
||||
SHCOLSTATE_NODPISCALE = 0x2000,
|
||||
SHCOLSTATE_FIXED_RATIO = 0x4000,
|
||||
SHCOLSTATE_DISPLAYMASK = 0xf000
|
||||
} SHCOLSTATE;
|
||||
|
||||
typedef DWORD SHCOLSTATEF;
|
||||
|
||||
typedef PROPERTYKEY SHCOLUMNID;
|
||||
|
||||
typedef const SHCOLUMNID *LPCSHCOLUMNID;
|
||||
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_shtypes_0000_0000_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_shtypes_0000_0000_v0_0_s_ifspec;
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_win_wdmks.c 1945 2015-01-21 06:24:32Z rbencina $
|
||||
* $Id$
|
||||
* PortAudio Windows WDM-KS interface
|
||||
*
|
||||
* Author: Andrew Baldwin, Robert Bielik (WaveRT)
|
||||
|
@ -94,12 +94,14 @@ of a device for the duration of active stream using those devices
|
|||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#ifndef __GNUC__ /* Fix for ticket #257: MinGW-w64: Inclusion of <winioctl.h> triggers multiple redefinition errors. */
|
||||
#include <winioctl.h>
|
||||
#endif
|
||||
#include <process.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
#ifdef _MSC_VER
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_win_wmme.c 1948 2015-01-21 06:52:11Z rbencina $
|
||||
* $Id$
|
||||
* pa_win_wmme.c
|
||||
* Implementation of PortAudio for Windows MultiMedia Extensions (WMME)
|
||||
*
|
||||
|
@ -1751,11 +1751,7 @@ static PaError CalculateBufferSettings(
|
|||
|
||||
if( *hostFramesPerOutputBuffer != *hostFramesPerInputBuffer )
|
||||
{
|
||||
// JKC: Patched By Audacity. Our Bug 1969
|
||||
// Previously this line incorrectly read:
|
||||
// if( hostFramesPerInputBuffer < hostFramesPerOutputBuffer )
|
||||
// So it was comparing pointers, rather than the values pointed to.
|
||||
if( *hostFramesPerInputBuffer < *hostFramesPerOutputBuffer )
|
||||
if( hostFramesPerInputBuffer < hostFramesPerOutputBuffer )
|
||||
{
|
||||
*hostFramesPerOutputBuffer = *hostFramesPerInputBuffer;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_unix_hostapis.c 1740 2011-08-25 07:17:48Z philburk $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library UNIX initialization table
|
||||
*
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_unix_util.c 1510 2010-06-10 08:05:29Z dmitrykos $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* UNIX platform-specific support functions
|
||||
*
|
||||
|
@ -154,10 +154,6 @@ void PaUtil_InitializeClock( void )
|
|||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
PaTime PaUtil_GetTime( void )
|
||||
{
|
||||
#ifdef HAVE_MACH_ABSOLUTE_TIME
|
||||
|
@ -173,10 +169,6 @@ PaTime PaUtil_GetTime( void )
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
PaError PaUtil_InitializeThreading( PaUtilThreading *threading )
|
||||
{
|
||||
(void) paUtilErr_;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pa_unix_util.h 1241 2007-07-23 20:08:31Z aknudsen $
|
||||
* $Id$
|
||||
* Portable Audio I/O Library
|
||||
* UNIX platform-specific support functions
|
||||
*
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue