ReactOS 0.4.16-dev-311-g9382aa2
|
#include <wine/config.h>
#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <wingdi.h>
#include <winternl.h>
#include <objbase.h>
#include <audioclient.h>
#include <mmddk.h>
#include <dsound.h>
#include <dsconf.h>
#include <dsdriver.h>
#include <vfwmsgs.h>
#include <wine/debug.h>
#include <wine/list.h>
Go to the source code of this file.
Classes | |
struct | DirectSoundDevice |
struct | BufferMemory |
struct | IDirectSoundBufferImpl |
struct | DirectSoundCaptureDevice |
struct | IDirectSoundCaptureBufferImpl |
struct | IDirectSound3DListenerImpl |
struct | IKsBufferPropertySetImpl |
struct | IDirectSound3DBufferImpl |
Macros | |
#define | WIN32_NO_STATUS |
#define | _INC_WINDOWS |
#define | COM_NO_WINDOWS_H |
#define | COBJMACROS |
#define | NONAMELESSSTRUCT |
#define | NONAMELESSUNION |
#define | DS_TIME_RES 2 /* Resolution of multimedia timer */ |
#define | DS_TIME_DEL 10 /* Delay of multimedia timer callback, and duration of HEL fragment */ |
#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 |
#define | STATE_STOPPED 0 |
#define | STATE_STARTING 1 |
#define | STATE_PLAYING 2 |
#define | STATE_CAPTURING 2 |
#define | STATE_STOPPING 3 |
#define | DSOUND_FREQSHIFT (20) |
Variables | |
int ds_emuldriver | DECLSPEC_HIDDEN |
#define _INC_WINDOWS |
Definition at line 32 of file dsound_private.h.
#define COBJMACROS |
Definition at line 35 of file dsound_private.h.
#define COM_NO_WINDOWS_H |
Definition at line 33 of file dsound_private.h.
#define DS_HW_ACCEL_BASIC 2 |
Definition at line 64 of file dsound_private.h.
#define DS_HW_ACCEL_EMULATION 3 |
Definition at line 65 of file dsound_private.h.
#define DS_HW_ACCEL_FULL 0 /* default on Windows 98 */ |
Definition at line 62 of file dsound_private.h.
#define DS_HW_ACCEL_STANDARD 1 /* default on Windows 2000 */ |
Definition at line 63 of file dsound_private.h.
Definition at line 59 of file dsound_private.h.
#define DS_TIME_RES 2 /* Resolution of multimedia timer */ |
Definition at line 58 of file dsound_private.h.
#define DSOUND_FREQSHIFT (20) |
Definition at line 405 of file dsound_private.h.
#define NONAMELESSSTRUCT |
Definition at line 36 of file dsound_private.h.
#define NONAMELESSUNION |
Definition at line 37 of file dsound_private.h.
#define STATE_CAPTURING 2 |
Definition at line 402 of file dsound_private.h.
#define STATE_PLAYING 2 |
Definition at line 401 of file dsound_private.h.
#define STATE_STARTING 1 |
Definition at line 400 of file dsound_private.h.
#define STATE_STOPPED 0 |
Definition at line 399 of file dsound_private.h.
#define STATE_STOPPING 3 |
Definition at line 403 of file dsound_private.h.
#define WIN32_NO_STATUS |
Definition at line 31 of file dsound_private.h.
Definition at line 97 of file dsound_private.h.
typedef struct BufferMemory BufferMemory |
Definition at line 94 of file dsound_private.h.
typedef struct DirectSoundDevice DirectSoundDevice |
Definition at line 93 of file dsound_private.h.
Definition at line 91 of file dsound_private.h.
Definition at line 90 of file dsound_private.h.
Definition at line 83 of file dsound_private.h.
Definition at line 84 of file dsound_private.h.
Definition at line 82 of file dsound_private.h.
Definition at line 81 of file dsound_private.h.
Definition at line 80 of file dsound_private.h.
Definition at line 85 of file dsound_private.h.
Definition at line 87 of file dsound_private.h.
Definition at line 86 of file dsound_private.h.
Definition at line 89 of file dsound_private.h.
typedef struct IDirectSoundImpl IDirectSoundImpl |
Definition at line 79 of file dsound_private.h.
Definition at line 88 of file dsound_private.h.
Definition at line 92 of file dsound_private.h.
Definition at line 99 of file dsound_private.h.
Definition at line 101 of file dsound_private.h.
HRESULT DirectSoundDevice_AddBuffer | ( | DirectSoundDevice * | device, |
IDirectSoundBufferImpl * | pDSB | ||
) |
Definition at line 1761 of file dsound.c.
Referenced by IDirectSoundBufferImpl_Create(), and IDirectSoundBufferImpl_Duplicate().
HRESULT DirectSoundDevice_Compact | ( | DirectSoundDevice * | device | ) |
Definition at line 1683 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_Compact(), IDirectSound8_IDirectSound_Compact(), and IDirectSound_IDirectSound_Compact().
HRESULT DirectSoundDevice_CreateSoundBuffer | ( | DirectSoundDevice * | device, |
LPCDSBUFFERDESC | dsbd, | ||
LPLPDIRECTSOUNDBUFFER | ppdsb, | ||
LPUNKNOWN | lpunk, | ||
BOOL | from8 | ||
) |
Definition at line 1482 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_CreateSoundBuffer(), IDirectSound8_IDirectSound_CreateSoundBuffer(), and IDirectSound_IDirectSound_CreateSoundBuffer().
HRESULT DirectSoundDevice_DuplicateSoundBuffer | ( | DirectSoundDevice * | device, |
LPDIRECTSOUNDBUFFER | psb, | ||
LPLPDIRECTSOUNDBUFFER | ppdsb | ||
) |
Definition at line 1621 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_DuplicateSoundBuffer(), IDirectSound8_IDirectSound_DuplicateSoundBuffer(), and IDirectSound_IDirectSound_DuplicateSoundBuffer().
HRESULT DirectSoundDevice_GetCaps | ( | DirectSoundDevice * | device, |
LPDSCAPS | lpDSCaps | ||
) |
Definition at line 1272 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_GetCaps(), IDirectSound8_IDirectSound_GetCaps(), and IDirectSound_IDirectSound_GetCaps().
HRESULT DirectSoundDevice_GetSpeakerConfig | ( | DirectSoundDevice * | device, |
LPDWORD | lpdwSpeakerConfig | ||
) |
Definition at line 1701 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_GetSpeakerConfig(), IDirectSound8_IDirectSound_GetSpeakerConfig(), and IDirectSound_IDirectSound_GetSpeakerConfig().
HRESULT DirectSoundDevice_Initialize | ( | DirectSoundDevice ** | ppDevice, |
LPCGUID | lpcGUID | ||
) |
Definition at line 1326 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_Initialize(), IDirectSound8_IDirectSound_Initialize(), and IDirectSound_IDirectSound_Initialize().
ULONG DirectSoundDevice_Release | ( | DirectSoundDevice * | device | ) |
Definition at line 1216 of file dsound.c.
Referenced by IDirectSoundImpl_Release().
HRESULT DirectSoundDevice_RemoveBuffer | ( | DirectSoundDevice * | device, |
IDirectSoundBufferImpl * | pDSB | ||
) |
Definition at line 1796 of file dsound.c.
Referenced by secondarybuffer_destroy().
HRESULT DirectSoundDevice_SetCooperativeLevel | ( | DirectSoundDevice * | devcie, |
HWND | hwnd, | ||
DWORD | level | ||
) |
Definition at line 1662 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_SetCooperativeLevel(), IDirectSound8_IDirectSound_SetCooperativeLevel(), and IDirectSound_IDirectSound_SetCooperativeLevel().
HRESULT DirectSoundDevice_SetSpeakerConfig | ( | DirectSoundDevice * | device, |
DWORD | config | ||
) |
Definition at line 1722 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_SetSpeakerConfig(), IDirectSound8_IDirectSound_SetSpeakerConfig(), and IDirectSound_IDirectSound_SetSpeakerConfig().
HRESULT DirectSoundDevice_VerifyCertification | ( | DirectSoundDevice * | device, |
LPDWORD | pdwCertified | ||
) |
Definition at line 1738 of file dsound.c.
Referenced by IDirectSound8_IDirectSound8_VerifyCertification().
void DSOUND_AmpFactorToVolPan | ( | PDSVOLUMEPAN | volpan | ) |
Definition at line 46 of file mixer.c.
Referenced by PrimaryBufferImpl_GetPan(), PrimaryBufferImpl_GetVolume(), PrimaryBufferImpl_SetPan(), and PrimaryBufferImpl_SetVolume().
DWORD DSOUND_bufpos_to_mixpos | ( | const DirectSoundDevice * | device, |
DWORD | pos | ||
) |
Convert a primary buffer position to a pointer position for device->mix_buffer device: DirectSoundDevice for which to calculate pos: Primary buffer position to converts Returns: Offset for mix_buffer
Definition at line 84 of file mixer.c.
Referenced by DSOUND_MixInBuffer(), DSOUND_PerformMix(), DSOUND_PrimaryOpen(), and primarybuffer_SetFormat().
void DSOUND_Calc3DBuffer | ( | IDirectSoundBufferImpl * | dsb | ) |
Definition at line 141 of file sound3d.c.
Referenced by DSOUND_Mix3DBuffer(), IDirectSoundBufferImpl_Create(), and IDirectSoundBufferImpl_SetVolume().
void CALLBACK DSOUND_callback | ( | HWAVEOUT | hwo, |
UINT | msg, | ||
DWORD_PTR | dwUser, | ||
DWORD_PTR | dw1, | ||
DWORD_PTR | dw2 | ||
) |
Definition at line 1011 of file mixer.c.
Referenced by DSOUND_ReopenDevice().
HRESULT DSOUND_CaptureCreate | ( | REFIID | riid, |
LPDIRECTSOUNDCAPTURE * | ppDSC | ||
) |
Definition at line 1336 of file capture.c.
Referenced by DirectSoundCaptureCreate().
HRESULT DSOUND_CaptureCreate8 | ( | REFIID | riid, |
LPDIRECTSOUNDCAPTURE8 * | ppDSC8 | ||
) |
Definition at line 1365 of file capture.c.
Referenced by DirectSoundCaptureCreate8(), and IDirectSoundFullDuplexImpl_Initialize().
void DSOUND_CheckEvent | ( | const IDirectSoundBufferImpl * | dsb, |
DWORD | playpos, | ||
int | len | ||
) |
Check for application callback requests for when the play position reaches certain points.
The offsets that will be triggered will be those between the recorded "last played" position for the buffer (i.e. dsb->playpos) and "len" bytes beyond that position.
Definition at line 221 of file mixer.c.
Referenced by DSOUND_MixInBuffer(), DSOUND_MixToPrimary(), and IDirectSoundBufferImpl_Stop().
LPWAVEFORMATEX DSOUND_CopyFormat | ( | LPCWAVEFORMATEX | wfex | ) |
Definition at line 437 of file primary.c.
Referenced by IDirectSoundBufferImpl_Create(), IDirectSoundBufferImpl_Duplicate(), IDirectSoundCaptureBufferImpl_Create(), and primarybuffer_SetFormat().
HRESULT DSOUND_Create | ( | REFIID | riid, |
LPDIRECTSOUND * | ppDS | ||
) |
Definition at line 963 of file dsound.c.
Referenced by DirectSoundCreate().
HRESULT DSOUND_Create8 | ( | REFIID | riid, |
LPDIRECTSOUND8 * | ppDS | ||
) |
Definition at line 1050 of file dsound.c.
Referenced by DirectSoundCreate8(), and IDirectSoundFullDuplexImpl_Initialize().
Calculate how long a fragment length of about 10 ms should be in frames
nSamplesPerSec: Frequency rate in samples per second nBlockAlign: Size of a single blockalign
Returns: Size in bytes of a single fragment
Definition at line 36 of file primary.c.
Referenced by DSOUND_RecalcPrimary(), and IDirectSoundCaptureBufferImpl_Start().
HRESULT DSOUND_FullDuplexCreate | ( | REFIID | riid, |
LPDIRECTSOUNDFULLDUPLEX * | ppDSFD | ||
) |
Definition at line 604 of file duplex.c.
Referenced by DirectSoundFullDuplexCreate().
void DSOUND_MixToTemporary | ( | const IDirectSoundBufferImpl * | dsb, |
DWORD | writepos, | ||
DWORD | len, | ||
BOOL | inmixer | ||
) |
Mix at most the given amount of data into the allocated temporary buffer of the given secondary buffer, starting from the dsb's first currently unsampled frame (writepos), translating frequency (pitch), stereo/mono and bits-per-sample so that it is ideal for the primary buffer. Doesn't perform any mixing - this is a straight copy/convert operation.
dsb = the secondary buffer writepos = Starting position of changed buffer len = number of bytes to resample from writepos
NOTE: writepos + len <= buflen. When called by mixer, MixOne makes sure of this.
Definition at line 332 of file mixer.c.
Referenced by DSOUND_Calc3DBuffer(), DSOUND_MixInBuffer(), IDirectSoundBufferImpl_Duplicate(), IDirectSoundBufferImpl_SetFrequency(), IDirectSoundBufferImpl_Unlock(), and primarybuffer_SetFormat().
HRESULT DSOUND_PrimaryCreate | ( | DirectSoundDevice * | device | ) |
Definition at line 304 of file primary.c.
Referenced by DirectSoundDevice_Initialize().
HRESULT DSOUND_PrimaryDestroy | ( | DirectSoundDevice * | device | ) |
Definition at line 321 of file primary.c.
Referenced by DirectSoundDevice_Release().
HRESULT DSOUND_PrimaryGetPosition | ( | DirectSoundDevice * | device, |
LPDWORD | playpos, | ||
LPDWORD | writepos | ||
) |
Definition at line 402 of file primary.c.
Referenced by DSOUND_PerformMix(), and PrimaryBufferImpl_GetCurrentPosition().
HRESULT DSOUND_PrimaryPlay | ( | DirectSoundDevice * | device | ) |
Definition at line 345 of file primary.c.
Referenced by DSOUND_PerformMix().
HRESULT DSOUND_PrimaryStop | ( | DirectSoundDevice * | device | ) |
Definition at line 363 of file primary.c.
Referenced by DSOUND_PerformMix().
void DSOUND_RecalcFormat | ( | IDirectSoundBufferImpl * | dsb | ) |
Recalculate the size for temporary buffer, and new writelead Should be called when one of the following things occur:
After this, DSOUND_MixToTemporary(dsb, 0, dsb->buflen) should be called to refill the temporary buffer with data.
Definition at line 162 of file mixer.c.
Referenced by DSOUND_Calc3DBuffer(), IDirectSoundBufferImpl_Create(), IDirectSoundBufferImpl_Duplicate(), IDirectSoundBufferImpl_SetFrequency(), and primarybuffer_SetFormat().
void DSOUND_RecalcVolPan | ( | PDSVOLUMEPAN | volpan | ) |
Definition at line 27 of file mixer.c.
Referenced by DSOUND_Calc3DBuffer(), IDirectSoundBufferImpl_Create(), IDirectSoundBufferImpl_SetPan(), IDirectSoundBufferImpl_SetVolume(), PrimaryBufferImpl_SetPan(), and PrimaryBufferImpl_SetVolume().
HRESULT DSOUND_ReopenDevice | ( | DirectSoundDevice * | device, |
BOOL | forcewave | ||
) |
Definition at line 73 of file primary.c.
Referenced by DirectSoundDevice_Initialize(), DSOUND_PrimaryOpen(), DSOUND_PrimaryStop(), and primarybuffer_SetFormat().
DWORD DSOUND_secpos_to_bufpos | ( | const IDirectSoundBufferImpl * | dsb, |
DWORD | secpos, | ||
DWORD | secmixpos, | ||
DWORD * | overshot | ||
) |
This function converts a 'native' sample pointer to a resampled pointer that fits for primary secmixpos is used to decide which freqAcc is needed overshot tells what the 'actual' secpos is now (optional)
Definition at line 99 of file mixer.c.
Referenced by DSOUND_MixToTemporary(), DSOUND_RecalcFormat(), DSOUND_RecalcFreqAcc(), and IDirectSoundBufferImpl_SetCurrentPosition().
void CALLBACK DSOUND_timer | ( | UINT | timerID, |
UINT | msg, | ||
DWORD_PTR | dwUser, | ||
DWORD_PTR | dw1, | ||
DWORD_PTR | dw2 | ||
) |
Definition at line 984 of file mixer.c.
Referenced by DirectSoundDevice_Initialize().
Definition at line 92 of file dsound.c.
Referenced by DirectSoundDevice_SetCooperativeLevel(), IDirectSound8_IDirectSound8_SetCooperativeLevel(), IDirectSound8_IDirectSound_SetCooperativeLevel(), IDirectSound_IDirectSound_SetCooperativeLevel(), and IDirectSoundFullDuplex_IDirectSound8_SetCooperativeLevel().
HRESULT IDirectSound3DBufferImpl_Create | ( | IDirectSoundBufferImpl * | dsb, |
IDirectSound3DBufferImpl ** | pds3db | ||
) |
Definition at line 667 of file sound3d.c.
Referenced by IDirectSoundBufferImpl_QueryInterface().
HRESULT IDirectSound3DBufferImpl_Destroy | ( | IDirectSound3DBufferImpl * | pds3db | ) |
Definition at line 709 of file sound3d.c.
Referenced by IDirectSoundBufferImpl_Destroy().
HRESULT IDirectSound3DListenerImpl_Create | ( | DirectSoundDevice * | device, |
IDirectSound3DListenerImpl ** | pdsl | ||
) |
Definition at line 1034 of file sound3d.c.
Referenced by PrimaryBufferImpl_QueryInterface().
HRESULT IDirectSoundBufferImpl_Create | ( | DirectSoundDevice * | device, |
IDirectSoundBufferImpl ** | ppdsb, | ||
LPCDSBUFFERDESC | dsbd | ||
) |
Definition at line 931 of file buffer.c.
Referenced by DirectSoundDevice_CreateSoundBuffer().
HRESULT IDirectSoundBufferImpl_Destroy | ( | IDirectSoundBufferImpl * | pdsb | ) |
Definition at line 1137 of file buffer.c.
Referenced by DirectSoundDevice_Release().
HRESULT IDirectSoundBufferImpl_Duplicate | ( | DirectSoundDevice * | device, |
IDirectSoundBufferImpl ** | ppdsb, | ||
IDirectSoundBufferImpl * | pdsb | ||
) |
Definition at line 1169 of file buffer.c.
Referenced by DirectSoundDevice_DuplicateSoundBuffer().
HRESULT IKsBufferPropertySetImpl_Create | ( | IDirectSoundBufferImpl * | dsb, |
IKsBufferPropertySetImpl ** | piks | ||
) |
Definition at line 1390 of file buffer.c.
Referenced by IDirectSoundBufferImpl_QueryInterface().
HRESULT IKsBufferPropertySetImpl_Destroy | ( | IKsBufferPropertySetImpl * | piks | ) |
Definition at line 1416 of file buffer.c.
Referenced by IDirectSoundBufferImpl_Destroy().
HRESULT IKsPrivatePropertySetImpl_Create | ( | REFIID | riid, |
IKsPropertySet ** | piks | ||
) |
Definition at line 615 of file propset.c.
Definition at line 44 of file dsound_main.c.
Referenced by DirectSoundCaptureDevice_Initialize(), DirectSoundCaptureEnumerateW(), DirectSoundDevice_Initialize(), DirectSoundEnumerateW(), DSOUND_PrimaryOpen(), DSOUND_PrimaryPlay(), DSOUND_PrimaryStop(), DSOUND_ReopenDevice(), IDirectSoundCaptureBufferImpl_Create(), IDirectSoundCaptureBufferImpl_Start(), and IDirectSoundCaptureBufferImpl_Stop().
HRESULT primarybuffer_create | ( | DirectSoundDevice * | device, |
IDirectSoundBufferImpl ** | ppdsb, | ||
const DSBUFFERDESC * | dsbd | ||
) |
Definition at line 1223 of file primary.c.
Referenced by DirectSoundDevice_CreateSoundBuffer().
void primarybuffer_destroy | ( | IDirectSoundBufferImpl * | This | ) |
Definition at line 763 of file primary.c.
Referenced by IDirectSound3DListenerImpl_Release(), IDirectSoundBufferImpl_Release(), and PrimaryBufferImpl_Release().
HRESULT primarybuffer_SetFormat | ( | DirectSoundDevice * | device, |
LPCWAVEFORMATEX | wfex | ||
) |
Definition at line 460 of file primary.c.
Referenced by IDirectSoundBufferImpl_SetFormat(), and PrimaryBufferImpl_SetFormat().
void secondarybuffer_destroy | ( | IDirectSoundBufferImpl * | This | ) |
Definition at line 1113 of file buffer.c.
Referenced by IDirectSound3DBufferImpl_Release(), IDirectSoundBufferImpl_Destroy(), and IDirectSoundBufferImpl_Release().
Definition at line 102 of file dsound_main.c.
Referenced by DirectSoundCaptureEnumerateW(), DirectSoundEnumerateW(), DSOUND_CaptureCreate(), DSOUND_CaptureCreate8(), DSOUND_Create(), DSOUND_Create8(), DSOUND_FullDuplexCreate(), and DSPROPERTY_DescriptionW().
WINE_DEFAULT_DEBUG_CHANNEL | ( | dsound | ) |
|
extern |
Definition at line 68 of file dsound_private.h.