Chris@45: #ifndef PA_WIN_WMME_H Chris@45: #define PA_WIN_WMME_H Chris@45: /* Chris@45: * $Id: pa_win_wmme.h 1592 2011-02-04 10:41:58Z rossb $ Chris@45: * PortAudio Portable Real-Time Audio Library Chris@45: * MME specific extensions Chris@45: * Chris@45: * Copyright (c) 1999-2000 Ross Bencina and Phil Burk Chris@45: * Chris@45: * Permission is hereby granted, free of charge, to any person obtaining Chris@45: * a copy of this software and associated documentation files Chris@45: * (the "Software"), to deal in the Software without restriction, Chris@45: * including without limitation the rights to use, copy, modify, merge, Chris@45: * publish, distribute, sublicense, and/or sell copies of the Software, Chris@45: * and to permit persons to whom the Software is furnished to do so, Chris@45: * subject to the following conditions: Chris@45: * Chris@45: * The above copyright notice and this permission notice shall be Chris@45: * included in all copies or substantial portions of the Software. Chris@45: * Chris@45: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Chris@45: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Chris@45: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. Chris@45: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR Chris@45: * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF Chris@45: * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Chris@45: * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chris@45: */ Chris@45: Chris@45: /* Chris@45: * The text above constitutes the entire PortAudio license; however, Chris@45: * the PortAudio community also makes the following non-binding requests: Chris@45: * Chris@45: * Any person wishing to distribute modifications to the Software is Chris@45: * requested to send the modifications to the original developer so that Chris@45: * they can be incorporated into the canonical version. It is also Chris@45: * requested that these non-binding requests be included along with the Chris@45: * license above. Chris@45: */ Chris@45: Chris@45: /** @file Chris@45: @ingroup public_header Chris@45: @brief WMME-specific PortAudio API extension header file. Chris@45: */ Chris@45: Chris@45: #include "portaudio.h" Chris@45: #include "pa_win_waveformat.h" Chris@45: Chris@45: #ifdef __cplusplus Chris@45: extern "C" Chris@45: { Chris@45: #endif /* __cplusplus */ Chris@45: Chris@45: Chris@45: /* The following are flags which can be set in Chris@45: PaWinMmeStreamInfo's flags field. Chris@45: */ Chris@45: Chris@45: #define paWinMmeUseLowLevelLatencyParameters (0x01) Chris@45: #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ Chris@45: #define paWinMmeUseChannelMask (0x04) Chris@45: Chris@45: /* By default, the mme implementation drops the processing thread's priority Chris@45: to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100% Chris@45: This flag disables any priority throttling. The processing thread will always Chris@45: run at THREAD_PRIORITY_TIME_CRITICAL. Chris@45: */ Chris@45: #define paWinMmeDontThrottleOverloadedProcessingThread (0x08) Chris@45: Chris@45: /* Flags for non-PCM spdif passthrough. Chris@45: */ Chris@45: #define paWinMmeWaveFormatDolbyAc3Spdif (0x10) Chris@45: #define paWinMmeWaveFormatWmaSpdif (0x20) Chris@45: Chris@45: Chris@45: typedef struct PaWinMmeDeviceAndChannelCount{ Chris@45: PaDeviceIndex device; Chris@45: int channelCount; Chris@45: }PaWinMmeDeviceAndChannelCount; Chris@45: Chris@45: Chris@45: typedef struct PaWinMmeStreamInfo{ Chris@45: unsigned long size; /**< sizeof(PaWinMmeStreamInfo) */ Chris@45: PaHostApiTypeId hostApiType; /**< paMME */ Chris@45: unsigned long version; /**< 1 */ Chris@45: Chris@45: unsigned long flags; Chris@45: Chris@45: /* low-level latency setting support Chris@45: These settings control the number and size of host buffers in order Chris@45: to set latency. They will be used instead of the generic parameters Chris@45: to Pa_OpenStream() if flags contains the PaWinMmeUseLowLevelLatencyParameters Chris@45: flag. Chris@45: Chris@45: If PaWinMmeStreamInfo structures with PaWinMmeUseLowLevelLatencyParameters Chris@45: are supplied for both input and output in a full duplex stream, then the Chris@45: input and output framesPerBuffer must be the same, or the larger of the Chris@45: two must be a multiple of the smaller, otherwise a Chris@45: paIncompatibleHostApiSpecificStreamInfo error will be returned from Chris@45: Pa_OpenStream(). Chris@45: */ Chris@45: unsigned long framesPerBuffer; Chris@45: unsigned long bufferCount; /* formerly numBuffers */ Chris@45: Chris@45: /* multiple devices per direction support Chris@45: If flags contains the PaWinMmeUseMultipleDevices flag, Chris@45: this functionality will be used, otherwise the device parameter to Chris@45: Pa_OpenStream() will be used instead. Chris@45: If devices are specified here, the corresponding device parameter Chris@45: to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification, Chris@45: otherwise an paInvalidDevice error will result. Chris@45: The total number of channels accross all specified devices Chris@45: must agree with the corresponding channelCount parameter to Chris@45: Pa_OpenStream() otherwise a paInvalidChannelCount error will result. Chris@45: */ Chris@45: PaWinMmeDeviceAndChannelCount *devices; Chris@45: unsigned long deviceCount; Chris@45: Chris@45: /* Chris@45: support for WAVEFORMATEXTENSIBLE channel masks. If flags contains Chris@45: paWinMmeUseChannelMask this allows you to specify which speakers Chris@45: to address in a multichannel stream. Constants for channelMask Chris@45: are specified in pa_win_waveformat.h Chris@45: Chris@45: */ Chris@45: PaWinWaveFormatChannelMask channelMask; Chris@45: Chris@45: }PaWinMmeStreamInfo; Chris@45: Chris@45: Chris@45: /** Retrieve the number of wave in handles used by a PortAudio WinMME stream. Chris@45: Returns zero if the stream is output only. Chris@45: Chris@45: @return A non-negative value indicating the number of wave in handles Chris@45: or, a PaErrorCode (which are always negative) if PortAudio is not initialized Chris@45: or an error is encountered. Chris@45: Chris@45: @see PaWinMME_GetStreamInputHandle Chris@45: */ Chris@45: int PaWinMME_GetStreamInputHandleCount( PaStream* stream ); Chris@45: Chris@45: Chris@45: /** Retrieve a wave in handle used by a PortAudio WinMME stream. Chris@45: Chris@45: @param stream The stream to query. Chris@45: @param handleIndex The zero based index of the wave in handle to retrieve. This Chris@45: should be in the range [0, PaWinMME_GetStreamInputHandleCount(stream)-1]. Chris@45: Chris@45: @return A valid wave in handle, or NULL if an error occurred. Chris@45: Chris@45: @see PaWinMME_GetStreamInputHandle Chris@45: */ Chris@45: HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* stream, int handleIndex ); Chris@45: Chris@45: Chris@45: /** Retrieve the number of wave out handles used by a PortAudio WinMME stream. Chris@45: Returns zero if the stream is input only. Chris@45: Chris@45: @return A non-negative value indicating the number of wave out handles Chris@45: or, a PaErrorCode (which are always negative) if PortAudio is not initialized Chris@45: or an error is encountered. Chris@45: Chris@45: @see PaWinMME_GetStreamOutputHandle Chris@45: */ Chris@45: int PaWinMME_GetStreamOutputHandleCount( PaStream* stream ); Chris@45: Chris@45: Chris@45: /** Retrieve a wave out handle used by a PortAudio WinMME stream. Chris@45: Chris@45: @param stream The stream to query. Chris@45: @param handleIndex The zero based index of the wave out handle to retrieve. Chris@45: This should be in the range [0, PaWinMME_GetStreamOutputHandleCount(stream)-1]. Chris@45: Chris@45: @return A valid wave out handle, or NULL if an error occurred. Chris@45: Chris@45: @see PaWinMME_GetStreamOutputHandleCount Chris@45: */ Chris@45: HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* stream, int handleIndex ); Chris@45: Chris@45: Chris@45: #ifdef __cplusplus Chris@45: } Chris@45: #endif /* __cplusplus */ Chris@45: Chris@45: #endif /* PA_WIN_WMME_H */