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
ecb38bf1
Commit
ecb38bf1
authored
Sep 10, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Keep the original instrument patch in the entry.
parent
b6f1a1a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
collection.c
dlls/dmusic/collection.c
+4
-6
dmusic.c
dlls/dmusic/tests/dmusic.c
+17
-1
No files found.
dlls/dmusic/collection.c
View file @
ecb38bf1
...
...
@@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
struct
instrument_entry
{
struct
list
entry
;
DWORD
patch
;
DMUS_OBJECTDESC
desc
;
IDirectMusicInstrument
*
instrument
;
};
...
...
@@ -176,15 +177,12 @@ static HRESULT WINAPI collection_GetInstrument(IDirectMusicCollection *iface,
{
struct
collection
*
This
=
impl_from_IDirectMusicCollection
(
iface
);
struct
instrument_entry
*
entry
;
DWORD
inst_patch
;
HRESULT
hr
;
TRACE
(
"(%p, %lu, %p)
\n
"
,
iface
,
patch
,
instrument
);
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
instruments
,
struct
instrument_entry
,
entry
)
{
if
(
FAILED
(
hr
=
IDirectMusicInstrument_GetPatch
(
entry
->
instrument
,
&
inst_patch
)))
return
hr
;
if
(
patch
==
inst_patch
)
if
(
patch
==
entry
->
patch
)
{
*
instrument
=
entry
->
instrument
;
IDirectMusicInstrument_AddRef
(
entry
->
instrument
);
...
...
@@ -202,14 +200,13 @@ static HRESULT WINAPI collection_EnumInstrument(IDirectMusicCollection *iface,
{
struct
collection
*
This
=
impl_from_IDirectMusicCollection
(
iface
);
struct
instrument_entry
*
entry
;
HRESULT
hr
;
TRACE
(
"(%p, %ld, %p, %p, %ld)
\n
"
,
iface
,
index
,
patch
,
name
,
name_length
);
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
instruments
,
struct
instrument_entry
,
entry
)
{
if
(
index
--
)
continue
;
if
(
FAILED
(
hr
=
IDirectMusicInstrument_GetPatch
(
entry
->
instrument
,
patch
)))
return
hr
;
*
patch
=
entry
->
patch
;
if
(
name
)
lstrcpynW
(
name
,
entry
->
desc
.
wszName
,
name_length
);
return
S_OK
;
}
...
...
@@ -239,6 +236,7 @@ static HRESULT parse_lins_list(struct collection *This, IStream *stream, struct
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_INS
):
if
(
!
(
entry
=
malloc
(
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
hr
=
instrument_create_from_chunk
(
stream
,
&
chunk
,
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
);
break
;
...
...
dlls/dmusic/tests/dmusic.c
View file @
ecb38bf1
...
...
@@ -1184,7 +1184,7 @@ static void test_download_instrument(void)
static
const
LARGE_INTEGER
zero
=
{
0
};
IDirectMusicDownloadedInstrument
*
downloaded
;
IDirectMusicCollection
*
collection
;
IDirectMusicInstrument
*
instrument
;
IDirectMusicInstrument
*
instrument
,
*
tmp_instrument
;
IPersistStream
*
persist
;
IDirectMusicPort
*
port
;
IDirectMusic
*
dmusic
;
...
...
@@ -1299,6 +1299,22 @@ static void test_download_instrument(void)
hr
=
IDirectMusicCollection_GetInstrument
(
collection
,
0x1234
,
&
instrument
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicInstrument_GetPatch
(
instrument
,
&
patch
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
patch
==
0x1234
,
"got %#lx
\n
"
,
patch
);
hr
=
IDirectMusicInstrument_SetPatch
(
instrument
,
0x4321
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicInstrument_GetPatch
(
instrument
,
&
patch
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
patch
==
0x4321
,
"got %#lx
\n
"
,
patch
);
hr
=
IDirectMusicCollection_GetInstrument
(
collection
,
0x1234
,
&
tmp_instrument
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
instrument
==
tmp_instrument
,
"got %p
\n
"
,
tmp_instrument
);
hr
=
IDirectMusicInstrument_GetPatch
(
tmp_instrument
,
&
patch
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
patch
==
0x4321
,
"got %#lx
\n
"
,
patch
);
IDirectMusicInstrument_Release
(
tmp_instrument
);
check_interface
(
instrument
,
&
IID_IDirectMusicObject
,
FALSE
);
check_interface
(
instrument
,
&
IID_IDirectMusicDownload
,
FALSE
);
...
...
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