mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
PortAudio: Update to v190600_20161030
This commit is contained in:
Vendored
+12
-8
@@ -137,6 +137,8 @@ IF(WIN32)
|
||||
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)
|
||||
@@ -156,7 +158,7 @@ IF(WIN32)
|
||||
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} winmm ole32 uuid)
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ole32 uuid)
|
||||
ELSE()
|
||||
# Set variables for DEF file expansion
|
||||
SET(DEF_EXCLUDE_ASIO_SYMBOLS ";")
|
||||
@@ -195,6 +197,7 @@ IF(WIN32)
|
||||
SOURCE_GROUP("hostapi\\wmme" FILES ${PA_WMME_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_win_wmme.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_WMME_SOURCES})
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ole32 uuid)
|
||||
ENDIF()
|
||||
|
||||
IF(MSVS)
|
||||
@@ -209,6 +212,7 @@ IF(WIN32)
|
||||
SOURCE_GROUP("hostapi\\wasapi" FILES ${PA_WASAPI_SOURCES})
|
||||
SET(PA_PUBLIC_INCLUDES ${PA_PUBLIC_INCLUDES} include/pa_win_wasapi.h)
|
||||
SET(PA_SOURCES ${PA_SOURCES} ${PA_WASAPI_SOURCES})
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} ole32 uuid)
|
||||
IF(NOT MSVC)
|
||||
SET(PA_PRIVATE_INCLUDE_PATHS ${PA_PRIVATE_INCLUDE_PATHS} src/hostapi/wasapi/mingw-include)
|
||||
ENDIF()
|
||||
@@ -222,8 +226,7 @@ IF(WIN32)
|
||||
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})
|
||||
# If we use WDM/KS we need setupapi.lib
|
||||
SET(PA_LIBRARY_DEPENDENCIES ${PA_LIBRARY_DEPENDENCIES} setupapi)
|
||||
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)
|
||||
@@ -250,7 +253,7 @@ ELSE()
|
||||
|
||||
IF(APPLE)
|
||||
|
||||
# SET(CMAKE_MACOSX_RPATH 1)
|
||||
SET(CMAKE_MACOSX_RPATH 1)
|
||||
OPTION(PA_USE_COREAUDIO "Enable support for CoreAudio" ON)
|
||||
IF(PA_USE_COREAUDIO)
|
||||
SET(PA_COREAUDIO_SOURCES
|
||||
@@ -344,14 +347,14 @@ ENDIF()
|
||||
|
||||
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 include)
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio BEFORE PRIVATE ${PA_PRIVATE_INCLUDE_PATHS})
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio BEFORE PUBLIC include)
|
||||
TARGET_LINK_LIBRARIES(portaudio ${PA_LIBRARY_DEPENDENCIES})
|
||||
|
||||
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 include)
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio_static BEFORE PRIVATE ${PA_PRIVATE_INCLUDE_PATHS})
|
||||
TARGET_INCLUDE_DIRECTORIES(portaudio_static BEFORE PUBLIC include)
|
||||
TARGET_LINK_LIBRARIES(portaudio_static ${PA_LIBRARY_DEPENDENCIES})
|
||||
|
||||
IF(WIN32 AND MSVC)
|
||||
@@ -402,3 +405,4 @@ OPTION(PA_BUILD_EXAMPLES "Include example projects" OFF)
|
||||
IF(PA_BUILD_EXAMPLES)
|
||||
SUBDIRS(examples)
|
||||
ENDIF()
|
||||
|
||||
|
||||
+53
-53
@@ -1,53 +1,53 @@
|
||||
; $Id: $
|
||||
;
|
||||
; !!! @GENERATED_MESSAGE@ !!!
|
||||
EXPORTS
|
||||
|
||||
;
|
||||
Pa_GetVersion @1
|
||||
Pa_GetVersionText @2
|
||||
Pa_GetErrorText @3
|
||||
Pa_Initialize @4
|
||||
Pa_Terminate @5
|
||||
Pa_GetHostApiCount @6
|
||||
Pa_GetDefaultHostApi @7
|
||||
Pa_GetHostApiInfo @8
|
||||
Pa_HostApiTypeIdToHostApiIndex @9
|
||||
Pa_HostApiDeviceIndexToDeviceIndex @10
|
||||
Pa_GetLastHostErrorInfo @11
|
||||
Pa_GetDeviceCount @12
|
||||
Pa_GetDefaultInputDevice @13
|
||||
Pa_GetDefaultOutputDevice @14
|
||||
Pa_GetDeviceInfo @15
|
||||
Pa_IsFormatSupported @16
|
||||
Pa_OpenStream @17
|
||||
Pa_OpenDefaultStream @18
|
||||
Pa_CloseStream @19
|
||||
Pa_SetStreamFinishedCallback @20
|
||||
Pa_StartStream @21
|
||||
Pa_StopStream @22
|
||||
Pa_AbortStream @23
|
||||
Pa_IsStreamStopped @24
|
||||
Pa_IsStreamActive @25
|
||||
Pa_GetStreamInfo @26
|
||||
Pa_GetStreamTime @27
|
||||
Pa_GetStreamCpuLoad @28
|
||||
Pa_ReadStream @29
|
||||
Pa_WriteStream @30
|
||||
Pa_GetStreamReadAvailable @31
|
||||
Pa_GetStreamWriteAvailable @32
|
||||
Pa_GetSampleSize @33
|
||||
Pa_Sleep @34
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_GetAvailableBufferSizes @50
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_ShowControlPanel @51
|
||||
@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
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetDeviceDefaultFormat @56
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetDeviceRole @57
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_ThreadPriorityBoost @58
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_ThreadPriorityRevert @59
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetFramesPerHostBuffer @60
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetJackDescription @61
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetJackCount @62
|
||||
; $Id: $
|
||||
;
|
||||
; !!! @GENERATED_MESSAGE@ !!!
|
||||
EXPORTS
|
||||
|
||||
;
|
||||
Pa_GetVersion @1
|
||||
Pa_GetVersionText @2
|
||||
Pa_GetErrorText @3
|
||||
Pa_Initialize @4
|
||||
Pa_Terminate @5
|
||||
Pa_GetHostApiCount @6
|
||||
Pa_GetDefaultHostApi @7
|
||||
Pa_GetHostApiInfo @8
|
||||
Pa_HostApiTypeIdToHostApiIndex @9
|
||||
Pa_HostApiDeviceIndexToDeviceIndex @10
|
||||
Pa_GetLastHostErrorInfo @11
|
||||
Pa_GetDeviceCount @12
|
||||
Pa_GetDefaultInputDevice @13
|
||||
Pa_GetDefaultOutputDevice @14
|
||||
Pa_GetDeviceInfo @15
|
||||
Pa_IsFormatSupported @16
|
||||
Pa_OpenStream @17
|
||||
Pa_OpenDefaultStream @18
|
||||
Pa_CloseStream @19
|
||||
Pa_SetStreamFinishedCallback @20
|
||||
Pa_StartStream @21
|
||||
Pa_StopStream @22
|
||||
Pa_AbortStream @23
|
||||
Pa_IsStreamStopped @24
|
||||
Pa_IsStreamActive @25
|
||||
Pa_GetStreamInfo @26
|
||||
Pa_GetStreamTime @27
|
||||
Pa_GetStreamCpuLoad @28
|
||||
Pa_ReadStream @29
|
||||
Pa_WriteStream @30
|
||||
Pa_GetStreamReadAvailable @31
|
||||
Pa_GetStreamWriteAvailable @32
|
||||
Pa_GetSampleSize @33
|
||||
Pa_Sleep @34
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_GetAvailableBufferSizes @50
|
||||
@DEF_EXCLUDE_ASIO_SYMBOLS@PaAsio_ShowControlPanel @51
|
||||
@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
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetDeviceDefaultFormat @56
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetDeviceRole @57
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_ThreadPriorityBoost @58
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_ThreadPriorityRevert @59
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetFramesPerHostBuffer @60
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetJackDescription @61
|
||||
@DEF_EXCLUDE_WASAPI_SYMBOLS@PaWasapi_GetJackCount @62
|
||||
|
||||
+1
-1
@@ -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
|
||||
*
|
||||
|
||||
+1
-1
@@ -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
|
||||
*
|
||||
|
||||
+14
-1
@@ -46,7 +46,7 @@
|
||||
#include "portaudio.h"
|
||||
|
||||
#include <AudioUnit/AudioUnit.h>
|
||||
//#include <AudioToolbox/AudioToolbox.h>
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -124,6 +124,19 @@ AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s );
|
||||
*/
|
||||
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input );
|
||||
|
||||
|
||||
/** Retrieve the range of legal native buffer sizes for the specificed device, in sample frames.
|
||||
|
||||
@param device The global index of the PortAudio device about which the query is being made.
|
||||
@param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
|
||||
@param maxBufferSizeFrames A pointer to the location which will receive the maximum buffer size value.
|
||||
|
||||
@see kAudioDevicePropertyBufferFrameSizeRange in the CoreAudio SDK.
|
||||
*/
|
||||
PaError PaMacCore_GetBufferSizeRange( PaDeviceIndex device,
|
||||
long *minBufferSizeFrames, long *maxBufferSizeFrames );
|
||||
|
||||
|
||||
/**
|
||||
* Flags
|
||||
*/
|
||||
|
||||
+11
-14
@@ -61,24 +61,21 @@ typedef struct PaWinDirectSoundStreamInfo{
|
||||
PaHostApiTypeId hostApiType; /**< paDirectSound */
|
||||
unsigned long version; /**< 2 */
|
||||
|
||||
unsigned long flags;
|
||||
unsigned long flags; /**< enable other features of this struct */
|
||||
|
||||
/* low-level latency setting support
|
||||
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.
|
||||
/**
|
||||
low-level latency setting support
|
||||
Sets the size of the DirectSound host buffer.
|
||||
When flags contains the paWinDirectSoundUseLowLevelLatencyParameters
|
||||
this size will be used instead of interpreting the generic latency
|
||||
parameters to Pa_OpenStream(). If the flag is not set this value is ignored.
|
||||
|
||||
If PaWinDirectSoundStreamInfo structures with paWinDirectSoundUseLowLevelLatencyParameters
|
||||
are supplied for both input and output in a full duplex stream, then the
|
||||
input and output framesPerBuffer must be the same, or the larger of the
|
||||
two must be a multiple of the smaller, otherwise a
|
||||
paIncompatibleHostApiSpecificStreamInfo error will be returned from
|
||||
Pa_OpenStream().
|
||||
If the stream is a full duplex stream the implementation requires that
|
||||
the values of framesPerBuffer for input and output match (if both are specified).
|
||||
*/
|
||||
unsigned long framesPerBuffer; /* NOT IMPLEMENTED see http://www.portaudio.com/trac/ticket/129 */
|
||||
unsigned long framesPerBuffer;
|
||||
|
||||
/*
|
||||
/**
|
||||
support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
|
||||
paWinDirectSoundUseChannelMask this allows you to specify which speakers
|
||||
to address in a multichannel stream. Constants for channelMask
|
||||
|
||||
+69
-17
@@ -69,8 +69,8 @@ typedef enum PaWasapiFlags
|
||||
method can only provide 15-20ms latency. */
|
||||
paWinWasapiPolling = (1 << 3),
|
||||
|
||||
/* forces custom thread priority setting. must be used if PaWasapiStreamInfo::threadPriority
|
||||
is set to custom value. */
|
||||
/* forces custom thread priority setting, must be used if PaWasapiStreamInfo::threadPriority
|
||||
is set to a custom value */
|
||||
paWinWasapiThreadPriority = (1 << 4)
|
||||
}
|
||||
PaWasapiFlags;
|
||||
@@ -91,7 +91,7 @@ typedef void (*PaWasapiHostProcessorCallback) (void *inputBuffer, long inputFra
|
||||
void *outputBuffer, long outputFrames,
|
||||
void *userData);
|
||||
|
||||
/* Device role */
|
||||
/* Device role. */
|
||||
typedef enum PaWasapiDeviceRole
|
||||
{
|
||||
eRoleRemoteNetworkDevice = 0,
|
||||
@@ -109,7 +109,7 @@ typedef enum PaWasapiDeviceRole
|
||||
PaWasapiDeviceRole;
|
||||
|
||||
|
||||
/* Jack connection type */
|
||||
/* Jack connection type. */
|
||||
typedef enum PaWasapiJackConnectionType
|
||||
{
|
||||
eJackConnTypeUnknown,
|
||||
@@ -128,10 +128,10 @@ typedef enum PaWasapiJackConnectionType
|
||||
PaWasapiJackConnectionType;
|
||||
|
||||
|
||||
/* Jack geometric location */
|
||||
/* Jack geometric location. */
|
||||
typedef enum PaWasapiJackGeoLocation
|
||||
{
|
||||
eJackGeoLocUnk = 0,
|
||||
eJackGeoLocUnk = 0,
|
||||
eJackGeoLocRear = 0x1, /* matches EPcxGeoLocation::eGeoLocRear */
|
||||
eJackGeoLocFront,
|
||||
eJackGeoLocLeft,
|
||||
@@ -151,7 +151,7 @@ typedef enum PaWasapiJackGeoLocation
|
||||
PaWasapiJackGeoLocation;
|
||||
|
||||
|
||||
/* Jack general location */
|
||||
/* Jack general location. */
|
||||
typedef enum PaWasapiJackGenLocation
|
||||
{
|
||||
eJackGenLocPrimaryBox = 0,
|
||||
@@ -162,7 +162,7 @@ typedef enum PaWasapiJackGenLocation
|
||||
PaWasapiJackGenLocation;
|
||||
|
||||
|
||||
/* Jack's type of port */
|
||||
/* Jack's type of port. */
|
||||
typedef enum PaWasapiJackPortConnection
|
||||
{
|
||||
eJackPortConnJack = 0,
|
||||
@@ -173,7 +173,7 @@ typedef enum PaWasapiJackPortConnection
|
||||
PaWasapiJackPortConnection;
|
||||
|
||||
|
||||
/* Thread priority */
|
||||
/* Thread priority. */
|
||||
typedef enum PaWasapiThreadPriority
|
||||
{
|
||||
eThreadPriorityNone = 0,
|
||||
@@ -202,6 +202,46 @@ typedef struct PaWasapiJackDescription
|
||||
PaWasapiJackDescription;
|
||||
|
||||
|
||||
/** Stream category.
|
||||
Note:
|
||||
- values are equal to WASAPI AUDIO_STREAM_CATEGORY enum
|
||||
- supported since Windows 8.0, noop on earler versions
|
||||
- values 1,2 are deprecated on Windows 10 and not included into enumeration
|
||||
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
typedef enum PaWasapiStreamCategory
|
||||
{
|
||||
eAudioCategoryOther = 0,
|
||||
eAudioCategoryCommunications = 3,
|
||||
eAudioCategoryAlerts = 4,
|
||||
eAudioCategorySoundEffects = 5,
|
||||
eAudioCategoryGameEffects = 6,
|
||||
eAudioCategoryGameMedia = 7,
|
||||
eAudioCategoryGameChat = 8,
|
||||
eAudioCategorySpeech = 9,
|
||||
eAudioCategoryMovie = 10,
|
||||
eAudioCategoryMedia = 11
|
||||
}
|
||||
PaWasapiStreamCategory;
|
||||
|
||||
|
||||
/** Stream option.
|
||||
Note:
|
||||
- values are equal to WASAPI AUDCLNT_STREAMOPTIONS enum
|
||||
- supported since Windows 8.1, noop on earler versions
|
||||
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
typedef enum PaWasapiStreamOption
|
||||
{
|
||||
eStreamOptionNone = 0, //!< default
|
||||
eStreamOptionRaw = 1, //!< bypass WASAPI Audio Engine DSP effects, supported since Windows 8.1
|
||||
eStreamOptionMatchFormat = 2 //!< force WASAPI Audio Engine into a stream format, supported since Windows 10
|
||||
}
|
||||
PaWasapiStreamOption;
|
||||
|
||||
|
||||
/* Stream descriptor. */
|
||||
typedef struct PaWasapiStreamInfo
|
||||
{
|
||||
@@ -211,7 +251,7 @@ typedef struct PaWasapiStreamInfo
|
||||
|
||||
unsigned long flags; /**< collection of PaWasapiFlags */
|
||||
|
||||
/* Support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
|
||||
/** 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
|
||||
@@ -219,7 +259,7 @@ typedef struct PaWasapiStreamInfo
|
||||
*/
|
||||
PaWinWaveFormatChannelMask channelMask;
|
||||
|
||||
/* Delivers raw data to callback obtained from GetBuffer() methods skipping
|
||||
/** 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.
|
||||
@@ -227,7 +267,7 @@ typedef struct PaWasapiStreamInfo
|
||||
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)
|
||||
@@ -235,6 +275,18 @@ typedef struct PaWasapiStreamInfo
|
||||
to setup thread priority.
|
||||
*/
|
||||
PaWasapiThreadPriority threadPriority;
|
||||
|
||||
/** Stream category.
|
||||
@see PaWasapiStreamCategory
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
PaWasapiStreamCategory streamCategory;
|
||||
|
||||
/** Stream option.
|
||||
@see PaWasapiStreamOption
|
||||
@version Available as of 19.6.0
|
||||
*/
|
||||
PaWasapiStreamOption streamOption;
|
||||
}
|
||||
PaWasapiStreamInfo;
|
||||
|
||||
@@ -303,7 +355,7 @@ PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *nInput
|
||||
|
||||
/** 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.
|
||||
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
|
||||
@@ -314,9 +366,9 @@ PaError PaWasapi_GetJackCount(PaDeviceIndex nDevice, int *jcount);
|
||||
|
||||
/** Get the jack description associated with a WASAPI device and jack number
|
||||
Before this function is called, use PaWasapi_GetJackCount to determine the
|
||||
number of jacks associated with device. If jcount is greater than zero, then
|
||||
each jack from 0 to jcount can be queried with this function to get the jack
|
||||
description.
|
||||
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.
|
||||
@@ -347,7 +399,7 @@ PaError PaWasapi_GetJackDescription(PaDeviceIndex nDevice, int jindex, PaWasapiJ
|
||||
This is the most powerful WASAPI implementation which provides glitch-free
|
||||
audio at around 3ms latency in Exclusive mode. Lowest possible latency for this mode is
|
||||
3 ms for HD Audio class audio chips. For the Shared mode latency can not be
|
||||
lower than 20 ms.
|
||||
lower than 20 ms.
|
||||
|
||||
2) Poll-Driven:
|
||||
Polling is another 2-nd method to operate with WASAPI. It is less efficient than Event-Driven
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
#ifndef PA_WIN_WDMKS_H
|
||||
#define PA_WIN_WDMKS_H
|
||||
/*
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* WDM/KS specific extensions
|
||||
*
|
||||
* Copyright (c) 1999-2007 Ross Bencina and Phil Burk
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
* and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* the PortAudio community also makes the following non-binding requests:
|
||||
*
|
||||
* Any person wishing to distribute modifications to the Software is
|
||||
* requested to send the modifications to the original developer so that
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
/** @file
|
||||
@ingroup public_header
|
||||
@brief WDM Kernel Streaming-specific PortAudio API extension header file.
|
||||
*/
|
||||
|
||||
|
||||
#include "portaudio.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** 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!
|
||||
*/
|
||||
paWinWDMKSOverrideFramesize = (1 << 0),
|
||||
|
||||
/** Makes WDMKS (output stream) use the given channelMask instead of the default.
|
||||
@version Available as of 19.5.0.
|
||||
*/
|
||||
paWinWDMKSUseGivenChannelMask = (1 << 1),
|
||||
|
||||
} PaWinWDMKSFlags;
|
||||
|
||||
typedef struct PaWinWDMKSInfo{
|
||||
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. */
|
||||
unsigned noOfPackets;
|
||||
|
||||
/** 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;
|
||||
|
||||
typedef enum PaWDMKSType
|
||||
{
|
||||
Type_kNotUsed,
|
||||
Type_kWaveCyclic,
|
||||
Type_kWaveRT,
|
||||
Type_kCnt,
|
||||
} PaWDMKSType;
|
||||
|
||||
typedef enum PaWDMKSSubType
|
||||
{
|
||||
SubType_kUnknown,
|
||||
SubType_kNotification,
|
||||
SubType_kPolled,
|
||||
SubType_kCnt,
|
||||
} PaWDMKSSubType;
|
||||
|
||||
typedef struct PaWinWDMKSDeviceInfo {
|
||||
wchar_t filterPath[MAX_PATH]; /**< KS filter path in Unicode! */
|
||||
wchar_t topologyPath[MAX_PATH]; /**< Topology filter path in Unicode! */
|
||||
PaWDMKSType streamingType;
|
||||
GUID deviceProductGuid; /**< The product GUID of the device (if supported) */
|
||||
} PaWinWDMKSDeviceInfo;
|
||||
|
||||
typedef struct PaWDMKSDirectionSpecificStreamInfo
|
||||
{
|
||||
PaDeviceIndex device;
|
||||
unsigned channels; /**< No of channels the device is opened with */
|
||||
unsigned framesPerHostBuffer; /**< No of frames of the device buffer */
|
||||
int endpointPinId; /**< Endpoint pin ID (on topology filter if topologyName is not empty) */
|
||||
int muxNodeId; /**< Only valid for input */
|
||||
PaWDMKSSubType streamingSubType; /**< Not known until device is opened for streaming */
|
||||
} PaWDMKSDirectionSpecificStreamInfo;
|
||||
|
||||
typedef struct PaWDMKSSpecificStreamInfo {
|
||||
PaWDMKSDirectionSpecificStreamInfo input;
|
||||
PaWDMKSDirectionSpecificStreamInfo output;
|
||||
} PaWDMKSSpecificStreamInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* PA_WIN_DS_H */
|
||||
+1
-1
@@ -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
|
||||
*
|
||||
|
||||
+60
-9
@@ -1,7 +1,7 @@
|
||||
#ifndef PORTAUDIO_H
|
||||
#define PORTAUDIO_H
|
||||
/*
|
||||
* $Id: portaudio.h 1745 2011-08-25 17:44:01Z rossb $
|
||||
* $Id$
|
||||
* PortAudio Portable Real-Time Audio Library
|
||||
* PortAudio API Header File
|
||||
* Latest version available at: http://www.portaudio.com/
|
||||
@@ -50,18 +50,69 @@ extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/** Retrieve the release number of the currently running PortAudio build,
|
||||
eg 1900.
|
||||
/** Retrieve the release number of the currently running PortAudio build.
|
||||
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-devel 13 October 2002".
|
||||
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:
|
||||
|
||||
@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 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 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;
|
||||
|
||||
/** 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();
|
||||
|
||||
|
||||
/** Error codes returned by PortAudio functions.
|
||||
Note that with the exception of paNoError, all PaErrorCodes are negative.
|
||||
@@ -900,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.
|
||||
|
||||
@@ -1021,7 +1072,7 @@ typedef struct PaStreamInfo
|
||||
/** Retrieve a pointer to a PaStreamInfo structure containing information
|
||||
about the specified stream.
|
||||
@return A pointer to an immutable PaStreamInfo structure. If the stream
|
||||
parameter invalid, or an error is encountered, the function returns NULL.
|
||||
parameter is invalid, or an error is encountered, the function returns NULL.
|
||||
|
||||
@param stream A pointer to an open stream previously created with Pa_OpenStream.
|
||||
|
||||
@@ -1098,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.
|
||||
|
||||
+1
-1
@@ -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
-1
@@ -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
-1
@@ -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
-1
@@ -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
-1
@@ -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
-1
@@ -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.
|
||||
*
|
||||
|
||||
+1
-1
@@ -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
-1
@@ -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
-1
@@ -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
|
||||
|
||||
+100
-59
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: pa_front.c 1730 2011-08-18 03:43:51Z rossb $
|
||||
* $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
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h> /* needed for strtol() */
|
||||
#include <assert.h> /* needed by PA_VALIDATE_ENDIANNESS */
|
||||
|
||||
#include "portaudio.h"
|
||||
@@ -76,25 +77,63 @@
|
||||
#include "pa_trace.h" /* still usefull?*/
|
||||
#include "pa_debugprint.h"
|
||||
|
||||
#ifndef PA_GIT_REVISION
|
||||
#include "pa_gitrevision.h"
|
||||
#endif
|
||||
|
||||
#define PA_VERSION_ 1899
|
||||
#define PA_VERSION_TEXT_ "PortAudio V19-devel (built " __DATE__ " " __TIME__ ")"
|
||||
/**
|
||||
* This is incremented if we make incompatible API changes.
|
||||
* This version scheme is based loosely on http://semver.org/
|
||||
*/
|
||||
#define paVersionMajor 19
|
||||
|
||||
/**
|
||||
* This is incremented when we add functionality in a backwards-compatible manner.
|
||||
* Or it is set to zero when paVersionMajor is incremented.
|
||||
*/
|
||||
#define paVersionMinor 6
|
||||
|
||||
/**
|
||||
* This is incremented when we make backwards-compatible bug fixes.
|
||||
* Or it is set to zero when paVersionMinor changes.
|
||||
*/
|
||||
#define paVersionSubMinor 0
|
||||
|
||||
/**
|
||||
* This is a combination of paVersionMajor, paVersionMinor and paVersionSubMinor.
|
||||
* It will always increase so that version numbers can be compared as integers to
|
||||
* see which is later.
|
||||
*/
|
||||
#define paVersion paMakeVersionNumber(paVersionMajor, paVersionMinor, paVersionSubMinor)
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
#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_GIT_REVISION)
|
||||
|
||||
int Pa_GetVersion( void )
|
||||
{
|
||||
return PA_VERSION_;
|
||||
return paVersion;
|
||||
}
|
||||
|
||||
|
||||
const char* Pa_GetVersionText( void )
|
||||
{
|
||||
return PA_VERSION_TEXT_;
|
||||
}
|
||||
|
||||
static PaVersionInfo versionInfo_ = {
|
||||
/*.versionMajor =*/ paVersionMajor,
|
||||
/*.versionMinor =*/ paVersionMinor,
|
||||
/*.versionSubMinor =*/ paVersionSubMinor,
|
||||
/*.versionControlRevision =*/ TOSTRING(PA_GIT_REVISION),
|
||||
/*.versionText =*/ PA_VERSION_TEXT_
|
||||
};
|
||||
|
||||
const PaVersionInfo* Pa_GetVersionInfo()
|
||||
{
|
||||
return &versionInfo_;
|
||||
}
|
||||
|
||||
#define PA_LAST_HOST_ERROR_TEXT_LENGTH_ 1024
|
||||
|
||||
@@ -170,7 +209,7 @@ static PaError InitializeHostApis( void )
|
||||
if( !hostApis_ )
|
||||
{
|
||||
result = paInsufficientMemory;
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
|
||||
hostApisCount_ = 0;
|
||||
@@ -196,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_;
|
||||
@@ -238,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 )
|
||||
{
|
||||
@@ -328,7 +367,7 @@ PaError Pa_Initialize( void )
|
||||
{
|
||||
PA_VALIDATE_TYPE_SIZES;
|
||||
PA_VALIDATE_ENDIANNESS;
|
||||
|
||||
|
||||
PaUtil_InitializeClock();
|
||||
PaUtil_ResetTraceMessages();
|
||||
|
||||
@@ -351,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();
|
||||
|
||||
@@ -359,6 +399,7 @@ PaError Pa_Terminate( void )
|
||||
|
||||
PaUtil_DumpTraceMessages();
|
||||
}
|
||||
--initializationCount_;
|
||||
result = paNoError;
|
||||
}
|
||||
else
|
||||
@@ -415,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;
|
||||
@@ -430,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 ));
|
||||
|
||||
@@ -441,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,7 +504,7 @@ PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **ho
|
||||
{
|
||||
PaError result;
|
||||
int i;
|
||||
|
||||
|
||||
if( !PA_IS_INITIALISED_ )
|
||||
{
|
||||
result = paNotInitialized;
|
||||
@@ -471,7 +512,7 @@ PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **ho
|
||||
else
|
||||
{
|
||||
result = paHostApiNotFound;
|
||||
|
||||
|
||||
for( i=0; i < hostApisCount_; ++i )
|
||||
{
|
||||
if( hostApis_[i]->info.type == type )
|
||||
@@ -492,7 +533,7 @@ PaError PaUtil_DeviceIndexToHostApiDeviceIndex(
|
||||
{
|
||||
PaError result;
|
||||
PaDeviceIndex x;
|
||||
|
||||
|
||||
x = device - hostApi->privatePaFrontInfo.baseDeviceIndex;
|
||||
|
||||
if( x < 0 || x >= hostApi->info.deviceCount )
|
||||
@@ -577,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" ));
|
||||
|
||||
@@ -686,7 +727,7 @@ PaDeviceIndex Pa_GetDefaultOutputDevice( void )
|
||||
{
|
||||
PaHostApiIndex hostApi;
|
||||
PaDeviceIndex result;
|
||||
|
||||
|
||||
PA_LOGAPI_ENTER( "Pa_GetDefaultOutputDevice" );
|
||||
|
||||
hostApi = Pa_GetDefaultHostApi();
|
||||
@@ -770,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.
|
||||
@@ -779,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
|
||||
@@ -803,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 200000.)
|
||||
- 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
|
||||
@@ -953,7 +994,7 @@ static PaError ValidateOpenStreamParameters(
|
||||
!= (*hostApi)->info.type )
|
||||
return paIncompatibleHostApiSpecificStreamInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( (inputParameters != NULL) && (outputParameters != NULL) )
|
||||
{
|
||||
@@ -962,10 +1003,10 @@ static PaError ValidateOpenStreamParameters(
|
||||
return paBadIODeviceCombination;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Check for absurd sample rates. */
|
||||
if( (sampleRate < 1000.0) || (sampleRate > 200000.0) )
|
||||
if( (sampleRate < 1000.0) || (sampleRate > 384000.0) )
|
||||
return paInvalidSampleRate;
|
||||
|
||||
if( ((streamFlags & ~paPlatformSpecificFlags) & ~(paClipOff | paDitherOff | paNeverDropInput | paPrimeOutputBuffersUsingStreamCallback ) ) != 0 )
|
||||
@@ -985,7 +1026,7 @@ static PaError ValidateOpenStreamParameters(
|
||||
if( framesPerBuffer != paFramesPerBufferUnspecified )
|
||||
return paInvalidFlag;
|
||||
}
|
||||
|
||||
|
||||
return paNoError;
|
||||
}
|
||||
|
||||
@@ -1025,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
|
||||
|
||||
@@ -1048,7 +1089,7 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
|
||||
PA_LOGAPI_EXIT_PAERROR( "Pa_IsFormatSupported", result );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( inputParameters )
|
||||
{
|
||||
@@ -1135,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 ));
|
||||
@@ -1182,7 +1223,7 @@ PaError Pa_OpenStream( PaStream** stream,
|
||||
PA_LOGAPI(("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) ));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( inputParameters )
|
||||
{
|
||||
@@ -1256,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
|
||||
@@ -1265,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;
|
||||
@@ -1279,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;
|
||||
@@ -1663,7 +1704,7 @@ PaError Pa_WriteStream( PaStream* stream,
|
||||
else if( result == 1 )
|
||||
{
|
||||
result = paStreamIsStopped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user