Fixed directsound PaDeviceInfo default latency and PaStreamInfo latency fields. Fixed host buffer size calculations based on suggestedLatency parameters. Switched to using 48kHz as default sample rate when other info isn't available. Fixed edge case in TimeSlice() where a full duplex stream could read data even though either input or output reported zero bytes available. Renamed some variables for clarity. Fixes ticket #160 (PaStreamInfo latency). Addresses #122 (although we're still using old default latency values from V18 codebase). Addresses #99 (correct interpretation of suggestedLatency down to zero).

This commit is contained in:
rossb 2011-08-25 15:59:32 +00:00
commit 4939e41248
2 changed files with 292 additions and 209 deletions

View file

@ -59,15 +59,14 @@ extern "C"
typedef struct PaWinDirectSoundStreamInfo{
unsigned long size; /**< sizeof(PaWinDirectSoundStreamInfo) */
PaHostApiTypeId hostApiType; /**< paDirectSound */
unsigned long version; /**< 1 */
unsigned long version; /**< 2 */
unsigned long flags;
/* low-level latency setting support
TODO ** NOT IMPLEMENTED **
These settings control the number and size of host buffers in order
to set latency. They will be used instead of the generic parameters
to Pa_OpenStream() if flags contains the paWinDirectSoundUseLowLevelLatencyParameters
Control the size of host buffers in order to set latency. They will
be used instead of the generic parameters to Pa_OpenStream() if
flags contains the paWinDirectSoundUseLowLevelLatencyParameters
flag.
If PaWinDirectSoundStreamInfo structures with paWinDirectSoundUseLowLevelLatencyParameters
@ -76,9 +75,8 @@ typedef struct PaWinDirectSoundStreamInfo{
two must be a multiple of the smaller, otherwise a
paIncompatibleHostApiSpecificStreamInfo error will be returned from
Pa_OpenStream().
unsigned long framesPerBuffer;
*/
unsigned long framesPerBuffer; /* NOT IMPLEMENTED see http://www.portaudio.com/trac/ticket/129 */
/*
support for WAVEFORMATEXTENSIBLE channel masks. If flags contains