annotate src/portaudio/include/pa_win_wmme.h @ 36:55ece8862b6d

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