Commit c77788b5 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

- Release DSBuffer on AudioPath destruction.

- Semi stub for AudioPath Activate. - IDirectMusicPerformance8::CreateAudioPath stub. - Most of the IDirectMusicSegment8_[Set,Get]* (using header). - Load of Streamer IDirectMusicSegment8 header.
parent 9e8d507c
...@@ -63,6 +63,9 @@ ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_Release (LPUNKNOWN iface) { ...@@ -63,6 +63,9 @@ ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_Release (LPUNKNOWN iface) {
ULONG ref = --This->ref; ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref); TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) { if (ref == 0) {
if (This->pDSBuffer) {
IDirectSoundBuffer8_Release(This->pDSBuffer);
}
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
return ref; return ref;
...@@ -182,6 +185,14 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectInPath ( ...@@ -182,6 +185,14 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectInPath (
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Activate (LPDIRECTMUSICAUDIOPATH iface, BOOL fActivate) { HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Activate (LPDIRECTMUSICAUDIOPATH iface, BOOL fActivate) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface); ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
FIXME("(%p, %d): stub\n", This, fActivate); FIXME("(%p, %d): stub\n", This, fActivate);
if (!fActivate) {
if (!This->fActive) return S_OK;
This->fActive = FALSE;
} else {
if (This->fActive) return S_OK;
This->fActive = TRUE;
IDirectSoundBuffer_Stop(This->pDSBuffer);
}
return S_OK; return S_OK;
} }
......
...@@ -1117,6 +1117,22 @@ const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { ...@@ -1117,6 +1117,22 @@ const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
/* dump whole DMUS_OBJECTDESC struct */ /* dump whole DMUS_OBJECTDESC struct */
const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) { if (pDesc) {
TRACE("DMUS_OBJECTDESC (%p):\n", pDesc);
TRACE(" - dwSize = %ld\n", pDesc->dwSize);
TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
if (pDesc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", pDesc->pStream);
} else {
TRACE("(NULL)\n");
}/*
if (pDesc) {
char buffer[1024] = "", *ptr = &buffer[0]; char buffer[1024] = "", *ptr = &buffer[0];
ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc); ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc);
...@@ -1136,4 +1152,6 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { ...@@ -1136,4 +1152,6 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
} else { } else {
return wine_dbg_sprintf("(NULL)"); return wine_dbg_sprintf("(NULL)");
} }
*/
return "X";
} }
...@@ -265,6 +265,8 @@ struct IDirectMusicSegment8Impl { ...@@ -265,6 +265,8 @@ struct IDirectMusicSegment8Impl {
/* IDirectMusicSegment8Impl fields */ /* IDirectMusicSegment8Impl fields */
LPDMUS_OBJECTDESC pDesc; LPDMUS_OBJECTDESC pDesc;
DMUS_IO_SEGMENT_HEADER header;
IDirectMusicGraph* pGraph;
}; };
/* IUnknown: */ /* IUnknown: */
...@@ -408,6 +410,8 @@ struct IDirectMusicAudioPathImpl { ...@@ -408,6 +410,8 @@ struct IDirectMusicAudioPathImpl {
IDirectMusicGraph* pToolGraph; IDirectMusicGraph* pToolGraph;
IDirectSoundBuffer* pDSBuffer; IDirectSoundBuffer* pDSBuffer;
IDirectSoundBuffer* pPrimary; IDirectSoundBuffer* pPrimary;
BOOL fActive;
}; };
/* IUnknown: */ /* IUnknown: */
......
...@@ -418,6 +418,8 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph (LPDIRECTMUSICPERFORMANCE8 ...@@ -418,6 +418,8 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph (LPDIRECTMUSICPERFORMANCE8
if (NULL != This->pToolGraph) { if (NULL != This->pToolGraph) {
*ppGraph = (LPDIRECTMUSICGRAPH) This->pToolGraph; *ppGraph = (LPDIRECTMUSICGRAPH) This->pToolGraph;
IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) *ppGraph); IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) *ppGraph);
} else {
return E_FAIL;
} }
return S_OK; return S_OK;
} }
...@@ -702,6 +704,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio (LPDIRECTMUSICPERFORMANCE8 ...@@ -702,6 +704,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio (LPDIRECTMUSICPERFORMANCE8
* TODO, how can i fill the struct * TODO, how can i fill the struct
* as seen at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directX/htm/dmusaudioparams.asp * as seen at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directX/htm/dmusaudioparams.asp
*/ */
memset(&This->pParams, 0, sizeof(DMUS_AUDIOPARAMS));
This->pParams.dwSize = sizeof(DMUS_AUDIOPARAMS); This->pParams.dwSize = sizeof(DMUS_AUDIOPARAMS);
This->pParams.fInitNow = FALSE; This->pParams.fInitNow = FALSE;
This->pParams.dwValidData = DMUS_AUDIOPARAMS_FEATURES | DMUS_AUDIOPARAMS_VOICES | DMUS_AUDIOPARAMS_SAMPLERATE | DMUS_AUDIOPARAMS_DEFAULTSYNTH; This->pParams.dwValidData = DMUS_AUDIOPARAMS_FEATURES | DMUS_AUDIOPARAMS_VOICES | DMUS_AUDIOPARAMS_SAMPLERATE | DMUS_AUDIOPARAMS_DEFAULTSYNTH;
...@@ -736,9 +739,25 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_ClonePMsg (LPDIRECTMUSICPERFORMANCE8 ...@@ -736,9 +739,25 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_ClonePMsg (LPDIRECTMUSICPERFORMANCE8
} }
HRESULT WINAPI IDirectMusicPerformance8Impl_CreateAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSourceConfig, BOOL fActivate, IDirectMusicAudioPath** ppNewPath) { HRESULT WINAPI IDirectMusicPerformance8Impl_CreateAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSourceConfig, BOOL fActivate, IDirectMusicAudioPath** ppNewPath) {
IDirectMusicAudioPathImpl *default_path;
IDirectMusicAudioPath *pPath;
ICOM_THIS(IDirectMusicPerformance8Impl,iface); ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %d, %p): stub\n", This, pSourceConfig, fActivate, ppNewPath); FIXME("(%p, %p, %d, %p): stub\n", This, pSourceConfig, fActivate, ppNewPath);
return S_OK;
if (NULL == ppNewPath) {
return E_POINTER;
}
DMUSIC_CreateDirectMusicAudioPathImpl (&IID_IDirectMusicAudioPath, (LPVOID*)&pPath, NULL);
default_path = (IDirectMusicAudioPathImpl*)((char*)(pPath) - offsetof(IDirectMusicAudioPathImpl,AudioPathVtbl));
default_path->pPerf = (IDirectMusicPerformance8*) This;
/** TODO */
*ppNewPath = (LPDIRECTMUSICAUDIOPATH) pPath;
return IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Activate(*ppNewPath, fActivate);
} }
/** /**
...@@ -765,6 +784,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath (LPDIRECTMUS ...@@ -765,6 +784,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath (LPDIRECTMUS
default_path->pPerf = (IDirectMusicPerformance8*) This; default_path->pPerf = (IDirectMusicPerformance8*) This;
/* Secondary buffer description */ /* Secondary buffer description */
memset(&format, 0, sizeof(format));
format.wFormatTag = WAVE_FORMAT_PCM; format.wFormatTag = WAVE_FORMAT_PCM;
format.nChannels = 1; format.nChannels = 1;
format.nSamplesPerSec = 44000; format.nSamplesPerSec = 44000;
...@@ -773,6 +793,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath (LPDIRECTMUS ...@@ -773,6 +793,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath (LPDIRECTMUS
format.wBitsPerSample = 16; format.wBitsPerSample = 16;
format.cbSize = 0; format.cbSize = 0;
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc); desc.dwSize = sizeof(desc);
desc.dwFlags = DSBCAPS_CTRLFX | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS; desc.dwFlags = DSBCAPS_CTRLFX | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS;
desc.dwBufferBytes = DSBSIZE_MIN; desc.dwBufferBytes = DSBSIZE_MIN;
...@@ -831,7 +852,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath (LPDIRECTMUS ...@@ -831,7 +852,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath (LPDIRECTMUS
TRACE(" returning IDirectMusicPerformance interface at %p.\n", *ppNewPath); TRACE(" returning IDirectMusicPerformance interface at %p.\n", *ppNewPath);
return S_OK; return IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Activate(*ppNewPath, fActivate);
} }
HRESULT WINAPI IDirectMusicPerformance8Impl_SetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath) { HRESULT WINAPI IDirectMusicPerformance8Impl_SetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath) {
......
...@@ -95,37 +95,52 @@ ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Release (LPDIRECTMUSI ...@@ -95,37 +95,52 @@ ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Release (LPDIRECTMUSI
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtLength) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtLength) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p): stub\n", This, pmtLength); TRACE("(%p, %p)\n", This, pmtLength);
if (NULL == pmtLength) {
return E_POINTER;
}
*pmtLength = This->header.mtLength;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtLength) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtLength) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %ld): stub\n", This, mtLength); TRACE("(%p, %ld)\n", This, mtLength);
This->header.mtLength = mtLength;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwRepeats) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwRepeats) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p): stub\n", This, pdwRepeats); TRACE("(%p, %p)\n", This, pdwRepeats);
if (NULL == pdwRepeats) {
return E_POINTER;
}
*pdwRepeats = This->header.dwRepeats;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD dwRepeats) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD dwRepeats) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %ld): stub\n", This, dwRepeats); TRACE("(%p, %ld)\n", This, dwRepeats);
This->header.dwRepeats = dwRepeats;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwResolution) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwResolution) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p): stub\n", This, pdwResolution); TRACE("(%p, %p)\n", This, pdwResolution);
if (NULL == pdwResolution) {
return E_POINTER;
}
*pdwResolution = This->header.dwResolution;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD dwResolution) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD dwResolution) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %ld): stub\n", This, dwResolution); TRACE("(%p, %ld)\n", This, dwResolution);
This->header.dwResolution = dwResolution;
return S_OK; return S_OK;
} }
...@@ -155,19 +170,48 @@ HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveTrack (LPDIRE ...@@ -155,19 +170,48 @@ HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveTrack (LPDIRE
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_InitPlay (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicSegmentState** ppSegState, IDirectMusicPerformance* pPerformance, DWORD dwFlags) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_InitPlay (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicSegmentState** ppSegState, IDirectMusicPerformance* pPerformance, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p, %p, %ld): stub\n", This, ppSegState, pPerformance, dwFlags); HRESULT hr;
FIXME("(%p, %p, %p, %ld): semi-stub\n", This, ppSegState, pPerformance, dwFlags);
if (NULL == ppSegState) {
return E_POINTER;
}
hr = DMUSIC_CreateDirectMusicSegmentStateImpl(&IID_IDirectMusicSegmentState, (void**) ppSegState, NULL);
if (FAILED(hr)) {
return hr;
}
/* TODO: DMUS_SEGF_FLAGS */
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph** ppGraph) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph** ppGraph) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p): stub\n", This, ppGraph); FIXME("(%p, %p): semi-stub\n", This, ppGraph);
if (NULL == ppGraph) {
return E_POINTER;
}
if (NULL == This->pGraph) {
return DMUS_E_NOT_FOUND;
}
/**
* should return This, as seen in msdn
* http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/htm/idirectmusicsegment8getgraph.asp
* "...The segment object implements IDirectMusicGraph directly..."
*/
*ppGraph = This->pGraph;
IDirectMusicGraph_AddRef(This->pGraph);
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph* pGraph) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph* pGraph) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p): stub\n", This, pGraph); FIXME("(%p, %p): to complete\n", This, pGraph);
if (NULL != This->pGraph) {
IDirectMusicGraph_Release(This->pGraph);
}
This->pGraph = pGraph;
if (NULL != This->pGraph) {
IDirectMusicGraph_AddRef(This->pGraph);
}
return S_OK; return S_OK;
} }
...@@ -203,25 +247,43 @@ HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Clone (LPDIRECTMUSI ...@@ -203,25 +247,43 @@ HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Clone (LPDIRECTMUSI
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %ld): stub\n", This, mtStart); TRACE("(%p, %ld)\n", This, mtStart);
if (mtStart >= This->header.mtLength) {
return DMUS_E_OUT_OF_RANGE;
}
This->header.mtPlayStart = mtStart;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p): stub\n", This, pmtStart); TRACE("(%p, %p)\n", This, pmtStart);
if (NULL == pmtStart) {
return E_POINTER;
}
*pmtStart = This->header.mtPlayStart;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %ld, %ld): stub\n", This, mtStart, mtEnd); TRACE("(%p, %ld, %ld)\n", This, mtStart, mtEnd);
if (mtStart >= This->header.mtLength || mtEnd > This->header.mtLength || mtStart > mtEnd) {
return DMUS_E_OUT_OF_RANGE;
}
This->header.mtLoopStart = mtStart;
This->header.mtLoopEnd = mtEnd;
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart, MUSIC_TIME* pmtEnd) { HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart, MUSIC_TIME* pmtEnd) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface);
FIXME("(%p, %p, %p): stub\n", This, pmtStart, pmtEnd); TRACE("(%p, %p, %p)\n", This, pmtStart, pmtEnd);
if (NULL == pmtStart || NULL == pmtEnd) {
return E_POINTER;
}
*pmtStart = This->header.mtLoopStart;
*pmtEnd = This->header.mtLoopEnd;
return S_OK; return S_OK;
} }
...@@ -914,8 +976,38 @@ static HRESULT IDirectMusicSegment8Impl_IPersistStream_ParseSegmentForm (LPPERSI ...@@ -914,8 +976,38 @@ static HRESULT IDirectMusicSegment8Impl_IPersistStream_ParseSegmentForm (LPPERSI
if (hr == S_FALSE) { if (hr == S_FALSE) {
switch (Chunk.fccID) { switch (Chunk.fccID) {
case DMUS_FOURCC_SEGMENT_CHUNK: { case DMUS_FOURCC_SEGMENT_CHUNK: {
DWORD checkSz = 0;
FIXME_(dmfile)(": segment chunk\n"); FIXME_(dmfile)(": segment chunk\n");
liMove.QuadPart = Chunk.dwSize; /** DX 7 */
IStream_Read (pStm, &This->header.dwRepeats, sizeof(This->header.dwRepeats), NULL);
checkSz += sizeof(This->header.dwRepeats);
IStream_Read (pStm, &This->header.mtLength, sizeof(This->header.mtLength), NULL);
checkSz += sizeof(This->header.mtLength);
IStream_Read (pStm, &This->header.mtPlayStart, sizeof(This->header.mtPlayStart), NULL);
checkSz += sizeof(This->header.mtPlayStart);
IStream_Read (pStm, &This->header.mtLoopStart, sizeof(This->header.mtLoopStart), NULL);
checkSz += sizeof(This->header.mtLoopStart);
IStream_Read (pStm, &This->header.mtLoopEnd, sizeof(This->header.mtLoopEnd), NULL);
checkSz += sizeof(This->header.mtLoopEnd);
IStream_Read (pStm, &This->header.dwResolution, sizeof(This->header.dwResolution), NULL);
checkSz += sizeof(This->header.dwResolution);
/** DX 8 */
if (Chunk.dwSize > checkSz) {
IStream_Read (pStm, &This->header.rtLength, sizeof(This->header.rtLength), NULL);
checkSz += sizeof(This->header.rtLength);
IStream_Read (pStm, &This->header.dwFlags, sizeof(This->header.dwFlags), NULL);
checkSz += sizeof(This->header.dwFlags);
}
/** DX 9 */
if (Chunk.dwSize > checkSz) {
IStream_Read (pStm, &This->header.rtLoopStart, sizeof(This->header.rtLoopStart), NULL);
checkSz += sizeof(This->header.rtLoopStart);
IStream_Read (pStm, &This->header.rtLoopEnd, sizeof(This->header.rtLoopEnd), NULL);
checkSz += sizeof(This->header.rtLoopEnd);
IStream_Read (pStm, &This->header.rtPlayStart, sizeof(This->header.rtPlayStart), NULL);
checkSz += sizeof(This->header.rtPlayStart);
}
liMove.QuadPart = Chunk.dwSize - checkSz;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break; break;
} }
......
...@@ -77,6 +77,7 @@ struct IDirectMusicScriptImpl { ...@@ -77,6 +77,7 @@ struct IDirectMusicScriptImpl {
DWORD ref; DWORD ref;
/* IDirectMusicScriptImpl fields */ /* IDirectMusicScriptImpl fields */
IDirectMusicPerformance* pPerformance;
LPDMUS_OBJECTDESC pDesc; LPDMUS_OBJECTDESC pDesc;
DMUS_IO_SCRIPT_HEADER* pHeader; DMUS_IO_SCRIPT_HEADER* pHeader;
DMUS_IO_VERSION* pVersion; DMUS_IO_VERSION* pVersion;
......
...@@ -106,6 +106,7 @@ ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Release (LPDIRECTMUSICSCR ...@@ -106,6 +106,7 @@ ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Release (LPDIRECTMUSICSCR
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo) { HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p): stub\n", This, pPerformance, pErrorInfo); FIXME("(%p, %p, %p): stub\n", This, pPerformance, pErrorInfo);
This->pPerformance = pPerformance;
return S_OK; return S_OK;
} }
...@@ -113,42 +114,43 @@ HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_CallRoutine (LPDIRECTMU ...@@ -113,42 +114,43 @@ HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_CallRoutine (LPDIRECTMU
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszRoutineName), pErrorInfo); FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszRoutineName), pErrorInfo);
/*return E_NOTIMPL;*/ /*return E_NOTIMPL;*/
return S_OK; /*return S_OK;*/
return E_FAIL;
} }
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo) { HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, FIXME, %d, %p): stub\n", This, pwszVariableName,/* varValue,*/ fSetRef, pErrorInfo); FIXME("(%p, %s, FIXME, %d, %p): stub\n", This, debugstr_w(pwszVariableName),/* varValue,*/ fSetRef, pErrorInfo);
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT* pvarValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) { HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT* pvarValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, pvarValue, pErrorInfo); FIXME("(%p, %s, %p, %p): stub\n", This, debugstr_w(pwszVariableName), pvarValue, pErrorInfo);
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG lValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) { HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG lValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %li, %p): stub\n", This, pwszVariableName, lValue, pErrorInfo); FIXME("(%p, %s, %li, %p): stub\n", This, debugstr_w(pwszVariableName), lValue, pErrorInfo);
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG* plValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) { HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG* plValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, plValue, pErrorInfo); FIXME("(%p, %s, %p, %p): stub\n", This, debugstr_w(pwszVariableName), plValue, pErrorInfo);
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, IUnknown* punkValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) { HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, IUnknown* punkValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, punkValue, pErrorInfo); FIXME("(%p, %s, %p, %p): stub\n", This, debugstr_w(pwszVariableName), punkValue, pErrorInfo);
return S_OK; return S_OK;
} }
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, REFIID riid, LPVOID* ppv, DMUS_SCRIPT_ERRORINFO* pErrorInfo) { HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, REFIID riid, LPVOID* ppv, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface); ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %s, %p, %p): stub\n", This, pwszVariableName, debugstr_dmguid(riid), ppv, pErrorInfo); FIXME("(%p, %s, %s, %p, %p): stub\n", This, debugstr_w(pwszVariableName), debugstr_dmguid(riid), ppv, pErrorInfo);
return S_OK; return S_OK;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment