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
07aa6b5d
Commit
07aa6b5d
authored
Sep 04, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth: Play some MIDI events in IDirectMusicSynth_Render.
parent
d3b5c6bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
synth.c
dlls/dmsynth/synth.c
+44
-1
No files found.
dlls/dmsynth/synth.c
View file @
07aa6b5d
...
...
@@ -979,9 +979,52 @@ static HRESULT WINAPI synth_Render(IDirectMusicSynth8 *iface, short *buffer,
DWORD
length
,
LONGLONG
position
)
{
struct
synth
*
This
=
impl_from_IDirectMusicSynth8
(
iface
);
struct
event
*
event
,
*
next
;
FIXME
(
"(%p, %p, %ld, 0x%s): stub
\n
"
,
This
,
buffer
,
length
,
wine_dbgstr_longlong
(
position
)
);
TRACE
(
"(%p, %p, %ld, %I64d)
\n
"
,
This
,
buffer
,
length
,
position
);
EnterCriticalSection
(
&
This
->
cs
);
LIST_FOR_EACH_ENTRY_SAFE
(
event
,
next
,
&
This
->
events
,
struct
event
,
entry
)
{
BYTE
status
=
event
->
midi
[
0
]
&
0xf0
,
chan
=
event
->
midi
[
0
]
&
0x0f
;
LONGLONG
offset
=
event
->
position
-
position
;
if
(
offset
>=
length
)
break
;
if
(
offset
>
0
)
{
fluid_synth_write_s16
(
This
->
fluid_synth
,
offset
,
buffer
,
0
,
2
,
buffer
,
1
,
2
);
buffer
+=
offset
*
2
;
position
+=
offset
;
length
-=
offset
;
}
TRACE
(
"status %#x chan %#x midi %#x %#x
\n
"
,
status
,
chan
,
event
->
midi
[
1
],
event
->
midi
[
2
]);
switch
(
status
)
{
case
0x80
:
fluid_synth_noteoff
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
]);
break
;
case
0x90
:
fluid_synth_noteon
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
],
event
->
midi
[
2
]);
break
;
case
0xb0
:
fluid_synth_cc
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
],
event
->
midi
[
2
]);
break
;
case
0xc0
:
fluid_synth_program_change
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
]);
break
;
default:
FIXME
(
"MIDI event not implemented: %#x %#x %#x
\n
"
,
event
->
midi
[
0
],
event
->
midi
[
1
],
event
->
midi
[
2
]);
break
;
}
list_remove
(
&
event
->
entry
);
free
(
event
);
}
LeaveCriticalSection
(
&
This
->
cs
);
if
(
length
)
fluid_synth_write_s16
(
This
->
fluid_synth
,
length
,
buffer
,
0
,
2
,
buffer
,
1
,
2
);
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