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
e32f4938
Commit
e32f4938
authored
Jun 01, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Jun 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test to check playback position after done playing.
parent
28d175b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
wave.c
dlls/winmm/tests/wave.c
+51
-0
No files found.
dlls/winmm/tests/wave.c
View file @
e32f4938
...
...
@@ -185,6 +185,55 @@ static const char * wave_out_caps(DWORD dwSupport)
#undef ADD_FLAG
}
static
void
check_position
(
int
device
,
HWAVEOUT
wout
,
double
duration
,
LPWAVEFORMATEX
pwfx
)
{
MMTIME
mmtime
;
MMRESULT
rc
;
mmtime
.
wType
=
TIME_BYTES
;
rc
=
waveOutGetPosition
(
wout
,
&
mmtime
,
sizeof
(
mmtime
));
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutGetPosition: device=%d rc=%s
\n
"
,
device
,
wave_out_error
(
rc
));
if
(
mmtime
.
wType
==
TIME_BYTES
)
ok
(
mmtime
.
u
.
cb
==
duration
*
pwfx
->
nAvgBytesPerSec
,
"waveOutGetPosition returned %ld bytes, should be %ld
\n
"
,
mmtime
.
u
.
cb
,
(
DWORD
)(
duration
*
pwfx
->
nAvgBytesPerSec
));
mmtime
.
wType
=
TIME_SAMPLES
;
rc
=
waveOutGetPosition
(
wout
,
&
mmtime
,
sizeof
(
mmtime
));
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutGetPosition: device=%d rc=%s
\n
"
,
device
,
wave_out_error
(
rc
));
if
(
mmtime
.
wType
==
TIME_SAMPLES
)
ok
(
mmtime
.
u
.
sample
==
duration
*
pwfx
->
nSamplesPerSec
,
"waveOutGetPosition returned %ld samples, should be %ld
\n
"
,
mmtime
.
u
.
sample
,
(
DWORD
)(
duration
*
pwfx
->
nSamplesPerSec
));
mmtime
.
wType
=
TIME_MS
;
rc
=
waveOutGetPosition
(
wout
,
&
mmtime
,
sizeof
(
mmtime
));
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutGetPosition: device=%d rc=%s
\n
"
,
device
,
wave_out_error
(
rc
));
if
(
mmtime
.
wType
==
TIME_MS
)
ok
(
mmtime
.
u
.
ms
==
(
DWORD
)(
duration
*
1000
),
"waveOutGetPosition returned %ld ms, should be %ld
\n
"
,
mmtime
.
u
.
ms
,
(
DWORD
)(
duration
*
1000
));
mmtime
.
wType
=
TIME_SMPTE
;
rc
=
waveOutGetPosition
(
wout
,
&
mmtime
,
sizeof
(
mmtime
));
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutGetPosition: device=%d rc=%s
\n
"
,
device
,
wave_out_error
(
rc
));
if
(
mmtime
.
wType
==
TIME_SMPTE
)
ok
(
mmtime
.
u
.
smpte
.
hour
==
(
BYTE
)(
floor
(
duration
/
(
60
*
60
)))
&&
mmtime
.
u
.
smpte
.
min
==
(
BYTE
)(
fmod
(
floor
(
duration
/
60
),
60
))
&&
mmtime
.
u
.
smpte
.
sec
==
(
BYTE
)(
fmod
(
duration
,
60
))
&&
mmtime
.
u
.
smpte
.
frame
==
(
BYTE
)(
fmod
(
duration
*
mmtime
.
u
.
smpte
.
fps
,
mmtime
.
u
.
smpte
.
fps
)),
"waveOutGetPosition returned %d:%d:%d %d, should be %d:%d:%d %d
\n
"
,
mmtime
.
u
.
smpte
.
hour
,
mmtime
.
u
.
smpte
.
min
,
mmtime
.
u
.
smpte
.
sec
,
mmtime
.
u
.
smpte
.
frame
,
(
BYTE
)(
floor
(
duration
/
(
60
*
60
))),
(
BYTE
)(
fmod
(
floor
(
duration
/
60
),
60
)),
(
BYTE
)(
fmod
(
duration
,
60
)),
(
BYTE
)(
fmod
(
duration
*
mmtime
.
u
.
smpte
.
fps
,
mmtime
.
u
.
smpte
.
fps
)));
}
static
void
wave_out_test_deviceOut
(
int
device
,
double
duration
,
LPWAVEFORMATEX
pwfx
,
DWORD
format
,
DWORD
flags
,
LPWAVEOUTCAPS
pcaps
)
{
HWAVEOUT
wout
;
...
...
@@ -262,6 +311,8 @@ static void wave_out_test_deviceOut(int device, double duration, LPWAVEFORMATEX
rc
=
waveOutSetVolume
(
wout
,
volume
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutSetVolume: device=%d rc=%s
\n
"
,
device
,
wave_out_error
(
rc
));
check_position
(
device
,
wout
,
duration
,
pwfx
);
}
rc
=
waveOutUnprepareHeader
(
wout
,
&
frag
,
sizeof
(
frag
));
...
...
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