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
6de4ec0c
Commit
6de4ec0c
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: Create one FluidSynth sample per wave.
parent
840923ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
synth.c
dlls/dmsynth/synth.c
+18
-16
No files found.
dlls/dmsynth/synth.c
View file @
6de4ec0c
...
...
@@ -209,6 +209,8 @@ struct wave
LONG
ref
;
UINT
id
;
fluid_sample_t
*
fluid_sample
;
WAVEFORMATEX
format
;
UINT
sample_count
;
short
samples
[];
...
...
@@ -224,7 +226,11 @@ static void wave_addref(struct wave *wave)
static
void
wave_release
(
struct
wave
*
wave
)
{
ULONG
ref
=
InterlockedDecrement
(
&
wave
->
ref
);
if
(
!
ref
)
free
(
wave
);
if
(
!
ref
)
{
delete_fluid_sample
(
wave
->
fluid_sample
);
free
(
wave
);
}
}
struct
articulation
...
...
@@ -825,6 +831,16 @@ static HRESULT synth_download_wave(struct synth *This, DMUS_DOWNLOADINFO *info,
}
}
if
(
!
(
wave
->
fluid_sample
=
new_fluid_sample
()))
{
WARN
(
"Failed to allocate FluidSynth sample
\n
"
);
free
(
wave
);
return
FLUID_FAILED
;
}
fluid_sample_set_sound_data
(
wave
->
fluid_sample
,
wave
->
samples
,
NULL
,
wave
->
sample_count
,
wave
->
format
.
nSamplesPerSec
,
TRUE
);
EnterCriticalSection
(
&
This
->
cs
);
list_add_tail
(
&
This
->
waves
,
&
wave
->
entry
);
LeaveCriticalSection
(
&
This
->
cs
);
...
...
@@ -1747,7 +1763,6 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui
{
struct
instrument
*
instrument
=
fluid_preset_get_data
(
fluid_preset
);
struct
synth
*
synth
=
instrument
->
synth
;
fluid_sample_t
*
fluid_sample
;
fluid_voice_t
*
fluid_voice
;
struct
region
*
region
;
...
...
@@ -1764,19 +1779,9 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui
if
(
key
<
region
->
key_range
.
usLow
||
key
>
region
->
key_range
.
usHigh
)
continue
;
if
(
vel
<
region
->
vel_range
.
usLow
||
vel
>
region
->
vel_range
.
usHigh
)
continue
;
if
(
!
(
fluid_sample
=
new_fluid_sample
()))
{
WARN
(
"Failed to allocate FluidSynth sample
\n
"
);
return
FLUID_FAILED
;
}
fluid_sample_set_sound_data
(
fluid_sample
,
wave
->
samples
,
NULL
,
wave
->
sample_count
,
wave
->
format
.
nSamplesPerSec
,
TRUE
);
if
(
!
(
fluid_voice
=
fluid_synth_alloc_voice
(
synth
->
fluid_synth
,
fluid_sample
,
chan
,
key
,
vel
)))
if
(
!
(
fluid_voice
=
fluid_synth_alloc_voice
(
synth
->
fluid_synth
,
wave
->
fluid_sample
,
chan
,
key
,
vel
)))
{
WARN
(
"Failed to allocate FluidSynth voice
\n
"
);
delete_fluid_sample
(
fluid_sample
);
return
FLUID_FAILED
;
}
...
...
@@ -1792,10 +1797,7 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui
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
);
}
...
...
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