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