1 2 /* 3 * PortAudio Portable Real-Time Audio Library 4 * PortAudio DLL Header File 5 * Latest version available at: http://www.audiomulch.com/portaudio/ 6 * 7 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining 10 * a copy of this software and associated documentation files 11 * (the "Software"), to deal in the Software without restriction, 12 * including without limitation the rights to use, copy, modify, merge, 13 * publish, distribute, sublicense, and/or sell copies of the Software, 14 * and to permit persons to whom the Software is furnished to do so, 15 * subject to the following conditions: 16 * 17 * The above copyright notice and this permission notice shall be 18 * included in all copies or substantial portions of the Software. 19 * 20 * Any person wishing to distribute modifications to the Software is 21 * requested to send the modifications to the original developer so that 22 * they can be incorporated into the canonical version. 23 * 24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 27 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 28 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 29 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 * 32 */ 33 34 // changed by zplane.developement in order to generate a DLL 35 36 #ifndef __PADLLENTRY_HEADER_INCLUDED__ 37 38 #define __PADLLENTRY_HEADER_INCLUDED__ 39 40 typedef int PaError; 41 typedef enum { 42 paNoError = 0, 43 44 paHostError = -10000, 45 paInvalidChannelCount, 46 paInvalidSampleRate, 47 paInvalidDeviceId, 48 paInvalidFlag, 49 paSampleFormatNotSupported, 50 paBadIODeviceCombination, 51 paInsufficientMemory, 52 paBufferTooBig, 53 paBufferTooSmall, 54 paNullCallback, 55 paBadStreamPtr, 56 paTimedOut, 57 paInternalError 58 } PaErrorNum; 59 60 typedef unsigned long PaSampleFormat; 61 #define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ 62 #define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ 63 #define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ 64 #define paInt24 ((PaSampleFormat) (1<<3)) 65 #define paPackedInt24 ((PaSampleFormat) (1<<4)) 66 #define paInt8 ((PaSampleFormat) (1<<5)) 67 #define paUInt8 ((PaSampleFormat) (1<<6)) /* unsigned 8 bit, 128 is "ground" */ 68 #define paCustomFormat ((PaSampleFormat) (1<<16)) 69 70 71 typedef int PaDeviceID; 72 #define paNoDevice -1 73 74 typedef struct 75 { 76 int structVersion; 77 const char *name; 78 int maxInputChannels; 79 int maxOutputChannels; 80 /* Number of discrete rates, or -1 if range supported. */ 81 int numSampleRates; 82 /* Array of supported sample rates, or {min,max} if range supported. */ 83 const double *sampleRates; 84 PaSampleFormat nativeSampleFormats; 85 } 86 PaDeviceInfo; 87 88 89 typedef double PaTimestamp; 90 91 92 typedef int (PortAudioCallback)( 93 void *inputBuffer, void *outputBuffer, 94 unsigned long framesPerBuffer, 95 PaTimestamp outTime, void *userData ); 96 97 98 #define paNoFlag (0) 99 #define paClipOff (1<<0) /* disable default clipping of out of range samples */ 100 #define paDitherOff (1<<1) /* disable default dithering */ 101 #define paPlatformSpecificFlags (0x00010000) 102 typedef unsigned long PaStreamFlags; 103 104 typedef void PortAudioStream; 105 #define PaStream PortAudioStream 106 107 extern PaError (__cdecl* Pa_Initialize)( void ); 108 109 110 111 extern PaError (__cdecl* Pa_Terminate)( void ); 112 113 114 extern long (__cdecl* Pa_GetHostError)( void ); 115 116 117 extern const char* (__cdecl* Pa_GetErrorText)( PaError ); 118 119 120 121 extern int (__cdecl* Pa_CountDevices)(void); 122 123 extern PaDeviceID (__cdecl* Pa_GetDefaultInputDeviceID)( void ); 124 125 extern PaDeviceID (__cdecl* Pa_GetDefaultOutputDeviceID)( void ); 126 127 128 extern const PaDeviceInfo* (__cdecl* Pa_GetDeviceInfo)( PaDeviceID); 129 130 131 132 extern PaError (__cdecl* Pa_OpenStream)( 133 PortAudioStream ** , 134 PaDeviceID , 135 int , 136 PaSampleFormat , 137 void *, 138 PaDeviceID , 139 int , 140 PaSampleFormat , 141 void *, 142 double , 143 unsigned long , 144 unsigned long , 145 unsigned long , 146 PortAudioCallback *, 147 void * ); 148 149 150 151 extern PaError (__cdecl* Pa_OpenDefaultStream)( PortAudioStream** stream, 152 int numInputChannels, 153 int numOutputChannels, 154 PaSampleFormat sampleFormat, 155 double sampleRate, 156 unsigned long framesPerBuffer, 157 unsigned long numberOfBuffers, 158 PortAudioCallback *callback, 159 void *userData ); 160 161 162 extern PaError (__cdecl* Pa_CloseStream)( PortAudioStream* ); 163 164 165 extern PaError (__cdecl* Pa_StartStream)( PortAudioStream *stream ); 166 167 extern PaError (__cdecl* Pa_StopStream)( PortAudioStream *stream ); 168 169 extern PaError (__cdecl* Pa_AbortStream)( PortAudioStream *stream ); 170 171 extern PaError (__cdecl* Pa_StreamActive)( PortAudioStream *stream ); 172 173 extern PaTimestamp (__cdecl* Pa_StreamTime)( PortAudioStream *stream ); 174 175 extern double (__cdecl* Pa_GetCPULoad)( PortAudioStream* stream ); 176 177 extern int (__cdecl* Pa_GetMinNumBuffers)( int framesPerBuffer, double sampleRate ); 178 179 extern void (__cdecl* Pa_Sleep)( long msec ); 180 181 extern PaError (__cdecl* Pa_GetSampleSize)( PaSampleFormat format ); 182 183 #endif // __PADLLENTRY_HEADER_INCLUDED__ 184 185