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
2d1f46c2
Commit
2d1f46c2
authored
Oct 23, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Fix tempo track GetParam with GUID_TempoParam implementation.
parent
92959b31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
55 deletions
+45
-55
tempotrack.c
dlls/dmime/tempotrack.c
+18
-28
dmime.c
dlls/dmime/tests/dmime.c
+27
-27
No files found.
dlls/dmime/tempotrack.c
View file @
2d1f46c2
...
...
@@ -140,42 +140,32 @@ static HRESULT WINAPI tempo_track_Play(IDirectMusicTrack8 *iface, void *pStateDa
return
S_OK
;
}
static
HRESULT
WINAPI
tempo_track_GetParam
(
IDirectMusicTrack8
*
iface
,
REFGUID
type
,
MUSIC_TIME
time
,
MUSIC_TIME
*
next
,
void
*
param
)
static
HRESULT
WINAPI
tempo_track_GetParam
(
IDirectMusicTrack8
*
iface
,
REFGUID
type
,
MUSIC_TIME
music_
time
,
MUSIC_TIME
*
next
_time
,
void
*
param
)
{
IDirectMusicTempoTrack
*
This
=
impl_from_IDirectMusicTrack8
(
iface
);
DMUS_TEMPO_PARAM
*
prm
=
param
;
unsigned
int
i
;
TRACE
(
"(%p, %s, %ld, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
type
),
time
,
next
,
param
);
DMUS_IO_TEMPO_ITEM
*
item
=
This
->
items
,
*
end
=
item
+
This
->
count
;
DMUS_TEMPO_PARAM
*
tempo
=
param
;
if
(
!
param
)
return
E_POINTER
;
if
(
!
IsEqualGUID
(
type
,
&
GUID_TempoParam
))
return
DMUS_E_GET_UNSUPPORTED
;
TRACE
(
"(%p, %s, %ld, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
type
),
music_time
,
next_time
,
param
);
FIXME
(
"Partial support for GUID_TempoParam
\n
"
);
if
(
!
param
)
return
E_POINTER
;
if
(
!
IsEqualGUID
(
type
,
&
GUID_TempoParam
))
return
DMUS_E_GET_UNSUPPORTED
;
if
(
item
==
end
)
return
DMUS_E_NOT_FOUND
;
if
(
next
)
*
next
=
0
;
prm
->
mtTime
=
0
;
prm
->
dblTempo
=
0
.
123456
;
tempo
->
mtTime
=
item
->
lTime
-
music_time
;
tempo
->
dblTempo
=
item
->
dblTempo
;
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
{
if
(
This
->
items
[
i
].
lTime
<=
time
)
{
MUSIC_TIME
ofs
=
This
->
items
[
i
].
lTime
-
time
;
if
(
ofs
>
prm
->
mtTime
)
{
prm
->
mtTime
=
ofs
;
prm
->
dblTempo
=
This
->
items
[
i
].
dblTempo
;
}
if
(
next
&&
This
->
items
[
i
].
lTime
>
time
&&
This
->
items
[
i
].
lTime
<
*
next
)
*
next
=
This
->
items
[
i
].
lTime
;
}
for
(;
item
<
end
;
item
++
)
{
MUSIC_TIME
time
=
item
->
lTime
-
music_time
;
if
(
next_time
)
*
next_time
=
item
->
lTime
-
music_time
;
if
(
time
>
0
)
break
;
tempo
->
mtTime
=
time
;
tempo
->
dblTempo
=
item
->
dblTempo
;
}
if
(
0
.
123456
==
prm
->
dblTempo
)
return
DMUS_E_NOT_FOUND
;
if
(
next_time
&&
item
==
end
)
*
next_time
=
0
;
return
S_OK
;
}
...
...
dlls/dmime/tests/dmime.c
View file @
2d1f46c2
...
...
@@ -4019,45 +4019,45 @@ static void test_tempo_track_play(void)
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
0
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
0
,
NULL
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
memset
(
&
param
,
0xcd
,
sizeof
(
param
));
next_time
=
0xdeadbeef
;
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
0
,
&
next_time
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
next_time
==
100
,
"got next_time %lu
\n
"
,
next_time
);
todo_wine
ok
(
param
.
mtTime
==
100
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
todo_wine
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
next_time
==
100
,
"got next_time %lu
\n
"
,
next_time
);
ok
(
param
.
mtTime
==
100
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
100
,
&
next_time
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
next_time
==
200
,
"got next_time %lu
\n
"
,
next_time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
next_time
==
200
,
"got next_time %lu
\n
"
,
next_time
);
ok
(
param
.
mtTime
==
0
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
todo_wine
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
199
,
&
next_time
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
next_time
==
101
,
"got next_time %lu
\n
"
,
next_time
);
todo_wine
ok
(
param
.
mtTime
==
-
99
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
todo_wine
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
next_time
==
101
,
"got next_time %lu
\n
"
,
next_time
);
ok
(
param
.
mtTime
==
-
99
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
200
,
&
next_time
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
next_time
==
100
,
"got next_time %lu
\n
"
,
next_time
);
todo_wine
ok
(
param
.
mtTime
==
-
100
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
todo_wine
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
next_time
==
100
,
"got next_time %lu
\n
"
,
next_time
);
ok
(
param
.
mtTime
==
-
100
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
299
,
&
next_time
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
next_time
==
1
,
"got next_time %lu
\n
"
,
next_time
);
todo_wine
ok
(
param
.
mtTime
==
-
199
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
todo_wine
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
next_time
==
1
,
"got next_time %lu
\n
"
,
next_time
);
ok
(
param
.
mtTime
==
-
199
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
ok
(
param
.
dblTempo
==
80
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
300
,
&
next_time
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
next_time
==
3700
,
"got next_time %lu
\n
"
,
next_time
);
todo_wine
ok
(
param
.
mtTime
==
-
100
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
todo_wine
ok
(
param
.
dblTempo
==
20
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
next_time
==
3700
,
"got next_time %lu
\n
"
,
next_time
);
ok
(
param
.
mtTime
==
-
100
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
ok
(
param
.
dblTempo
==
20
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
hr
=
IDirectMusicSegment_GetParam
(
segment
,
&
GUID_TempoParam
,
-
1
,
DMUS_SEG_ALLTRACKS
,
5000
,
&
next_time
,
&
param
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
next_time
==
0
,
"got next_time %lu
\n
"
,
next_time
);
todo_wine
ok
(
param
.
mtTime
==
-
1000
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
todo_wine
ok
(
param
.
dblTempo
==
50
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
ok
(
param
.
mtTime
==
-
1000
,
"got mtTime %ld
\n
"
,
param
.
mtTime
);
ok
(
param
.
dblTempo
==
50
,
"got dblTempo %f
\n
"
,
param
.
dblTempo
);
/* now play the segment, and check produced messages */
...
...
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