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