xaudio2: Implement IXAudio2SourceVoice::GetState.
This commit is contained in:
parent
e43ca169ee
commit
d2ae105401
|
@ -655,7 +655,30 @@ static void WINAPI XA2SRC_GetState(IXAudio2SourceVoice *iface,
|
|||
XAUDIO2_VOICE_STATE *pVoiceState, UINT32 Flags)
|
||||
{
|
||||
XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface);
|
||||
|
||||
TRACE("%p, %p, 0x%x\n", This, pVoiceState, Flags);
|
||||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!(Flags & XAUDIO2_VOICE_NOSAMPLESPLAYED)){
|
||||
ALint bufpos = 0;
|
||||
|
||||
alGetSourcei(This->al_src, AL_SAMPLE_OFFSET, &bufpos);
|
||||
|
||||
pVoiceState->SamplesPlayed = This->played_frames + bufpos;
|
||||
}else
|
||||
pVoiceState->SamplesPlayed = 0;
|
||||
|
||||
if(This->nbufs)
|
||||
pVoiceState->pCurrentBufferContext = This->buffers[This->first_buf].xa2buffer.pContext;
|
||||
else
|
||||
pVoiceState->pCurrentBufferContext = NULL;
|
||||
|
||||
pVoiceState->BuffersQueued = This->nbufs;
|
||||
|
||||
LeaveCriticalSection(&This->lock);
|
||||
|
||||
TRACE("returning %s, queued: %u\n", wine_dbgstr_longlong(pVoiceState->SamplesPlayed), This->nbufs);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI XA2SRC_SetFrequencyRatio(IXAudio2SourceVoice *iface,
|
||||
|
|
|
@ -567,6 +567,7 @@ const UINT32 XAUDIO2_VOICE_MUSIC = 16;
|
|||
const UINT32 XAUDIO2_PLAY_TAILS = 32;
|
||||
const UINT32 XAUDIO2_END_OF_STREAM = 64;
|
||||
const UINT32 XAUDIO2_SEND_USEFILTER = 128;
|
||||
const UINT32 XAUDIO2_VOICE_NOSAMPLESPLAYED = 256;
|
||||
|
||||
const XAUDIO2_FILTER_TYPE XAUDIO2_DEFAULT_FILTER_TYPE = LowPassFilter;
|
||||
const float XAUDIO2_DEFAULT_FILTER_FREQUENCY = XAUDIO2_MAX_FILTER_FREQUENCY;
|
||||
|
|
Loading…
Reference in New Issue