dmime: Get rid of the DMUS_PRIVATE_SEGMENT_ITEM typedef.

Also move the struct to its only user.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-09-24 22:03:58 +02:00 committed by Alexandre Julliard
parent 59aa29cd1d
commit ee2e44f790
2 changed files with 15 additions and 15 deletions

View File

@ -86,13 +86,6 @@ typedef struct _DMUS_PRIVATE_TEMPO_ITEM {
DMUS_IO_TEMPO_ITEM item; DMUS_IO_TEMPO_ITEM item;
} DMUS_PRIVATE_TEMPO_ITEM, *LPDMUS_PRIVATE_TEMPO_ITEM; } DMUS_PRIVATE_TEMPO_ITEM, *LPDMUS_PRIVATE_TEMPO_ITEM;
typedef struct _DMUS_PRIVATE_SEGMENT_ITEM {
struct list entry; /* for listing elements */
DMUS_IO_SEGMENT_ITEM_HEADER header;
IDirectMusicObject* pObject;
WCHAR wszName[DMUS_MAX_NAME];
} DMUS_PRIVATE_SEGMENT_ITEM, *LPDMUS_PRIVATE_SEGMENT_ITEM;
typedef struct _DMUS_PRIVATE_GRAPH_TOOL { typedef struct _DMUS_PRIVATE_GRAPH_TOOL {
struct list entry; /* for listing elements */ struct list entry; /* for listing elements */
DWORD dwIndex; DWORD dwIndex;

View File

@ -28,6 +28,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/***************************************************************************** /*****************************************************************************
* IDirectMusicSegTriggerTrack implementation * IDirectMusicSegTriggerTrack implementation
*/ */
struct segment_item {
struct list entry;
DMUS_IO_SEGMENT_ITEM_HEADER header;
IDirectMusicObject *dmobj;
WCHAR name[DMUS_MAX_NAME];
};
typedef struct IDirectMusicSegTriggerTrack { typedef struct IDirectMusicSegTriggerTrack {
IDirectMusicTrack8 IDirectMusicTrack8_iface; IDirectMusicTrack8 IDirectMusicTrack8_iface;
struct dmobject dmobj;/* IPersistStream only */ struct dmobject dmobj;/* IPersistStream only */
@ -83,14 +90,14 @@ static ULONG WINAPI segment_track_Release(IDirectMusicTrack8 *iface)
if (!ref) { if (!ref) {
struct list *cursor, *cursor2; struct list *cursor, *cursor2;
DMUS_PRIVATE_SEGMENT_ITEM *item; struct segment_item *item;
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->Items) { LIST_FOR_EACH_SAFE(cursor, cursor2, &This->Items) {
item = LIST_ENTRY(cursor, DMUS_PRIVATE_SEGMENT_ITEM, entry); item = LIST_ENTRY(cursor, struct segment_item, entry);
list_remove(cursor); list_remove(cursor);
if (item->pObject) if (item->dmobj)
IDirectMusicObject_Release(item->pObject); IDirectMusicObject_Release(item->dmobj);
heap_free(item); heap_free(item);
} }
@ -262,7 +269,7 @@ static HRESULT parse_segment_item(IDirectMusicSegTriggerTrack *This, IStream *st
const struct chunk_entry *lseg) const struct chunk_entry *lseg)
{ {
struct chunk_entry chunk = {.parent = lseg}; struct chunk_entry chunk = {.parent = lseg};
DMUS_PRIVATE_SEGMENT_ITEM *item; struct segment_item *item;
HRESULT hr; HRESULT hr;
/* First chunk is a header */ /* First chunk is a header */
@ -286,7 +293,7 @@ static HRESULT parse_segment_item(IDirectMusicSegTriggerTrack *This, IStream *st
hr = DMUS_E_INVALID_SEGMENTTRIGGERTRACK; hr = DMUS_E_INVALID_SEGMENTTRIGGERTRACK;
goto error; goto error;
} }
if (FAILED(hr = dmobj_parsereference(stream, &chunk, &item->pObject))) if (FAILED(hr = dmobj_parsereference(stream, &chunk, &item->dmobj)))
goto error; goto error;
/* Optional third chunk if the reference is a motif */ /* Optional third chunk if the reference is a motif */
@ -294,10 +301,10 @@ static HRESULT parse_segment_item(IDirectMusicSegTriggerTrack *This, IStream *st
if (FAILED(hr = stream_next_chunk(stream, &chunk))) if (FAILED(hr = stream_next_chunk(stream, &chunk)))
goto error; goto error;
if (chunk.id == DMUS_FOURCC_SEGMENTITEMNAME_CHUNK) if (chunk.id == DMUS_FOURCC_SEGMENTITEMNAME_CHUNK)
if (FAILED(hr = stream_chunk_get_wstr(stream, &chunk, item->wszName, DMUS_MAX_NAME))) if (FAILED(hr = stream_chunk_get_wstr(stream, &chunk, item->name, DMUS_MAX_NAME)))
goto error; goto error;
TRACE("Found motif name: %s\n", debugstr_w(item->wszName)); TRACE("Found motif name: %s\n", debugstr_w(item->name));
} }
list_add_tail(&This->Items, &item->entry); list_add_tail(&This->Items, &item->entry);