Jamoma API  0.6.0.a19
pa_win_wmme.h
Go to the documentation of this file.
1 #ifndef PA_WIN_WMME_H
2 #define PA_WIN_WMME_H
3 /*
4  * $Id: pa_win_wmme.h 1247 2007-08-11 16:29:09Z rossb $
5  * PortAudio Portable Real-Time Audio Library
6  * MME specific extensions
7  *
8  * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
9  *
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:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
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.
28  */
29 
30 /*
31  * The text above constitutes the entire PortAudio license; however,
32  * the PortAudio community also makes the following non-binding requests:
33  *
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
38  * license above.
39  */
40 
41 /** @file
42  @brief WMME-specific PortAudio API extension header file.
43 */
44 
45 
46 #include "portaudio.h"
47 #include "pa_win_waveformat.h"
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif /* __cplusplus */
53 
54 
55 #define paWinMmeUseLowLevelLatencyParameters (0x01)
56 #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */
57 #define paWinMmeUseChannelMask (0x04)
58 
59 /* By default, the mme implementation drops the processing thread's priority
60  to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100%
61  This flag disables any priority throttling. The processing thread will always
62  run at THREAD_PRIORITY_TIME_CRITICAL.
63 */
64 #define paWinMmeDontThrottleOverloadedProcessingThread (0x08)
65 
66 
67 typedef struct PaWinMmeDeviceAndChannelCount{
68  PaDeviceIndex device;
69  int channelCount;
70 }PaWinMmeDeviceAndChannelCount;
71 
72 
73 typedef struct PaWinMmeStreamInfo{
74  unsigned long size; /**< sizeof(PaWinMmeStreamInfo) */
75  PaHostApiTypeId hostApiType; /**< paMME */
76  unsigned long version; /**< 1 */
77 
78  unsigned long flags;
79 
80  /* low-level latency setting support
81  These settings control the number and size of host buffers in order
82  to set latency. They will be used instead of the generic parameters
83  to Pa_OpenStream() if flags contains the PaWinMmeUseLowLevelLatencyParameters
84  flag.
85 
86  If PaWinMmeStreamInfo structures with PaWinMmeUseLowLevelLatencyParameters
87  are supplied for both input and output in a full duplex stream, then the
88  input and output framesPerBuffer must be the same, or the larger of the
89  two must be a multiple of the smaller, otherwise a
90  paIncompatibleHostApiSpecificStreamInfo error will be returned from
91  Pa_OpenStream().
92  */
93  unsigned long framesPerBuffer;
94  unsigned long bufferCount; /* formerly numBuffers */
95 
96  /* multiple devices per direction support
97  If flags contains the PaWinMmeUseMultipleDevices flag,
98  this functionality will be used, otherwise the device parameter to
99  Pa_OpenStream() will be used instead.
100  If devices are specified here, the corresponding device parameter
101  to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification,
102  otherwise an paInvalidDevice error will result.
103  The total number of channels accross all specified devices
104  must agree with the corresponding channelCount parameter to
105  Pa_OpenStream() otherwise a paInvalidChannelCount error will result.
106  */
107  PaWinMmeDeviceAndChannelCount *devices;
108  unsigned long deviceCount;
109 
110  /*
111  support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
112  paWinMmeUseChannelMask this allows you to specify which speakers
113  to address in a multichannel stream. Constants for channelMask
114  are specified in pa_win_waveformat.h
115 
116  */
117  PaWinWaveFormatChannelMask channelMask;
118 
119 }PaWinMmeStreamInfo;
120 
121 
122 /** Retrieve the number of wave in handles used by a PortAudio WinMME stream.
123  Returns zero if the stream is output only.
124 
125  @return A non-negative value indicating the number of wave in handles
126  or, a PaErrorCode (which are always negative) if PortAudio is not initialized
127  or an error is encountered.
128 
129  @see PaWinMME_GetStreamInputHandle
130 */
132 
133 
134 /** Retrieve a wave in handle used by a PortAudio WinMME stream.
135 
136  @param stream The stream to query.
137  @param handleIndex The zero based index of the wave in handle to retrieve. This
138  should be in the range [0, PaWinMME_GetStreamInputHandleCount(stream)-1].
139 
140  @return A valid wave in handle, or NULL if an error occurred.
141 
142  @see PaWinMME_GetStreamInputHandle
143 */
144 HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* stream, int handleIndex );
145 
146 
147 /** Retrieve the number of wave out handles used by a PortAudio WinMME stream.
148  Returns zero if the stream is input only.
149 
150  @return A non-negative value indicating the number of wave out handles
151  or, a PaErrorCode (which are always negative) if PortAudio is not initialized
152  or an error is encountered.
153 
154  @see PaWinMME_GetStreamOutputHandle
155 */
157 
158 
159 /** Retrieve a wave out handle used by a PortAudio WinMME stream.
160 
161  @param stream The stream to query.
162  @param handleIndex The zero based index of the wave out handle to retrieve.
163  This should be in the range [0, PaWinMME_GetStreamOutputHandleCount(stream)-1].
164 
165  @return A valid wave out handle, or NULL if an error occurred.
166 
167  @see PaWinMME_GetStreamOutputHandleCount
168 */
169 HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* stream, int handleIndex );
170 
171 
172 #ifdef __cplusplus
173 }
174 #endif /* __cplusplus */
175 
176 #endif /* PA_WIN_WMME_H */
int PaWinMME_GetStreamOutputHandleCount(PaStream *stream)
Retrieve the number of wave out handles used by a PortAudio WinMME stream.
void PaStream
A single PaStream can provide multiple channels of real-time streaming audio input and output to a cl...
Definition: portaudio.h:579
int PaDeviceIndex
The type used to refer to audio devices.
Definition: portaudio.h:160
int PaWinMME_GetStreamInputHandleCount(PaStream *stream)
Retrieve the number of wave in handles used by a PortAudio WinMME stream.
The PortAudio API.
PaHostApiTypeId
Unchanging unique identifiers for each supported host API.
Definition: portaudio.h:223
HWAVEOUT PaWinMME_GetStreamOutputHandle(PaStream *stream, int handleIndex)
Retrieve a wave out handle used by a PortAudio WinMME stream.
Windows specific PortAudio API extension and utilities header file.
HWAVEIN PaWinMME_GetStreamInputHandle(PaStream *stream, int handleIndex)
Retrieve a wave in handle used by a PortAudio WinMME stream.