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
3fa399b1
Commit
3fa399b1
authored
Sep 12, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Parse instrument name from INFO list.
parent
d30f914d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
18 deletions
+15
-18
collection.c
dlls/dmusic/collection.c
+3
-8
dmusic_private.h
dlls/dmusic/dmusic_private.h
+1
-4
instrument.c
dlls/dmusic/instrument.c
+11
-6
No files found.
dlls/dmusic/collection.c
View file @
3fa399b1
...
@@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
...
@@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
struct
instrument_entry
struct
instrument_entry
{
{
struct
list
entry
;
struct
list
entry
;
DMUS_OBJECTDESC
desc
;
IDirectMusicInstrument
*
instrument
;
IDirectMusicInstrument
*
instrument
;
};
};
...
@@ -156,13 +157,7 @@ static HRESULT WINAPI collection_EnumInstrument(IDirectMusicCollection *iface,
...
@@ -156,13 +157,7 @@ static HRESULT WINAPI collection_EnumInstrument(IDirectMusicCollection *iface,
{
{
if
(
index
--
)
continue
;
if
(
index
--
)
continue
;
if
(
FAILED
(
hr
=
IDirectMusicInstrument_GetPatch
(
entry
->
instrument
,
patch
)))
return
hr
;
if
(
FAILED
(
hr
=
IDirectMusicInstrument_GetPatch
(
entry
->
instrument
,
patch
)))
return
hr
;
if
(
name
)
if
(
name
)
lstrcpynW
(
name
,
entry
->
desc
.
wszName
,
name_length
);
{
struct
instrument
*
instrument
=
impl_from_IDirectMusicInstrument
(
entry
->
instrument
);
DWORD
length
=
min
(
lstrlenW
(
instrument
->
wszName
),
name_length
-
1
);
memcpy
(
name
,
instrument
->
wszName
,
length
*
sizeof
(
WCHAR
));
name
[
length
]
=
'\0'
;
}
return
S_OK
;
return
S_OK
;
}
}
...
@@ -190,7 +185,7 @@ static HRESULT parse_lins_list(struct collection *This, IStream *stream, struct
...
@@ -190,7 +185,7 @@ static HRESULT parse_lins_list(struct collection *This, IStream *stream, struct
{
{
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_INS
):
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_INS
):
if
(
!
(
entry
=
malloc
(
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
if
(
!
(
entry
=
malloc
(
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
hr
=
instrument_create_from_chunk
(
stream
,
&
chunk
,
&
entry
->
instrument
);
hr
=
instrument_create_from_chunk
(
stream
,
&
chunk
,
&
entry
->
desc
,
&
entry
->
instrument
);
if
(
SUCCEEDED
(
hr
))
list_add_tail
(
&
This
->
instruments
,
&
entry
->
entry
);
if
(
SUCCEEDED
(
hr
))
list_add_tail
(
&
This
->
instruments
,
&
entry
->
entry
);
else
free
(
entry
);
else
free
(
entry
);
break
;
break
;
...
...
dlls/dmusic/dmusic_private.h
View file @
3fa399b1
...
@@ -98,7 +98,7 @@ extern HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj,
...
@@ -98,7 +98,7 @@ 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
);
extern
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
extern
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
IDirectMusicInstrument
**
ret_iface
);
DMUS_OBJECTDESC
*
desc
,
IDirectMusicInstrument
**
ret_iface
);
/*****************************************************************************
/*****************************************************************************
* IDirectMusic8Impl implementation structure
* IDirectMusic8Impl implementation structure
...
@@ -173,10 +173,7 @@ struct instrument
...
@@ -173,10 +173,7 @@ struct instrument
IDirectMusicInstrument
IDirectMusicInstrument_iface
;
IDirectMusicInstrument
IDirectMusicInstrument_iface
;
LONG
ref
;
LONG
ref
;
GUID
id
;
INSTHEADER
header
;
INSTHEADER
header
;
WCHAR
wszName
[
DMUS_MAX_NAME
];
/* instrument data */
struct
list
articulations
;
struct
list
articulations
;
struct
list
regions
;
struct
list
regions
;
...
...
dlls/dmusic/instrument.c
View file @
3fa399b1
...
@@ -266,11 +266,16 @@ static HRESULT parse_lrgn_list(struct instrument *This, IStream *stream, struct
...
@@ -266,11 +266,16 @@ static HRESULT parse_lrgn_list(struct instrument *This, IStream *stream, struct
return
hr
;
return
hr
;
}
}
static
HRESULT
parse_ins_chunk
(
struct
instrument
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
parent
)
static
HRESULT
parse_ins_chunk
(
struct
instrument
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
parent
,
DMUS_OBJECTDESC
*
desc
)
{
{
struct
chunk_entry
chunk
=
{.
parent
=
parent
};
struct
chunk_entry
chunk
=
{.
parent
=
parent
};
HRESULT
hr
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
parent
,
desc
,
DMUS_OBJ_NAME_INFO
|
DMUS_OBJ_GUID_DLID
))
||
FAILED
(
hr
=
stream_reset_chunk_data
(
stream
,
parent
)))
return
hr
;
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
{
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
...
@@ -280,7 +285,8 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct
...
@@ -280,7 +285,8 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct
break
;
break
;
case
FOURCC_DLID
:
case
FOURCC_DLID
:
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
This
->
id
,
sizeof
(
This
->
id
));
case
MAKE_IDTYPE
(
FOURCC_LIST
,
DMUS_FOURCC_INFO_LIST
):
/* already parsed by dmobj_parsedescriptor */
break
;
break
;
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_LRGN
):
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_LRGN
):
...
@@ -303,7 +309,7 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct
...
@@ -303,7 +309,7 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct
}
}
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
IDirectMusicInstrument
**
ret_iface
)
DMUS_OBJECTDESC
*
desc
,
IDirectMusicInstrument
**
ret_iface
)
{
{
IDirectMusicInstrument
*
iface
;
IDirectMusicInstrument
*
iface
;
struct
instrument
*
This
;
struct
instrument
*
This
;
...
@@ -314,7 +320,7 @@ HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent
...
@@ -314,7 +320,7 @@ HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent
if
(
FAILED
(
hr
=
instrument_create
(
&
iface
)))
return
hr
;
if
(
FAILED
(
hr
=
instrument_create
(
&
iface
)))
return
hr
;
This
=
impl_from_IDirectMusicInstrument
(
iface
);
This
=
impl_from_IDirectMusicInstrument
(
iface
);
if
(
FAILED
(
hr
=
parse_ins_chunk
(
This
,
stream
,
parent
)))
if
(
FAILED
(
hr
=
parse_ins_chunk
(
This
,
stream
,
parent
,
desc
)))
{
{
IDirectMusicInstrument_Release
(
iface
);
IDirectMusicInstrument_Release
(
iface
);
return
DMUS_E_UNSUPPORTED_STREAM
;
return
DMUS_E_UNSUPPORTED_STREAM
;
...
@@ -323,14 +329,13 @@ HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent
...
@@ -323,14 +329,13 @@ HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent
if
(
TRACE_ON
(
dmusic
))
if
(
TRACE_ON
(
dmusic
))
{
{
TRACE
(
"Created DirectMusicInstrument (%p) ***
\n
"
,
This
);
TRACE
(
"Created DirectMusicInstrument (%p) ***
\n
"
,
This
);
if
(
!
IsEqualGUID
(
&
This
->
id
,
&
GUID_NULL
))
TRACE
(
" - GUID = %s
\n
"
,
debugstr_dmguid
(
&
This
->
id
));
TRACE
(
" - Instrument header:
\n
"
);
TRACE
(
" - Instrument header:
\n
"
);
TRACE
(
" - cRegions: %ld
\n
"
,
This
->
header
.
cRegions
);
TRACE
(
" - cRegions: %ld
\n
"
,
This
->
header
.
cRegions
);
TRACE
(
" - Locale:
\n
"
);
TRACE
(
" - Locale:
\n
"
);
TRACE
(
" - ulBank: %ld
\n
"
,
This
->
header
.
Locale
.
ulBank
);
TRACE
(
" - ulBank: %ld
\n
"
,
This
->
header
.
Locale
.
ulBank
);
TRACE
(
" - ulInstrument: %ld
\n
"
,
This
->
header
.
Locale
.
ulInstrument
);
TRACE
(
" - ulInstrument: %ld
\n
"
,
This
->
header
.
Locale
.
ulInstrument
);
TRACE
(
" => dwPatch: %ld
\n
"
,
MIDILOCALE2Patch
(
&
This
->
header
.
Locale
));
TRACE
(
" => dwPatch: %ld
\n
"
,
MIDILOCALE2Patch
(
&
This
->
header
.
Locale
));
if
(
desc
->
dwValidData
&
DMUS_OBJ_OBJECT
)
TRACE
(
" - guid: %s
\n
"
,
debugstr_dmguid
(
&
desc
->
guidObject
));
}
}
*
ret_iface
=
iface
;
*
ret_iface
=
iface
;
...
...
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