ReactOS 0.4.16-dev-136-g52192f1
|
#include "dsound_private.h"
Go to the source code of this file.
|
inlinestatic |
Copy a single frame from the given input buffer to the given output buffer. Translate 8 <-> 16 bits and mono <-> stereo
Definition at line 271 of file mixer.c.
Referenced by DSOUND_MixToTemporary().
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().
|
static |
Convert a resampled pointer that fits for primary to a 'native' sample pointer freqAccNext is used here rather than freqAcc: In case the app wants to fill up to the play position it won't overwrite it
Definition at line 125 of file mixer.c.
Referenced by DSOUND_MixInBuffer().
Calculate the distance between two buffer offsets, taking wraparound into account.
Definition at line 308 of file mixer.c.
Referenced by DSOUND_MixInBuffer(), DSOUND_MixOne(), and DSOUND_PerformMix().
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().
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().
|
static |
Apply volume to the given soundbuffer from (primary) position writepos and length len Returns: NULL if no volume needs to be applied or else a memory handle that holds 'len' volume adjusted buffer
Definition at line 409 of file mixer.c.
Referenced by DSOUND_MixInBuffer().
|
static |
Mix (at most) the given number of bytes into the given position of the device buffer, from the secondary buffer "dsb" (starting at the current mix position for that buffer).
Returns the number of bytes actually mixed into the device buffer. This will match fraglen unless the end of the secondary buffer is reached (and it is not looping).
dsb = the secondary buffer to mix from writepos = position (offset) in device buffer to write at fraglen = number of bytes to mix
Definition at line 499 of file mixer.c.
Referenced by DSOUND_MixOne().
|
static |
Mix some frames from the given secondary buffer "dsb" into the device primary buffer.
dsb = the secondary buffer playpos = the current play position in the device buffer (primary buffer) writepos = the current safe-to-write position in the device buffer mixlen = the maximum number of bytes in the primary buffer to mix, from the current writepos.
Returns: the number of bytes beyond the writepos that were mixed.
Definition at line 579 of file mixer.c.
Referenced by DSOUND_MixToPrimary().
|
static |
For a DirectSoundDevice, go through all the currently playing buffers and mix them in to the device buffer.
writepos = the current safe-to-write position in the primary buffer mixlen = the maximum amount to mix into the primary buffer (beyond the current writepos) recover = true if the sound device may have been reset and the write position in the device buffer changed all_stopped = reports back if all buffers have stopped
Returns: the length beyond the writepos that was mixed to.
Definition at line 663 of file mixer.c.
Referenced by DSOUND_PerformMix().
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().
|
static |
Perform mixing for a Direct Sound device. That is, go through all the secondary buffers (the sound bites currently playing) and mix them in to the primary buffer (the device buffer).
Definition at line 787 of file mixer.c.
Referenced by DSOUND_timer().
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().
|
static |
Move freqAccNext to freqAcc, and find new values for buffer length and freqAccNext
Definition at line 145 of file mixer.c.
Referenced by DSOUND_MixInBuffer(), and DSOUND_RecalcFormat().
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().
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().
|
static |
Add buffers to the emulated wave device system.
device = The current dsound playback device force = If TRUE, the function will buffer up as many frags as possible, even though and will ignore the actual state of the primary buffer.
Returns: None
Definition at line 725 of file mixer.c.
Referenced by DSOUND_PerformMix().