Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2e25af4f
Commit
2e25af4f
authored
Sep 04, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Add a IDirectMusicGraph interface to the performance.
parent
e5ae7f90
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
15 deletions
+83
-15
performance.c
dlls/dmime/performance.c
+74
-0
dmime.c
dlls/dmime/tests/dmime.c
+8
-14
performance.c
dlls/dmime/tests/performance.c
+1
-1
No files found.
dlls/dmime/performance.c
View file @
2e25af4f
...
...
@@ -37,6 +37,7 @@ struct pchannel_block {
struct
performance
{
IDirectMusicPerformance8
IDirectMusicPerformance8_iface
;
IDirectMusicGraph
IDirectMusicGraph_iface
;
LONG
ref
;
IDirectMusic8
*
dmusic
;
IDirectSound
*
dsound
;
...
...
@@ -254,6 +255,8 @@ static inline struct performance *impl_from_IDirectMusicPerformance8(IDirectMusi
/* IDirectMusicPerformance8 IUnknown part: */
static
HRESULT
WINAPI
performance_QueryInterface
(
IDirectMusicPerformance8
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
TRACE
(
"(%p, %s, %p)
\n
"
,
iface
,
debugstr_dmguid
(
riid
),
ret_iface
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
...
...
@@ -266,6 +269,13 @@ static HRESULT WINAPI performance_QueryInterface(IDirectMusicPerformance8 *iface
return
S_OK
;
}
if
(
IsEqualGUID
(
riid
,
&
IID_IDirectMusicGraph
))
{
*
ret_iface
=
&
This
->
IDirectMusicGraph_iface
;
IDirectMusicGraph_AddRef
(
&
This
->
IDirectMusicGraph_iface
);
return
S_OK
;
}
*
ret_iface
=
NULL
;
WARN
(
"(%p, %s, %p): not found
\n
"
,
iface
,
debugstr_dmguid
(
riid
),
ret_iface
);
return
E_NOINTERFACE
;
...
...
@@ -1249,6 +1259,69 @@ static const IDirectMusicPerformance8Vtbl performance_vtbl =
performance_GetParamEx
,
};
static
inline
struct
performance
*
impl_from_IDirectMusicGraph
(
IDirectMusicGraph
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
performance
,
IDirectMusicGraph_iface
);
}
static
HRESULT
WINAPI
performance_graph_QueryInterface
(
IDirectMusicGraph
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
struct
performance
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
return
IDirectMusicPerformance8_QueryInterface
(
&
This
->
IDirectMusicPerformance8_iface
,
riid
,
ret_iface
);
}
static
ULONG
WINAPI
performance_graph_AddRef
(
IDirectMusicGraph
*
iface
)
{
struct
performance
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
return
IDirectMusicPerformance8_AddRef
(
&
This
->
IDirectMusicPerformance8_iface
);
}
static
ULONG
WINAPI
performance_graph_Release
(
IDirectMusicGraph
*
iface
)
{
struct
performance
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
return
IDirectMusicPerformance8_Release
(
&
This
->
IDirectMusicPerformance8_iface
);
}
static
HRESULT
WINAPI
performance_graph_StampPMsg
(
IDirectMusicGraph
*
iface
,
DMUS_PMSG
*
msg
)
{
struct
performance
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
FIXME
(
"(%p, %p): stub
\n
"
,
This
,
msg
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
performance_graph_InsertTool
(
IDirectMusicGraph
*
iface
,
IDirectMusicTool
*
tool
,
DWORD
*
channels
,
DWORD
channels_count
,
LONG
index
)
{
struct
performance
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
FIXME
(
"(%p, %p, %p, %lu, %ld): stub
\n
"
,
This
,
tool
,
channels
,
channels_count
,
index
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
performance_graph_GetTool
(
IDirectMusicGraph
*
iface
,
DWORD
index
,
IDirectMusicTool
**
tool
)
{
struct
performance
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
FIXME
(
"(%p, %lu, %p): stub
\n
"
,
This
,
index
,
tool
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
performance_graph_RemoveTool
(
IDirectMusicGraph
*
iface
,
IDirectMusicTool
*
tool
)
{
struct
performance
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
FIXME
(
"(%p, %p): stub
\n
"
,
This
,
tool
);
return
E_NOTIMPL
;
}
static
const
IDirectMusicGraphVtbl
performance_graph_vtbl
=
{
performance_graph_QueryInterface
,
performance_graph_AddRef
,
performance_graph_Release
,
performance_graph_StampPMsg
,
performance_graph_InsertTool
,
performance_graph_GetTool
,
performance_graph_RemoveTool
,
};
/* for ClassFactory */
HRESULT
create_dmperformance
(
REFIID
iid
,
void
**
ret_iface
)
{
...
...
@@ -1260,6 +1333,7 @@ HRESULT create_dmperformance(REFIID iid, void **ret_iface)
*
ret_iface
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicPerformance8_iface
.
lpVtbl
=
&
performance_vtbl
;
obj
->
IDirectMusicGraph_iface
.
lpVtbl
=
&
performance_graph_vtbl
;
obj
->
ref
=
1
;
obj
->
pDefaultPath
=
NULL
;
...
...
dlls/dmime/tests/dmime.c
View file @
2e25af4f
...
...
@@ -1536,8 +1536,7 @@ static void test_performance_graph(void)
/* performance exposes a graph interface but it's not an actual toolgraph */
hr
=
IDirectMusicPerformance_QueryInterface
(
performance
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
skip_graph
;
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicGraph_InsertTool
(
graph
,
(
IDirectMusicTool
*
)
tool
,
NULL
,
0
,
-
1
);
ok
(
hr
==
E_NOTIMPL
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicGraph_GetTool
(
graph
,
0
,
&
tmp_tool
);
...
...
@@ -1578,7 +1577,6 @@ static void test_performance_graph(void)
IDirectMusicGraph_Release
(
graph
);
skip_graph:
/* performance doesn't have a default embedded toolgraph */
hr
=
IDirectMusicPerformance_GetGraph
(
performance
,
&
graph
);
ok
(
hr
==
DMUS_E_NOT_FOUND
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -1604,8 +1602,7 @@ skip_graph:
/* test IDirectMusicGraph_StampPMsg usage */
hr
=
IDirectMusicPerformance_QueryInterface
(
performance
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
skip_graph2
;
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
memset
(
&
msg
,
0
,
sizeof
(
msg
));
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
&
msg
);
...
...
@@ -1636,7 +1633,6 @@ skip_graph:
IDirectMusicGraph_Release
(
graph
);
skip_graph2:
IDirectMusicPerformance_Release
(
performance
);
IDirectMusicTool_Release
(
tool
);
}
...
...
@@ -1874,12 +1870,11 @@ static void test_performance_pmsg(void)
msg
->
dwFlags
=
DMUS_PMSGF_REFTIME
;
msg
->
dwType
=
DMUS_PMSGT_USER
;
graph
=
NULL
;
hr
=
IDirectMusicPerformance_QueryInterface
(
performance
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
msg
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
graph
)
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
msg
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
graph
)
IDirectMusicGraph_Release
(
graph
);
IDirectMusicGraph_Release
(
graph
);
hr
=
IDirectMusicPerformance_SendPMsg
(
performance
,
msg
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -1906,11 +1901,10 @@ static void test_performance_pmsg(void)
msg
->
dwType
=
DMUS_PMSGT_USER
;
hr
=
IDirectMusicPerformance_QueryInterface
(
performance
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
!
graph
)
hr
=
S_OK
;
else
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
msg
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
graph
)
IDirectMusicGraph_Release
(
graph
);
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
msg
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
IDirectMusicGraph_Release
(
graph
);
msg
->
dwFlags
&=
~
(
DMUS_PMSGF_TOOL_IMMEDIATE
|
DMUS_PMSGF_TOOL_QUEUE
|
DMUS_PMSGF_TOOL_ATTIME
);
msg
->
dwFlags
|=
delivery_flags
[
i
];
...
...
dlls/dmime/tests/performance.c
View file @
2e25af4f
...
...
@@ -627,7 +627,7 @@ static void test_performance_graph(void)
ok
(
graph2
==
NULL
,
"unexpected pointer.
\n
"
);
hr
=
IDirectMusicPerformance8_QueryInterface
(
perf
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed: %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed: %#lx
\n
"
,
hr
);
if
(
graph
)
IDirectMusicGraph_Release
(
graph
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment