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
2c4fc0ad
Commit
2c4fc0ad
authored
Oct 16, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Use a dmusic_midi.h header for MIDI messages.
parent
65e38813
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
9 deletions
+52
-9
performance.c
dlls/dmime/performance.c
+6
-5
Makefile.in
dlls/dmsynth/Makefile.in
+1
-0
synth.c
dlls/dmsynth/synth.c
+5
-4
dmusic_midi.h
dlls/dmusic/dmusic_midi.h
+40
-0
No files found.
dlls/dmime/performance.c
View file @
2c4fc0ad
...
...
@@ -19,6 +19,7 @@
*/
#include "dmime_private.h"
#include "dmusic_midi.h"
#include "wine/rbtree.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
...
...
@@ -1702,12 +1703,12 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
msg
->
mtTime
+=
note
->
nOffset
;
if
(
FAILED
(
hr
=
performance_send_midi_pmsg
(
This
,
msg
,
DMUS_PMSGF_REFTIME
|
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_IMMEDIATE
,
0x90
/* NOTE_ON */
,
note
->
bMidiValue
,
note
->
bVelocity
)))
MIDI_NOTE_ON
,
note
->
bMidiValue
,
note
->
bVelocity
)))
WARN
(
"Failed to translate message to MIDI, hr %#lx
\n
"
,
hr
);
msg
->
mtTime
+=
note
->
mtDuration
;
if
(
FAILED
(
hr
=
performance_send_midi_pmsg
(
This
,
msg
,
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_QUEUE
,
0x80
/* NOTE_OFF */
,
note
->
bMidiValue
,
0
)))
MIDI_NOTE_OFF
,
note
->
bMidiValue
,
0
)))
WARN
(
"Failed to translate message to MIDI, hr %#lx
\n
"
,
hr
);
break
;
...
...
@@ -1718,15 +1719,15 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
DMUS_PATCH_PMSG
*
patch
=
(
DMUS_PATCH_PMSG
*
)
msg
;
if
(
FAILED
(
hr
=
performance_send_midi_pmsg
(
This
,
msg
,
DMUS_PMSGF_REFTIME
|
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_IMMEDIATE
,
0xb0
/* Control Change */
,
0x00
/* CC: Bank MSB */
,
patch
->
byMSB
)))
MIDI_CONTROL_CHANGE
,
MIDI_CC_BANK_MSB
,
patch
->
byMSB
)))
WARN
(
"Failed to translate message to MIDI, hr %#lx
\n
"
,
hr
);
if
(
FAILED
(
hr
=
performance_send_midi_pmsg
(
This
,
msg
,
DMUS_PMSGF_REFTIME
|
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_IMMEDIATE
,
0xb0
/* Control Change */
,
0x20
/* CC: Bank LSB */
,
patch
->
byLSB
)))
MIDI_CONTROL_CHANGE
,
MIDI_CC_BANK_LSB
,
patch
->
byLSB
)))
WARN
(
"Failed to translate message to MIDI, hr %#lx
\n
"
,
hr
);
if
(
FAILED
(
hr
=
performance_send_midi_pmsg
(
This
,
msg
,
DMUS_PMSGF_REFTIME
|
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_IMMEDIATE
,
0xc0
/* Program Change */
,
patch
->
byInstrument
,
0
)))
MIDI_PROGRAM_CHANGE
,
patch
->
byInstrument
,
0
)))
WARN
(
"Failed to translate message to MIDI, hr %#lx
\n
"
,
hr
);
break
;
...
...
dlls/dmsynth/Makefile.in
View file @
2c4fc0ad
MODULE
=
dmsynth.dll
IMPORTS
=
$(FLUIDSYNTH_PE_LIBS)
dxguid uuid ole32 advapi32 user32
EXTRAINCL
=
$(FLUIDSYNTH_PE_CFLAGS)
PARENTSRC
=
../dmusic
C_SRCS
=
\
dmsynth_main.c
\
...
...
dlls/dmsynth/synth.c
View file @
2c4fc0ad
...
...
@@ -25,6 +25,7 @@
#include "dmksctrl.h"
#include "dmsynth_private.h"
#include "dmusic_midi.h"
#include "dls2.h"
#include <fluidsynth.h>
...
...
@@ -1063,16 +1064,16 @@ static HRESULT WINAPI synth_Render(IDirectMusicSynth8 *iface, short *buffer,
switch
(
status
)
{
case
0x80
:
case
MIDI_NOTE_OFF
:
fluid_synth_noteoff
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
]);
break
;
case
0x90
:
case
MIDI_NOTE_ON
:
fluid_synth_noteon
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
],
event
->
midi
[
2
]);
break
;
case
0xb0
:
case
MIDI_CONTROL_CHANGE
:
fluid_synth_cc
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
],
event
->
midi
[
2
]);
break
;
case
0xc0
:
case
MIDI_PROGRAM_CHANGE
:
fluid_synth_program_change
(
This
->
fluid_synth
,
chan
,
event
->
midi
[
1
]);
break
;
default:
...
...
dlls/dmusic/dmusic_midi.h
0 → 100644
View file @
2c4fc0ad
/*
* Copyright 2023 Rémi Bernon for CodeWeavers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "stdarg.h"
#include "stddef.h"
#include "windef.h"
#include "winbase.h"
enum
midi_message
{
MIDI_NOTE_OFF
=
0x80
,
MIDI_NOTE_ON
=
0x90
,
MIDI_KEY_PRESSURE
=
0xa0
,
MIDI_CONTROL_CHANGE
=
0xb0
,
MIDI_PROGRAM_CHANGE
=
0xc0
,
MIDI_CHANNEL_PRESSURE
=
0xd0
,
MIDI_PITCH_BEND_CHANGE
=
0xe0
,
};
enum
midi_control
{
MIDI_CC_BANK_MSB
=
0x00
,
MIDI_CC_BANK_LSB
=
0x20
,
};
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