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
3cfa740c
Commit
3cfa740c
authored
Oct 02, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth: Create a fluid_synth instance on Open.
parent
fcc8a1be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
synth.c
dlls/dmsynth/synth.c
+8
-1
dmsynth.c
dlls/dmsynth/tests/dmsynth.c
+2
-2
No files found.
dlls/dmsynth/synth.c
View file @
3cfa740c
...
@@ -232,6 +232,7 @@ struct synth
...
@@ -232,6 +232,7 @@ struct synth
struct
list
waves
;
struct
list
waves
;
fluid_settings_t
*
fluid_settings
;
fluid_settings_t
*
fluid_settings
;
fluid_synth_t
*
fluid_synth
;
};
};
static
inline
struct
synth
*
impl_from_IDirectMusicSynth8
(
IDirectMusicSynth8
*
iface
)
static
inline
struct
synth
*
impl_from_IDirectMusicSynth8
(
IDirectMusicSynth8
*
iface
)
...
@@ -351,7 +352,8 @@ static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *par
...
@@ -351,7 +352,8 @@ static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *par
if
((
params
->
dwValidParams
&
DMUS_PORTPARAMS_AUDIOCHANNELS
)
&&
params
->
dwAudioChannels
)
if
((
params
->
dwValidParams
&
DMUS_PORTPARAMS_AUDIOCHANNELS
)
&&
params
->
dwAudioChannels
)
{
{
actual
.
dwAudioChannels
=
min
(
params
->
dwAudioChannels
,
This
->
caps
.
dwMaxAudioChannels
);
/* FluidSynth only works with stereo */
actual
.
dwAudioChannels
=
2
;
modified
|=
actual
.
dwAudioChannels
!=
params
->
dwAudioChannels
;
modified
|=
actual
.
dwAudioChannels
!=
params
->
dwAudioChannels
;
}
}
...
@@ -384,6 +386,9 @@ static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *par
...
@@ -384,6 +386,9 @@ static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *par
memcpy
(
params
,
&
actual
,
size
);
memcpy
(
params
,
&
actual
,
size
);
}
}
fluid_settings_setnum
(
This
->
fluid_settings
,
"synth.sample-rate"
,
actual
.
dwSampleRate
);
if
(
!
(
This
->
fluid_synth
=
new_fluid_synth
(
This
->
fluid_settings
)))
return
E_OUTOFMEMORY
;
This
->
params
=
actual
;
This
->
params
=
actual
;
This
->
open
=
TRUE
;
This
->
open
=
TRUE
;
...
@@ -399,6 +404,8 @@ static HRESULT WINAPI synth_Close(IDirectMusicSynth8 *iface)
...
@@ -399,6 +404,8 @@ static HRESULT WINAPI synth_Close(IDirectMusicSynth8 *iface)
if
(
!
This
->
open
)
if
(
!
This
->
open
)
return
DMUS_E_ALREADYCLOSED
;
return
DMUS_E_ALREADYCLOSED
;
delete_fluid_synth
(
This
->
fluid_synth
);
This
->
fluid_synth
=
NULL
;
This
->
open
=
FALSE
;
This
->
open
=
FALSE
;
return
S_OK
;
return
S_OK
;
...
...
dlls/dmsynth/tests/dmsynth.c
View file @
3cfa740c
...
@@ -437,7 +437,7 @@ static void test_dmsynth(void)
...
@@ -437,7 +437,7 @@ static void test_dmsynth(void)
ok
(
params
.
dwValidParams
==
all_params
,
"dwValidParams: %#lx
\n
"
,
params
.
dwValidParams
);
ok
(
params
.
dwValidParams
==
all_params
,
"dwValidParams: %#lx
\n
"
,
params
.
dwValidParams
);
ok
(
params
.
dwVoices
==
1
,
"dwVoices: %ld
\n
"
,
params
.
dwVoices
);
ok
(
params
.
dwVoices
==
1
,
"dwVoices: %ld
\n
"
,
params
.
dwVoices
);
ok
(
params
.
dwChannelGroups
==
1
,
"dwChannelGroups: %ld
\n
"
,
params
.
dwChannelGroups
);
ok
(
params
.
dwChannelGroups
==
1
,
"dwChannelGroups: %ld
\n
"
,
params
.
dwChannelGroups
);
ok
(
params
.
dwAudioChannels
==
1
,
"dwAudioChannels: %ld
\n
"
,
params
.
dwAudioChannels
);
todo_wine
ok
(
params
.
dwAudioChannels
==
1
,
"dwAudioChannels: %ld
\n
"
,
params
.
dwAudioChannels
);
ok
(
params
.
dwSampleRate
==
11025
,
"dwSampleRate: %ld
\n
"
,
params
.
dwSampleRate
);
ok
(
params
.
dwSampleRate
==
11025
,
"dwSampleRate: %ld
\n
"
,
params
.
dwSampleRate
);
test_synth_getformat
(
dmsynth
,
&
params
,
"min"
);
test_synth_getformat
(
dmsynth
,
&
params
,
"min"
);
IDirectMusicSynth_Close
(
dmsynth
);
IDirectMusicSynth_Close
(
dmsynth
);
...
@@ -525,7 +525,7 @@ static void test_dmsynth(void)
...
@@ -525,7 +525,7 @@ static void test_dmsynth(void)
params
.
dwValidParams
=
DMUS_PORTPARAMS_AUDIOCHANNELS
;
params
.
dwValidParams
=
DMUS_PORTPARAMS_AUDIOCHANNELS
;
params
.
dwAudioChannels
=
1
;
params
.
dwAudioChannels
=
1
;
hr
=
IDirectMusicSynth_Open
(
dmsynth
,
&
params
);
hr
=
IDirectMusicSynth_Open
(
dmsynth
,
&
params
);
ok
(
hr
==
S_OK
,
"Open failed: %#lx
\n
"
,
hr
);
todo_wine_if
(
SUCCEEDED
(
hr
))
ok
(
hr
==
S_OK
,
"Open failed: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
dmsynth_sink
,
&
size
);
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
dmsynth_sink
,
&
size
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx
\n
"
,
hr
);
ok
(
size
==
params
.
dwSampleRate
*
params
.
dwAudioChannels
*
4
,
"size: %ld
\n
"
,
size
);
ok
(
size
==
params
.
dwSampleRate
*
params
.
dwAudioChannels
*
4
,
"size: %ld
\n
"
,
size
);
...
...
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