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
1b1f2162
Commit
1b1f2162
authored
Feb 15, 2024
by
Yuxuan Shui
Committed by
Alexandre Julliard
Mar 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Implement setting TempoParam for tempotracks.
And add some tests.
parent
6a3f067e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
tempotrack.c
dlls/dmime/tempotrack.c
+18
-1
dmime.c
dlls/dmime/tests/dmime.c
+51
-0
No files found.
dlls/dmime/tempotrack.c
View file @
1b1f2162
...
...
@@ -203,9 +203,26 @@ static HRESULT WINAPI tempo_track_SetParam(IDirectMusicTrack8 *iface, REFGUID ty
return
S_OK
;
}
if
(
IsEqualGUID
(
type
,
&
GUID_TempoParam
))
{
struct
tempo_entry
*
item
,
*
next_item
;
DMUS_TEMPO_PARAM
*
tempo_param
=
param
;
struct
tempo_entry
*
entry
;
if
(
!
param
)
return
E_POINTER
;
FIXME
(
"GUID_TempoParam not handled yet
\n
"
);
if
(
!
(
entry
=
calloc
(
1
,
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
entry
->
item
.
lTime
=
time
;
entry
->
item
.
dblTempo
=
tempo_param
->
dblTempo
;
if
(
list_empty
(
&
This
->
items
))
list_add_tail
(
&
This
->
items
,
&
entry
->
entry
);
else
{
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
next_item
,
&
This
->
items
,
struct
tempo_entry
,
entry
)
if
(
item
->
entry
.
next
==
&
This
->
items
||
next_item
->
item
.
lTime
>
time
)
{
list_add_after
(
&
item
->
entry
,
&
entry
->
entry
);
break
;
}
}
return
S_OK
;
}
...
...
dlls/dmime/tests/dmime.c
View file @
1b1f2162
...
...
@@ -4456,6 +4456,56 @@ static void check_dmus_tempo_pmsg_(int line, DMUS_TEMPO_PMSG *msg, MUSIC_TIME ti
ok_
(
__FILE__
,
line
)(
msg
->
dblTempo
==
tempo
,
"got tempo %f
\n
"
,
msg
->
dblTempo
);
}
static
void
test_tempo_track
(
void
)
{
HRESULT
hr
;
IDirectMusicTrack
*
track
;
DMUS_TEMPO_PARAM
param
;
MUSIC_TIME
next
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicTempoTrack
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicTrack
,
(
void
**
)
&
track
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicTrack_GetParam
(
track
,
&
GUID_TempoParam
,
0
,
&
next
,
&
param
);
ok
(
hr
==
DMUS_E_NOT_FOUND
,
"got %#lx
\n
"
,
hr
);
param
.
dblTempo
=
150
;
param
.
mtTime
=
10
;
hr
=
IDirectMusicTrack_SetParam
(
track
,
&
GUID_TempoParam
,
10
,
&
param
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicTrack_GetParam
(
track
,
&
GUID_TempoParam
,
0
,
&
next
,
&
param
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
param
.
dblTempo
==
150
,
"got %f, expected 150
\n
"
,
param
.
dblTempo
);
ok
(
param
.
mtTime
==
10
,
"got %lu, expected 10
\n
"
,
param
.
mtTime
);
ok
(
next
==
10
,
"got %lu, expected 10
\n
"
,
next
);
hr
=
IDirectMusicTrack_GetParam
(
track
,
&
GUID_TempoParam
,
10
,
&
next
,
&
param
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
param
.
dblTempo
==
150
,
"got %f, expected 150
\n
"
,
param
.
dblTempo
);
ok
(
param
.
mtTime
==
0
,
"got %lu, expected 0
\n
"
,
param
.
mtTime
);
ok
(
next
==
0
,
"got %lu, expected 0
\n
"
,
next
);
hr
=
IDirectMusicTrack_GetParam
(
track
,
&
GUID_TempoParam
,
11
,
&
next
,
&
param
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
param
.
dblTempo
==
150
,
"got %f, expected 150
\n
"
,
param
.
dblTempo
);
ok
(
param
.
mtTime
==
-
1
,
"got %lu, expected 0
\n
"
,
param
.
mtTime
);
ok
(
next
==
0
,
"got %lu, expected 0
\n
"
,
next
);
param
.
dblTempo
=
180
;
param
.
mtTime
=
20
;
hr
=
IDirectMusicTrack_SetParam
(
track
,
&
GUID_TempoParam
,
20
,
&
param
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicTrack_GetParam
(
track
,
&
GUID_TempoParam
,
11
,
&
next
,
&
param
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
param
.
dblTempo
==
150
,
"got %f, expected 150
\n
"
,
param
.
dblTempo
);
ok
(
param
.
mtTime
==
-
1
,
"got %ld, expected -1
\n
"
,
param
.
mtTime
);
ok
(
next
==
9
,
"got %lu, expected 9
\n
"
,
next
);
IDirectMusicTrack_Release
(
track
);
}
static
void
test_tempo_track_play
(
void
)
{
static
const
DWORD
message_types
[]
=
...
...
@@ -5045,6 +5095,7 @@ START_TEST(dmime)
test_wave_pmsg
(
0
);
test_wave_pmsg
(
10
);
test_sequence_track
();
test_tempo_track
();
test_band_track_play
();
test_tempo_track_play
();
test_connect_to_collection
();
...
...
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