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

dmime: Set the tool delivery type on the messages flags.

parent 09dc4a3f
......@@ -26,6 +26,7 @@ struct tool_entry
{
struct list entry;
IDirectMusicTool *tool;
DWORD delivery;
};
struct graph
......@@ -111,6 +112,7 @@ static ULONG WINAPI graph_Release(IDirectMusicGraph *iface)
static HRESULT WINAPI graph_StampPMsg(IDirectMusicGraph *iface, DMUS_PMSG *msg)
{
const DWORD delivery_flags = DMUS_PMSGF_TOOL_IMMEDIATE | DMUS_PMSGF_TOOL_QUEUE | DMUS_PMSGF_TOOL_ATTIME;
struct graph *This = impl_from_IDirectMusicGraph(iface);
struct tool_entry *entry, *next, *first;
......@@ -140,6 +142,9 @@ static HRESULT WINAPI graph_StampPMsg(IDirectMusicGraph *iface, DMUS_PMSG *msg)
msg->pTool = next->tool;
IDirectMusicTool_AddRef(msg->pTool);
msg->dwFlags &= ~delivery_flags;
msg->dwFlags |= next->delivery;
return S_OK;
}
......@@ -148,6 +153,7 @@ static HRESULT WINAPI graph_InsertTool(IDirectMusicGraph *iface, IDirectMusicToo
{
struct graph *This = impl_from_IDirectMusicGraph(iface);
struct tool_entry *entry, *next;
HRESULT hr;
TRACE("(%p, %p, %p, %ld, %li)\n", This, tool, channels, channel_count, index);
......@@ -163,6 +169,11 @@ static HRESULT WINAPI graph_InsertTool(IDirectMusicGraph *iface, IDirectMusicToo
entry->tool = tool;
IDirectMusicTool_AddRef(tool);
IDirectMusicTool_Init(tool, iface);
if (FAILED(hr = IDirectMusicTool_GetMsgDeliveryType(tool, &entry->delivery)))
{
WARN("Failed to get delivery type from tool %p, hr %#lx\n", tool, hr);
entry->delivery = DMUS_PMSGF_TOOL_IMMEDIATE;
}
list_add_before(&next->entry, &entry->entry);
return S_OK;
......
......@@ -1311,6 +1311,10 @@ static HRESULT WINAPI performance_graph_StampPMsg(IDirectMusicGraph *iface, DMUS
if (hr == DMUS_S_LAST_TOOL)
{
const DWORD delivery_flags = DMUS_PMSGF_TOOL_IMMEDIATE | DMUS_PMSGF_TOOL_QUEUE | DMUS_PMSGF_TOOL_ATTIME;
msg->dwFlags &= ~delivery_flags;
msg->dwFlags |= DMUS_PMSGF_TOOL_QUEUE;
if (msg->pTool) IDirectMusicTool_Release(msg->pTool);
msg->pTool = &This->IDirectMusicTool_iface;
IDirectMusicTool_AddRef(msg->pTool);
......
......@@ -756,7 +756,7 @@ static void test_graph(void)
ok(!msg.dwSize, "got %ld\n", msg.dwSize);
ok(!msg.rtTime, "got %I64d\n", msg.rtTime);
ok(!msg.mtTime, "got %ld\n", msg.mtTime);
todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags);
ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags);
ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel);
ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID);
ok(!msg.dwType, "got %#lx\n", msg.dwType);
......@@ -1555,7 +1555,7 @@ static void test_performance_graph(void)
ok(!msg.dwSize, "got %ld\n", msg.dwSize);
ok(!msg.rtTime, "got %I64d\n", msg.rtTime);
ok(!msg.mtTime, "got %ld\n", msg.mtTime);
todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_QUEUE, "got %#lx\n", msg.dwFlags);
ok(msg.dwFlags == DMUS_PMSGF_TOOL_QUEUE, "got %#lx\n", msg.dwFlags);
ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel);
ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID);
ok(!msg.dwType, "got %#lx\n", msg.dwType);
......@@ -1611,7 +1611,7 @@ static void test_performance_graph(void)
ok(!msg.dwSize, "got %ld\n", msg.dwSize);
ok(!msg.rtTime, "got %I64d\n", msg.rtTime);
ok(!msg.mtTime, "got %ld\n", msg.mtTime);
todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags);
ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags);
ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel);
ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID);
ok(!msg.dwType, "got %#lx\n", msg.dwType);
......
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