2003-08-23 01:53:27 +02:00
|
|
|
/* IDirectMusicBandTrack Implementation
|
|
|
|
*
|
2004-01-20 01:21:40 +01:00
|
|
|
* Copyright (C) 2003-2004 Rok Mandeljc
|
2003-08-23 01:53:27 +02:00
|
|
|
*
|
2007-05-30 12:54:07 +02:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2003-08-23 01:53:27 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-05-30 12:54:07 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2003-08-23 01:53:27 +02:00
|
|
|
*
|
2007-05-30 12:54:07 +02:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-08-23 01:53:27 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "dmband_private.h"
|
2015-06-26 00:24:39 +02:00
|
|
|
#include "dmobject.h"
|
2003-08-23 01:53:27 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
|
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectMusicBandTrack implementation
|
|
|
|
*/
|
2014-06-09 13:28:01 +02:00
|
|
|
typedef struct IDirectMusicBandTrack {
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicTrack8 IDirectMusicTrack8_iface;
|
2015-06-26 00:24:39 +02:00
|
|
|
struct dmobject dmobj; /* IPersistStream only */
|
2014-06-09 13:28:01 +02:00
|
|
|
LONG ref;
|
|
|
|
DMUS_IO_BAND_TRACK_HEADER header;
|
|
|
|
struct list Bands;
|
|
|
|
} IDirectMusicBandTrack;
|
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
/* IDirectMusicBandTrack IDirectMusicTrack8 part: */
|
2015-06-25 00:31:17 +02:00
|
|
|
static inline IDirectMusicBandTrack *impl_from_IDirectMusicTrack8(IDirectMusicTrack8 *iface)
|
|
|
|
{
|
2015-06-26 00:16:24 +02:00
|
|
|
return CONTAINING_RECORD(iface, IDirectMusicBandTrack, IDirectMusicTrack8_iface);
|
2015-06-25 00:31:17 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_QueryInterface(IDirectMusicTrack8 *iface, REFIID riid,
|
2015-06-26 13:23:39 +02:00
|
|
|
void **ret_iface)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2015-06-26 13:23:39 +02:00
|
|
|
|
2015-06-28 23:37:31 +02:00
|
|
|
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ret_iface);
|
|
|
|
|
2015-06-26 13:23:39 +02:00
|
|
|
*ret_iface = NULL;
|
|
|
|
|
|
|
|
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicTrack) ||
|
|
|
|
IsEqualIID(riid, &IID_IDirectMusicTrack8))
|
|
|
|
*ret_iface = iface;
|
|
|
|
else if (IsEqualIID(riid, &IID_IPersistStream))
|
2015-06-26 00:24:39 +02:00
|
|
|
*ret_iface = &This->dmobj.IPersistStream_iface;
|
2015-06-26 13:23:39 +02:00
|
|
|
else {
|
|
|
|
WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ret_iface);
|
|
|
|
return S_OK;
|
2004-01-20 01:21:40 +01:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static ULONG WINAPI band_track_AddRef(IDirectMusicTrack8 *iface)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2015-06-26 13:23:39 +02:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE("(%p) ref=%ld\n", This, ref);
|
2015-06-26 13:23:39 +02:00
|
|
|
|
|
|
|
return ref;
|
2004-01-20 01:21:40 +01:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static ULONG WINAPI band_track_Release(IDirectMusicTrack8 *iface)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2015-06-26 13:23:39 +02:00
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE("(%p) ref=%ld\n", This, ref);
|
2015-06-26 13:23:39 +02:00
|
|
|
|
|
|
|
if (!ref) {
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
DMBAND_UnlockModule();
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
2004-01-20 01:21:40 +01:00
|
|
|
}
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_Init(IDirectMusicTrack8 *iface, IDirectMusicSegment *pSegment)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2004-05-13 01:18:22 +02:00
|
|
|
FIXME("(%p, %p): stub\n", This, pSegment);
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_InitPlay(IDirectMusicTrack8 *iface,
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicSegmentState *segment_state, IDirectMusicPerformance *performance,
|
|
|
|
void **state_data, DWORD virtual_track8id, DWORD flags)
|
2012-04-12 08:28:44 +02:00
|
|
|
{
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2012-04-12 08:28:44 +02:00
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
FIXME("(%p, %p, %p, %p, %ld, %lx): stub\n", This, segment_state, performance, state_data, virtual_track8id, flags);
|
2012-04-12 08:28:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_EndPlay(IDirectMusicTrack8 *iface, void *pStateData)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2004-05-13 01:18:22 +02:00
|
|
|
FIXME("(%p, %p): stub\n", This, pStateData);
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_Play(IDirectMusicTrack8 *iface, void *state_data,
|
2015-06-26 00:16:24 +02:00
|
|
|
MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD flags,
|
|
|
|
IDirectMusicPerformance *performance, IDirectMusicSegmentState *segment_state,
|
|
|
|
DWORD virtual_id)
|
2012-04-12 08:28:44 +02:00
|
|
|
{
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2004-05-13 01:18:22 +02:00
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
FIXME("(%p, %p, %ld, %ld, %ld, %lx, %p, %p, %ld): semi-stub\n", This, state_data, mtStart, mtEnd, mtOffset, flags, performance, segment_state, virtual_id);
|
2012-04-12 08:28:44 +02:00
|
|
|
|
|
|
|
/* Sends following pMSG:
|
|
|
|
- DMUS_PATCH_PMSG
|
|
|
|
- DMUS_TRANSPOSE_PMSG
|
|
|
|
- DMUS_CHANNEL_PRIORITY_PMSG
|
|
|
|
- DMUS_MIDI_PMSG
|
|
|
|
*/
|
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-12-10 00:15:12 +01:00
|
|
|
static HRESULT WINAPI band_track_GetParam(IDirectMusicTrack8 *iface, REFGUID type, MUSIC_TIME time,
|
|
|
|
MUSIC_TIME *next, void *param)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
2019-12-10 00:15:12 +01:00
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE("(%p, %s, %ld, %p, %p)\n", This, debugstr_dmguid(type), time, next, param);
|
2019-12-10 00:15:12 +01:00
|
|
|
|
|
|
|
if (!type)
|
|
|
|
return E_POINTER;
|
|
|
|
if (!IsEqualGUID(type, &GUID_BandParam))
|
|
|
|
return DMUS_E_GET_UNSUPPORTED;
|
|
|
|
|
|
|
|
FIXME("GUID_BandParam not handled yet\n");
|
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-12-10 00:15:12 +01:00
|
|
|
static HRESULT WINAPI band_track_SetParam(IDirectMusicTrack8 *iface, REFGUID type, MUSIC_TIME time,
|
|
|
|
void *param)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
2019-12-10 00:15:12 +01:00
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE("(%p, %s, %ld, %p)\n", This, debugstr_dmguid(type), time, param);
|
2019-12-10 00:15:12 +01:00
|
|
|
|
|
|
|
if (!type)
|
|
|
|
return E_POINTER;
|
|
|
|
if (FAILED(IDirectMusicTrack8_IsParamSupported(iface, type)))
|
|
|
|
return DMUS_E_TYPE_UNSUPPORTED;
|
|
|
|
|
|
|
|
if (IsEqualGUID(type, &GUID_BandParam))
|
|
|
|
FIXME("GUID_BandParam not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_Clear_All_Bands))
|
|
|
|
FIXME("GUID_Clear_All_Bands not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_ConnectToDLSCollection))
|
|
|
|
FIXME("GUID_ConnectToDLSCollection not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_Disable_Auto_Download))
|
|
|
|
FIXME("GUID_Disable_Auto_Download not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_Download))
|
|
|
|
FIXME("GUID_Download not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_DownloadToAudioPath))
|
|
|
|
FIXME("GUID_DownloadToAudioPath not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_Enable_Auto_Download))
|
|
|
|
FIXME("GUID_Enable_Auto_Download not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_IDirectMusicBand))
|
|
|
|
FIXME("GUID_IDirectMusicBand not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_StandardMIDIFile))
|
|
|
|
FIXME("GUID_StandardMIDIFile not handled yet\n");
|
|
|
|
else if (IsEqualGUID(type, &GUID_UnloadFromAudioPath))
|
|
|
|
FIXME("GUID_UnloadFromAudioPath not handled yet\n");
|
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_IsParamSupported(IDirectMusicTrack8 *iface, REFGUID rguidType)
|
2015-06-26 00:16:24 +02:00
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
|
|
|
|
2006-10-13 02:23:08 +02:00
|
|
|
TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType));
|
2015-06-25 00:12:53 +02:00
|
|
|
|
|
|
|
if (!rguidType)
|
|
|
|
return E_POINTER;
|
|
|
|
|
2004-05-13 01:18:22 +02:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_BandParam)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_Clear_All_Bands)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_ConnectToDLSCollection)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_Disable_Auto_Download)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_Download)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_DownloadToAudioPath)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_Enable_Auto_Download)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_IDirectMusicBand)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_StandardMIDIFile)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_Unload)
|
|
|
|
|| IsEqualGUID (rguidType, &GUID_UnloadFromAudioPath)) {
|
|
|
|
TRACE("param supported\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("param unsupported\n");
|
|
|
|
return DMUS_E_TYPE_UNSUPPORTED;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_AddNotificationType(IDirectMusicTrack8 *iface, REFGUID notiftype)
|
2015-06-25 00:31:17 +02:00
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
|
|
|
|
|
|
|
TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype));
|
|
|
|
return E_NOTIMPL;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_RemoveNotificationType(IDirectMusicTrack8 *iface,
|
2015-06-25 00:31:17 +02:00
|
|
|
REFGUID notiftype)
|
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
|
|
|
|
|
|
|
TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype));
|
|
|
|
return E_NOTIMPL;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_Clone(IDirectMusicTrack8 *iface, MUSIC_TIME mtStart,
|
2015-06-26 00:16:24 +02:00
|
|
|
MUSIC_TIME mtEnd, IDirectMusicTrack **ppTrack)
|
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2022-02-08 23:14:51 +01:00
|
|
|
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
|
2004-05-13 01:18:22 +02:00
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_PlayEx(IDirectMusicTrack8 *iface, void *state_data,
|
2015-06-26 00:16:24 +02:00
|
|
|
REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD flags,
|
|
|
|
IDirectMusicPerformance *performance, IDirectMusicSegmentState *segment_state,
|
|
|
|
DWORD virtual_id)
|
2012-04-12 08:28:44 +02:00
|
|
|
{
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2012-04-12 08:28:44 +02:00
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
FIXME("(%p, %p, 0x%s, 0x%s, 0x%s, %lx, %p, %p, %ld): stub\n", This, state_data, wine_dbgstr_longlong(rtStart),
|
2012-04-12 08:28:44 +02:00
|
|
|
wine_dbgstr_longlong(rtEnd), wine_dbgstr_longlong(rtOffset), flags, performance, segment_state, virtual_id);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_GetParamEx(IDirectMusicTrack8 *iface,
|
2015-06-26 00:16:24 +02:00
|
|
|
REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME *rtNext, void *param,
|
|
|
|
void *state_data, DWORD flags)
|
2012-04-12 08:28:44 +02:00
|
|
|
{
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2012-04-12 08:28:44 +02:00
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
FIXME("(%p, %s, 0x%s, %p, %p, %p, %lx): stub\n", This, debugstr_dmguid(rguidType),
|
2012-04-12 08:28:44 +02:00
|
|
|
wine_dbgstr_longlong(rtTime), rtNext, param, state_data, flags);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_SetParamEx(IDirectMusicTrack8 *iface, REFGUID rguidType,
|
|
|
|
REFERENCE_TIME rtTime, void *param, void *state_data, DWORD flags)
|
2012-04-12 08:28:44 +02:00
|
|
|
{
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2012-04-12 08:28:44 +02:00
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
FIXME("(%p, %s, 0x%s, %p, %p, %lx): stub\n", This, debugstr_dmguid(rguidType),
|
2012-04-12 08:28:44 +02:00
|
|
|
wine_dbgstr_longlong(rtTime), param, state_data, flags);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_Compose(IDirectMusicTrack8 *iface, IUnknown *context,
|
2015-06-25 00:31:17 +02:00
|
|
|
DWORD trackgroup, IDirectMusicTrack **track)
|
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
|
|
|
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE("(%p, %p, %ld, %p): method not implemented\n", This, context, trackgroup, track);
|
2015-06-25 00:31:17 +02:00
|
|
|
return E_NOTIMPL;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-10 17:23:39 +01:00
|
|
|
static HRESULT WINAPI band_track_Join(IDirectMusicTrack8 *iface, IDirectMusicTrack *pNewTrack,
|
|
|
|
MUSIC_TIME mtJoin, IUnknown *pContext, DWORD dwTrackGroup,
|
2015-06-26 00:16:24 +02:00
|
|
|
IDirectMusicTrack **ppResultTrack)
|
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IDirectMusicTrack8(iface);
|
2022-02-08 23:14:51 +01:00
|
|
|
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
|
2004-05-13 01:18:22 +02:00
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2015-06-26 00:16:24 +02:00
|
|
|
static const IDirectMusicTrack8Vtbl dmtrack8_vtbl = {
|
2019-11-10 17:23:39 +01:00
|
|
|
band_track_QueryInterface,
|
|
|
|
band_track_AddRef,
|
|
|
|
band_track_Release,
|
|
|
|
band_track_Init,
|
|
|
|
band_track_InitPlay,
|
|
|
|
band_track_EndPlay,
|
|
|
|
band_track_Play,
|
|
|
|
band_track_GetParam,
|
|
|
|
band_track_SetParam,
|
|
|
|
band_track_IsParamSupported,
|
|
|
|
band_track_AddNotificationType,
|
|
|
|
band_track_RemoveNotificationType,
|
|
|
|
band_track_Clone,
|
|
|
|
band_track_PlayEx,
|
|
|
|
band_track_GetParamEx,
|
|
|
|
band_track_SetParamEx,
|
|
|
|
band_track_Compose,
|
|
|
|
band_track_Join
|
2003-08-23 01:53:27 +02:00
|
|
|
};
|
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
/* IDirectMusicBandTrack IPersistStream part: */
|
2015-06-26 00:15:04 +02:00
|
|
|
static HRESULT load_band(IDirectMusicBandTrack *This, IStream *pClonedStream,
|
|
|
|
IDirectMusicBand **ppBand, DMUS_PRIVATE_BAND_ITEM_HEADER *pHeader)
|
|
|
|
{
|
2004-05-13 01:18:22 +02:00
|
|
|
HRESULT hr = E_FAIL;
|
|
|
|
IPersistStream* pPersistStream = NULL;
|
|
|
|
|
|
|
|
hr = CoCreateInstance (&CLSID_DirectMusicBand, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicBand, (LPVOID*) ppBand);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR(": could not create object\n");
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
/* acquire PersistStream interface */
|
|
|
|
hr = IDirectMusicBand_QueryInterface (*ppBand, &IID_IPersistStream, (LPVOID*) &pPersistStream);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR(": could not acquire IPersistStream\n");
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
/* load */
|
|
|
|
hr = IPersistStream_Load (pPersistStream, pClonedStream);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR(": failed to load object\n");
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* release all loading-related stuff */
|
|
|
|
IPersistStream_Release (pPersistStream);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @TODO insert pBand into This
|
|
|
|
*/
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
LPDMUS_PRIVATE_BAND pNewBand = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_BAND));
|
|
|
|
if (NULL == pNewBand) {
|
|
|
|
ERR(": no more memory\n");
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2008-02-23 09:40:25 +01:00
|
|
|
pNewBand->BandHeader = *pHeader;
|
2014-01-30 01:02:57 +01:00
|
|
|
pNewBand->band = *ppBand;
|
2005-06-22 14:01:39 +02:00
|
|
|
IDirectMusicBand_AddRef(*ppBand);
|
2004-05-13 01:18:22 +02:00
|
|
|
list_add_tail (&This->Bands, &pNewBand->entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-06-26 00:15:04 +02:00
|
|
|
static HRESULT parse_bands_list(IDirectMusicBandTrack *This, DMUS_PRIVATE_CHUNK *pChunk,
|
|
|
|
IStream *pStm)
|
|
|
|
{
|
2004-05-13 01:18:22 +02:00
|
|
|
HRESULT hr = E_FAIL;
|
|
|
|
DMUS_PRIVATE_CHUNK Chunk;
|
|
|
|
DWORD StreamSize, ListSize[3], ListCount[3];
|
|
|
|
LARGE_INTEGER liMove; /* used when skipping chunks */
|
|
|
|
|
|
|
|
IDirectMusicBand* pBand = NULL;
|
|
|
|
DMUS_PRIVATE_BAND_ITEM_HEADER header;
|
|
|
|
|
2008-02-23 09:40:25 +01:00
|
|
|
memset(&header, 0, sizeof header);
|
|
|
|
|
2004-05-13 01:18:22 +02:00
|
|
|
if (pChunk->fccID != DMUS_FOURCC_BANDS_LIST) {
|
|
|
|
ERR_(dmfile)(": %s chunk should be a BANDS list\n", debugstr_fourcc (pChunk->fccID));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ListSize[0] = pChunk->dwSize - sizeof(FOURCC);
|
|
|
|
ListCount[0] = 0;
|
|
|
|
|
|
|
|
do {
|
|
|
|
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
|
|
|
|
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
2004-05-13 01:18:22 +02:00
|
|
|
switch (Chunk.fccID) {
|
|
|
|
case FOURCC_LIST: {
|
|
|
|
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
|
|
|
|
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
|
|
|
|
ListSize[1] = Chunk.dwSize - sizeof(FOURCC);
|
|
|
|
ListCount[1] = 0;
|
|
|
|
do {
|
|
|
|
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
|
|
|
|
ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
2004-05-13 01:18:22 +02:00
|
|
|
switch (Chunk.fccID) {
|
|
|
|
case DMUS_FOURCC_BANDITEM_CHUNK: {
|
|
|
|
DMUS_IO_BAND_ITEM_HEADER tmp_header;
|
|
|
|
TRACE_(dmfile)(": Band Item chunk v1\n");
|
|
|
|
|
|
|
|
IStream_Read (pStm, &tmp_header, sizeof(DMUS_IO_BAND_ITEM_HEADER), NULL);
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(" - lBandTime: %lu\n", tmp_header.lBandTime);
|
2009-01-10 02:44:41 +01:00
|
|
|
|
2004-05-13 01:18:22 +02:00
|
|
|
header.dwVersion = 1;
|
|
|
|
header.lBandTime = tmp_header.lBandTime;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case DMUS_FOURCC_BANDITEM_CHUNK2: {
|
|
|
|
DMUS_IO_BAND_ITEM_HEADER2 tmp_header2;
|
|
|
|
TRACE_(dmfile)(": Band Item chunk v2\n");
|
|
|
|
|
|
|
|
IStream_Read (pStm, &tmp_header2, sizeof(DMUS_IO_BAND_ITEM_HEADER2), NULL);
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(" - lBandTimeLogical: %lu\n", tmp_header2.lBandTimeLogical);
|
|
|
|
TRACE_(dmfile)(" - lBandTimePhysical: %lu\n", tmp_header2.lBandTimePhysical);
|
2009-01-10 02:44:41 +01:00
|
|
|
|
2004-05-13 01:18:22 +02:00
|
|
|
header.dwVersion = 2;
|
|
|
|
header.lBandTimeLogical = tmp_header2.lBandTimeLogical;
|
|
|
|
header.lBandTimePhysical = tmp_header2.lBandTimePhysical;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FOURCC_RIFF: {
|
|
|
|
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
|
2004-05-13 07:19:47 +02:00
|
|
|
TRACE_(dmfile)(": RIFF chunk of type %s\n", debugstr_fourcc(Chunk.fccID));
|
2004-05-13 01:18:22 +02:00
|
|
|
StreamSize = Chunk.dwSize - sizeof(FOURCC);
|
|
|
|
switch (Chunk.fccID) {
|
|
|
|
case DMUS_FOURCC_BAND_FORM: {
|
2020-09-17 14:18:08 +02:00
|
|
|
ULARGE_INTEGER liOrigPos;
|
2004-05-13 01:18:22 +02:00
|
|
|
TRACE_(dmfile)(": BAND RIFF\n");
|
2020-09-17 14:18:08 +02:00
|
|
|
|
2004-05-13 01:18:22 +02:00
|
|
|
liMove.QuadPart = 0;
|
2020-09-17 14:18:08 +02:00
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, &liOrigPos);
|
|
|
|
|
2004-05-13 01:18:22 +02:00
|
|
|
liMove.QuadPart -= sizeof(FOURCC) + (sizeof(FOURCC)+sizeof(DWORD));
|
2020-09-17 14:18:08 +02:00
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
2015-06-26 00:15:04 +02:00
|
|
|
|
2020-09-17 14:18:08 +02:00
|
|
|
hr = load_band(This, pStm, &pBand, &header);
|
2004-05-13 01:18:22 +02:00
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR(": could not load track\n");
|
|
|
|
return hr;
|
|
|
|
}
|
2020-09-17 14:18:08 +02:00
|
|
|
liMove.QuadPart = (LONGLONG)liOrigPos.QuadPart;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_SET, NULL);
|
2004-05-13 01:18:22 +02:00
|
|
|
|
|
|
|
IDirectMusicTrack_Release(pBand); pBand = NULL; /* now we can release at as it inserted */
|
|
|
|
|
|
|
|
/** now safe move the cursor */
|
|
|
|
liMove.QuadPart = StreamSize;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
2004-05-14 06:57:02 +02:00
|
|
|
break;
|
2004-05-13 01:18:22 +02:00
|
|
|
}
|
|
|
|
default: {
|
2011-07-30 12:03:08 +02:00
|
|
|
TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
|
2004-05-13 01:18:22 +02:00
|
|
|
liMove.QuadPart = StreamSize;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
2011-07-30 12:03:08 +02:00
|
|
|
TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
|
2004-05-13 01:18:22 +02:00
|
|
|
liMove.QuadPart = Chunk.dwSize;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": ListCount[1] = %ld < ListSize[1] = %ld\n", ListCount[1], ListSize[1]);
|
2004-05-13 01:18:22 +02:00
|
|
|
} while (ListCount[1] < ListSize[1]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
2011-07-30 12:03:08 +02:00
|
|
|
TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
|
2004-05-13 01:18:22 +02:00
|
|
|
liMove.QuadPart = Chunk.dwSize;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
|
2004-05-13 01:18:22 +02:00
|
|
|
} while (ListCount[0] < ListSize[0]);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-06-26 00:15:04 +02:00
|
|
|
static HRESULT parse_bandtrack_form(IDirectMusicBandTrack *This, DMUS_PRIVATE_CHUNK *pChunk,
|
|
|
|
IStream *pStm)
|
|
|
|
{
|
2004-05-13 01:18:22 +02:00
|
|
|
HRESULT hr = E_FAIL;
|
|
|
|
DMUS_PRIVATE_CHUNK Chunk;
|
|
|
|
DWORD StreamSize, StreamCount, ListSize[3], ListCount[3];
|
|
|
|
LARGE_INTEGER liMove; /* used when skipping chunks */
|
|
|
|
|
|
|
|
if (pChunk->fccID != DMUS_FOURCC_BANDTRACK_FORM) {
|
|
|
|
ERR_(dmfile)(": %s chunk should be a BANDTRACK form\n", debugstr_fourcc (pChunk->fccID));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
StreamSize = pChunk->dwSize - sizeof(FOURCC);
|
|
|
|
StreamCount = 0;
|
|
|
|
|
|
|
|
do {
|
|
|
|
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
|
|
|
|
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
2004-05-13 07:19:47 +02:00
|
|
|
|
2015-06-26 00:24:39 +02:00
|
|
|
hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &This->dmobj.desc);
|
2004-05-13 07:19:47 +02:00
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
|
2004-05-14 06:57:02 +02:00
|
|
|
if (hr == S_FALSE) {
|
2004-05-13 01:18:22 +02:00
|
|
|
switch (Chunk.fccID) {
|
2004-05-14 06:57:02 +02:00
|
|
|
case DMUS_FOURCC_BANDTRACK_CHUNK: {
|
|
|
|
TRACE_(dmfile)(": BandTrack chunk\n");
|
|
|
|
IStream_Read (pStm, &This->header, sizeof(DMUS_IO_BAND_TRACK_HEADER), NULL);
|
|
|
|
TRACE_(dmfile)(" - bAutoDownload: %u\n", This->header.bAutoDownload);
|
2004-05-13 07:19:47 +02:00
|
|
|
break;
|
2004-05-14 06:57:02 +02:00
|
|
|
}
|
|
|
|
case FOURCC_LIST: {
|
|
|
|
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
|
|
|
|
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
|
|
|
|
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
|
|
|
|
ListCount[0] = 0;
|
|
|
|
switch (Chunk.fccID) {
|
|
|
|
case DMUS_FOURCC_UNFO_LIST: {
|
|
|
|
TRACE_(dmfile)(": UNFO list\n");
|
|
|
|
do {
|
|
|
|
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
|
|
|
|
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
2015-06-26 00:24:39 +02:00
|
|
|
|
|
|
|
hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, &This->dmobj.desc);
|
2004-05-14 06:57:02 +02:00
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
|
|
|
|
if (hr == S_FALSE) {
|
|
|
|
switch (Chunk.fccID) {
|
|
|
|
default: {
|
2011-07-30 12:03:08 +02:00
|
|
|
TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
|
2004-05-14 06:57:02 +02:00
|
|
|
liMove.QuadPart = Chunk.dwSize;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
|
2004-05-14 06:57:02 +02:00
|
|
|
} while (ListCount[0] < ListSize[0]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case DMUS_FOURCC_BANDS_LIST: {
|
|
|
|
TRACE_(dmfile)(": TRACK list\n");
|
2015-06-26 00:15:04 +02:00
|
|
|
hr = parse_bands_list(This, &Chunk, pStm);
|
2004-05-14 06:57:02 +02:00
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
TRACE_(dmfile)(": unknown (skipping)\n");
|
|
|
|
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2004-05-13 01:18:22 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
2011-07-30 12:03:08 +02:00
|
|
|
TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
|
2004-05-14 06:57:02 +02:00
|
|
|
liMove.QuadPart = Chunk.dwSize;
|
2004-05-13 01:18:22 +02:00
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
|
2004-05-13 01:18:22 +02:00
|
|
|
} while (StreamCount < StreamSize);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-06-26 00:24:39 +02:00
|
|
|
static inline IDirectMusicBandTrack *impl_from_IPersistStream(IPersistStream *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, IDirectMusicBandTrack, dmobj.IPersistStream_iface);
|
|
|
|
}
|
2004-05-13 01:18:22 +02:00
|
|
|
|
2015-06-26 00:24:39 +02:00
|
|
|
static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pStm)
|
|
|
|
{
|
|
|
|
IDirectMusicBandTrack *This = impl_from_IPersistStream(iface);
|
2004-05-13 01:18:22 +02:00
|
|
|
DMUS_PRIVATE_CHUNK Chunk;
|
|
|
|
LARGE_INTEGER liMove;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2004-05-13 07:19:47 +02:00
|
|
|
TRACE("(%p, %p): Loading\n", This, pStm);
|
2004-05-13 01:18:22 +02:00
|
|
|
|
|
|
|
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
2004-05-13 01:18:22 +02:00
|
|
|
switch (Chunk.fccID) {
|
|
|
|
case FOURCC_RIFF: {
|
|
|
|
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
|
2022-02-08 23:14:51 +01:00
|
|
|
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
2004-05-13 01:18:22 +02:00
|
|
|
switch (Chunk.fccID) {
|
|
|
|
case DMUS_FOURCC_BANDTRACK_FORM: {
|
|
|
|
TRACE_(dmfile)(": Band track form\n");
|
2015-06-26 00:15:04 +02:00
|
|
|
hr = parse_bandtrack_form(This, &Chunk, pStm);
|
2004-05-13 01:18:22 +02:00
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
|
|
|
|
liMove.QuadPart = Chunk.dwSize;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TRACE_(dmfile)(": reading finished\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
|
|
|
|
liMove.QuadPart = Chunk.dwSize;
|
|
|
|
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2015-06-26 00:24:39 +02:00
|
|
|
static const IPersistStreamVtbl persiststream_vtbl = {
|
|
|
|
dmobj_IPersistStream_QueryInterface,
|
|
|
|
dmobj_IPersistStream_AddRef,
|
|
|
|
dmobj_IPersistStream_Release,
|
|
|
|
dmobj_IPersistStream_GetClassID,
|
|
|
|
unimpl_IPersistStream_IsDirty,
|
|
|
|
IPersistStreamImpl_Load,
|
|
|
|
unimpl_IPersistStream_Save,
|
|
|
|
unimpl_IPersistStream_GetSizeMax
|
2003-08-23 01:53:27 +02:00
|
|
|
};
|
2004-01-20 01:21:40 +01:00
|
|
|
|
|
|
|
/* for ClassFactory */
|
2014-01-30 00:46:19 +01:00
|
|
|
HRESULT WINAPI create_dmbandtrack(REFIID lpcGUID, void **ppobj)
|
|
|
|
{
|
2015-06-26 13:23:39 +02:00
|
|
|
IDirectMusicBandTrack *track;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
track = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*track));
|
|
|
|
if (!track) {
|
|
|
|
*ppobj = NULL;
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2015-06-26 00:16:24 +02:00
|
|
|
track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl;
|
2015-06-26 13:23:39 +02:00
|
|
|
track->ref = 1;
|
2015-06-26 00:24:39 +02:00
|
|
|
dmobject_init(&track->dmobj, &CLSID_DirectMusicBandTrack,
|
|
|
|
(IUnknown *)&track->IDirectMusicTrack8_iface);
|
|
|
|
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
|
2015-06-26 13:23:39 +02:00
|
|
|
list_init (&track->Bands);
|
2008-02-19 23:03:43 +01:00
|
|
|
|
2015-06-26 13:23:39 +02:00
|
|
|
DMBAND_LockModule();
|
|
|
|
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
|
|
|
|
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
|
|
|
|
|
|
|
|
return hr;
|
2004-01-20 01:21:40 +01:00
|
|
|
}
|