1 #ifndef INCLUDED_PA_DSOUND_DYNLINK_H 2 #define INCLUDED_PA_DSOUND_DYNLINK_H 3 /* 4 * Interface for dynamically loading directsound and providing a dummy 5 * implementation if it isn't present. 6 * 7 * Author: Ross Bencina (some portions Phil Burk & Robert Marsanyi 8 * 9 * For PortAudio Portable Real-Time Audio Library 10 * For more information see: http://www.portaudio.com 11 * Copyright (c) 1999-2006 Phil Burk, Robert Marsanyi and Ross Bencina 12 * 13 * Permission is hereby granted, free of charge, to any person obtaining 14 * a copy of this software and associated documentation files 15 * (the "Software"), to deal in the Software without restriction, 16 * including without limitation the rights to use, copy, modify, merge, 17 * publish, distribute, sublicense, and/or sell copies of the Software, 18 * and to permit persons to whom the Software is furnished to do so, 19 * subject to the following conditions: 20 * 21 * The above copyright notice and this permission notice shall be 22 * included in all copies or substantial portions of the Software. 23 * 24 * Any person wishing to distribute modifications to the Software is 25 * requested to send the modifications to the original developer so that 26 * they can be incorporated into the canonical version. 27 * 28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 29 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 31 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 32 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 33 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 34 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 35 * 36 */ 37 38 /* on Borland compilers, WIN32 doesn't seem to be defined by default, which 39 breaks DSound.h. Adding the define here fixes the problem. - rossb. */ 40 #ifdef __BORLANDC__ 41 #if !defined(WIN32) 42 #define WIN32 43 #endif 44 #endif 45 46 /* 47 We are only using DX3 in here, no need to polute the namespace - davidv 48 */ 49 #define DIRECTSOUND_VERSION 0x0300 50 51 #include <DSound.h> 52 53 #ifdef __cplusplus 54 extern "C" 55 { 56 #endif /* __cplusplus */ 57 58 59 typedef struct 60 { 61 HINSTANCE hInstance_; 62 63 HRESULT (WINAPI *DirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); 64 HRESULT (WINAPI *DirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID); 65 HRESULT (WINAPI *DirectSoundEnumerateA)(LPDSENUMCALLBACKA, LPVOID); 66 67 HRESULT (WINAPI *DirectSoundCaptureCreate)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN); 68 HRESULT (WINAPI *DirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW, LPVOID); 69 HRESULT (WINAPI *DirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA, LPVOID); 70 }PaWinDsDSoundEntryPoints; 71 72 extern PaWinDsDSoundEntryPoints paWinDsDSoundEntryPoints; 73 74 void PaWinDs_InitializeDSoundEntryPoints(void); 75 void PaWinDs_TerminateDSoundEntryPoints(void); 76 77 78 #ifdef __cplusplus 79 } 80 #endif /* __cplusplus */ 81 82 #endif /* INCLUDED_PA_DSOUND_DYNLINK_H */ 83