PortAudio 2.0
|
00001 #ifndef PA_WIN_WMME_H 00002 #define PA_WIN_WMME_H 00003 /* 00004 * $Id: pa_win_wmme.h 1592 2011-02-04 10:41:58Z rossb $ 00005 * PortAudio Portable Real-Time Audio Library 00006 * MME specific extensions 00007 * 00008 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk 00009 * 00010 * Permission is hereby granted, free of charge, to any person obtaining 00011 * a copy of this software and associated documentation files 00012 * (the "Software"), to deal in the Software without restriction, 00013 * including without limitation the rights to use, copy, modify, merge, 00014 * publish, distribute, sublicense, and/or sell copies of the Software, 00015 * and to permit persons to whom the Software is furnished to do so, 00016 * subject to the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be 00019 * included in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00022 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00023 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00024 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 00025 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 00026 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00027 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00028 */ 00029 00030 /* 00031 * The text above constitutes the entire PortAudio license; however, 00032 * the PortAudio community also makes the following non-binding requests: 00033 * 00034 * Any person wishing to distribute modifications to the Software is 00035 * requested to send the modifications to the original developer so that 00036 * they can be incorporated into the canonical version. It is also 00037 * requested that these non-binding requests be included along with the 00038 * license above. 00039 */ 00040 00046 #include "portaudio.h" 00047 #include "pa_win_waveformat.h" 00048 00049 #ifdef __cplusplus 00050 extern "C" 00051 { 00052 #endif /* __cplusplus */ 00053 00054 00055 /* The following are flags which can be set in 00056 PaWinMmeStreamInfo's flags field. 00057 */ 00058 00059 #define paWinMmeUseLowLevelLatencyParameters (0x01) 00060 #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ 00061 #define paWinMmeUseChannelMask (0x04) 00062 00063 /* By default, the mme implementation drops the processing thread's priority 00064 to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100% 00065 This flag disables any priority throttling. The processing thread will always 00066 run at THREAD_PRIORITY_TIME_CRITICAL. 00067 */ 00068 #define paWinMmeDontThrottleOverloadedProcessingThread (0x08) 00069 00070 /* Flags for non-PCM spdif passthrough. 00071 */ 00072 #define paWinMmeWaveFormatDolbyAc3Spdif (0x10) 00073 #define paWinMmeWaveFormatWmaSpdif (0x20) 00074 00075 00076 typedef struct PaWinMmeDeviceAndChannelCount{ 00077 PaDeviceIndex device; 00078 int channelCount; 00079 }PaWinMmeDeviceAndChannelCount; 00080 00081 00082 typedef struct PaWinMmeStreamInfo{ 00083 unsigned long size; 00084 PaHostApiTypeId hostApiType; 00085 unsigned long version; 00087 unsigned long flags; 00088 00089 /* low-level latency setting support 00090 These settings control the number and size of host buffers in order 00091 to set latency. They will be used instead of the generic parameters 00092 to Pa_OpenStream() if flags contains the PaWinMmeUseLowLevelLatencyParameters 00093 flag. 00094 00095 If PaWinMmeStreamInfo structures with PaWinMmeUseLowLevelLatencyParameters 00096 are supplied for both input and output in a full duplex stream, then the 00097 input and output framesPerBuffer must be the same, or the larger of the 00098 two must be a multiple of the smaller, otherwise a 00099 paIncompatibleHostApiSpecificStreamInfo error will be returned from 00100 Pa_OpenStream(). 00101 */ 00102 unsigned long framesPerBuffer; 00103 unsigned long bufferCount; /* formerly numBuffers */ 00104 00105 /* multiple devices per direction support 00106 If flags contains the PaWinMmeUseMultipleDevices flag, 00107 this functionality will be used, otherwise the device parameter to 00108 Pa_OpenStream() will be used instead. 00109 If devices are specified here, the corresponding device parameter 00110 to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification, 00111 otherwise an paInvalidDevice error will result. 00112 The total number of channels accross all specified devices 00113 must agree with the corresponding channelCount parameter to 00114 Pa_OpenStream() otherwise a paInvalidChannelCount error will result. 00115 */ 00116 PaWinMmeDeviceAndChannelCount *devices; 00117 unsigned long deviceCount; 00118 00119 /* 00120 support for WAVEFORMATEXTENSIBLE channel masks. If flags contains 00121 paWinMmeUseChannelMask this allows you to specify which speakers 00122 to address in a multichannel stream. Constants for channelMask 00123 are specified in pa_win_waveformat.h 00124 00125 */ 00126 PaWinWaveFormatChannelMask channelMask; 00127 00128 }PaWinMmeStreamInfo; 00129 00130 00140 int PaWinMME_GetStreamInputHandleCount( PaStream* stream ); 00141 00142 00153 HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* stream, int handleIndex ); 00154 00155 00165 int PaWinMME_GetStreamOutputHandleCount( PaStream* stream ); 00166 00167 00178 HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* stream, int handleIndex ); 00179 00180 00181 #ifdef __cplusplus 00182 } 00183 #endif /* __cplusplus */ 00184 00185 #endif /* PA_WIN_WMME_H */