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