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
45d1c00e
Commit
45d1c00e
authored
Oct 03, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Introduce a new segment_state_create constructor.
parent
9cb01426
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
24 deletions
+82
-24
dmime_private.h
dlls/dmime/dmime_private.h
+3
-0
performance.c
dlls/dmime/performance.c
+26
-8
segmentstate.c
dlls/dmime/segmentstate.c
+46
-9
dmime.c
dlls/dmime/tests/dmime.c
+7
-7
No files found.
dlls/dmime/dmime_private.h
View file @
45d1c00e
...
...
@@ -70,6 +70,9 @@ extern void set_audiopath_perf_pointer(IDirectMusicAudioPath*,IDirectMusicPerfor
extern
void
set_audiopath_dsound_buffer
(
IDirectMusicAudioPath
*
,
IDirectSoundBuffer
*
);
extern
void
set_audiopath_primary_dsound_buffer
(
IDirectMusicAudioPath
*
,
IDirectSoundBuffer
*
);
extern
HRESULT
segment_state_create
(
IDirectMusicSegment
*
segment
,
MUSIC_TIME
start_time
,
IDirectMusicSegmentState
**
ret_iface
);
/*****************************************************************************
* Auxiliary definitions
*/
...
...
dlls/dmime/performance.c
View file @
45d1c00e
...
...
@@ -1063,17 +1063,35 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi
return
S_OK
;
}
static
HRESULT
WINAPI
performance_PlaySegmentEx
(
IDirectMusicPerformance8
*
iface
,
IUnknown
*
pS
ource
,
WCHAR
*
pwzSegmentName
,
IUnknown
*
pTransition
,
DWORD
dwFlags
,
__int64
i64StartT
ime
,
IDirectMusicSegmentState
**
ppSegmentState
,
IUnknown
*
pFrom
,
IUnknown
*
pAudioP
ath
)
static
HRESULT
WINAPI
performance_PlaySegmentEx
(
IDirectMusicPerformance8
*
iface
,
IUnknown
*
s
ource
,
WCHAR
*
segment_name
,
IUnknown
*
transition
,
DWORD
segment_flags
,
INT64
start_t
ime
,
IDirectMusicSegmentState
**
segment_state
,
IUnknown
*
from
,
IUnknown
*
audio_p
ath
)
{
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
IDirectMusicSegmentState
*
state
;
IDirectMusicSegment
*
segment
;
HRESULT
hr
;
FIXME
(
"(%p, %p, %p, %p, %ld, 0x%s, %p, %p, %p): stub
\n
"
,
This
,
pSource
,
pwzSegmentName
,
pTransition
,
dwFlags
,
wine_dbgstr_longlong
(
i64StartTime
),
ppSegmentState
,
pFrom
,
pAudioPath
);
if
(
ppSegmentState
)
return
create_dmsegmentstate
(
&
IID_IDirectMusicSegmentState
,(
void
**
)
ppSegmentState
);
return
S_OK
;
FIXME
(
"(%p, %p, %s, %p, %#lx, %I64d, %p, %p, %p): stub
\n
"
,
This
,
source
,
debugstr_w
(
segment_name
),
transition
,
segment_flags
,
start_time
,
segment_state
,
from
,
audio_path
);
if
(
FAILED
(
hr
=
IUnknown_QueryInterface
(
source
,
&
IID_IDirectMusicSegment
,
(
void
**
)
&
segment
)))
return
hr
;
if
(
FAILED
(
hr
=
segment_state_create
((
IDirectMusicSegment
*
)
segment
,
start_time
,
&
state
)))
{
IDirectMusicSegment_Release
(
segment
);
return
hr
;
}
if
(
segment_state
)
{
*
segment_state
=
state
;
IDirectMusicSegmentState_AddRef
(
state
);
}
IDirectMusicSegmentState_Release
(
state
);
IDirectMusicSegment_Release
(
segment
);
return
hr
;
}
static
HRESULT
WINAPI
performance_StopEx
(
IDirectMusicPerformance8
*
iface
,
IUnknown
*
pObjectToStop
,
...
...
dlls/dmime/segmentstate.c
View file @
45d1c00e
...
...
@@ -25,6 +25,10 @@ struct segment_state
{
IDirectMusicSegmentState8
IDirectMusicSegmentState8_iface
;
LONG
ref
;
IDirectMusicSegment
*
segment
;
MUSIC_TIME
start_point
;
MUSIC_TIME
start_time
;
};
static
inline
struct
segment_state
*
impl_from_IDirectMusicSegmentState8
(
IDirectMusicSegmentState8
*
iface
)
...
...
@@ -73,7 +77,11 @@ static ULONG WINAPI segment_state_Release(IDirectMusicSegmentState8 *iface)
TRACE
(
"(%p): %ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
free
(
This
);
if
(
!
ref
)
{
if
(
This
->
segment
)
IDirectMusicSegment_Release
(
This
->
segment
);
free
(
This
);
}
return
ref
;
}
...
...
@@ -89,17 +97,21 @@ static HRESULT WINAPI segment_state_GetSegment(IDirectMusicSegmentState8 *iface,
{
struct
segment_state
*
This
=
impl_from_IDirectMusicSegmentState8
(
iface
);
FIXME
(
"(%p, %p): semi-stub
\n
"
,
This
,
segment
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
segment
);
*
segment
=
NULL
;
return
DMUS_E_NOT_FOUND
;
if
(
!
(
*
segment
=
This
->
segment
))
return
DMUS_E_NOT_FOUND
;
IDirectMusicSegment_AddRef
(
This
->
segment
);
return
S_OK
;
}
static
HRESULT
WINAPI
segment_state_GetStartTime
(
IDirectMusicSegmentState8
*
iface
,
MUSIC_TIME
*
start_time
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicSegmentState8
(
iface
);
FIXME
(
"(%p, %p): semi-stub
\n
"
,
This
,
start_time
);
*
start_time
=
-
1
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
start_time
);
*
start_time
=
This
->
start_time
;
return
S_OK
;
}
...
...
@@ -111,13 +123,13 @@ static HRESULT WINAPI segment_state_GetSeek(IDirectMusicSegmentState8 *iface, MU
return
S_OK
;
}
static
HRESULT
WINAPI
segment_state_GetStartPoint
(
IDirectMusicSegmentState8
*
iface
,
MUSIC_TIME
*
start_
time
)
static
HRESULT
WINAPI
segment_state_GetStartPoint
(
IDirectMusicSegmentState8
*
iface
,
MUSIC_TIME
*
start_
point
)
{
struct
segment_state
*
This
=
impl_from_IDirectMusicSegmentState8
(
iface
);
FIXME
(
"(%p, %p): semi-stub
\n
"
,
This
,
start_time
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
start_point
);
*
start_
time
=
0
;
*
start_
point
=
This
->
start_point
;
return
S_OK
;
}
...
...
@@ -161,8 +173,33 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface)
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicSegmentState8_iface
.
lpVtbl
=
&
segment_state_vtbl
;
obj
->
ref
=
1
;
obj
->
start_time
=
-
1
;
TRACE
(
"Created IDirectMusicSegmentState %p
\n
"
,
obj
);
hr
=
IDirectMusicSegmentState8_QueryInterface
(
&
obj
->
IDirectMusicSegmentState8_iface
,
riid
,
ret_iface
);
IDirectMusicSegmentState8_Release
(
&
obj
->
IDirectMusicSegmentState8_iface
);
return
hr
;
}
HRESULT
segment_state_create
(
IDirectMusicSegment
*
segment
,
MUSIC_TIME
start_time
,
IDirectMusicSegmentState
**
ret_iface
)
{
IDirectMusicSegmentState
*
iface
;
struct
segment_state
*
This
;
HRESULT
hr
;
TRACE
(
"(%p, %lu, %p)
\n
"
,
segment
,
start_time
,
ret_iface
);
if
(
FAILED
(
hr
=
create_dmsegmentstate
(
&
IID_IDirectMusicSegmentState
,
(
void
**
)
&
iface
)))
return
hr
;
This
=
impl_from_IDirectMusicSegmentState8
((
IDirectMusicSegmentState8
*
)
iface
);
This
->
segment
=
segment
;
IDirectMusicSegment_AddRef
(
This
->
segment
);
This
->
start_time
=
start_time
;
hr
=
IDirectMusicSegment_GetStartPoint
(
segment
,
&
This
->
start_point
);
if
(
SUCCEEDED
(
hr
))
*
ret_iface
=
iface
;
else
IDirectMusicSegmentState_Release
(
iface
);
return
hr
;
}
dlls/dmime/tests/dmime.c
View file @
45d1c00e
...
...
@@ -4043,14 +4043,14 @@ static void test_segment_state(void)
tmp_segment
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetSegment
(
state
,
&
tmp_segment
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
tmp_segment
==
segment
,
"got %p
\n
"
,
tmp_segment
);
if
(
tmp_segment
)
IDirectMusicSegment_Release
(
tmp_segment
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
tmp_segment
==
segment
,
"got %p
\n
"
,
tmp_segment
);
IDirectMusicSegment_Release
(
tmp_segment
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetStartPoint
(
state
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
==
50
,
"got %lu
\n
"
,
time
);
ok
(
time
==
50
,
"got %lu
\n
"
,
time
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetRepeats
(
state
,
&
value
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -4058,7 +4058,7 @@ static void test_segment_state(void)
time
=
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetStartTime
(
state
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
==
20
,
"got %#lx
\n
"
,
time
);
ok
(
time
==
20
,
"got %#lx
\n
"
,
time
);
time
=
0xdeadbeef
;
/* The seek value is also dependent on whether the tracks are playing.
...
...
@@ -4080,7 +4080,7 @@ static void test_segment_state(void)
time
=
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetStartPoint
(
state
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
==
50
,
"got %#lx
\n
"
,
time
);
ok
(
time
==
50
,
"got %#lx
\n
"
,
time
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetRepeats
(
state
,
&
value
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -4088,7 +4088,7 @@ static void test_segment_state(void)
time
=
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetStartTime
(
state
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
==
20
,
"got %#lx
\n
"
,
time
);
ok
(
time
==
20
,
"got %#lx
\n
"
,
time
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicSegmentState_GetSeek
(
state
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
...
...
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