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