annotate win64-msvc/include/pa_win_wmme.h @ 166:cbd6d7e562c7

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