PortAudio 2.0

pa_win_ds_dynlink.h

Go to the documentation of this file.
00001 /*
00002  * Interface for dynamically loading directsound and providing a dummy
00003  * implementation if it isn't present.
00004  *
00005  * Author: Ross Bencina (some portions Phil Burk & Robert Marsanyi)
00006  *
00007  * For PortAudio Portable Real-Time Audio Library
00008  * For more information see: http://www.portaudio.com
00009  * Copyright (c) 1999-2006 Phil Burk, Robert Marsanyi and Ross Bencina
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 
00047 #ifndef INCLUDED_PA_DSOUND_DYNLINK_H
00048 #define INCLUDED_PA_DSOUND_DYNLINK_H
00049 
00050 /* on Borland compilers, WIN32 doesn't seem to be defined by default, which
00051     breaks dsound.h. Adding the define here fixes the problem. - rossb. */
00052 #ifdef __BORLANDC__
00053 #if !defined(WIN32)
00054 #define WIN32
00055 #endif
00056 #endif
00057 
00058 /*
00059   Use the earliest version of DX required, no need to polute the namespace
00060 */
00061 #ifdef PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE
00062 #define DIRECTSOUND_VERSION 0x0800
00063 #else
00064 #define DIRECTSOUND_VERSION 0x0300
00065 #endif
00066 #include <dsound.h>
00067 
00068 #ifdef __cplusplus
00069 extern "C"
00070 {
00071 #endif /* __cplusplus */
00072 
00073 
00074 typedef struct
00075 {
00076     HINSTANCE hInstance_;
00077     
00078     HRESULT (WINAPI *DllGetClassObject)(REFCLSID , REFIID , LPVOID *);
00079 
00080     HRESULT (WINAPI *DirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
00081     HRESULT (WINAPI *DirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID);
00082     HRESULT (WINAPI *DirectSoundEnumerateA)(LPDSENUMCALLBACKA, LPVOID);
00083 
00084     HRESULT (WINAPI *DirectSoundCaptureCreate)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
00085     HRESULT (WINAPI *DirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW, LPVOID);
00086     HRESULT (WINAPI *DirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA, LPVOID);
00087 
00088 #ifdef PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE
00089     HRESULT (WINAPI *DirectSoundFullDuplexCreate8)(
00090                 LPCGUID, LPCGUID, LPCDSCBUFFERDESC, LPCDSBUFFERDESC,
00091                 HWND, DWORD, LPDIRECTSOUNDFULLDUPLEX *, LPDIRECTSOUNDCAPTUREBUFFER8 *, 
00092                 LPDIRECTSOUNDBUFFER8 *, LPUNKNOWN );
00093 #endif
00094 }PaWinDsDSoundEntryPoints;
00095 
00096 extern PaWinDsDSoundEntryPoints paWinDsDSoundEntryPoints;
00097 
00098 void PaWinDs_InitializeDSoundEntryPoints(void);
00099 void PaWinDs_TerminateDSoundEntryPoints(void);
00100 
00101 
00102 #ifdef __cplusplus
00103 }
00104 #endif /* __cplusplus */
00105 
00106 #endif /* INCLUDED_PA_DSOUND_DYNLINK_H */