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
f74fe2e2
Commit
f74fe2e2
authored
Sep 21, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Translate DMUS_PMSGT_NOTE to DMUS_PMSGT_MIDI messages.
parent
a4b006e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
performance.c
dlls/dmime/performance.c
+45
-0
No files found.
dlls/dmime/performance.c
View file @
f74fe2e2
...
...
@@ -1626,6 +1626,35 @@ static HRESULT WINAPI performance_tool_GetMediaTypes(IDirectMusicTool *iface, DW
return
E_NOTIMPL
;
}
static
HRESULT
performance_send_midi_pmsg
(
struct
performance
*
This
,
DMUS_PMSG
*
msg
,
UINT
flags
,
BYTE
status
,
BYTE
byte1
,
BYTE
byte2
)
{
IDirectMusicPerformance8
*
performance
=
&
This
->
IDirectMusicPerformance8_iface
;
DMUS_MIDI_PMSG
*
midi
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IDirectMusicPerformance8_AllocPMsg
(
performance
,
sizeof
(
*
midi
),
(
DMUS_PMSG
**
)
&
midi
)))
return
hr
;
if
(
flags
&
DMUS_PMSGF_REFTIME
)
midi
->
rtTime
=
msg
->
rtTime
;
if
(
flags
&
DMUS_PMSGF_MUSICTIME
)
midi
->
mtTime
=
msg
->
mtTime
;
midi
->
dwFlags
=
flags
;
midi
->
dwPChannel
=
msg
->
dwPChannel
;
midi
->
dwVirtualTrackID
=
msg
->
dwVirtualTrackID
;
midi
->
dwVoiceID
=
msg
->
dwVoiceID
;
midi
->
dwGroupID
=
msg
->
dwGroupID
;
midi
->
dwType
=
DMUS_PMSGT_MIDI
;
midi
->
bStatus
=
status
;
midi
->
bByte1
=
byte1
;
midi
->
bByte2
=
byte2
;
if
(
FAILED
(
hr
=
IDirectMusicPerformance8_SendPMsg
(
performance
,
(
DMUS_PMSG
*
)
midi
)))
IDirectMusicPerformance8_FreePMsg
(
performance
,
(
DMUS_PMSG
*
)
midi
);
return
hr
;
}
static
HRESULT
WINAPI
performance_tool_ProcessPMsg
(
IDirectMusicTool
*
iface
,
IDirectMusicPerformance
*
performance
,
DMUS_PMSG
*
msg
)
{
...
...
@@ -1670,6 +1699,22 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
break
;
}
case
DMUS_PMSGT_NOTE
:
{
DMUS_NOTE_PMSG
*
note
=
(
DMUS_NOTE_PMSG
*
)
msg
;
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
)))
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
)))
WARN
(
"Failed to translate message to MIDI, hr %#lx
\n
"
,
hr
);
break
;
}
case
DMUS_PMSGT_NOTIFICATION
:
{
DMUS_NOTIFICATION_PMSG
*
notif
=
(
DMUS_NOTIFICATION_PMSG
*
)
msg
;
...
...
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