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
a788bf96
Commit
a788bf96
authored
Sep 15, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Parse instrument regions articulation lists.
parent
d32fb707
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
instrument.c
dlls/dmusic/instrument.c
+20
-5
No files found.
dlls/dmusic/instrument.c
View file @
a788bf96
...
...
@@ -36,6 +36,7 @@ C_ASSERT(sizeof(struct articulation) == offsetof(struct articulation, connection
struct
region
{
struct
list
entry
;
struct
list
articulations
;
RGNHEADER
header
;
WAVELINK
wave_link
;
WSMPL
wave_sample
;
...
...
@@ -121,6 +122,13 @@ static ULONG WINAPI instrument_Release(LPDIRECTMUSICINSTRUMENT iface)
LIST_FOR_EACH_ENTRY_SAFE
(
region
,
next_region
,
&
This
->
regions
,
struct
region
,
entry
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
articulation
,
next_articulation
,
&
region
->
articulations
,
struct
articulation
,
entry
)
{
list_remove
(
&
articulation
->
entry
);
free
(
articulation
);
}
list_remove
(
&
region
->
entry
);
free
(
region
);
}
...
...
@@ -221,7 +229,8 @@ static HRESULT instrument_create(struct collection *collection, IDirectMusicInst
return
S_OK
;
}
static
HRESULT
parse_art1_chunk
(
struct
instrument
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
static
HRESULT
parse_art1_chunk
(
struct
instrument
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
chunk
,
struct
list
*
articulations
)
{
struct
articulation
*
articulation
;
CONNECTIONLIST
list
;
...
...
@@ -239,12 +248,13 @@ static HRESULT parse_art1_chunk(struct instrument *This, IStream *stream, struct
size
=
sizeof
(
CONNECTION
)
*
list
.
cConnections
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
articulation
->
connections
,
size
)))
free
(
articulation
);
else
list_add_tail
(
&
This
->
articulations
,
&
articulation
->
entry
);
else
list_add_tail
(
articulations
,
&
articulation
->
entry
);
return
hr
;
}
static
HRESULT
parse_lart_list
(
struct
instrument
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
parent
)
static
HRESULT
parse_lart_list
(
struct
instrument
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
parent
,
struct
list
*
articulations
)
{
struct
chunk_entry
chunk
=
{.
parent
=
parent
};
HRESULT
hr
;
...
...
@@ -254,7 +264,7 @@ static HRESULT parse_lart_list(struct instrument *This, IStream *stream, struct
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
{
case
FOURCC_ART1
:
hr
=
parse_art1_chunk
(
This
,
stream
,
&
chunk
);
hr
=
parse_art1_chunk
(
This
,
stream
,
&
chunk
,
articulations
);
break
;
default:
...
...
@@ -275,6 +285,7 @@ static HRESULT parse_rgn_chunk(struct instrument *This, IStream *stream, struct
HRESULT
hr
;
if
(
!
(
region
=
malloc
(
sizeof
(
*
region
))))
return
E_OUTOFMEMORY
;
list_init
(
&
region
->
articulations
);
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
...
...
@@ -299,6 +310,10 @@ static HRESULT parse_rgn_chunk(struct instrument *This, IStream *stream, struct
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
region
->
wave_link
,
sizeof
(
region
->
wave_link
));
break
;
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_LART
):
hr
=
parse_lart_list
(
This
,
stream
,
&
chunk
,
&
region
->
articulations
);
break
;
default:
FIXME
(
"Ignoring chunk %s %s
\n
"
,
debugstr_fourcc
(
chunk
.
id
),
debugstr_fourcc
(
chunk
.
type
));
break
;
...
...
@@ -365,7 +380,7 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct
break
;
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_LART
):
hr
=
parse_lart_list
(
This
,
stream
,
&
chunk
);
hr
=
parse_lart_list
(
This
,
stream
,
&
chunk
,
&
This
->
articulations
);
break
;
default:
...
...
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