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
467f3a2a
Commit
467f3a2a
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: Simplify and rename channel_block_set to channel_block_init.
parent
0e73870e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
performance.c
dlls/dmime/performance.c
+20
-20
No files found.
dlls/dmime/performance.c
View file @
467f3a2a
...
@@ -257,32 +257,31 @@ static struct channel *performance_get_channel(struct performance *This, DWORD c
...
@@ -257,32 +257,31 @@ static struct channel *performance_get_channel(struct performance *This, DWORD c
return
WINE_RB_ENTRY_VALUE
(
entry
,
struct
channel_block
,
entry
)
->
channels
+
channel_num
%
16
;
return
WINE_RB_ENTRY_VALUE
(
entry
,
struct
channel_block
,
entry
)
->
channels
+
channel_num
%
16
;
}
}
static
struct
channel_block
*
channel_block_set
(
struct
wine_rb_tree
*
tree
,
DWORD
block_num
,
static
HRESULT
channel_block_init
(
struct
performance
*
This
,
DWORD
block_num
,
IDirectMusicPort
*
port
,
DWORD
midi_group
,
BOOL
only_set_new
)
IDirectMusicPort
*
port
,
DWORD
midi_group
)
{
{
struct
channel_block
*
block
;
struct
channel_block
*
block
;
struct
wine_rb_entry
*
entry
;
struct
wine_rb_entry
*
entry
;
unsigned
int
i
;
UINT
i
;
entry
=
wine_rb_get
(
tree
,
&
block_num
);
if
((
entry
=
wine_rb_get
(
&
This
->
channel_blocks
,
&
block_num
)))
if
(
entry
)
{
block
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
channel_block
,
entry
);
block
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
channel_block
,
entry
);
if
(
only_set_new
)
else
return
block
;
{
}
else
{
if
(
!
(
block
=
calloc
(
1
,
sizeof
(
*
block
))))
return
E_OUTOFMEMORY
;
if
(
!
(
block
=
malloc
(
sizeof
(
*
block
))))
return
NULL
;
block
->
block_num
=
block_num
;
block
->
block_num
=
block_num
;
wine_rb_put
(
&
This
->
channel_blocks
,
&
block_num
,
&
block
->
entry
);
}
}
for
(
i
=
0
;
i
<
16
;
++
i
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
block
->
channels
);
++
i
)
block
->
channels
[
i
].
port
=
port
;
{
block
->
channels
[
i
].
midi_group
=
midi_group
;
struct
channel
*
channel
=
block
->
channels
+
i
;
block
->
channels
[
i
].
midi_channel
=
i
;
channel
->
midi_group
=
midi_group
;
channel
->
midi_channel
=
i
;
channel
->
port
=
port
;
}
}
if
(
!
entry
)
wine_rb_put
(
tree
,
&
block
->
block_num
,
&
block
->
entry
);
return
block
;
return
S_OK
;
}
}
static
inline
struct
performance
*
impl_from_IDirectMusicPerformance8
(
IDirectMusicPerformance8
*
iface
)
static
inline
struct
performance
*
impl_from_IDirectMusicPerformance8
(
IDirectMusicPerformance8
*
iface
)
...
@@ -994,7 +993,10 @@ static HRESULT perf_dmport_create(struct performance *perf, DMUS_PORTPARAMS *par
...
@@ -994,7 +993,10 @@ static HRESULT perf_dmport_create(struct performance *perf, DMUS_PORTPARAMS *par
}
}
for
(
i
=
0
;
i
<
params
->
dwChannelGroups
;
i
++
)
for
(
i
=
0
;
i
<
params
->
dwChannelGroups
;
i
++
)
channel_block_set
(
&
perf
->
channel_blocks
,
i
,
port
,
i
+
1
,
FALSE
);
{
if
(
FAILED
(
hr
=
channel_block_init
(
perf
,
i
,
port
,
i
+
1
)))
ERR
(
"Failed to init channel block, hr %#lx
\n
"
,
hr
);
}
performance_update_latency_time
(
perf
,
port
,
NULL
);
performance_update_latency_time
(
perf
,
port
,
NULL
);
return
S_OK
;
return
S_OK
;
...
@@ -1051,9 +1053,7 @@ static HRESULT WINAPI performance_AssignPChannelBlock(IDirectMusicPerformance8 *
...
@@ -1051,9 +1053,7 @@ static HRESULT WINAPI performance_AssignPChannelBlock(IDirectMusicPerformance8 *
if
(
block_num
>
MAXDWORD
/
16
)
return
E_INVALIDARG
;
if
(
block_num
>
MAXDWORD
/
16
)
return
E_INVALIDARG
;
if
(
This
->
audio_paths_enabled
)
return
DMUS_E_AUDIOPATHS_IN_USE
;
if
(
This
->
audio_paths_enabled
)
return
DMUS_E_AUDIOPATHS_IN_USE
;
channel_block_set
(
&
This
->
channel_blocks
,
block_num
,
port
,
midi_group
,
FALSE
);
return
channel_block_init
(
This
,
block_num
,
port
,
midi_group
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
performance_AssignPChannel
(
IDirectMusicPerformance8
*
iface
,
DWORD
channel_num
,
static
HRESULT
WINAPI
performance_AssignPChannel
(
IDirectMusicPerformance8
*
iface
,
DWORD
channel_num
,
...
...
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