2002-06-13 21:15:06 +02:00
|
|
|
/* DirectSound
|
|
|
|
*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
|
|
|
* Copyright 1998 Rob Riggs
|
|
|
|
* Copyright 2000-2001 TransGaming Technologies, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Linux does not support better timing than 10ms */
|
|
|
|
#define DS_TIME_RES 10 /* Resolution of multimedia timer */
|
|
|
|
#define DS_TIME_DEL 10 /* Delay of multimedia timer callback, and duration of HEL fragment */
|
|
|
|
|
|
|
|
#define DS_HEL_FRAGS 48 /* HEL only: number of waveOut fragments in primary buffer
|
|
|
|
* (changing this won't help you) */
|
|
|
|
|
2003-03-06 23:46:34 +01:00
|
|
|
/* direct sound hardware acceleration levels */
|
|
|
|
#define DS_HW_ACCEL_FULL 0 /* default on Windows 98 */
|
|
|
|
#define DS_HW_ACCEL_STANDARD 1 /* default on Windows 2000 */
|
|
|
|
#define DS_HW_ACCEL_BASIC 2
|
|
|
|
#define DS_HW_ACCEL_EMULATION 3
|
|
|
|
|
2002-06-13 21:15:06 +02:00
|
|
|
extern int ds_emuldriver;
|
|
|
|
extern int ds_hel_margin;
|
|
|
|
extern int ds_hel_queue;
|
|
|
|
extern int ds_snd_queue_max;
|
|
|
|
extern int ds_snd_queue_min;
|
2003-03-06 23:46:34 +01:00
|
|
|
extern int ds_hw_accel;
|
2003-03-15 01:54:11 +01:00
|
|
|
extern int ds_default_playback;
|
|
|
|
extern int ds_default_capture;
|
2002-06-13 21:15:06 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Predeclare the interface implementation structures
|
|
|
|
*/
|
2004-07-04 02:13:44 +02:00
|
|
|
typedef struct IDirectSoundImpl IDirectSoundImpl;
|
|
|
|
typedef struct IDirectSound_IUnknown IDirectSound_IUnknown;
|
|
|
|
typedef struct IDirectSound_IDirectSound IDirectSound_IDirectSound;
|
|
|
|
typedef struct IDirectSound8_IUnknown IDirectSound8_IUnknown;
|
|
|
|
typedef struct IDirectSound8_IDirectSound IDirectSound8_IDirectSound;
|
|
|
|
typedef struct IDirectSound8_IDirectSound8 IDirectSound8_IDirectSound8;
|
|
|
|
typedef struct IDirectSoundBufferImpl IDirectSoundBufferImpl;
|
|
|
|
typedef struct IDirectSoundCaptureImpl IDirectSoundCaptureImpl;
|
2003-02-15 01:01:17 +01:00
|
|
|
typedef struct IDirectSoundCaptureBufferImpl IDirectSoundCaptureBufferImpl;
|
2004-07-04 02:13:44 +02:00
|
|
|
typedef struct IDirectSoundFullDuplexImpl IDirectSoundFullDuplexImpl;
|
|
|
|
typedef struct IDirectSoundNotifyImpl IDirectSoundNotifyImpl;
|
2003-09-02 01:58:43 +02:00
|
|
|
typedef struct IDirectSoundCaptureNotifyImpl IDirectSoundCaptureNotifyImpl;
|
2004-07-04 02:13:44 +02:00
|
|
|
typedef struct IDirectSound3DListenerImpl IDirectSound3DListenerImpl;
|
|
|
|
typedef struct IDirectSound3DBufferImpl IDirectSound3DBufferImpl;
|
|
|
|
typedef struct IKsBufferPropertySetImpl IKsBufferPropertySetImpl;
|
|
|
|
typedef struct IKsPrivatePropertySetImpl IKsPrivatePropertySetImpl;
|
|
|
|
typedef struct PrimaryBufferImpl PrimaryBufferImpl;
|
|
|
|
typedef struct SecondaryBufferImpl SecondaryBufferImpl;
|
|
|
|
typedef struct IClassFactoryImpl IClassFactoryImpl;
|
2002-06-13 21:15:06 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSound implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSoundImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSound8Vtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
2002-06-13 21:15:06 +02:00
|
|
|
/* IDirectSoundImpl fields */
|
2003-03-15 01:54:11 +01:00
|
|
|
GUID guid;
|
2002-06-13 21:15:06 +02:00
|
|
|
PIDSDRIVER driver;
|
|
|
|
DSDRIVERDESC drvdesc;
|
|
|
|
DSDRIVERCAPS drvcaps;
|
|
|
|
DWORD priolevel;
|
2004-08-18 02:30:37 +02:00
|
|
|
PWAVEFORMATEX pwfx;
|
2002-06-13 21:15:06 +02:00
|
|
|
HWAVEOUT hwo;
|
|
|
|
LPWAVEHDR pwave[DS_HEL_FRAGS];
|
|
|
|
UINT timerID, pwplay, pwwrite, pwqueue, prebuf, precount;
|
|
|
|
DWORD fraglen;
|
|
|
|
PIDSDRIVERBUFFER hwbuf;
|
|
|
|
LPBYTE buffer;
|
|
|
|
DWORD writelead, buflen, state, playpos, mixpos;
|
|
|
|
BOOL need_remix;
|
|
|
|
int nrofbuffers;
|
|
|
|
IDirectSoundBufferImpl** buffers;
|
2004-09-07 21:32:21 +02:00
|
|
|
RTL_RWLOCK buffer_list_lock;
|
2003-02-15 01:01:17 +01:00
|
|
|
CRITICAL_SECTION mixlock;
|
2003-06-28 00:22:15 +02:00
|
|
|
PrimaryBufferImpl* primary;
|
|
|
|
DSBUFFERDESC dsbd;
|
2003-09-02 01:58:43 +02:00
|
|
|
DWORD speaker_config;
|
2004-07-19 22:06:22 +02:00
|
|
|
BOOL initialized;
|
2003-06-28 00:22:15 +02:00
|
|
|
|
|
|
|
/* DirectSound3DListener fields */
|
|
|
|
IDirectSound3DListenerImpl* listener;
|
|
|
|
DS3DLISTENER ds3dl;
|
|
|
|
BOOL ds3dl_need_recalc;
|
2004-07-04 02:13:44 +02:00
|
|
|
|
|
|
|
LPUNKNOWN pUnknown;
|
|
|
|
LPDIRECTSOUND pDS;
|
|
|
|
LPDIRECTSOUND8 pDS8;
|
2002-06-13 21:15:06 +02:00
|
|
|
};
|
|
|
|
|
2003-06-28 00:22:15 +02:00
|
|
|
/* reference counted buffer memory for duplicated buffer memory */
|
|
|
|
typedef struct BufferMemory
|
|
|
|
{
|
|
|
|
DWORD ref;
|
|
|
|
LPBYTE memory;
|
|
|
|
} BufferMemory;
|
|
|
|
|
2004-07-04 02:13:44 +02:00
|
|
|
HRESULT WINAPI IDirectSoundImpl_Create(
|
|
|
|
LPCGUID lpcGUID,
|
|
|
|
LPDIRECTSOUND8 * ppds);
|
|
|
|
|
2004-07-19 22:06:22 +02:00
|
|
|
HRESULT WINAPI DSOUND_Create(
|
|
|
|
LPCGUID lpcGUID,
|
|
|
|
LPDIRECTSOUND *ppDS,
|
|
|
|
IUnknown *pUnkOuter);
|
|
|
|
|
|
|
|
HRESULT WINAPI DSOUND_Create8(
|
|
|
|
LPCGUID lpcGUID,
|
|
|
|
LPDIRECTSOUND8 *ppDS,
|
|
|
|
IUnknown *pUnkOuter);
|
|
|
|
|
2004-07-04 02:13:44 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSound COM components
|
|
|
|
*/
|
|
|
|
struct IDirectSound_IUnknown {
|
2004-08-12 21:52:49 +02:00
|
|
|
IUnknownVtbl *lpVtbl;
|
2004-07-04 02:13:44 +02:00
|
|
|
DWORD ref;
|
|
|
|
LPDIRECTSOUND8 pds;
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectSound_IUnknown_Create(
|
|
|
|
LPDIRECTSOUND8 pds,
|
|
|
|
LPUNKNOWN * ppunk);
|
|
|
|
|
|
|
|
struct IDirectSound_IDirectSound {
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundVtbl *lpVtbl;
|
2004-07-04 02:13:44 +02:00
|
|
|
DWORD ref;
|
|
|
|
LPDIRECTSOUND8 pds;
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectSound_IDirectSound_Create(
|
|
|
|
LPDIRECTSOUND8 pds,
|
|
|
|
LPDIRECTSOUND * ppds);
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSound8 COM components
|
|
|
|
*/
|
|
|
|
struct IDirectSound8_IUnknown {
|
2004-08-12 21:52:49 +02:00
|
|
|
IUnknownVtbl *lpVtbl;
|
2004-07-04 02:13:44 +02:00
|
|
|
DWORD ref;
|
|
|
|
LPDIRECTSOUND8 pds;
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectSound8_IUnknown_Create(
|
|
|
|
LPDIRECTSOUND8 pds,
|
|
|
|
LPUNKNOWN * ppunk);
|
|
|
|
|
|
|
|
struct IDirectSound8_IDirectSound {
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundVtbl *lpVtbl;
|
2004-07-04 02:13:44 +02:00
|
|
|
DWORD ref;
|
|
|
|
LPDIRECTSOUND8 pds;
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectSound8_IDirectSound_Create(
|
|
|
|
LPDIRECTSOUND8 pds,
|
|
|
|
LPDIRECTSOUND * ppds);
|
|
|
|
|
|
|
|
struct IDirectSound8_IDirectSound8 {
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSound8Vtbl *lpVtbl;
|
2004-07-04 02:13:44 +02:00
|
|
|
DWORD ref;
|
|
|
|
LPDIRECTSOUND8 pds;
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectSound8_IDirectSound8_Create(
|
|
|
|
LPDIRECTSOUND8 pds,
|
|
|
|
LPDIRECTSOUND8 * ppds);
|
|
|
|
|
2002-06-13 21:15:06 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSoundBuffer implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSoundBufferImpl
|
|
|
|
{
|
|
|
|
/* FIXME: document */
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundBuffer8Vtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
2002-06-13 21:15:06 +02:00
|
|
|
/* IDirectSoundBufferImpl fields */
|
2003-09-02 01:58:43 +02:00
|
|
|
SecondaryBufferImpl* dsb;
|
2003-06-28 00:22:15 +02:00
|
|
|
IDirectSoundImpl* dsound;
|
|
|
|
CRITICAL_SECTION lock;
|
|
|
|
PIDSDRIVERBUFFER hwbuf;
|
2004-08-18 02:30:37 +02:00
|
|
|
PWAVEFORMATEX pwfx;
|
2003-06-28 00:22:15 +02:00
|
|
|
BufferMemory* buffer;
|
|
|
|
DWORD playflags,state,leadin;
|
|
|
|
DWORD playpos,startpos,writelead,buflen;
|
|
|
|
DWORD nAvgBytesPerSec;
|
|
|
|
DWORD freq;
|
|
|
|
DSVOLUMEPAN volpan, cvolpan;
|
|
|
|
DSBUFFERDESC dsbd;
|
2002-06-13 21:15:06 +02:00
|
|
|
/* used for frequency conversion (PerfectPitch) */
|
2003-06-28 00:22:15 +02:00
|
|
|
ULONG freqAdjust, freqAcc;
|
2002-06-13 21:15:06 +02:00
|
|
|
/* used for intelligent (well, sort of) prebuffering */
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD probably_valid_to, last_playpos;
|
|
|
|
DWORD primary_mixpos, buf_mixpos;
|
|
|
|
BOOL need_remix;
|
2003-09-02 01:58:43 +02:00
|
|
|
|
2002-06-13 21:15:06 +02:00
|
|
|
/* IDirectSoundNotifyImpl fields */
|
2003-06-28 00:22:15 +02:00
|
|
|
IDirectSoundNotifyImpl* notify;
|
2003-09-02 01:58:43 +02:00
|
|
|
LPDSBPOSITIONNOTIFY notifies;
|
|
|
|
int nrofnotifies;
|
|
|
|
PIDSDRIVERNOTIFY hwnotify;
|
2003-06-28 00:22:15 +02:00
|
|
|
|
|
|
|
/* DirectSound3DBuffer fields */
|
2003-09-02 01:58:43 +02:00
|
|
|
IDirectSound3DBufferImpl* ds3db;
|
2003-06-28 00:22:15 +02:00
|
|
|
DS3DBUFFER ds3db_ds3db;
|
|
|
|
LONG ds3db_lVolume;
|
|
|
|
BOOL ds3db_need_recalc;
|
2003-09-02 01:58:43 +02:00
|
|
|
|
|
|
|
/* IKsPropertySet fields */
|
|
|
|
IKsBufferPropertySetImpl* iks;
|
2002-06-13 21:15:06 +02:00
|
|
|
};
|
|
|
|
|
2003-09-02 01:58:43 +02:00
|
|
|
HRESULT WINAPI IDirectSoundBufferImpl_Create(
|
|
|
|
IDirectSoundImpl *ds,
|
|
|
|
IDirectSoundBufferImpl **pdsb,
|
2004-01-09 23:06:54 +01:00
|
|
|
LPCDSBUFFERDESC dsbd);
|
2004-07-14 01:35:09 +02:00
|
|
|
HRESULT WINAPI IDirectSoundBufferImpl_Destroy(
|
|
|
|
IDirectSoundBufferImpl *pdsb);
|
2002-06-13 21:15:06 +02:00
|
|
|
|
2003-09-02 01:58:43 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* SecondaryBuffer implementation structure
|
|
|
|
*/
|
|
|
|
struct SecondaryBufferImpl
|
|
|
|
{
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundBuffer8Vtbl *lpVtbl;
|
2003-09-02 01:58:43 +02:00
|
|
|
DWORD ref;
|
|
|
|
IDirectSoundBufferImpl* dsb;
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI SecondaryBufferImpl_Create(
|
|
|
|
IDirectSoundBufferImpl *dsb,
|
|
|
|
SecondaryBufferImpl **pdsb);
|
2004-07-14 01:35:09 +02:00
|
|
|
HRESULT WINAPI SecondaryBufferImpl_Destroy(
|
|
|
|
SecondaryBufferImpl *pdsb);
|
2003-09-02 01:58:43 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* PrimaryBuffer implementation structure
|
|
|
|
*/
|
|
|
|
struct PrimaryBufferImpl
|
|
|
|
{
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundBuffer8Vtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
|
|
|
IDirectSoundImpl* dsound;
|
2002-06-13 21:15:06 +02:00
|
|
|
};
|
|
|
|
|
2003-09-02 01:58:43 +02:00
|
|
|
HRESULT WINAPI PrimaryBufferImpl_Create(
|
|
|
|
IDirectSoundImpl *ds,
|
|
|
|
PrimaryBufferImpl **pdsb,
|
2004-01-09 23:06:54 +01:00
|
|
|
LPCDSBUFFERDESC dsbd);
|
2002-06-13 21:15:06 +02:00
|
|
|
|
2003-02-15 01:01:17 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSoundCapture implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSoundCaptureImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundCaptureVtbl *lpVtbl;
|
2003-02-15 01:01:17 +01:00
|
|
|
DWORD ref;
|
|
|
|
|
|
|
|
/* IDirectSoundCaptureImpl fields */
|
2003-03-04 03:12:34 +01:00
|
|
|
GUID guid;
|
|
|
|
BOOL initialized;
|
2003-02-15 01:01:17 +01:00
|
|
|
|
2003-03-04 03:12:34 +01:00
|
|
|
/* DirectSound driver stuff */
|
|
|
|
PIDSCDRIVER driver;
|
|
|
|
DSDRIVERDESC drvdesc;
|
|
|
|
DSCDRIVERCAPS drvcaps;
|
|
|
|
PIDSCDRIVERBUFFER hwbuf;
|
2003-02-15 01:01:17 +01:00
|
|
|
|
2003-03-04 03:12:34 +01:00
|
|
|
/* wave driver info */
|
|
|
|
HWAVEIN hwi;
|
2003-02-15 01:01:17 +01:00
|
|
|
|
2003-03-04 03:12:34 +01:00
|
|
|
/* more stuff */
|
2003-02-15 01:01:17 +01:00
|
|
|
LPBYTE buffer;
|
|
|
|
DWORD buflen;
|
2003-03-04 03:12:34 +01:00
|
|
|
DWORD read_position;
|
2003-02-15 01:01:17 +01:00
|
|
|
|
2003-10-09 00:35:26 +02:00
|
|
|
PWAVEFORMATEX pwfx;
|
2003-02-15 01:01:17 +01:00
|
|
|
|
2003-03-04 03:12:34 +01:00
|
|
|
IDirectSoundCaptureBufferImpl* capture_buffer;
|
|
|
|
DWORD state;
|
2003-02-15 01:01:17 +01:00
|
|
|
LPWAVEHDR pwave;
|
2003-03-04 03:12:34 +01:00
|
|
|
int nrofpwaves;
|
|
|
|
int index;
|
2003-02-15 01:01:17 +01:00
|
|
|
CRITICAL_SECTION lock;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSoundCaptureBuffer implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSoundCaptureBufferImpl
|
|
|
|
{
|
2003-03-04 03:12:34 +01:00
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundCaptureBuffer8Vtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
2003-03-04 03:12:34 +01:00
|
|
|
|
|
|
|
/* IDirectSoundCaptureBufferImpl fields */
|
2003-06-28 00:22:15 +02:00
|
|
|
IDirectSoundCaptureImpl* dsound;
|
2003-03-04 03:12:34 +01:00
|
|
|
/* FIXME: don't need this */
|
2003-06-28 00:22:15 +02:00
|
|
|
LPDSCBUFFERDESC pdscbd;
|
|
|
|
DWORD flags;
|
2003-09-02 01:58:43 +02:00
|
|
|
|
|
|
|
/* IDirectSoundCaptureNotifyImpl fields */
|
|
|
|
IDirectSoundCaptureNotifyImpl* notify;
|
|
|
|
LPDSBPOSITIONNOTIFY notifies;
|
|
|
|
int nrofnotifies;
|
|
|
|
PIDSDRIVERNOTIFY hwnotify;
|
2003-03-04 03:12:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSoundFullDuplex implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSoundFullDuplexImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundFullDuplexVtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
2003-03-04 03:12:34 +01:00
|
|
|
|
|
|
|
/* IDirectSoundFullDuplexImpl fields */
|
2003-06-28 00:22:15 +02:00
|
|
|
CRITICAL_SECTION lock;
|
2003-02-15 01:01:17 +01:00
|
|
|
};
|
|
|
|
|
2002-06-13 21:15:06 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSoundNotify implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSoundNotifyImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundNotifyVtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
2003-09-02 01:58:43 +02:00
|
|
|
IDirectSoundBufferImpl* dsb;
|
|
|
|
};
|
2003-05-02 22:16:48 +02:00
|
|
|
|
2003-09-02 01:58:43 +02:00
|
|
|
HRESULT WINAPI IDirectSoundNotifyImpl_Create(
|
|
|
|
IDirectSoundBufferImpl *dsb,
|
|
|
|
IDirectSoundNotifyImpl **pdsn);
|
2004-07-14 01:35:09 +02:00
|
|
|
HRESULT WINAPI IDirectSoundNotifyImpl_Destroy(
|
|
|
|
IDirectSoundNotifyImpl *pdsn);
|
2003-09-02 01:58:43 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSoundCaptureNotify implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSoundCaptureNotifyImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSoundNotifyVtbl *lpVtbl;
|
2003-09-02 01:58:43 +02:00
|
|
|
DWORD ref;
|
|
|
|
IDirectSoundCaptureBufferImpl* dscb;
|
2002-06-13 21:15:06 +02:00
|
|
|
};
|
|
|
|
|
2003-09-02 01:58:43 +02:00
|
|
|
HRESULT WINAPI IDirectSoundCaptureNotifyImpl_Create(
|
|
|
|
IDirectSoundCaptureBufferImpl *dscb,
|
|
|
|
IDirectSoundCaptureNotifyImpl ** pdscn);
|
|
|
|
|
2002-06-13 21:15:06 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSound3DListener implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSound3DListenerImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSound3DListenerVtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
2002-06-13 21:15:06 +02:00
|
|
|
/* IDirectSound3DListenerImpl fields */
|
2003-06-28 00:22:15 +02:00
|
|
|
IDirectSoundImpl* dsound;
|
2002-06-13 21:15:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectSound3DListenerImpl_Create(
|
2003-09-02 01:58:43 +02:00
|
|
|
PrimaryBufferImpl *pb,
|
|
|
|
IDirectSound3DListenerImpl **pdsl);
|
2002-06-13 21:15:06 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
2003-08-20 20:18:23 +02:00
|
|
|
* IKsBufferPropertySet implementation structure
|
2002-06-13 21:15:06 +02:00
|
|
|
*/
|
2003-08-20 20:18:23 +02:00
|
|
|
struct IKsBufferPropertySetImpl
|
2002-06-13 21:15:06 +02:00
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IKsPropertySetVtbl *lpVtbl;
|
2002-06-13 21:15:06 +02:00
|
|
|
DWORD ref;
|
|
|
|
/* IKsPropertySetImpl fields */
|
|
|
|
IDirectSoundBufferImpl* dsb;
|
|
|
|
};
|
|
|
|
|
2003-08-20 20:18:23 +02:00
|
|
|
HRESULT WINAPI IKsBufferPropertySetImpl_Create(
|
2003-09-02 01:58:43 +02:00
|
|
|
IDirectSoundBufferImpl *dsb,
|
|
|
|
IKsBufferPropertySetImpl **piks);
|
2004-07-14 01:35:09 +02:00
|
|
|
HRESULT WINAPI IKsBufferPropertySetImpl_Destroy(
|
|
|
|
IKsBufferPropertySetImpl *piks);
|
2003-08-20 20:18:23 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IKsPrivatePropertySet implementation structure
|
|
|
|
*/
|
|
|
|
struct IKsPrivatePropertySetImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IKsPropertySetVtbl *lpVtbl;
|
2003-08-20 20:18:23 +02:00
|
|
|
DWORD ref;
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IKsPrivatePropertySetImpl_Create(
|
2003-09-02 01:58:43 +02:00
|
|
|
IKsPrivatePropertySetImpl **piks);
|
2002-06-13 21:15:06 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectSound3DBuffer implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectSound3DBufferImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IDirectSound3DBufferVtbl *lpVtbl;
|
2003-06-28 00:22:15 +02:00
|
|
|
DWORD ref;
|
2002-06-13 21:15:06 +02:00
|
|
|
/* IDirectSound3DBufferImpl fields */
|
2003-06-28 00:22:15 +02:00
|
|
|
IDirectSoundBufferImpl* dsb;
|
2002-06-13 21:15:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectSound3DBufferImpl_Create(
|
2003-09-02 01:58:43 +02:00
|
|
|
IDirectSoundBufferImpl *dsb,
|
|
|
|
IDirectSound3DBufferImpl **pds3db);
|
2004-07-14 01:35:09 +02:00
|
|
|
HRESULT WINAPI IDirectSound3DBufferImpl_Destroy(
|
|
|
|
IDirectSound3DBufferImpl *pds3db);
|
2002-06-13 21:15:06 +02:00
|
|
|
|
2003-08-07 00:57:24 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* DirectSound ClassFactory implementation structure
|
|
|
|
*/
|
|
|
|
struct IClassFactoryImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2004-08-12 21:52:49 +02:00
|
|
|
IClassFactoryVtbl *lpVtbl;
|
2003-08-07 00:57:24 +02:00
|
|
|
DWORD ref;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern IClassFactoryImpl DSOUND_CAPTURE_CF;
|
|
|
|
extern IClassFactoryImpl DSOUND_FULLDUPLEX_CF;
|
|
|
|
|
2002-06-13 21:15:06 +02:00
|
|
|
void DSOUND_RecalcVolPan(PDSVOLUMEPAN volpan);
|
2004-07-23 21:06:31 +02:00
|
|
|
void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan);
|
2002-06-13 21:15:06 +02:00
|
|
|
void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb);
|
|
|
|
|
2004-09-07 21:32:21 +02:00
|
|
|
/* dsound.c */
|
|
|
|
|
|
|
|
HRESULT DSOUND_AddBuffer(IDirectSoundImpl * pDS, IDirectSoundBufferImpl * pDSB);
|
|
|
|
HRESULT DSOUND_RemoveBuffer(IDirectSoundImpl * pDS, IDirectSoundBufferImpl * pDSB);
|
|
|
|
|
2002-06-13 21:15:06 +02:00
|
|
|
/* primary.c */
|
|
|
|
|
|
|
|
HRESULT DSOUND_PrimaryCreate(IDirectSoundImpl *This);
|
|
|
|
HRESULT DSOUND_PrimaryDestroy(IDirectSoundImpl *This);
|
|
|
|
HRESULT DSOUND_PrimaryPlay(IDirectSoundImpl *This);
|
|
|
|
HRESULT DSOUND_PrimaryStop(IDirectSoundImpl *This);
|
|
|
|
HRESULT DSOUND_PrimaryGetPosition(IDirectSoundImpl *This, LPDWORD playpos, LPDWORD writepos);
|
|
|
|
|
|
|
|
/* buffer.c */
|
|
|
|
|
|
|
|
DWORD DSOUND_CalcPlayPosition(IDirectSoundBufferImpl *This,
|
|
|
|
DWORD state, DWORD pplay, DWORD pwrite, DWORD pmix, DWORD bmix);
|
|
|
|
|
|
|
|
/* mixer.c */
|
|
|
|
|
|
|
|
void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, int len);
|
|
|
|
void DSOUND_ForceRemix(IDirectSoundBufferImpl *dsb);
|
|
|
|
void DSOUND_MixCancelAt(IDirectSoundBufferImpl *dsb, DWORD buf_writepos);
|
|
|
|
void DSOUND_WaveQueue(IDirectSoundImpl *dsound, DWORD mixq);
|
2004-01-12 22:02:22 +01:00
|
|
|
void DSOUND_PerformMix(IDirectSoundImpl *dsound);
|
2002-06-13 21:15:06 +02:00
|
|
|
void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2);
|
|
|
|
void CALLBACK DSOUND_callback(HWAVEOUT hwo, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2);
|
|
|
|
|
2003-06-28 00:22:15 +02:00
|
|
|
/* sound3d.c */
|
|
|
|
|
|
|
|
void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb);
|
|
|
|
|
2003-02-15 01:01:17 +01:00
|
|
|
#define STATE_STOPPED 0
|
|
|
|
#define STATE_STARTING 1
|
|
|
|
#define STATE_PLAYING 2
|
|
|
|
#define STATE_CAPTURING 2
|
|
|
|
#define STATE_STOPPING 3
|
2002-06-13 21:15:06 +02:00
|
|
|
|
|
|
|
#define DSOUND_FREQSHIFT (14)
|
|
|
|
|
|
|
|
extern IDirectSoundImpl* dsound;
|
|
|
|
|
2004-08-20 22:01:31 +02:00
|
|
|
extern GUID renderer_guids[MAXWAVEDRIVERS];
|
|
|
|
extern GUID capture_guids[MAXWAVEDRIVERS];
|
|
|
|
|
2003-02-15 01:01:17 +01:00
|
|
|
extern HRESULT mmErr(UINT err);
|
2003-03-04 03:12:34 +01:00
|
|
|
extern void setup_dsound_options(void);
|
2004-07-21 05:23:13 +02:00
|
|
|
extern const char * get_device_id(LPCGUID pGuid);
|