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
a303bb39
Commit
a303bb39
authored
Nov 06, 2023
by
Anton Baskanov
Committed by
Alexandre Julliard
Nov 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth: Keep track of voice/wave mapping.
parent
ad6e87c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
synth.c
dlls/dmsynth/synth.c
+43
-0
No files found.
dlls/dmsynth/synth.c
View file @
a303bb39
...
...
@@ -320,6 +320,13 @@ struct event
BYTE
midi
[
3
];
};
struct
voice
{
struct
list
entry
;
fluid_voice_t
*
fluid_voice
;
struct
wave
*
wave
;
};
struct
synth
{
IDirectMusicSynth8
IDirectMusicSynth8_iface
;
...
...
@@ -336,6 +343,7 @@ struct synth
struct
list
instruments
;
struct
list
waves
;
struct
list
events
;
struct
list
voices
;
fluid_settings_t
*
fluid_settings
;
fluid_sfont_t
*
fluid_sfont
;
...
...
@@ -584,6 +592,8 @@ static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *par
static
HRESULT
WINAPI
synth_Close
(
IDirectMusicSynth8
*
iface
)
{
struct
synth
*
This
=
impl_from_IDirectMusicSynth8
(
iface
);
struct
voice
*
voice
;
void
*
next
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -597,6 +607,14 @@ static HRESULT WINAPI synth_Close(IDirectMusicSynth8 *iface)
fluid_synth_remove_sfont
(
This
->
fluid_synth
,
This
->
fluid_sfont
);
delete_fluid_synth
(
This
->
fluid_synth
);
This
->
fluid_synth
=
NULL
;
LIST_FOR_EACH_ENTRY_SAFE
(
voice
,
next
,
&
This
->
voices
,
struct
voice
,
entry
)
{
list_remove
(
&
voice
->
entry
);
wave_release
(
voice
->
wave
);
free
(
voice
);
}
This
->
open
=
FALSE
;
LeaveCriticalSection
(
&
This
->
cs
);
...
...
@@ -1742,6 +1760,7 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui
{
struct
articulation
*
articulation
;
struct
wave
*
wave
=
region
->
wave
;
struct
voice
*
voice
;
if
(
key
<
region
->
key_range
.
usLow
||
key
>
region
->
key_range
.
usHigh
)
continue
;
if
(
vel
<
region
->
vel_range
.
usLow
||
vel
>
region
->
vel_range
.
usHigh
)
continue
;
...
...
@@ -1763,6 +1782,29 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui
return
FLUID_FAILED
;
}
LIST_FOR_EACH_ENTRY
(
voice
,
&
synth
->
voices
,
struct
voice
,
entry
)
{
if
(
voice
->
fluid_voice
==
fluid_voice
)
{
wave_release
(
voice
->
wave
);
break
;
}
}
if
(
&
voice
->
entry
==
&
synth
->
voices
)
{
if
(
!
(
voice
=
calloc
(
1
,
sizeof
(
struct
voice
))))
{
delete_fluid_sample
(
fluid_sample
);
return
FLUID_FAILED
;
}
voice
->
fluid_voice
=
fluid_voice
;
list_add_tail
(
&
synth
->
voices
,
&
voice
->
entry
);
}
voice
->
wave
=
wave
;
wave_addref
(
voice
->
wave
);
set_default_voice_connections
(
fluid_voice
);
if
(
region
->
wave_sample
.
cSampleLoops
)
{
...
...
@@ -1885,6 +1927,7 @@ HRESULT synth_create(IUnknown **ret_iface)
list_init
(
&
obj
->
instruments
);
list_init
(
&
obj
->
waves
);
list_init
(
&
obj
->
events
);
list_init
(
&
obj
->
voices
);
if
(
!
(
obj
->
fluid_settings
=
new_fluid_settings
()))
goto
failed
;
if
(
!
(
obj
->
fluid_sfont
=
new_fluid_sfont
(
synth_sfont_get_name
,
synth_sfont_get_preset
,
...
...
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