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

dmstyle: Get rid of the IDirectMusicStyle8Impl typedef.

parent 717c278b
/* IDirectMusicStyle8 Implementation /*
*
* Copyright (C) 2003-2004 Rok Mandeljc * Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2003-2004 Raphael Junqueira * Copyright (C) 2003-2004 Raphael Junqueira
* *
...@@ -46,27 +45,25 @@ struct style_motif { ...@@ -46,27 +45,25 @@ struct style_motif {
struct list Items; struct list Items;
}; };
/***************************************************************************** struct style
* IDirectMusicStyleImpl implementation {
*/
typedef struct IDirectMusicStyle8Impl {
IDirectMusicStyle8 IDirectMusicStyle8_iface; IDirectMusicStyle8 IDirectMusicStyle8_iface;
struct dmobject dmobj; struct dmobject dmobj;
LONG ref; LONG ref;
DMUS_IO_STYLE style; DMUS_IO_STYLE style;
struct list motifs; struct list motifs;
struct list bands; struct list bands;
} IDirectMusicStyle8Impl; };
static inline IDirectMusicStyle8Impl *impl_from_IDirectMusicStyle8(IDirectMusicStyle8 *iface) static inline struct style *impl_from_IDirectMusicStyle8(IDirectMusicStyle8 *iface)
{ {
return CONTAINING_RECORD(iface, IDirectMusicStyle8Impl, IDirectMusicStyle8_iface); return CONTAINING_RECORD(iface, struct style, IDirectMusicStyle8_iface);
} }
static HRESULT WINAPI style_QueryInterface(IDirectMusicStyle8 *iface, REFIID riid, static HRESULT WINAPI style_QueryInterface(IDirectMusicStyle8 *iface, REFIID riid,
void **ret_iface) void **ret_iface)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ret_iface); TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ret_iface);
...@@ -90,7 +87,7 @@ static HRESULT WINAPI style_QueryInterface(IDirectMusicStyle8 *iface, REFIID rii ...@@ -90,7 +87,7 @@ static HRESULT WINAPI style_QueryInterface(IDirectMusicStyle8 *iface, REFIID rii
static ULONG WINAPI style_AddRef(IDirectMusicStyle8 *iface) static ULONG WINAPI style_AddRef(IDirectMusicStyle8 *iface)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
LONG ref = InterlockedIncrement(&This->ref); LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%ld\n", This, ref); TRACE("(%p) ref=%ld\n", This, ref);
...@@ -100,7 +97,7 @@ static ULONG WINAPI style_AddRef(IDirectMusicStyle8 *iface) ...@@ -100,7 +97,7 @@ static ULONG WINAPI style_AddRef(IDirectMusicStyle8 *iface)
static ULONG WINAPI style_Release(IDirectMusicStyle8 *iface) static ULONG WINAPI style_Release(IDirectMusicStyle8 *iface)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
LONG ref = InterlockedDecrement(&This->ref); LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%ld\n", This, ref); TRACE("(%p) ref=%ld\n", This, ref);
...@@ -133,7 +130,7 @@ static ULONG WINAPI style_Release(IDirectMusicStyle8 *iface) ...@@ -133,7 +130,7 @@ static ULONG WINAPI style_Release(IDirectMusicStyle8 *iface)
static HRESULT WINAPI style_GetBand(IDirectMusicStyle8 *iface, WCHAR *name, static HRESULT WINAPI style_GetBand(IDirectMusicStyle8 *iface, WCHAR *name,
IDirectMusicBand **band) IDirectMusicBand **band)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
struct style_band *sband; struct style_band *sband;
HRESULT hr; HRESULT hr;
...@@ -168,15 +165,15 @@ static HRESULT WINAPI style_GetBand(IDirectMusicStyle8 *iface, WCHAR *name, ...@@ -168,15 +165,15 @@ static HRESULT WINAPI style_GetBand(IDirectMusicStyle8 *iface, WCHAR *name,
static HRESULT WINAPI style_EnumBand(IDirectMusicStyle8 *iface, DWORD dwIndex, static HRESULT WINAPI style_EnumBand(IDirectMusicStyle8 *iface, DWORD dwIndex,
WCHAR *pwszName) WCHAR *pwszName)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName); FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK; return S_OK;
} }
static HRESULT WINAPI style_GetDefaultBand(IDirectMusicStyle8 *iface, static HRESULT WINAPI style_GetDefaultBand(IDirectMusicStyle8 *iface,
IDirectMusicBand **band) IDirectMusicBand **band)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %p): stub\n", This, band); FIXME("(%p, %p): stub\n", This, band);
if (!band) if (!band)
...@@ -190,7 +187,7 @@ static HRESULT WINAPI style_GetDefaultBand(IDirectMusicStyle8 *iface, ...@@ -190,7 +187,7 @@ static HRESULT WINAPI style_GetDefaultBand(IDirectMusicStyle8 *iface,
static HRESULT WINAPI style_EnumMotif(IDirectMusicStyle8 *iface, DWORD index, static HRESULT WINAPI style_EnumMotif(IDirectMusicStyle8 *iface, DWORD index,
WCHAR *name) WCHAR *name)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
const struct style_motif *motif = NULL; const struct style_motif *motif = NULL;
const struct list *cursor; const struct list *cursor;
unsigned int i = 0; unsigned int i = 0;
...@@ -223,64 +220,64 @@ static HRESULT WINAPI style_EnumMotif(IDirectMusicStyle8 *iface, DWORD index, ...@@ -223,64 +220,64 @@ static HRESULT WINAPI style_EnumMotif(IDirectMusicStyle8 *iface, DWORD index,
static HRESULT WINAPI style_GetMotif(IDirectMusicStyle8 *iface, WCHAR *pwszName, static HRESULT WINAPI style_GetMotif(IDirectMusicStyle8 *iface, WCHAR *pwszName,
IDirectMusicSegment **ppSegment) IDirectMusicSegment **ppSegment)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszName), ppSegment); FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszName), ppSegment);
return S_FALSE; return S_FALSE;
} }
static HRESULT WINAPI style_GetDefaultChordMap(IDirectMusicStyle8 *iface, static HRESULT WINAPI style_GetDefaultChordMap(IDirectMusicStyle8 *iface,
IDirectMusicChordMap **ppChordMap) IDirectMusicChordMap **ppChordMap)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %p): stub\n", This, ppChordMap); FIXME("(%p, %p): stub\n", This, ppChordMap);
return S_OK; return S_OK;
} }
static HRESULT WINAPI style_EnumChordMap(IDirectMusicStyle8 *iface, DWORD dwIndex, static HRESULT WINAPI style_EnumChordMap(IDirectMusicStyle8 *iface, DWORD dwIndex,
WCHAR *pwszName) WCHAR *pwszName)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName); FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK; return S_OK;
} }
static HRESULT WINAPI style_GetChordMap(IDirectMusicStyle8 *iface, WCHAR *pwszName, static HRESULT WINAPI style_GetChordMap(IDirectMusicStyle8 *iface, WCHAR *pwszName,
IDirectMusicChordMap **ppChordMap) IDirectMusicChordMap **ppChordMap)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %p, %p): stub\n", This, pwszName, ppChordMap); FIXME("(%p, %p, %p): stub\n", This, pwszName, ppChordMap);
return S_OK; return S_OK;
} }
static HRESULT WINAPI style_GetTimeSignature(IDirectMusicStyle8 *iface, static HRESULT WINAPI style_GetTimeSignature(IDirectMusicStyle8 *iface,
DMUS_TIMESIGNATURE *pTimeSig) DMUS_TIMESIGNATURE *pTimeSig)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %p): stub\n", This, pTimeSig); FIXME("(%p, %p): stub\n", This, pTimeSig);
return S_OK; return S_OK;
} }
static HRESULT WINAPI style_GetEmbellishmentLength(IDirectMusicStyle8 *iface, static HRESULT WINAPI style_GetEmbellishmentLength(IDirectMusicStyle8 *iface,
DWORD dwType, DWORD dwLevel, DWORD *pdwMin, DWORD *pdwMax) DWORD dwType, DWORD dwLevel, DWORD *pdwMin, DWORD *pdwMax)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %ld, %ld, %p, %p): stub\n", This, dwType, dwLevel, pdwMin, pdwMax); FIXME("(%p, %ld, %ld, %p, %p): stub\n", This, dwType, dwLevel, pdwMin, pdwMax);
return S_OK; return S_OK;
} }
static HRESULT WINAPI style_GetTempo(IDirectMusicStyle8 *iface, double *pTempo) static HRESULT WINAPI style_GetTempo(IDirectMusicStyle8 *iface, double *pTempo)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %p): stub\n", This, pTempo); FIXME("(%p, %p): stub\n", This, pTempo);
return S_OK; return S_OK;
} }
static HRESULT WINAPI style_EnumPattern(IDirectMusicStyle8 *iface, DWORD dwIndex, static HRESULT WINAPI style_EnumPattern(IDirectMusicStyle8 *iface, DWORD dwIndex,
DWORD dwPatternType, WCHAR *pwszName) DWORD dwPatternType, WCHAR *pwszName)
{ {
IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); struct style *This = impl_from_IDirectMusicStyle8(iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, dwIndex, dwPatternType, pwszName); FIXME("(%p, %ld, %ld, %p): stub\n", This, dwIndex, dwPatternType, pwszName);
return S_OK; return S_OK;
} }
static const IDirectMusicStyle8Vtbl dmstyle8_vtbl = { static const IDirectMusicStyle8Vtbl dmstyle8_vtbl = {
...@@ -341,9 +338,9 @@ static const IDirectMusicObjectVtbl dmobject_vtbl = { ...@@ -341,9 +338,9 @@ static const IDirectMusicObjectVtbl dmobject_vtbl = {
style_IDirectMusicObject_ParseDescriptor style_IDirectMusicObject_ParseDescriptor
}; };
static inline IDirectMusicStyle8Impl *impl_from_IPersistStream(IPersistStream *iface) static inline struct style *impl_from_IPersistStream(IPersistStream *iface)
{ {
return CONTAINING_RECORD(iface, IDirectMusicStyle8Impl, dmobj.IPersistStream_iface); return CONTAINING_RECORD(iface, struct style, dmobj.IPersistStream_iface);
} }
static HRESULT load_band(IStream *pClonedStream, IDirectMusicBand **ppBand) static HRESULT load_band(IStream *pClonedStream, IDirectMusicBand **ppBand)
...@@ -595,8 +592,7 @@ static HRESULT parse_part_list(DMUS_PRIVATE_CHUNK *pChunk, IStream *pStm) ...@@ -595,8 +592,7 @@ static HRESULT parse_part_list(DMUS_PRIVATE_CHUNK *pChunk, IStream *pStm)
return S_OK; return S_OK;
} }
static HRESULT parse_pattern_list(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK *pChunk, static HRESULT parse_pattern_list(struct style *This, DMUS_PRIVATE_CHUNK *pChunk, IStream *pStm)
IStream *pStm)
{ {
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
DMUS_PRIVATE_CHUNK Chunk; DMUS_PRIVATE_CHUNK Chunk;
...@@ -752,8 +748,7 @@ static HRESULT parse_pattern_list(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHU ...@@ -752,8 +748,7 @@ static HRESULT parse_pattern_list(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHU
return S_OK; return S_OK;
} }
static HRESULT parse_style_form(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK *pChunk, static HRESULT parse_style_form(struct style *This, DMUS_PRIVATE_CHUNK *pChunk, IStream *pStm)
IStream *pStm)
{ {
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
DMUS_PRIVATE_CHUNK Chunk; DMUS_PRIVATE_CHUNK Chunk;
...@@ -902,7 +897,7 @@ static HRESULT parse_style_form(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK ...@@ -902,7 +897,7 @@ static HRESULT parse_style_form(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK
static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pStm) static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pStm)
{ {
IDirectMusicStyle8Impl *This = impl_from_IPersistStream(iface); struct style *This = impl_from_IPersistStream(iface);
DMUS_PRIVATE_CHUNK Chunk; DMUS_PRIVATE_CHUNK Chunk;
LARGE_INTEGER liMove; /* used when skipping chunks */ LARGE_INTEGER liMove; /* used when skipping chunks */
HRESULT hr; HRESULT hr;
...@@ -956,21 +951,21 @@ static const IPersistStreamVtbl persiststream_vtbl = { ...@@ -956,21 +951,21 @@ static const IPersistStreamVtbl persiststream_vtbl = {
HRESULT create_dmstyle(REFIID lpcGUID, void **ppobj) HRESULT create_dmstyle(REFIID lpcGUID, void **ppobj)
{ {
IDirectMusicStyle8Impl* obj; struct style *obj;
HRESULT hr; HRESULT hr;
*ppobj = NULL; *ppobj = NULL;
if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY; if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
obj->IDirectMusicStyle8_iface.lpVtbl = &dmstyle8_vtbl; obj->IDirectMusicStyle8_iface.lpVtbl = &dmstyle8_vtbl;
obj->ref = 1; obj->ref = 1;
dmobject_init(&obj->dmobj, &CLSID_DirectMusicStyle, (IUnknown *)&obj->IDirectMusicStyle8_iface); dmobject_init(&obj->dmobj, &CLSID_DirectMusicStyle, (IUnknown *)&obj->IDirectMusicStyle8_iface);
obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl; obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl;
obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
list_init(&obj->bands); list_init(&obj->bands);
list_init(&obj->motifs); list_init(&obj->motifs);
hr = IDirectMusicStyle8_QueryInterface(&obj->IDirectMusicStyle8_iface, lpcGUID, ppobj); hr = IDirectMusicStyle8_QueryInterface(&obj->IDirectMusicStyle8_iface, lpcGUID, ppobj);
IDirectMusicStyle8_Release(&obj->IDirectMusicStyle8_iface); IDirectMusicStyle8_Release(&obj->IDirectMusicStyle8_iface);
return hr; return hr;
} }
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