Win32 host API implementation for the Windows MultiMedia Extensions (WMME) audio API.
More...
Data Structures |
struct | PaWinMmeHostApiRepresentation |
struct | PaWinMmeDeviceInfo |
struct | PaWinMmeSingleDirectionHandlesAndBuffers |
struct | PaWinMmeStream |
Defines |
#define | CREATE_THREAD (HANDLE)_beginthreadex( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) |
#define | PA_THREAD_FUNC static unsigned WINAPI |
#define | PA_THREAD_ID unsigned |
#define | DWORD_PTR unsigned long |
#define | PA_MME_USE_HIGH_DEFAULT_LATENCY_ (0) |
#define | PA_MME_WIN_9X_DEFAULT_LATENCY_ (0.2) |
#define | PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_ (2) |
#define | PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ (3) |
#define | PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_HALF_DUPLEX_ (2) |
#define | PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ (16) |
#define | PA_MME_MAX_HOST_BUFFER_SECS_ (0.1) |
#define | PA_MME_MAX_HOST_BUFFER_BYTES_ (32 * 1024) |
#define | PA_MME_WIN_NT_DEFAULT_LATENCY_ (PA_MME_WIN_9X_DEFAULT_LATENCY_ * 2) |
#define | PA_MME_WIN_WDM_DEFAULT_LATENCY_ (PA_MME_WIN_9X_DEFAULT_LATENCY_) |
#define | PA_MME_MIN_TIMEOUT_MSEC_ (1000) |
#define | PA_MME_SET_LAST_WAVEIN_ERROR(mmresult) |
#define | PA_MME_SET_LAST_WAVEOUT_ERROR(mmresult) |
#define | PA_MME_SET_LAST_SYSTEM_ERROR(errorCode) PaMme_SetLastSystemError( errorCode ) |
#define | PA_ENV_BUF_SIZE_ (32) |
#define | PA_REC_IN_DEV_ENV_NAME_ ("PA_RECOMMENDED_INPUT_DEVICE") |
#define | PA_REC_OUT_DEV_ENV_NAME_ ("PA_RECOMMENDED_OUTPUT_DEVICE") |
#define | PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ (13) |
#define | DRVM_MAPPER_PREFERRED_GET (0x2000+21) |
#define | PA_IS_INPUT_STREAM_(stream) ( stream ->input.waveHandles ) |
#define | PA_IS_OUTPUT_STREAM_(stream) ( stream ->output.waveHandles ) |
#define | PA_IS_FULL_DUPLEX_STREAM_(stream) ( stream ->input.waveHandles && stream ->output.waveHandles ) |
#define | PA_IS_HALF_DUPLEX_STREAM_(stream) ( !(stream ->input.waveHandles && stream ->output.waveHandles) ) |
#define | PA_CIRCULAR_INCREMENT_(current, max) ( (((current) + 1) >= (max)) ? (0) : (current+1) ) |
#define | PA_CIRCULAR_DECREMENT_(current, max) ( ((current) == 0) ? ((max)-1) : (current-1) ) |
Typedefs |
typedef struct PaWinMmeStream | PaWinMmeStream |
Functions |
char * | StrTCpyToC (char *to, const TCHAR *from) |
size_t | StrTLen (const TCHAR *str) |
PaError | PaWinMme_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index) |
PA_THREAD_FUNC | ProcessingThreadProc (void *pArg) |
int | PaWinMME_GetStreamInputHandleCount (PaStream *s) |
HWAVEIN | PaWinMME_GetStreamInputHandle (PaStream *s, int handleIndex) |
int | PaWinMME_GetStreamOutputHandleCount (PaStream *s) |
HWAVEOUT | PaWinMME_GetStreamOutputHandle (PaStream *s, int handleIndex) |
Win32 host API implementation for the Windows MultiMedia Extensions (WMME) audio API.
PA_THREAD_FUNC ProcessingThreadProc |
( |
void * |
pArg |
) |
|
- Todo:
- support paInputUnderflow, paOutputOverflow and paNeverDropInput
- Todo:
- FIXME/REVIEW: can't return host error info from an asyncronous thread. see http://www.portaudio.com/trac/ticket/143
- Todo:
- if all of the other buffers are also ready then we discard all but the most recent. This is an input buffer overflow. FIXME: these buffers should be passed to the callback in a paNeverDropInput stream. http://www.portaudio.com/trac/ticket/142
note that it is also possible for an input overflow to happen while the callback is processing a buffer. that is handled further down.
- Todo:
- implement inputBufferAdcTime
- Todo:
- FIXME: should probably reset the output device immediately once the callback returns paAbort see: http://www.portaudio.com/trac/ticket/141
- Todo:
- need to handle PaNeverDropInput here where necessary
References PaWinMmeStream::abortEvent, PaWinMmeStream::abortProcessing, PaWinMmeStream::allBuffersDurationMs, PaWinMmeSingleDirectionHandlesAndBuffers::bufferCount, PaWinMmeSingleDirectionHandlesAndBuffers::bufferEvent, PaWinMmeStream::bufferProcessor, PaUtilBufferProcessor::bytesPerHostInputSample, PaUtilBufferProcessor::bytesPerHostOutputSample, PaWinMmeStream::cpuLoadMeasurer, PaWinMmeSingleDirectionHandlesAndBuffers::currentBufferIndex, PaStreamCallbackTimeInfo::currentTime, PaWinMmeSingleDirectionHandlesAndBuffers::deviceCount, FALSE, PaWinMmeSingleDirectionHandlesAndBuffers::framesPerBuffer, PaUtilBufferProcessor::framesPerHostBuffer, PaWinMmeSingleDirectionHandlesAndBuffers::framesUsedInCurrentBuffer, HANDLE(), PaWinMmeStream::highThreadPriority, PaWinMmeStream::input, PaWinMmeStream::isActive, PaWinMmeStream::output, PaStreamCallbackTimeInfo::outputBufferDacTime, PA_IS_FULL_DUPLEX_STREAM_, PA_IS_HALF_DUPLEX_STREAM_, PA_IS_INPUT_STREAM_, PA_IS_OUTPUT_STREAM_, paAbort, paContinue, paInputOverflow, paNoError, paOutputUnderflow, paUnanticipatedHostError, PaUtil_BeginBufferProcessing(), PaUtil_BeginCpuLoadMeasurement(), PaUtil_EndBufferProcessing(), PaUtil_EndCpuLoadMeasurement(), PaUtil_GetCpuLoad(), PaUtil_GetTime(), PaUtil_ResetCpuLoadMeasurer(), PaUtil_SetInputFrameCount(), PaUtil_SetInterleavedInputChannels(), PaUtil_SetInterleavedOutputChannels(), PaUtil_SetOutputFrameCount(), PaUtil_ZeroOutput(), PaWinMmeStream::processingThread, PaWinMmeStream::processingThreadPriority, PaUtilBufferProcessor::samplePeriod, PaWinMmeStream::stopProcessing, PaUtilStreamRepresentation::streamFinishedCallback, PaWinMmeStream::streamRepresentation, PaWinMmeStream::throttledSleepMsecs, PaWinMmeStream::throttledThreadPriority, PaWinMmeStream::throttleProcessingThreadOnOverload, PaUtilStreamRepresentation::userData, PaWinMmeSingleDirectionHandlesAndBuffers::waveHandles, and PaWinMmeSingleDirectionHandlesAndBuffers::waveHeaders.