Commit b0573f9d authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmband: Download / unload bands when initializing / ending band track.

parent d177709b
......@@ -104,10 +104,13 @@ static ULONG WINAPI band_track_Release(IDirectMusicTrack8 *iface)
return ref;
}
static HRESULT WINAPI band_track_Init(IDirectMusicTrack8 *iface, IDirectMusicSegment *pSegment)
static HRESULT WINAPI band_track_Init(IDirectMusicTrack8 *iface, IDirectMusicSegment *segment)
{
struct band_track *This = impl_from_IDirectMusicTrack8(iface);
FIXME("(%p, %p): stub\n", This, pSegment);
FIXME("(%p, %p): stub\n", This, segment);
if (!segment) return E_POINTER;
return S_OK;
}
......@@ -116,16 +119,42 @@ static HRESULT WINAPI band_track_InitPlay(IDirectMusicTrack8 *iface,
void **state_data, DWORD virtual_track8id, DWORD flags)
{
struct band_track *This = impl_from_IDirectMusicTrack8(iface);
struct band_entry *entry;
HRESULT hr;
FIXME("(%p, %p, %p, %p, %ld, %lx): semi-stub\n", This, segment_state, performance, state_data, virtual_track8id, flags);
if (!performance) return E_POINTER;
FIXME("(%p, %p, %p, %p, %ld, %lx): stub\n", This, segment_state, performance, state_data, virtual_track8id, flags);
if (This->header.bAutoDownload)
{
LIST_FOR_EACH_ENTRY(entry, &This->bands, struct band_entry, entry)
{
if (FAILED(hr = IDirectMusicBand_Download(entry->band, performance)))
return hr;
}
}
return S_OK;
}
static HRESULT WINAPI band_track_EndPlay(IDirectMusicTrack8 *iface, void *pStateData)
static HRESULT WINAPI band_track_EndPlay(IDirectMusicTrack8 *iface, void *state_data)
{
struct band_track *This = impl_from_IDirectMusicTrack8(iface);
FIXME("(%p, %p): stub\n", This, pStateData);
struct band_entry *entry;
HRESULT hr;
FIXME("(%p, %p): semi-stub\n", This, state_data);
if (This->header.bAutoDownload)
{
LIST_FOR_EACH_ENTRY(entry, &This->bands, struct band_entry, entry)
{
if (FAILED(hr = IDirectMusicBand_Unload(entry->band, NULL)))
return hr;
}
}
return S_OK;
}
......
......@@ -226,12 +226,10 @@ static void test_bandtrack(void)
ok(hr == S_OK, "DirectMusicBandTrack create failed: %#lx, expected S_OK\n", hr);
/* IDirectMusicTrack8 */
todo_wine {
hr = IDirectMusicTrack8_Init(dmt8, NULL);
ok(hr == E_POINTER, "IDirectMusicTrack8_Init failed: %#lx\n", hr);
hr = IDirectMusicTrack8_InitPlay(dmt8, NULL, NULL, NULL, 0, 0);
ok(hr == E_POINTER, "IDirectMusicTrack8_InitPlay failed: %#lx\n", hr);
}
hr = IDirectMusicTrack8_EndPlay(dmt8, NULL);
ok(hr == S_OK, "IDirectMusicTrack8_EndPlay failed: %#lx\n", hr);
hr = IDirectMusicTrack8_Play(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0);
......
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