Module: wine Branch: master Commit: b8aadbfbd9d1d50de9c606ccd0dabf11f5666173 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b8aadbfbd9d1d50de9c606ccd0...
Author: Christian Costa titan.costa@gmail.com Date: Thu Sep 20 00:17:20 2012 +0200
dmusic: Implement SynthPortImpl_IDirectMusicPort_PlayBuffer.
---
dlls/dmusic/port.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index a611641..5a7776a 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -104,10 +104,28 @@ static ULONG WINAPI SynthPortImpl_IDirectMusicPort_Release(LPDIRECTMUSICPORT ifa static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_PlayBuffer(LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER buffer) { SynthPortImpl *This = impl_from_SynthPortImpl_IDirectMusicPort(iface); + HRESULT hr; + REFERENCE_TIME time; + LPBYTE data; + DWORD size;
- FIXME("(%p/%p)->(%p): stub\n", iface, This, buffer); + TRACE("(%p/%p)->(%p)\n", iface, This, buffer);
- return S_OK; + if (!buffer) + return E_POINTER; + + hr = IDirectMusicBuffer_GetStartTime(buffer, &time); + + if (SUCCEEDED(hr)) + hr = IDirectMusicBuffer_GetRawBufferPtr(buffer, &data); + + if (SUCCEEDED(hr)) + hr = IDirectMusicBuffer_GetUsedBytes(buffer, &size); + + if (SUCCEEDED(hr)) + hr = IDirectMusicSynth_PlayBuffer(This->synth, time, data, size); + + return hr; }
static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_SetReadNotificationHandle(LPDIRECTMUSICPORT iface, HANDLE event)