Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/xactengine3_7/xact_dll.c | 39 +++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c index 913cabe1e48..a3a0e490024 100644 --- a/dlls/xactengine3_7/xact_dll.c +++ b/dlls/xactengine3_7/xact_dll.c @@ -974,8 +974,43 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareInMemoryWave(IXACT3Engine *iface, IXACT3Wave **ppWave) { XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); - FIXME("(%p): stub!\n", This); - return E_NOTIMPL; + XACT3WaveImpl *wave; + FACTWave *fwave = NULL; + FACTWaveBankEntry fact_wavebank; + UINT ret; + + TRACE("(%p)->(0x%08x, %p, %p, %p, %d, %d, %p)\n", This, dwFlags, &entry, pdwSeekTable, + pbWaveData, dwPlayOffset, nLoopCount, ppWave); + + fact_wavebank.dwFlagsAndDuration = entry.u.dwFlagsAndDuration; + fact_wavebank.Format.dwValue = entry.Format.dwValue; + fact_wavebank.PlayRegion.dwOffset = entry.PlayRegion.dwOffset; + fact_wavebank.PlayRegion.dwLength = entry.PlayRegion.dwLength; + fact_wavebank.LoopRegion.dwStartSample = entry.LoopRegion.dwStartSample; + fact_wavebank.LoopRegion.dwTotalSamples = entry.LoopRegion.dwTotalSamples; + + ret = FACTAudioEngine_PrepareInMemoryWave(This->fact_engine, dwFlags, fact_wavebank, + pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, &fwave); + if(ret != 0 || !fwave) + { + ERR("Failed to create a wave: %d (%p)\n", ret, fwave); + return E_FAIL; + } + + wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); + if (!wave) + { + FACTWave_Destroy(fwave); + return E_OUTOFMEMORY; + } + + wave->IXACT3Wave_iface.lpVtbl = &XACT3Wave_Vtbl; + wave->fact_wave = fwave; + *ppWave = &wave->IXACT3Wave_iface; + + TRACE("Created Wave: %p\n", wave); + + return S_OK; }
static HRESULT WINAPI IXACT3EngineImpl_PrepareStreamingWave(IXACT3Engine *iface,