pa_win_ds.c File Reference

#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <objbase.h>
#include <dsound.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"

Data Structures

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

Defines

#define DIRECTSOUND_VERSION   0x0300
#define DWORD_PTR   DWORD
#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_WIN_9X_LATENCY   (140)
#define PA_WIN_NT_LATENCY   (280)
#define PA_WIN_WDM_LATENCY   (120)
#define SECONDS_PER_MSEC   (0.001)
#define MSEC_PER_SECOND   (1000)
#define PA_DS_SET_LAST_DIRECTSOUND_ERROR(hr)   PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" )
#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_   (13)
#define WAVE_FORMAT_48M08   0x00001000
#define WAVE_FORMAT_48S08   0x00002000
#define WAVE_FORMAT_48M16   0x00004000
#define WAVE_FORMAT_48S16   0x00008000
#define WAVE_FORMAT_96M08   0x00010000
#define WAVE_FORMAT_96S08   0x00020000
#define WAVE_FORMAT_96M16   0x00040000
#define WAVE_FORMAT_96S16   0x00080000
#define PA_LATENCY_ENV_NAME   ("PA_MIN_LATENCY_MSEC")
#define PA_ENV_BUF_SIZE   (32)

Functions

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}

Detailed Description

Todo:
implement paInputOverflow callback status flag
Todo:
implement paNeverDropInput.
Todo:
implement host api specific extension to set i/o buffer sizes in frames
Todo:
implement initialisation of PaDeviceInfo default*Latency fields (currently set to 0.)
Todo:
implement ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable
Todo:
audit handling of DirectSound result codes - in many cases we could convert a HRESULT into a native portaudio error code. Standard DirectSound result codes are documented at msdn.
Todo:
implement IsFormatSupported
Todo:
call PaUtil_SetLastHostErrorInfo with a specific error string (currently just "DSound error").
Todo:
make sure all buffers have been played before stopping the stream when the stream callback returns paComplete
Todo:
retrieve default devices using the DRVM_MAPPER_PREFERRED_GET functions used in the wmme api these wave device ids can be aligned with the directsound devices either by retrieving the system interface device name using DRV_QUERYDEVICEINTERFACE or by using the wave device id retrieved in KsPropertySetEnumerateCallback.

old TODOs from phil, need to work out if these have been done: O- fix "patest_stop.c"


Define Documentation

#define DBUG (  )     PRINT(x)
#define DBUGX (  )     PRINT(x)
#define DIRECTSOUND_VERSION   0x0300
#define DWORD_PTR   DWORD
#define ERR_RPT (  )     PRINT(x)
#define MSEC_PER_SECOND   (1000)
#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_   (13)
#define PA_DS_SET_LAST_DIRECTSOUND_ERROR ( hr   )     PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" )
#define PA_ENV_BUF_SIZE   (32)
#define PA_LATENCY_ENV_NAME   ("PA_MIN_LATENCY_MSEC")
#define PA_USE_HIGH_LATENCY   (0)
#define PA_WIN_9X_LATENCY   (140)
#define PA_WIN_NT_LATENCY   (280)
#define PA_WIN_WDM_LATENCY   (120)
#define PRINT (  )     PA_DEBUG(x);
#define SECONDS_PER_MSEC   (0.001)
#define WAVE_FORMAT_48M08   0x00001000
#define WAVE_FORMAT_48M16   0x00004000
#define WAVE_FORMAT_48S08   0x00002000
#define WAVE_FORMAT_48S16   0x00008000
#define WAVE_FORMAT_96M08   0x00010000
#define WAVE_FORMAT_96M16   0x00040000
#define WAVE_FORMAT_96S08   0x00020000
#define WAVE_FORMAT_96S16   0x00080000

Function Documentation

PaError PaWinDs_Initialize ( PaUtilHostApiRepresentation **  hostApi,
PaHostApiIndex  index 
)

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}

Generated for PortAudio by  doxygen1.6.1