Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5815ba45
Commit
5815ba45
authored
Feb 22, 2022
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Feb 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Forward GetFormat() to the corresponding synth & sink methods.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ec69d69f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
44 deletions
+36
-44
port.c
dlls/dmusic/port.c
+15
-44
dmusic.c
dlls/dmusic/tests/dmusic.c
+21
-0
No files found.
dlls/dmusic/port.c
View file @
5815ba45
...
...
@@ -510,50 +510,21 @@ static HRESULT WINAPI synth_port_SetDirectSound(IDirectMusicPort *iface, IDirect
return
S_OK
;
}
static
HRESULT
WINAPI
synth_port_GetFormat
(
IDirectMusicPort
*
iface
,
WAVEFORMATEX
*
pWaveFormatEx
,
DWORD
*
pdwWaveFormatExSize
,
DWORD
*
pdwBufferSize
)
{
struct
synth_port
*
This
=
synth_from_IDirectMusicPort
(
iface
);
WAVEFORMATEX
format
;
FIXME
(
"(%p, %p, %p, %p): stub
\n
"
,
This
,
pWaveFormatEx
,
pdwWaveFormatExSize
,
pdwBufferSize
);
if
(
pWaveFormatEx
==
NULL
)
{
if
(
pdwWaveFormatExSize
)
*
pdwWaveFormatExSize
=
sizeof
(
format
);
else
return
E_POINTER
;
}
else
{
if
(
pdwWaveFormatExSize
==
NULL
)
return
E_POINTER
;
/* Just fill this in with something that will not crash Direct Sound for now. */
/* It won't be used anyway until Performances are completed */
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
format
.
nChannels
=
2
;
/* This->params.dwAudioChannels; */
format
.
nSamplesPerSec
=
44100
;
/* This->params.dwSampleRate; */
format
.
wBitsPerSample
=
16
;
/* FIXME: check this */
format
.
nBlockAlign
=
(
format
.
wBitsPerSample
*
format
.
nChannels
)
/
8
;
format
.
nAvgBytesPerSec
=
format
.
nSamplesPerSec
*
format
.
nBlockAlign
;
format
.
cbSize
=
0
;
if
(
*
pdwWaveFormatExSize
>=
sizeof
(
format
))
{
CopyMemory
(
pWaveFormatEx
,
&
format
,
min
(
sizeof
(
format
),
*
pdwWaveFormatExSize
));
*
pdwWaveFormatExSize
=
sizeof
(
format
);
/* FIXME check if this is set */
}
else
return
E_POINTER
;
/* FIXME find right error */
}
if
(
pdwBufferSize
)
*
pdwBufferSize
=
44100
*
2
*
2
;
else
return
E_POINTER
;
return
S_OK
;
static
HRESULT
WINAPI
synth_port_GetFormat
(
IDirectMusicPort
*
iface
,
WAVEFORMATEX
*
format
,
DWORD
*
fmtsize
,
DWORD
*
bufsize
)
{
struct
synth_port
*
This
=
synth_from_IDirectMusicPort
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
This
,
format
,
fmtsize
,
bufsize
);
if
(
FAILED
(
hr
=
IDirectMusicSynth_GetFormat
(
This
->
synth
,
format
,
fmtsize
)))
return
hr
;
if
(
bufsize
)
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
This
->
synth_sink
,
bufsize
);
return
hr
;
}
static
const
IDirectMusicPortVtbl
synth_port_vtbl
=
{
...
...
dlls/dmusic/tests/dmusic.c
View file @
5815ba45
...
...
@@ -877,6 +877,9 @@ static void test_synthport(void)
IDirectMusicPort
*
port
;
DMUS_BUFFERDESC
desc
;
DMUS_PORTCAPS
caps
;
WAVEFORMATEX
fmt
;
DWORD
fmtsize
,
bufsize
;
HRESULT
hr
;
port
=
create_synth_port
(
&
dmusic
);
...
...
@@ -922,6 +925,24 @@ static void test_synthport(void)
ok
(
caps
.
dwEffectFlags
==
DMUS_EFFECT_REVERB
,
"Unexpected dwEffectFlags returned: %#lx
\n
"
,
caps
.
dwEffectFlags
);
trace
(
"Port wszDescription: %s
\n
"
,
wine_dbgstr_w
(
caps
.
wszDescription
));
/* GetFormat */
hr
=
IDirectMusicPort_GetFormat
(
port
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetFormat failed: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPort_GetFormat
(
port
,
NULL
,
&
fmtsize
,
NULL
);
ok
(
hr
==
S_OK
,
"GetFormat failed: %#lx
\n
"
,
hr
);
ok
(
fmtsize
==
sizeof
(
fmt
),
"format size; %ld
\n
"
,
fmtsize
);
fmtsize
=
0
;
hr
=
IDirectMusicPort_GetFormat
(
port
,
&
fmt
,
&
fmtsize
,
NULL
);
ok
(
hr
==
S_OK
,
"GetFormat failed: %#lx
\n
"
,
hr
);
ok
(
fmtsize
==
sizeof
(
fmt
),
"format size; %ld
\n
"
,
fmtsize
);
hr
=
IDirectMusicPort_GetFormat
(
port
,
NULL
,
NULL
,
&
bufsize
);
ok
(
hr
==
E_POINTER
,
"GetFormat failed: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPort_GetFormat
(
port
,
NULL
,
&
fmtsize
,
&
bufsize
);
ok
(
hr
==
S_OK
,
"GetFormat failed: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPort_GetFormat
(
port
,
&
fmt
,
&
fmtsize
,
&
bufsize
);
ok
(
hr
==
S_OK
,
"GetFormat failed: %#lx
\n
"
,
hr
);
ok
(
bufsize
==
fmt
.
nSamplesPerSec
*
fmt
.
nChannels
*
4
,
"buffer size: %ld
\n
"
,
bufsize
);
IDirectMusicPort_Release
(
port
);
IDirectMusic_Release
(
dmusic
);
}
...
...
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