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
1383b841
Commit
1383b841
authored
Feb 08, 2022
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Feb 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth: Implement the synth's Open and Close methods.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dd04b947
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
10 deletions
+90
-10
performance.c
dlls/dmime/tests/performance.c
+2
-2
dmsynth_private.h
dlls/dmsynth/dmsynth_private.h
+2
-3
synth.c
dlls/dmsynth/synth.c
+86
-5
No files found.
dlls/dmime/tests/performance.c
View file @
1383b841
...
...
@@ -286,7 +286,7 @@ static void test_createport(void)
hr
=
IDirectMusic_CreatePort
(
music
,
&
CLSID_DirectMusicSynth
,
&
portparams
,
&
port
,
NULL
);
ok
(
hr
==
S_OK
,
"CreatePort failed: %08x
\n
"
,
hr
);
ok
(
port
!=
NULL
,
"Didn't get IDirectMusicPort pointer
\n
"
);
todo_wine
ok
(
portparams
.
dwValidParams
,
"portparams struct was not filled in
\n
"
);
ok
(
portparams
.
dwValidParams
,
"portparams struct was not filled in
\n
"
);
IDirectMusicPort_Release
(
port
);
port
=
NULL
;
...
...
@@ -312,7 +312,7 @@ static void test_createport(void)
hr
=
IDirectMusic_CreatePort
(
music
,
&
GUID_NULL
,
&
portparams
,
&
port
,
NULL
);
ok
(
hr
==
S_OK
,
"CreatePort failed: %08x
\n
"
,
hr
);
ok
(
port
!=
NULL
,
"Didn't get IDirectMusicPort pointer
\n
"
);
todo_wine
ok
(
portparams
.
dwValidParams
,
"portparams struct was not filled in
\n
"
);
ok
(
portparams
.
dwValidParams
,
"portparams struct was not filled in
\n
"
);
IDirectMusicPort_Release
(
port
);
port
=
NULL
;
...
...
dlls/dmsynth/dmsynth_private.h
View file @
1383b841
...
...
@@ -56,14 +56,13 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **
* IDirectMusicSynth8Impl implementation structure
*/
struct
IDirectMusicSynth8Impl
{
/* IUnknown fields */
IDirectMusicSynth8
IDirectMusicSynth8_iface
;
IKsControl
IKsControl_iface
;
LONG
ref
;
/* IDirectMusicSynth8 fields */
DMUS_PORTCAPS
caps
;
DMUS_PORTPARAMS
params
;
BOOL
active
;
BOOL
open
;
IReferenceClock
*
latency_clock
;
IDirectMusicSynthSink
*
sink
;
};
...
...
dlls/dmsynth/synth.c
View file @
1383b841
...
...
@@ -94,21 +94,102 @@ static ULONG WINAPI IDirectMusicSynth8Impl_Release(IDirectMusicSynth8 *iface)
}
/* IDirectMusicSynth8Impl IDirectMusicSynth part: */
static
HRESULT
WINAPI
IDirectMusicSynth8Impl_Open
(
IDirectMusicSynth8
*
iface
,
DMUS_PORTPARAMS
*
pPortParams
)
static
HRESULT
WINAPI
IDirectMusicSynth8Impl_Open
(
IDirectMusicSynth8
*
iface
,
DMUS_PORTPARAMS
*
params
)
{
IDirectMusicSynth8Impl
*
This
=
impl_from_IDirectMusicSynth8
(
iface
);
BOOL
modified
=
FALSE
;
const
DMUS_PORTPARAMS
def
=
{
.
dwValidParams
=
DMUS_PORTPARAMS_VOICES
|
DMUS_PORTPARAMS_CHANNELGROUPS
|
DMUS_PORTPARAMS_AUDIOCHANNELS
|
DMUS_PORTPARAMS_SAMPLERATE
|
DMUS_PORTPARAMS_EFFECTS
|
DMUS_PORTPARAMS_SHARE
|
DMUS_PORTPARAMS_FEATURES
,
.
dwSize
=
sizeof
(
def
),
.
dwVoices
=
32
,
.
dwChannelGroups
=
2
,
.
dwAudioChannels
=
2
,
.
dwSampleRate
=
22050
,
.
dwEffectFlags
=
DMUS_EFFECT_REVERB
};
TRACE
(
"(%p, %p)
\n
"
,
This
,
params
);
if
(
This
->
open
)
return
DMUS_E_ALREADYOPEN
;
if
(
params
&&
params
->
dwSize
<
sizeof
(
DMUS_PORTPARAMS7
))
return
E_INVALIDARG
;
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
pPortParams
)
;
This
->
open
=
TRUE
;
return
S_OK
;
if
(
!
params
)
{
memcpy
(
&
This
->
params
,
&
def
,
sizeof
(
This
->
params
));
return
S_OK
;
}
if
(
params
->
dwValidParams
&
DMUS_PORTPARAMS_VOICES
&&
params
->
dwVoices
)
{
if
(
params
->
dwVoices
>
This
->
caps
.
dwMaxVoices
)
{
modified
=
TRUE
;
params
->
dwVoices
=
This
->
caps
.
dwMaxVoices
;
}
}
else
params
->
dwVoices
=
def
.
dwVoices
;
if
(
params
->
dwValidParams
&
DMUS_PORTPARAMS_CHANNELGROUPS
&&
params
->
dwChannelGroups
)
{
if
(
params
->
dwChannelGroups
>
This
->
caps
.
dwMaxChannelGroups
)
{
modified
=
TRUE
;
params
->
dwChannelGroups
=
This
->
caps
.
dwMaxChannelGroups
;
}
}
else
params
->
dwChannelGroups
=
def
.
dwChannelGroups
;
if
(
params
->
dwValidParams
&
DMUS_PORTPARAMS_AUDIOCHANNELS
&&
params
->
dwAudioChannels
)
{
if
(
params
->
dwAudioChannels
>
This
->
caps
.
dwMaxAudioChannels
)
{
modified
=
TRUE
;
params
->
dwAudioChannels
=
This
->
caps
.
dwMaxAudioChannels
;
}
}
else
params
->
dwAudioChannels
=
def
.
dwAudioChannels
;
if
(
params
->
dwValidParams
&
DMUS_PORTPARAMS_SAMPLERATE
&&
params
->
dwSampleRate
)
{
if
(
params
->
dwSampleRate
>
96000
)
{
modified
=
TRUE
;
params
->
dwSampleRate
=
96000
;
}
else
if
(
params
->
dwSampleRate
<
11025
)
{
modified
=
TRUE
;
params
->
dwSampleRate
=
11025
;
}
}
else
params
->
dwSampleRate
=
def
.
dwSampleRate
;
if
(
params
->
dwValidParams
&
DMUS_PORTPARAMS_EFFECTS
&&
params
->
dwEffectFlags
!=
def
.
dwEffectFlags
)
modified
=
TRUE
;
params
->
dwEffectFlags
=
def
.
dwEffectFlags
;
if
(
params
->
dwValidParams
&
DMUS_PORTPARAMS_SHARE
&&
params
->
fShare
)
modified
=
TRUE
;
params
->
fShare
=
FALSE
;
if
(
params
->
dwSize
>=
sizeof
(
params
))
{
if
(
params
->
dwValidParams
&
DMUS_PORTPARAMS_FEATURES
&&
params
->
dwFeatures
)
{
if
(
params
->
dwFeatures
&
~
(
DMUS_PORT_FEATURE_AUDIOPATH
|
DMUS_PORT_FEATURE_STREAMING
))
{
modified
=
TRUE
;
params
->
dwFeatures
&=
DMUS_PORT_FEATURE_AUDIOPATH
|
DMUS_PORT_FEATURE_STREAMING
;
}
}
else
params
->
dwFeatures
=
def
.
dwFeatures
;
params
->
dwValidParams
=
def
.
dwValidParams
;
}
else
params
->
dwValidParams
=
def
.
dwValidParams
&
~
DMUS_PORTPARAMS_FEATURES
;
memcpy
(
&
This
->
params
,
params
,
min
(
params
->
dwSize
,
sizeof
(
This
->
params
)));
return
modified
?
S_FALSE
:
S_OK
;
}
static
HRESULT
WINAPI
IDirectMusicSynth8Impl_Close
(
IDirectMusicSynth8
*
iface
)
{
IDirectMusicSynth8Impl
*
This
=
impl_from_IDirectMusicSynth8
(
iface
);
FIXME
(
"(%p)->(): stub
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
This
->
open
)
return
DMUS_E_ALREADYCLOSED
;
This
->
open
=
FALSE
;
return
S_OK
;
}
...
...
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