1 /*---------------------------------------------------------------------
5 *---------------------------------------------------------------------
9 *---------------------------------------------------------------------
11 * ia3d header file. It's the part the outside world needs to see.
13 *---------------------------------------------------------------------
15 * AUREAL SEMICONDUCTOR, INC. PROPRIETARY AND CONFIDENTIAL
16 * Copyright (c) 1996 Aureal Semiconductor, Inc. - All rights
19 *---------------------------------------------------------------------
31 // A3d Class ID! {D8F1EEE0-F634-11cf-8700-00A0245D918B}
32 DEFINE_GUID(CLSID_A3d,
33 0xd8f1eee0, 0xf634, 0x11cf, 0x87, 0x0, 0x0, 0xa0, 0x24, 0x5d, 0x91, 0x8b);
35 // A3d Interface ID! {D8F1EEE1-F634-11cf-8700-00A0245D918B}
37 0xd8f1eee1, 0xf634, 0x11cf, 0x87, 0x0, 0x0, 0xa0, 0x24, 0x5d, 0x91, 0x8b);
39 // GUID generated from UUGENID.EXE, Good until the year 3400 AD
40 // A3d Interface ID! {fb80d1e0-98d3-11d1-90fb-006008a1f441}
41 DEFINE_GUID(IID_IA3d2,
42 0xfb80d1e0, 0x98d3, 0x11d1, 0x90, 0xfb, 0x00, 0x60, 0x08, 0xa1, 0xf4, 0x41);
44 // Bits for manipulating output modes
46 // Values for bOutputMode
47 #define OUTPUT_MODE_STEREO 0x00000001
48 #define OUTPUT_MODE_QUAD 0x00000002
50 // Values for FrontXtalkMode and bRearXtalkMode
51 #define OUTPUT_HEADPHONES 0x00000001 // headphones
52 #define OUTPUT_SPEAKERS_WIDE 0x00000002
53 #define OUTPUT_SPEAKERS_NARROW 0x00000003
55 // Values for Resource Management Mode
56 #define A3D_RESOURCE_MODE_OFF 0x00000000
57 #define A3D_RESOURCE_MODE_NOTIFY 0x00000001
58 #define A3D_RESOURCE_MODE_DYNAMIC 0x00000002
59 #define A3D_RESOURCE_MODE_DYNAMIC_LOOPERS 0x00000003
60 #define A3D_RESOURCE_MODE_LAST 0x00000003
63 // Version Definitions for A3DCAPS
65 #define A3D_CURRENT_VERSION IA3DVERSION_RELEASE12
67 #define IA3DVERSION_RELEASE10 10
68 #define IA3DVERSION_RELEASE12 12
70 // A3d Caps structure for A3d2 interface
71 // If Fail to get IA3d2 interface, version of DLL is IA3DVERSION_PRE12
73 typedef struct __A3DCAPS_SOFTWARE
75 DWORD dwSize; // Use for internal version control
76 DWORD dwVersion; // For Backwards capablities purposes
80 } A3DCAPS_SOFTWARE, *LPA3DCAPS_SOFTWARE;
82 typedef struct __A3DCAPS_HARDWARE
84 DWORD dwSize; // Use for internal version control
88 } A3DCAPS_HARDWARE, *LPA3DCAPS_HARDWARE;
91 // Declare the IA3d Interface. It's not very complex at all.
94 #define INTERFACE IA3d
96 typedef struct IA3d *LPIA3D;
98 DECLARE_INTERFACE_(IA3d, IUnknown)
101 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
102 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
103 STDMETHOD_(ULONG,Release) (THIS) PURE;
106 STDMETHOD(SetOutputMode)(THIS_ DWORD dwFrontXtalkMode, DWORD dwBackXtalkMode, DWORD dwQuadMode) PURE;
107 STDMETHOD(GetOutputMode)(THIS_ DWORD *lpdwFrontXtalkMode, DWORD *lpdwBackXtalkMode, DWORD *lpdwQuadMode) PURE;
109 STDMETHOD(SetResourceManagerMode) (THIS_ DWORD ) PURE;
110 STDMETHOD(GetResourceManagerMode) (THIS_ DWORD *) PURE;
112 STDMETHOD(SetHFAbsorbFactor)(THIS_ FLOAT ) PURE;
113 STDMETHOD(GetHFAbsorbFactor)(THIS_ FLOAT *) PURE;
118 // IA3d2 interface derived from IA3d
121 #define INTERFACE IA3d2
123 typedef struct IA3d2 *LPIA3D2;
125 DECLARE_INTERFACE_(IA3d2, IUnknown)
128 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
129 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
130 STDMETHOD_(ULONG,Release) (THIS) PURE;
133 STDMETHOD(SetOutputMode)(THIS_ DWORD dwFrontXtalkMode, DWORD dwBackXtalkMode, DWORD dwQuadMode) PURE;
134 STDMETHOD(GetOutputMode)(THIS_ DWORD *lpdwFrontXtalkMode, DWORD *lpdwBackXtalkMode, DWORD *lpdwQuadMode) PURE;
136 STDMETHOD(SetResourceManagerMode) (THIS_ DWORD ) PURE;
137 STDMETHOD(GetResourceManagerMode) (THIS_ DWORD *) PURE;
139 STDMETHOD(SetHFAbsorbFactor)(THIS_ FLOAT ) PURE;
140 STDMETHOD(GetHFAbsorbFactor)(THIS_ FLOAT *) PURE;
142 // New Methods inaddition to old ones
143 STDMETHOD(RegisterVersion) (THIS_ DWORD dwVersionNr) PURE;
144 STDMETHOD(GetSoftwareCaps) (THIS_ LPA3DCAPS_SOFTWARE lpCaps) PURE;
145 STDMETHOD(GetHardwareCaps) (THIS_ LPA3DCAPS_HARDWARE lpCaps) PURE;
149 // The library function that gets things going. It returns an interface
150 // pointer to DirectSound.
152 #define A3D_OK 1 // A3dCreate returns this upon detection of A3D Dll.
153 #define A3D_OK_OLD_DLL 2 // A3dCreate returns this upon detection of A3D Dll but user's version is older than expected.
155 // Usefull Macros for C folks.
157 #if !defined(__cplusplus) || defined(CINTERFACE)
158 #define IA3d_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
159 #define IA3d_AddRef(p) (p)->lpVtbl->AddRef(p)
160 #define IA3d_Release(p) (p)->lpVtbl->Release(p)
161 #define IA3d_SetOutputMode(p,a,b,c) (p)->lpVtbl->SetOutputMode(p,a,b,c)
162 #define IA3d_GetOutputMode(p,a,b,c) (p)->lpVtbl->GetOutputMode(p,a,b,c)
163 #define IA3d_SetResourceManagerMode(p,a) (p)->lpVtbl->SetResourceManagerMode(p,a)
164 #define IA3d_GetResourceManagerMode(p,a) (p)->lpVtbl->GetResourceManagerMode(p,a)
165 #define IA3d_SetHFAbsorbFactor(p,a) (p)->lpVtbl->SetHFAbsorbFactor(p,a)
166 #define IA3d_GetHFAbsorbFactor(p,a) (p)->lpVtbl->GetHFAbsorbFactor(p,a)
169 #define IA3d2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
170 #define IA3d2_AddRef(p) (p)->lpVtbl->AddRef(p)
171 #define IA3d2_Release(p) (p)->lpVtbl->Release(p)
172 #define IA3d2_SetOutputMode(p,a,b,c) (p)->lpVtbl->SetOutputMode(p,a,b,c)
173 #define IA3d2_GetOutputMode(p,a,b,c) (p)->lpVtbl->GetOutputMode(p,a,b,c)
174 #define IA3d2_SetResourceManagerMode(p,a) (p)->lpVtbl->SetResourceManagerMode(p,a)
175 #define IA3d2_GetResourceManagerMode(p,a) (p)->lpVtbl->GetResourceManagerMode(p,a)
176 #define IA3d2_SetHFAbsorbFactor(p,a) (p)->lpVtbl->SetHFAbsorbFactor(p,a)
177 #define IA3d2_GetHFAbsorbFactor(p,a) (p)->lpVtbl->GetHFAbsorbFactor(p,a)
178 #define IA3d2_RegisterVersion(p,a) (p)->lpVtbl->RegisterVersion(p,a)
179 #define IA3d2_GetSoftwareCaps(p,a) (p)->lpVtbl->GetSoftwareCaps(p,a)
180 #define IA3d2_GetHardwareCaps(p,a) (p)->lpVtbl->GetHardwareCaps(p,a)
183 #define IA3d_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
184 #define IA3d_AddRef(p) (p)->AddRef()
185 #define IA3d_Release(p) (p)->Release()
186 #define IA3d_SetOutputMode(p,a,b,c) (p)->SetOutputMode(a,b,c)
187 #define IA3d_GetOutputMode(p,a,b,c) (p)->GetOutputMode(a,b,c)
188 #define IA3d_SetResourceManagerMode(p,a) (p)->SetResourceManagerMode(a)
189 #define IA3d_GetResourceManagerMode(p,a) (p)->GetResourceManagerMode(a)
190 #define IA3d_SetHFAbsorbFactor(p,a) (p)->SetHFAbsorbFactor(a)
191 #define IA3d_GetHFAbsorbFactor(p,a) (p)->GetHFAbsorbFactor(a)
194 #define IA3d2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
195 #define IA3d2_AddRef(p) (p)->AddRef()
196 #define IA3d2_Release(p) (p)->Release()
197 #define IA3d2_SetOutputMode(p,a,b,c) (p)->SetOutputMode(a,b,c)
198 #define IA3d2_GetOutputMode(p,a,b,c) (p)->GetOutputMode(a,b,c)
199 #define IA3d2_SetResourceManagerMode(p,a) (p)->SetResourceManagerMode(a)
200 #define IA3d2_GetResourceManagerMode(p,a) (p)->GetResourceManagerMode(a)
201 #define IA3d2_SetHFAbsorbFactor(p,a) (p)->SetHFAbsorbFactor(a)
202 #define IA3d2_GetHFAbsorbFactor(p,a) (p)->GetHFAbsorbFactor(a)
203 #define IA3d2_RegisterVersion(p,a) (p)->RegisterVersion(a)
204 #define IA3d2_GetSoftwareCaps(p,a) (p)->GetSoftwareCaps(a)
205 #define IA3d2_GetHardwareCaps(p,a) (p)->GetHardwareCaps(a)
209 // Convenience Macro A3D_REGISTER_VERSION()
210 // Register version for backwards compatibility
211 // Pass in any COM object from CLSID_A3d
213 #if !defined(__cplusplus) || defined(CINTERFACE)
214 #define A3D_UNKNOWN_QI(pU,I,ppI) (SUCCEEDED((pU)->lpVtbl->QueryInterface(pU,&I,ppI)))
216 #define A3D_UNKNOWN_QI(pU,I,ppI) (SUCCEEDED((pU)->QueryInterface(I,ppI)))
219 #define A3D_REGISTER_VERSION(p) \
221 LPIA3D2 __pIA3d2__=NULL; \
222 IUnknown *__pU__ = (IUnknown *)p; \
226 if (A3D_UNKNOWN_QI(__pU__,IID_IA3d2,(void **)&__pIA3d2__))\
228 IA3d2_RegisterVersion(__pIA3d2__,A3D_CURRENT_VERSION); \
229 IA3d2_Release(__pIA3d2__); \
235 // Helper functions in ia3d.lib
237 extern HRESULT WINAPI A3dInitialize(void);
239 extern void WINAPI A3dUninitialize(void);
241 extern HRESULT WINAPI A3dCreate(GUID * lpGUID, /* in, Prefered Driver Guid, NULL ok */
242 void **ppDS, /* out, Direct Sound pointer */
243 IUnknown FAR *pUnkOuter); /* in, Outer COM object, for Aggregate only NULL oK */