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
051418c0
Commit
051418c0
authored
Oct 26, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Send MIDI_SYSTEM_RESET message on performance reset.
parent
2414bb40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
29 deletions
+43
-29
performance.c
dlls/dmime/performance.c
+42
-29
dmusic_midi.h
dlls/dmusic/dmusic_midi.h
+1
-0
No files found.
dlls/dmime/performance.c
View file @
051418c0
...
...
@@ -472,6 +472,35 @@ static HRESULT performance_init_dmusic(struct performance *This, IDirectSound *d
return
hr
;
}
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_Init
(
IDirectMusicPerformance8
*
iface
,
IDirectMusic
**
dmusic
,
IDirectSound
*
dsound
,
HWND
hwnd
)
{
...
...
@@ -631,6 +660,7 @@ static HRESULT WINAPI performance_Stop(IDirectMusicPerformance8 *iface, IDirectM
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
struct
list
states
=
LIST_INIT
(
states
);
struct
state_entry
*
entry
,
*
next
;
DMUS_PMSG
msg
=
{.
mtTime
=
-
1
};
HRESULT
hr
;
FIXME
(
"(%p, %p, %p, %ld, %ld): semi-stub
\n
"
,
This
,
segment
,
state
,
music_time
,
flags
);
...
...
@@ -670,6 +700,13 @@ static HRESULT WINAPI performance_Stop(IDirectMusicPerformance8 *iface, IDirectM
free
(
entry
);
}
if
(
!
state
&&
!
segment
)
{
if
(
FAILED
(
hr
=
performance_send_midi_pmsg
(
This
,
&
msg
,
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_IMMEDIATE
,
MIDI_SYSTEM_RESET
,
0
,
0
)))
ERR
(
"Failed to send MIDI_SYSTEM_RESET message, hr %#lx
\n
"
,
hr
);
}
LeaveCriticalSection
(
&
This
->
safe
);
return
S_OK
;
...
...
@@ -1368,6 +1405,7 @@ static HRESULT WINAPI performance_CloseDown(IDirectMusicPerformance8 *iface)
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
struct
list
states
=
LIST_INIT
(
states
);
struct
state_entry
*
entry
,
*
next
;
DMUS_PMSG
msg
=
{.
mtTime
=
-
1
};
HANDLE
message_thread
;
HRESULT
hr
;
...
...
@@ -1400,6 +1438,10 @@ static HRESULT WINAPI performance_CloseDown(IDirectMusicPerformance8 *iface)
free
(
entry
);
}
if
(
FAILED
(
hr
=
performance_send_midi_pmsg
(
This
,
&
msg
,
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_IMMEDIATE
,
MIDI_SYSTEM_RESET
,
0
,
0
)))
ERR
(
"Failed to send MIDI_SYSTEM_RESET message, hr %#lx
\n
"
,
hr
);
performance_set_primary_segment
(
This
,
NULL
);
performance_set_control_segment
(
This
,
NULL
);
...
...
@@ -1953,35 +1995,6 @@ 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
)
{
...
...
dlls/dmusic/dmusic_midi.h
View file @
051418c0
...
...
@@ -31,6 +31,7 @@ enum midi_message
MIDI_PROGRAM_CHANGE
=
0xc0
,
MIDI_CHANNEL_PRESSURE
=
0xd0
,
MIDI_PITCH_BEND_CHANGE
=
0xe0
,
MIDI_SYSTEM_RESET
=
0xff
,
};
enum
midi_control
...
...
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