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
dfaa4506
Commit
dfaa4506
authored
Jan 29, 2024
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Add IDirectMusicGraph interface to segment state.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
425c270d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
5 deletions
+93
-5
segmentstate.c
dlls/dmime/segmentstate.c
+93
-4
dmime.c
dlls/dmime/tests/dmime.c
+0
-1
No files found.
dlls/dmime/segmentstate.c
View file @
dfaa4506
...
...
@@ -45,8 +45,10 @@ static void track_entry_destroy(struct track_entry *entry)
struct
segment_state
{
IDirectMusicSegmentState8
IDirectMusicSegmentState8_iface
;
IDirectMusicGraph
IDirectMusicGraph_iface
;
LONG
ref
;
IDirectMusicGraph
*
parent_graph
;
IDirectMusicSegment
*
segment
;
MUSIC_TIME
start_time
;
MUSIC_TIME
start_point
;
...
...
@@ -82,7 +84,12 @@ static HRESULT WINAPI segment_state_QueryInterface(IDirectMusicSegmentState8 *if
*
ppobj
=
&
This
->
IDirectMusicSegmentState8_iface
;
return
S_OK
;
}
if
(
IsEqualIID
(
riid
,
&
IID_IDirectMusicGraph
))
{
IDirectMusicSegmentState8_AddRef
(
iface
);
*
ppobj
=
&
This
->
IDirectMusicGraph_iface
;
return
S_OK
;
}
WARN
(
"(%p, %s, %p): not found
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
...
...
@@ -108,6 +115,7 @@ static ULONG WINAPI segment_state_Release(IDirectMusicSegmentState8 *iface)
{
segment_state_end_play
((
IDirectMusicSegmentState
*
)
iface
,
NULL
);
if
(
This
->
segment
)
IDirectMusicSegment_Release
(
This
->
segment
);
if
(
This
->
parent_graph
)
IDirectMusicGraph_Release
(
This
->
parent_graph
);
free
(
This
);
}
...
...
@@ -192,6 +200,73 @@ static const IDirectMusicSegmentState8Vtbl segment_state_vtbl =
segment_state_GetObjectInPath
,
};
static
inline
struct
segment_state
*
impl_from_IDirectMusicGraph
(
IDirectMusicGraph
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
segment_state
,
IDirectMusicGraph_iface
);
}
static
HRESULT
WINAPI
segment_state_graph_QueryInterface
(
IDirectMusicGraph
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
return
IDirectMusicSegmentState8_QueryInterface
(
&
This
->
IDirectMusicSegmentState8_iface
,
riid
,
ret_iface
);
}
static
ULONG
WINAPI
segment_state_graph_AddRef
(
IDirectMusicGraph
*
iface
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
return
IDirectMusicSegmentState8_AddRef
(
&
This
->
IDirectMusicSegmentState8_iface
);
}
static
ULONG
WINAPI
segment_state_graph_Release
(
IDirectMusicGraph
*
iface
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
return
IDirectMusicSegmentState8_Release
(
&
This
->
IDirectMusicSegmentState8_iface
);
}
static
HRESULT
WINAPI
segment_state_graph_StampPMsg
(
IDirectMusicGraph
*
iface
,
DMUS_PMSG
*
msg
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
msg
);
if
(
!
msg
)
return
E_POINTER
;
return
IDirectMusicGraph_StampPMsg
(
This
->
parent_graph
,
msg
);
}
static
HRESULT
WINAPI
segment_state_graph_InsertTool
(
IDirectMusicGraph
*
iface
,
IDirectMusicTool
*
tool
,
DWORD
*
channels
,
DWORD
channels_count
,
LONG
index
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
TRACE
(
"(%p, %p, %p, %lu, %ld)
\n
"
,
This
,
tool
,
channels
,
channels_count
,
index
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
segment_state_graph_GetTool
(
IDirectMusicGraph
*
iface
,
DWORD
index
,
IDirectMusicTool
**
tool
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
TRACE
(
"(%p, %lu, %p)
\n
"
,
This
,
index
,
tool
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
segment_state_graph_RemoveTool
(
IDirectMusicGraph
*
iface
,
IDirectMusicTool
*
tool
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicGraph
(
iface
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
tool
);
return
E_NOTIMPL
;
}
static
const
IDirectMusicGraphVtbl
segment_state_graph_vtbl
=
{
segment_state_graph_QueryInterface
,
segment_state_graph_AddRef
,
segment_state_graph_Release
,
segment_state_graph_StampPMsg
,
segment_state_graph_InsertTool
,
segment_state_graph_GetTool
,
segment_state_graph_RemoveTool
,
};
/* for ClassFactory */
HRESULT
create_dmsegmentstate
(
REFIID
riid
,
void
**
ret_iface
)
{
...
...
@@ -201,6 +276,7 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface)
*
ret_iface
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicSegmentState8_iface
.
lpVtbl
=
&
segment_state_vtbl
;
obj
->
IDirectMusicGraph_iface
.
lpVtbl
=
&
segment_state_graph_vtbl
;
obj
->
ref
=
1
;
obj
->
start_time
=
-
1
;
list_init
(
&
obj
->
tracks
);
...
...
@@ -216,6 +292,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
{
IDirectMusicSegmentState
*
iface
;
struct
segment_state
*
This
;
IDirectMusicGraph
*
graph
;
IDirectMusicTrack
*
track
;
HRESULT
hr
;
UINT
i
;
...
...
@@ -228,7 +305,10 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
This
->
segment
=
segment
;
IDirectMusicSegment_AddRef
(
This
->
segment
);
if
(
SUCCEEDED
(
hr
=
IDirectMusicPerformance8_GetGlobalParam
(
performance
,
&
GUID_PerfAutoDownload
,
hr
=
IDirectMusicPerformance8_QueryInterface
(
performance
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
if
(
SUCCEEDED
(
hr
)
&&
SUCCEEDED
(
hr
=
IDirectMusicPerformance8_GetGlobalParam
(
performance
,
&
GUID_PerfAutoDownload
,
&
This
->
auto_download
,
sizeof
(
This
->
auto_download
)))
&&
This
->
auto_download
)
hr
=
IDirectMusicSegment_SetParam
(
segment
,
&
GUID_DownloadToAudioPath
,
-
1
,
DMUS_SEG_ALLTRACKS
,
0
,
performance
);
...
...
@@ -268,8 +348,17 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
}
}
if
(
SUCCEEDED
(
hr
))
*
ret_iface
=
iface
;
else
IDirectMusicSegmentState_Release
(
iface
);
if
(
SUCCEEDED
(
hr
))
{
*
ret_iface
=
iface
;
This
->
parent_graph
=
graph
;
}
else
{
IDirectMusicSegmentState_Release
(
iface
);
IDirectMusicGraph_Release
(
graph
);
}
return
hr
;
}
...
...
dlls/dmime/tests/dmime.c
View file @
dfaa4506
...
...
@@ -4577,7 +4577,6 @@ static void test_segment_state(void)
graph
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_QueryInterface
(
state
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
...
...
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