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