PortAudio 2.0
|
00001 #ifndef PA_HOSTAPI_H 00002 #define PA_HOSTAPI_H 00003 /* 00004 * $Id: pa_hostapi.h 1634 2011-03-04 04:12:08Z rossb $ 00005 * Portable Audio I/O Library 00006 * host api representation 00007 * 00008 * Based on the Open Source API proposed by Ross Bencina 00009 * Copyright (c) 1999-2008 Ross Bencina, Phil Burk 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining 00012 * a copy of this software and associated documentation files 00013 * (the "Software"), to deal in the Software without restriction, 00014 * including without limitation the rights to use, copy, modify, merge, 00015 * publish, distribute, sublicense, and/or sell copies of the Software, 00016 * and to permit persons to whom the Software is furnished to do so, 00017 * subject to the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be 00020 * included in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00023 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00024 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00025 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 00026 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 00027 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00028 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00029 */ 00030 00031 /* 00032 * The text above constitutes the entire PortAudio license; however, 00033 * the PortAudio community also makes the following non-binding requests: 00034 * 00035 * Any person wishing to distribute modifications to the Software is 00036 * requested to send the modifications to the original developer so that 00037 * they can be incorporated into the canonical version. It is also 00038 * requested that these non-binding requests be included along with the 00039 * license above. 00040 */ 00041 00049 #include "portaudio.h" 00050 00063 #ifndef PA_USE_SKELETON 00064 #define PA_USE_SKELETON 0 00065 #elif (PA_USE_SKELETON != 0) && (PA_USE_SKELETON != 1) 00066 #undef PA_USE_SKELETON 00067 #define PA_USE_SKELETON 1 00068 #endif 00069 00070 #if defined(PA_NO_ASIO) || defined(PA_NO_DS) || defined(PA_NO_WMME) || defined(PA_NO_WASAPI) || defined(PA_NO_WDMKS) 00071 #error "Portaudio: PA_NO_<APINAME> is no longer supported, please remove definition and use PA_USE_<APINAME> instead" 00072 #endif 00073 00074 #ifndef PA_USE_ASIO 00075 #define PA_USE_ASIO 0 00076 #elif (PA_USE_ASIO != 0) && (PA_USE_ASIO != 1) 00077 #undef PA_USE_ASIO 00078 #define PA_USE_ASIO 1 00079 #endif 00080 00081 #ifndef PA_USE_DS 00082 #define PA_USE_DS 0 00083 #elif (PA_USE_DS != 0) && (PA_USE_DS != 1) 00084 #undef PA_USE_DS 00085 #define PA_USE_DS 1 00086 #endif 00087 00088 #ifndef PA_USE_WMME 00089 #define PA_USE_WMME 0 00090 #elif (PA_USE_WMME != 0) && (PA_USE_WMME != 1) 00091 #undef PA_USE_WMME 00092 #define PA_USE_WMME 1 00093 #endif 00094 00095 #ifndef PA_USE_WASAPI 00096 #define PA_USE_WASAPI 0 00097 #elif (PA_USE_WASAPI != 0) && (PA_USE_WASAPI != 1) 00098 #undef PA_USE_WASAPI 00099 #define PA_USE_WASAPI 1 00100 #endif 00101 00102 #ifndef PA_USE_WDMKS 00103 #define PA_USE_WDMKS 0 00104 #elif (PA_USE_WDMKS != 0) && (PA_USE_WDMKS != 1) 00105 #undef PA_USE_WDMKS 00106 #define PA_USE_WDMKS 1 00107 #endif 00108 00109 #ifdef __cplusplus 00110 extern "C" 00111 { 00112 #endif /* __cplusplus */ 00113 00114 00120 typedef struct PaUtilPrivatePaFrontHostApiInfo { 00121 00122 00123 unsigned long baseDeviceIndex; 00124 }PaUtilPrivatePaFrontHostApiInfo; 00125 00126 00135 typedef struct PaUtilHostApiSpecificStreamInfoHeader 00136 { 00137 unsigned long size; 00138 PaHostApiTypeId hostApiType; 00139 unsigned long version; 00140 } PaUtilHostApiSpecificStreamInfoHeader; 00141 00142 00143 00147 typedef struct PaUtilHostApiRepresentation { 00148 PaUtilPrivatePaFrontHostApiInfo privatePaFrontInfo; 00149 00157 PaHostApiInfo info; 00158 00159 PaDeviceInfo** deviceInfos; 00160 00166 void (*Terminate)( struct PaUtilHostApiRepresentation *hostApi ); 00167 00263 PaError (*OpenStream)( struct PaUtilHostApiRepresentation *hostApi, 00264 PaStream** stream, 00265 const PaStreamParameters *inputParameters, 00266 const PaStreamParameters *outputParameters, 00267 double sampleRate, 00268 unsigned long framesPerCallback, 00269 PaStreamFlags streamFlags, 00270 PaStreamCallback *streamCallback, 00271 void *userData ); 00272 00273 00274 PaError (*IsFormatSupported)( struct PaUtilHostApiRepresentation *hostApi, 00275 const PaStreamParameters *inputParameters, 00276 const PaStreamParameters *outputParameters, 00277 double sampleRate ); 00278 } PaUtilHostApiRepresentation; 00279 00280 00292 typedef PaError PaUtilHostApiInitializer( PaUtilHostApiRepresentation**, PaHostApiIndex ); 00293 00294 00302 extern PaUtilHostApiInitializer *paHostApiInitializers[]; 00303 00304 00310 extern int paDefaultHostApiIndex; 00311 00312 00313 #ifdef __cplusplus 00314 } 00315 #endif /* __cplusplus */ 00316 #endif /* PA_HOSTAPI_H */