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
086e114f
Commit
086e114f
authored
Sep 21, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Implement SoundFont2 instrument parsing.
parent
215a55d6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
254 additions
and
1 deletion
+254
-1
collection.c
dlls/dmusic/collection.c
+11
-0
dmusic_private.h
dlls/dmusic/dmusic_private.h
+2
-0
instrument.c
dlls/dmusic/instrument.c
+239
-0
dmusic.c
dlls/dmusic/tests/dmusic.c
+2
-1
No files found.
dlls/dmusic/collection.c
View file @
086e114f
...
@@ -580,6 +580,17 @@ static HRESULT parse_sfbk_chunk(struct collection *This, IStream *stream, struct
...
@@ -580,6 +580,17 @@ static HRESULT parse_sfbk_chunk(struct collection *This, IStream *stream, struct
}
}
}
}
for
(
i
=
0
;
SUCCEEDED
(
hr
)
&&
i
<
soundfont
.
preset_count
;
i
++
)
{
struct
instrument_entry
*
entry
;
if
(
!
(
entry
=
malloc
(
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
hr
=
instrument_create_from_soundfont
(
&
soundfont
,
i
,
This
,
&
entry
->
desc
,
&
entry
->
instrument
);
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectMusicInstrument_GetPatch
(
entry
->
instrument
,
&
entry
->
patch
);
if
(
SUCCEEDED
(
hr
))
list_add_tail
(
&
This
->
instruments
,
&
entry
->
entry
);
else
free
(
entry
);
}
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
UINT
size
=
offsetof
(
struct
pool
,
cues
[
soundfont
.
sample_count
]);
UINT
size
=
offsetof
(
struct
pool
,
cues
[
soundfont
.
sample_count
]);
...
...
dlls/dmusic/dmusic_private.h
View file @
086e114f
...
@@ -92,6 +92,8 @@ extern HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj,
...
@@ -92,6 +92,8 @@ extern HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj,
extern
HRESULT
download_create
(
DWORD
size
,
IDirectMusicDownload
**
ret_iface
);
extern
HRESULT
download_create
(
DWORD
size
,
IDirectMusicDownload
**
ret_iface
);
struct
soundfont
;
struct
soundfont
;
extern
HRESULT
instrument_create_from_soundfont
(
struct
soundfont
*
soundfont
,
UINT
index
,
struct
collection
*
collection
,
DMUS_OBJECTDESC
*
desc
,
IDirectMusicInstrument
**
ret_iface
);
extern
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
extern
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
struct
collection
*
collection
,
DMUS_OBJECTDESC
*
desc
,
IDirectMusicInstrument
**
ret_iface
);
struct
collection
*
collection
,
DMUS_OBJECTDESC
*
desc
,
IDirectMusicInstrument
**
ret_iface
);
extern
HRESULT
instrument_download_to_port
(
IDirectMusicInstrument
*
iface
,
IDirectMusicPortDownload
*
port
,
extern
HRESULT
instrument_download_to_port
(
IDirectMusicInstrument
*
iface
,
IDirectMusicPortDownload
*
port
,
...
...
dlls/dmusic/instrument.c
View file @
086e114f
This diff is collapsed.
Click to expand it.
dlls/dmusic/tests/dmusic.c
View file @
086e114f
...
@@ -1619,7 +1619,7 @@ static void test_default_gm_collection(void)
...
@@ -1619,7 +1619,7 @@ static void test_default_gm_collection(void)
}
}
if
(
hr
==
S_FALSE
)
i
--
;
if
(
hr
==
S_FALSE
)
i
--
;
ok
(
hr
==
S_FALSE
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
i
>
0
,
"got %lu
\n
"
,
i
);
ok
(
i
>
0
,
"got %lu
\n
"
,
i
);
todo_wine
ok
(
i
==
ARRAY_SIZE
(
expected
),
"got %lu
\n
"
,
i
);
todo_wine
ok
(
i
==
ARRAY_SIZE
(
expected
),
"got %lu
\n
"
,
i
);
qsort
(
results
,
i
,
sizeof
(
*
results
),
result_cmp
);
qsort
(
results
,
i
,
sizeof
(
*
results
),
result_cmp
);
...
@@ -1628,6 +1628,7 @@ static void test_default_gm_collection(void)
...
@@ -1628,6 +1628,7 @@ static void test_default_gm_collection(void)
{
{
winetest_push_context
(
"%lu"
,
i
);
winetest_push_context
(
"%lu"
,
i
);
trace
(
"got %#lx %s
\n
"
,
results
[
i
].
patch
,
debugstr_w
(
results
[
i
].
name
));
trace
(
"got %#lx %s
\n
"
,
results
[
i
].
patch
,
debugstr_w
(
results
[
i
].
name
));
todo_wine_if
(
expected
[
i
].
patch
>=
128
)
ok
(
results
[
i
].
patch
==
expected
[
i
].
patch
,
"got %#lx
\n
"
,
results
[
i
].
patch
);
ok
(
results
[
i
].
patch
==
expected
[
i
].
patch
,
"got %#lx
\n
"
,
results
[
i
].
patch
);
/* system soundfont names are not very predictable, let's not check them */
/* system soundfont names are not very predictable, let's not check them */
winetest_pop_context
();
winetest_pop_context
();
...
...
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