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
79a98eb7
Commit
79a98eb7
authored
Oct 26, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Use a dedicated struct channel to hold performance channels.
parent
53035c69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
28 deletions
+29
-28
performance.c
dlls/dmime/performance.c
+29
-28
No files found.
dlls/dmime/performance.c
View file @
79a98eb7
...
...
@@ -32,14 +32,17 @@ enum dmus_internal_message_type
DMUS_PMSGT_INTERNAL_SEGMENT_TICK
,
};
struct
channel
{
DWORD
midi_group
;
DWORD
midi_channel
;
IDirectMusicPort
*
port
;
};
struct
channel_block
{
DWORD
block_num
;
/* Block 0 is PChannels 0-15, Block 1 is PChannels 16-31, etc */
struct
{
DWORD
channel
;
/* MIDI channel */
DWORD
group
;
/* MIDI group */
IDirectMusicPort
*
port
;
}
pchannel
[
16
];
struct
channel
channels
[
16
];
struct
wine_rb_entry
entry
;
};
...
...
@@ -247,7 +250,7 @@ static void channel_block_free(struct wine_rb_entry *entry, void *context)
}
static
struct
channel_block
*
channel_block_set
(
struct
wine_rb_tree
*
tree
,
DWORD
block_num
,
IDirectMusicPort
*
port
,
DWORD
group
,
BOOL
only_set_new
)
IDirectMusicPort
*
port
,
DWORD
midi_
group
,
BOOL
only_set_new
)
{
struct
channel_block
*
block
;
struct
wine_rb_entry
*
entry
;
...
...
@@ -264,9 +267,9 @@ static struct channel_block *channel_block_set(struct wine_rb_tree *tree, DWORD
}
for
(
i
=
0
;
i
<
16
;
++
i
)
{
block
->
pchannel
[
i
].
port
=
port
;
block
->
pchannel
[
i
].
group
=
group
;
block
->
pchannel
[
i
].
channel
=
i
;
block
->
channels
[
i
].
port
=
port
;
block
->
channels
[
i
].
midi_group
=
midi_
group
;
block
->
channels
[
i
].
midi_
channel
=
i
;
}
if
(
!
entry
)
wine_rb_put
(
tree
,
&
block
->
block_num
,
&
block
->
entry
);
...
...
@@ -1030,51 +1033,51 @@ static HRESULT WINAPI performance_RemovePort(IDirectMusicPerformance8 *iface, ID
}
static
HRESULT
WINAPI
performance_AssignPChannelBlock
(
IDirectMusicPerformance8
*
iface
,
DWORD
block_num
,
IDirectMusicPort
*
port
,
DWORD
group
)
DWORD
block_num
,
IDirectMusicPort
*
port
,
DWORD
midi_
group
)
{
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
FIXME
(
"(%p, %ld, %p, %ld): semi-stub
\n
"
,
This
,
block_num
,
port
,
group
);
FIXME
(
"(%p, %ld, %p, %ld): semi-stub
\n
"
,
This
,
block_num
,
port
,
midi_
group
);
if
(
!
port
)
return
E_POINTER
;
if
(
block_num
>
MAXDWORD
/
16
)
return
E_INVALIDARG
;
if
(
This
->
audio_paths_enabled
)
return
DMUS_E_AUDIOPATHS_IN_USE
;
channel_block_set
(
&
This
->
channel_blocks
,
block_num
,
port
,
group
,
FALSE
);
channel_block_set
(
&
This
->
channel_blocks
,
block_num
,
port
,
midi_
group
,
FALSE
);
return
S_OK
;
}
static
HRESULT
WINAPI
performance_AssignPChannel
(
IDirectMusicPerformance8
*
iface
,
DWORD
pchannel
,
IDirectMusicPort
*
port
,
DWORD
group
,
DWORD
channel
)
static
HRESULT
WINAPI
performance_AssignPChannel
(
IDirectMusicPerformance8
*
iface
,
DWORD
channel_num
,
IDirectMusicPort
*
port
,
DWORD
midi_group
,
DWORD
midi_
channel
)
{
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
struct
channel_block
*
block
;
FIXME
(
"(%p)->(%ld, %p, %ld, %ld) semi-stub
\n
"
,
This
,
pchannel
,
port
,
group
,
channel
);
FIXME
(
"(%p)->(%ld, %p, %ld, %ld) semi-stub
\n
"
,
This
,
channel_num
,
port
,
midi_group
,
midi_
channel
);
if
(
!
port
)
return
E_POINTER
;
if
(
This
->
audio_paths_enabled
)
return
DMUS_E_AUDIOPATHS_IN_USE
;
block
=
channel_block_set
(
&
This
->
channel_blocks
,
pchannel
/
16
,
port
,
0
,
TRUE
);
block
=
channel_block_set
(
&
This
->
channel_blocks
,
channel_num
/
16
,
port
,
0
,
TRUE
);
if
(
block
)
{
block
->
pchannel
[
pchannel
%
16
].
group
=
group
;
block
->
pchannel
[
pchannel
%
16
].
channel
=
channel
;
block
->
channels
[
channel_num
%
16
].
midi_group
=
midi_
group
;
block
->
channels
[
channel_num
%
16
].
midi_channel
=
midi_
channel
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
performance_PChannelInfo
(
IDirectMusicPerformance8
*
iface
,
DWORD
pchannel
,
IDirectMusicPort
**
port
,
DWORD
*
group
,
DWORD
*
channel
)
static
HRESULT
WINAPI
performance_PChannelInfo
(
IDirectMusicPerformance8
*
iface
,
DWORD
channel_num
,
IDirectMusicPort
**
port
,
DWORD
*
midi_group
,
DWORD
*
midi_
channel
)
{
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
struct
channel_block
*
block
;
struct
wine_rb_entry
*
entry
;
DWORD
block_num
=
pchannel
/
16
;
unsigned
int
index
=
pchannel
%
16
;
DWORD
block_num
=
channel_num
/
16
;
unsigned
int
index
=
channel_num
%
16
;
TRACE
(
"(%p)->(%ld, %p, %p, %p)
\n
"
,
This
,
pchannel
,
port
,
group
,
channel
);
TRACE
(
"(%p)->(%ld, %p, %p, %p)
\n
"
,
This
,
channel_num
,
port
,
midi_group
,
midi_
channel
);
entry
=
wine_rb_get
(
&
This
->
channel_blocks
,
&
block_num
);
if
(
!
entry
)
...
...
@@ -1082,13 +1085,11 @@ static HRESULT WINAPI performance_PChannelInfo(IDirectMusicPerformance8 *iface,
block
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
channel_block
,
entry
);
if
(
port
)
{
*
port
=
block
->
pchannel
[
index
].
port
;
*
port
=
block
->
channels
[
index
].
port
;
IDirectMusicPort_AddRef
(
*
port
);
}
if
(
group
)
*
group
=
block
->
pchannel
[
index
].
group
;
if
(
channel
)
*
channel
=
block
->
pchannel
[
index
].
channel
;
if
(
midi_group
)
*
midi_group
=
block
->
channels
[
index
].
midi_group
;
if
(
midi_channel
)
*
midi_channel
=
block
->
channels
[
index
].
midi_channel
;
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