PortAudio  2.0
Data Structures | Macros | Typedefs | Functions | Variables
pa_win_ds.c File Reference
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <initguid.h>
#include <windows.h>
#include <objbase.h>
#include <dsound.h>
#include <process.h>
#include "pa_util.h"
#include "pa_allocation.h"
#include "pa_hostapi.h"
#include "pa_stream.h"
#include "pa_cpuload.h"
#include "pa_process.h"
#include "pa_debugprint.h"
#include "pa_win_ds.h"
#include "pa_win_ds_dynlink.h"
#include "pa_win_waveformat.h"
#include "pa_win_wdmks_utils.h"
#include "pa_win_coinitialize.h"

Data Structures

struct  PaWinDsDeviceInfo
 
struct  PaWinDsHostApiRepresentation
 
struct  PaWinDsStream
 
struct  DSDeviceNameAndGUID
 
struct  DSDeviceNameAndGUIDVector
 
struct  DSDeviceNamesAndGUIDs
 

Macros

#define _WIN32_WINNT   0x0400 /* required to get waitable timer APIs */
 
#define DIRECTSOUND_VERSION   0x0300
 
#define CREATE_THREAD   (HANDLE)_beginthreadex
 
#define PA_THREAD_FUNC   static unsigned WINAPI
 
#define PA_THREAD_ID   unsigned
 
#define PA_WIN_DS_USE_WAITABLE_TIMER_OBJECT   /* use waitable timer where possible, otherwise we use a WaitForSingleObject timeout */
 
#define DWORD_PTR   unsigned long
 
#define PRINT(x)   PA_DEBUG(x);
 
#define ERR_RPT(x)   PRINT(x)
 
#define DBUG(x)   PRINT(x)
 
#define DBUGX(x)   PRINT(x)
 
#define PA_USE_HIGH_LATENCY   (0)
 
#define PA_DS_WIN_9X_DEFAULT_LATENCY_   (.140)
 
#define PA_DS_WIN_NT_DEFAULT_LATENCY_   (.280)
 
#define PA_DS_WIN_WDM_DEFAULT_LATENCY_   (.120)
 
#define PA_DS_MINIMUM_POLLING_PERIOD_SECONDS   (0.001) /* 1ms */
 
#define PA_DS_MAXIMUM_POLLING_PERIOD_SECONDS   (0.100) /* 100ms */
 
#define PA_DS_POLLING_JITTER_SECONDS   (0.001) /* 1ms */
 
#define SECONDS_PER_MSEC   (0.001)
 
#define MSECS_PER_SECOND   (1000)
 
#define PA_DS_SET_LAST_DIRECTSOUND_ERROR(hr)   PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" )
 
#define PA_LATENCY_ENV_NAME   ("PA_MIN_LATENCY_MSEC")
 
#define PA_ENV_BUF_SIZE   (32)
 
#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_   (13) /* must match array length below */
 
#define DSSPEAKER_7POINT1_SURROUND   0x00000008
 
#define DSSPEAKER_5POINT1_SURROUND   0x00000009
 
#define WAVE_FORMAT_48M08   0x00001000 /* 48 kHz, Mono, 8-bit */
 
#define WAVE_FORMAT_48S08   0x00002000 /* 48 kHz, Stereo, 8-bit */
 
#define WAVE_FORMAT_48M16   0x00004000 /* 48 kHz, Mono, 16-bit */
 
#define WAVE_FORMAT_48S16   0x00008000 /* 48 kHz, Stereo, 16-bit */
 
#define WAVE_FORMAT_96M08   0x00010000 /* 96 kHz, Mono, 8-bit */
 
#define WAVE_FORMAT_96S08   0x00020000 /* 96 kHz, Stereo, 8-bit */
 
#define WAVE_FORMAT_96M16   0x00040000 /* 96 kHz, Mono, 16-bit */
 
#define WAVE_FORMAT_96S16   0x00080000 /* 96 kHz, Stereo, 16-bit */
 

Typedefs

typedef struct PaWinDsDeviceInfo PaWinDsDeviceInfo
 
typedef struct PaWinDsStream PaWinDsStream
 
typedef struct DSDeviceNameAndGUID DSDeviceNameAndGUID
 
typedef struct
DSDeviceNameAndGUIDVector 
DSDeviceNameAndGUIDVector
 
typedef struct
DSDeviceNamesAndGUIDs 
DSDeviceNamesAndGUIDs
 

Functions

PA_THREAD_FUNC ProcessingThreadProc (void *pArg)
 
PaError PaWinDs_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index)
 

Variables

GUID IID_IRolandVSCEmulated1 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x01}
 
GUID IID_IRolandVSCEmulated2 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x02}
 

Macro Definition Documentation

#define _WIN32_WINNT   0x0400 /* required to get waitable timer APIs */
#define CREATE_THREAD   (HANDLE)_beginthreadex
#define DBUG (   x)    PRINT(x)
#define DBUGX (   x)    PRINT(x)
#define DIRECTSOUND_VERSION   0x0300
#define DSSPEAKER_5POINT1_SURROUND   0x00000009
#define DSSPEAKER_7POINT1_SURROUND   0x00000008
#define DWORD_PTR   unsigned long

Referenced by ProcessingThreadProc().

#define ERR_RPT (   x)    PRINT(x)
#define MSECS_PER_SECOND   (1000)

Referenced by ProcessingThreadProc().

#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_   (13) /* must match array length below */
#define PA_DS_MAXIMUM_POLLING_PERIOD_SECONDS   (0.100) /* 100ms */
#define PA_DS_MINIMUM_POLLING_PERIOD_SECONDS   (0.001) /* 1ms */
#define PA_DS_POLLING_JITTER_SECONDS   (0.001) /* 1ms */
#define PA_DS_SET_LAST_DIRECTSOUND_ERROR (   hr)    PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" )
#define PA_DS_WIN_9X_DEFAULT_LATENCY_   (.140)
#define PA_DS_WIN_NT_DEFAULT_LATENCY_   (.280)
#define PA_DS_WIN_WDM_DEFAULT_LATENCY_   (.120)
#define PA_ENV_BUF_SIZE   (32)
#define PA_LATENCY_ENV_NAME   ("PA_MIN_LATENCY_MSEC")
#define PA_THREAD_FUNC   static unsigned WINAPI
#define PA_THREAD_ID   unsigned
#define PA_USE_HIGH_LATENCY   (0)
#define PA_WIN_DS_USE_WAITABLE_TIMER_OBJECT   /* use waitable timer where possible, otherwise we use a WaitForSingleObject timeout */
#define PRINT (   x)    PA_DEBUG(x);
#define SECONDS_PER_MSEC   (0.001)
#define WAVE_FORMAT_48M08   0x00001000 /* 48 kHz, Mono, 8-bit */
#define WAVE_FORMAT_48M16   0x00004000 /* 48 kHz, Mono, 16-bit */
#define WAVE_FORMAT_48S08   0x00002000 /* 48 kHz, Stereo, 8-bit */
#define WAVE_FORMAT_48S16   0x00008000 /* 48 kHz, Stereo, 16-bit */
#define WAVE_FORMAT_96M08   0x00010000 /* 96 kHz, Mono, 8-bit */
#define WAVE_FORMAT_96M16   0x00040000 /* 96 kHz, Mono, 16-bit */
#define WAVE_FORMAT_96S08   0x00020000 /* 96 kHz, Stereo, 8-bit */
#define WAVE_FORMAT_96S16   0x00080000 /* 96 kHz, Stereo, 16-bit */

Typedef Documentation

typedef struct PaWinDsStream PaWinDsStream

Function Documentation

PaError PaWinDs_Initialize ( PaUtilHostApiRepresentation **  hostApi,
PaHostApiIndex  index 
)
PA_THREAD_FUNC ProcessingThreadProc ( void *  pArg)

Variable Documentation

GUID IID_IRolandVSCEmulated1 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x01}
GUID IID_IRolandVSCEmulated2 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x02}