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
94c1dd8a
Commit
94c1dd8a
authored
Sep 10, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmband: Rewrite band IPersistStream_Load.
parent
b2f1e978
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
52 deletions
+49
-52
band.c
dlls/dmband/band.c
+49
-52
No files found.
dlls/dmband/band.c
View file @
94c1dd8a
...
...
@@ -21,7 +21,24 @@
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmband
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
void
dump_DMUS_IO_INSTRUMENT
(
DMUS_IO_INSTRUMENT
*
inst
)
{
TRACE
(
"DMUS_IO_INSTRUMENT: %p
\n
"
,
inst
);
TRACE
(
" - dwPatch: %lu
\n
"
,
inst
->
dwPatch
);
TRACE
(
" - dwAssignPatch: %lu
\n
"
,
inst
->
dwAssignPatch
);
TRACE
(
" - dwNoteRanges[0]: %lu
\n
"
,
inst
->
dwNoteRanges
[
0
]);
TRACE
(
" - dwNoteRanges[1]: %lu
\n
"
,
inst
->
dwNoteRanges
[
1
]);
TRACE
(
" - dwNoteRanges[2]: %lu
\n
"
,
inst
->
dwNoteRanges
[
2
]);
TRACE
(
" - dwNoteRanges[3]: %lu
\n
"
,
inst
->
dwNoteRanges
[
3
]);
TRACE
(
" - dwPChannel: %lu
\n
"
,
inst
->
dwPChannel
);
TRACE
(
" - dwFlags: %lx
\n
"
,
inst
->
dwFlags
);
TRACE
(
" - bPan: %u
\n
"
,
inst
->
bPan
);
TRACE
(
" - bVolume: %u
\n
"
,
inst
->
bVolume
);
TRACE
(
" - nTranspose: %d
\n
"
,
inst
->
nTranspose
);
TRACE
(
" - dwChannelPriority: %lu
\n
"
,
inst
->
dwChannelPriority
);
TRACE
(
" - nPitchBendRange: %d
\n
"
,
inst
->
nPitchBendRange
);
}
struct
instrument_entry
{
...
...
@@ -171,32 +188,15 @@ static HRESULT parse_lbin_list(struct band *This, IStream *stream, struct chunk_
case
DMUS_FOURCC_INSTRUMENT_CHUNK
:
{
UINT
size
=
sizeof
(
inst
);
if
(
chunk
.
size
==
offsetof
(
DMUS_IO_INSTRUMENT
,
nPitchBendRange
))
size
=
chunk
.
size
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
inst
,
size
)))
break
;
TRACE_
(
dmfile
)(
" - dwPatch: %lu
\n
"
,
inst
.
dwPatch
);
TRACE_
(
dmfile
)(
" - dwAssignPatch: %lu
\n
"
,
inst
.
dwAssignPatch
);
TRACE_
(
dmfile
)(
" - dwNoteRanges[0]: %lu
\n
"
,
inst
.
dwNoteRanges
[
0
]);
TRACE_
(
dmfile
)(
" - dwNoteRanges[1]: %lu
\n
"
,
inst
.
dwNoteRanges
[
1
]);
TRACE_
(
dmfile
)(
" - dwNoteRanges[2]: %lu
\n
"
,
inst
.
dwNoteRanges
[
2
]);
TRACE_
(
dmfile
)(
" - dwNoteRanges[3]: %lu
\n
"
,
inst
.
dwNoteRanges
[
3
]);
TRACE_
(
dmfile
)(
" - dwPChannel: %lu
\n
"
,
inst
.
dwPChannel
);
TRACE_
(
dmfile
)(
" - dwFlags: %lx
\n
"
,
inst
.
dwFlags
);
TRACE_
(
dmfile
)(
" - bPan: %u
\n
"
,
inst
.
bPan
);
TRACE_
(
dmfile
)(
" - bVolume: %u
\n
"
,
inst
.
bVolume
);
TRACE_
(
dmfile
)(
" - nTranspose: %d
\n
"
,
inst
.
nTranspose
);
TRACE_
(
dmfile
)(
" - dwChannelPriority: %lu
\n
"
,
inst
.
dwChannelPriority
);
TRACE_
(
dmfile
)(
" - nPitchBendRange: %d
\n
"
,
inst
.
nPitchBendRange
);
break
;
}
case
MAKE_IDTYPE
(
FOURCC_LIST
,
DMUS_FOURCC_REF_LIST
):
{
IDirectMusicObject
*
object
;
if
(
FAILED
(
hr
=
dmobj_parsereference
(
stream
,
&
chunk
,
&
object
)))
break
;
TRACE_
(
dmfile
)(
" - object: %p
\n
"
,
object
);
hr
=
IDirectMusicObject_QueryInterface
(
object
,
&
IID_IDirectMusicCollection
,
(
void
**
)
&
collection
);
IDirectMusicObject_Release
(
object
);
break
;
...
...
@@ -333,50 +333,47 @@ static inline struct band *impl_from_IPersistStream(IPersistStream *iface)
return
CONTAINING_RECORD
(
iface
,
struct
band
,
dmobj
.
IPersistStream_iface
);
}
static
HRESULT
WINAPI
band_persist_stream_Load
(
IPersistStream
*
iface
,
IStream
*
pSt
m
)
static
HRESULT
WINAPI
band_persist_stream_Load
(
IPersistStream
*
iface
,
IStream
*
strea
m
)
{
struct
band
*
This
=
impl_from_IPersistStream
(
iface
);
DMUS_PRIVATE_CHUNK
Chunk
;
LARGE_INTEGER
liMove
;
struct
chunk_entry
chunk
=
{
0
};
HRESULT
hr
;
TRACE
(
"(%p,%p): loading
\n
"
,
This
,
pStm
);
IStream_Read
(
pStm
,
&
Chunk
,
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
),
NULL
);
TRACE_
(
dmfile
)(
": %s chunk (size = %ld)"
,
debugstr_fourcc
(
Chunk
.
fccID
),
Chunk
.
dwSize
);
switch
(
Chunk
.
fccID
)
{
case
FOURCC_RIFF
:
{
IStream_Read
(
pStm
,
&
Chunk
.
fccID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": %s chunk (size = %ld)"
,
debugstr_fourcc
(
Chunk
.
fccID
),
Chunk
.
dwSize
);
switch
(
Chunk
.
fccID
)
{
case
DMUS_FOURCC_BAND_FORM
:
{
static
const
LARGE_INTEGER
zero
=
{
0
};
struct
chunk_entry
chunk
=
{
FOURCC_LIST
,
.
size
=
Chunk
.
dwSize
,
.
type
=
Chunk
.
fccID
};
TRACE_
(
dmfile
)(
": Band form
\n
"
);
IStream_Seek
(
pStm
,
zero
,
STREAM_SEEK_CUR
,
&
chunk
.
offset
);
chunk
.
offset
.
QuadPart
-=
12
;
hr
=
parse_dmbd_chunk
(
This
,
pStm
,
&
chunk
);
if
(
FAILED
(
hr
))
return
hr
;
TRACE
(
"%p, %p
\n
"
,
iface
,
stream
);
if
((
hr
=
stream_get_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
{
case
MAKE_IDTYPE
(
FOURCC_RIFF
,
DMUS_FOURCC_BAND_FORM
):
hr
=
parse_dmbd_chunk
(
This
,
stream
,
&
chunk
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
return
E_FAIL
;
}
}
TRACE_
(
dmfile
)(
": reading finished
\n
"
);
default:
WARN
(
"Invalid band chunk %s %s
\n
"
,
debugstr_fourcc
(
chunk
.
id
),
debugstr_fourcc
(
chunk
.
type
));
hr
=
DMUS_E_UNSUPPORTED_STREAM
;
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
E_FAIL
;
}
if
(
FAILED
(
hr
))
return
hr
;
if
(
TRACE_ON
(
dmband
))
{
struct
instrument_entry
*
entry
;
TRACE
(
"Loaded IDirectMusicBand %p
\n
"
,
This
);
dump_DMUS_OBJECTDESC
(
&
This
->
dmobj
.
desc
);
TRACE
(
" - Instruments:
\n
"
);
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
instruments
,
struct
instrument_entry
,
entry
)
{
dump_DMUS_IO_INSTRUMENT
(
&
entry
->
instrument
);
TRACE
(
" - collection: %p
\n
"
,
entry
->
collection
);
}
}
stream_skip_chunk
(
stream
,
&
chunk
);
return
S_OK
;
}
...
...
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