annotate src/portaudio_20140130/include/pa_win_wmme.h @ 81:7029a4916348

Merge build update
author Chris Cannam
date Thu, 31 Oct 2019 13:36:58 +0000
parents 7ddb4fc30dac
children
rev   line source
Chris@39 1 #ifndef PA_WIN_WMME_H
Chris@39 2 #define PA_WIN_WMME_H
Chris@39 3 /*
Chris@39 4 * $Id: pa_win_wmme.h 1592 2011-02-04 10:41:58Z rossb $
Chris@39 5 * PortAudio Portable Real-Time Audio Library
Chris@39 6 * MME specific extensions
Chris@39 7 *
Chris@39 8 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
Chris@39 9 *
Chris@39 10 * Permission is hereby granted, free of charge, to any person obtaining
Chris@39 11 * a copy of this software and associated documentation files
Chris@39 12 * (the "Software"), to deal in the Software without restriction,
Chris@39 13 * including without limitation the rights to use, copy, modify, merge,
Chris@39 14 * publish, distribute, sublicense, and/or sell copies of the Software,
Chris@39 15 * and to permit persons to whom the Software is furnished to do so,
Chris@39 16 * subject to the following conditions:
Chris@39 17 *
Chris@39 18 * The above copyright notice and this permission notice shall be
Chris@39 19 * included in all copies or substantial portions of the Software.
Chris@39 20 *
Chris@39 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Chris@39 22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Chris@39 23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Chris@39 24 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
Chris@39 25 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Chris@39 26 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
Chris@39 27 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Chris@39 28 */
Chris@39 29
Chris@39 30 /*
Chris@39 31 * The text above constitutes the entire PortAudio license; however,
Chris@39 32 * the PortAudio community also makes the following non-binding requests:
Chris@39 33 *
Chris@39 34 * Any person wishing to distribute modifications to the Software is
Chris@39 35 * requested to send the modifications to the original developer so that
Chris@39 36 * they can be incorporated into the canonical version. It is also
Chris@39 37 * requested that these non-binding requests be included along with the
Chris@39 38 * license above.
Chris@39 39 */
Chris@39 40
Chris@39 41 /** @file
Chris@39 42 @ingroup public_header
Chris@39 43 @brief WMME-specific PortAudio API extension header file.
Chris@39 44 */
Chris@39 45
Chris@39 46 #include "portaudio.h"
Chris@39 47 #include "pa_win_waveformat.h"
Chris@39 48
Chris@39 49 #ifdef __cplusplus
Chris@39 50 extern "C"
Chris@39 51 {
Chris@39 52 #endif /* __cplusplus */
Chris@39 53
Chris@39 54
Chris@39 55 /* The following are flags which can be set in
Chris@39 56 PaWinMmeStreamInfo's flags field.
Chris@39 57 */
Chris@39 58
Chris@39 59 #define paWinMmeUseLowLevelLatencyParameters (0x01)
Chris@39 60 #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */
Chris@39 61 #define paWinMmeUseChannelMask (0x04)
Chris@39 62
Chris@39 63 /* By default, the mme implementation drops the processing thread's priority
Chris@39 64 to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100%
Chris@39 65 This flag disables any priority throttling. The processing thread will always
Chris@39 66 run at THREAD_PRIORITY_TIME_CRITICAL.
Chris@39 67 */
Chris@39 68 #define paWinMmeDontThrottleOverloadedProcessingThread (0x08)
Chris@39 69
Chris@39 70 /* Flags for non-PCM spdif passthrough.
Chris@39 71 */
Chris@39 72 #define paWinMmeWaveFormatDolbyAc3Spdif (0x10)
Chris@39 73 #define paWinMmeWaveFormatWmaSpdif (0x20)
Chris@39 74
Chris@39 75
Chris@39 76 typedef struct PaWinMmeDeviceAndChannelCount{
Chris@39 77 PaDeviceIndex device;
Chris@39 78 int channelCount;
Chris@39 79 }PaWinMmeDeviceAndChannelCount;
Chris@39 80
Chris@39 81
Chris@39 82 typedef struct PaWinMmeStreamInfo{
Chris@39 83 unsigned long size; /**< sizeof(PaWinMmeStreamInfo) */
Chris@39 84 PaHostApiTypeId hostApiType; /**< paMME */
Chris@39 85 unsigned long version; /**< 1 */
Chris@39 86
Chris@39 87 unsigned long flags;
Chris@39 88
Chris@39 89 /* low-level latency setting support
Chris@39 90 These settings control the number and size of host buffers in order
Chris@39 91 to set latency. They will be used instead of the generic parameters
Chris@39 92 to Pa_OpenStream() if flags contains the PaWinMmeUseLowLevelLatencyParameters
Chris@39 93 flag.
Chris@39 94
Chris@39 95 If PaWinMmeStreamInfo structures with PaWinMmeUseLowLevelLatencyParameters
Chris@39 96 are supplied for both input and output in a full duplex stream, then the
Chris@39 97 input and output framesPerBuffer must be the same, or the larger of the
Chris@39 98 two must be a multiple of the smaller, otherwise a
Chris@39 99 paIncompatibleHostApiSpecificStreamInfo error will be returned from
Chris@39 100 Pa_OpenStream().
Chris@39 101 */
Chris@39 102 unsigned long framesPerBuffer;
Chris@39 103 unsigned long bufferCount; /* formerly numBuffers */
Chris@39 104
Chris@39 105 /* multiple devices per direction support
Chris@39 106 If flags contains the PaWinMmeUseMultipleDevices flag,
Chris@39 107 this functionality will be used, otherwise the device parameter to
Chris@39 108 Pa_OpenStream() will be used instead.
Chris@39 109 If devices are specified here, the corresponding device parameter
Chris@39 110 to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification,
Chris@39 111 otherwise an paInvalidDevice error will result.
Chris@39 112 The total number of channels accross all specified devices
Chris@39 113 must agree with the corresponding channelCount parameter to
Chris@39 114 Pa_OpenStream() otherwise a paInvalidChannelCount error will result.
Chris@39 115 */
Chris@39 116 PaWinMmeDeviceAndChannelCount *devices;
Chris@39 117 unsigned long deviceCount;
Chris@39 118
Chris@39 119 /*
Chris@39 120 support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
Chris@39 121 paWinMmeUseChannelMask this allows you to specify which speakers
Chris@39 122 to address in a multichannel stream. Constants for channelMask
Chris@39 123 are specified in pa_win_waveformat.h
Chris@39 124
Chris@39 125 */
Chris@39 126 PaWinWaveFormatChannelMask channelMask;
Chris@39 127
Chris@39 128 }PaWinMmeStreamInfo;
Chris@39 129
Chris@39 130
Chris@39 131 /** Retrieve the number of wave in handles used by a PortAudio WinMME stream.
Chris@39 132 Returns zero if the stream is output only.
Chris@39 133
Chris@39 134 @return A non-negative value indicating the number of wave in handles
Chris@39 135 or, a PaErrorCode (which are always negative) if PortAudio is not initialized
Chris@39 136 or an error is encountered.
Chris@39 137
Chris@39 138 @see PaWinMME_GetStreamInputHandle
Chris@39 139 */
Chris@39 140 int PaWinMME_GetStreamInputHandleCount( PaStream* stream );
Chris@39 141
Chris@39 142
Chris@39 143 /** Retrieve a wave in handle used by a PortAudio WinMME stream.
Chris@39 144
Chris@39 145 @param stream The stream to query.
Chris@39 146 @param handleIndex The zero based index of the wave in handle to retrieve. This
Chris@39 147 should be in the range [0, PaWinMME_GetStreamInputHandleCount(stream)-1].
Chris@39 148
Chris@39 149 @return A valid wave in handle, or NULL if an error occurred.
Chris@39 150
Chris@39 151 @see PaWinMME_GetStreamInputHandle
Chris@39 152 */
Chris@39 153 HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* stream, int handleIndex );
Chris@39 154
Chris@39 155
Chris@39 156 /** Retrieve the number of wave out handles used by a PortAudio WinMME stream.
Chris@39 157 Returns zero if the stream is input only.
Chris@39 158
Chris@39 159 @return A non-negative value indicating the number of wave out handles
Chris@39 160 or, a PaErrorCode (which are always negative) if PortAudio is not initialized
Chris@39 161 or an error is encountered.
Chris@39 162
Chris@39 163 @see PaWinMME_GetStreamOutputHandle
Chris@39 164 */
Chris@39 165 int PaWinMME_GetStreamOutputHandleCount( PaStream* stream );
Chris@39 166
Chris@39 167
Chris@39 168 /** Retrieve a wave out handle used by a PortAudio WinMME stream.
Chris@39 169
Chris@39 170 @param stream The stream to query.
Chris@39 171 @param handleIndex The zero based index of the wave out handle to retrieve.
Chris@39 172 This should be in the range [0, PaWinMME_GetStreamOutputHandleCount(stream)-1].
Chris@39 173
Chris@39 174 @return A valid wave out handle, or NULL if an error occurred.
Chris@39 175
Chris@39 176 @see PaWinMME_GetStreamOutputHandleCount
Chris@39 177 */
Chris@39 178 HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* stream, int handleIndex );
Chris@39 179
Chris@39 180
Chris@39 181 #ifdef __cplusplus
Chris@39 182 }
Chris@39 183 #endif /* __cplusplus */
Chris@39 184
Chris@39 185 #endif /* PA_WIN_WMME_H */