Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
27ab6967
Commit
27ab6967
authored
Sep 15, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Implement DirectMusicSeqTrack IPersistStream_Load.
parent
d3742ab8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
130 additions
and
2 deletions
+130
-2
seqtrack.c
dlls/dmime/seqtrack.c
+130
-2
No files found.
dlls/dmime/seqtrack.c
View file @
27ab6967
...
...
@@ -26,6 +26,12 @@ struct sequence_track
IDirectMusicTrack8
IDirectMusicTrack8_iface
;
struct
dmobject
dmobj
;
/* IPersistStream only */
LONG
ref
;
DMUS_IO_SEQ_ITEM
*
items
;
unsigned
int
count
;
DMUS_IO_CURVE_ITEM
*
curve_items
;
unsigned
int
curve_count
;
};
static
inline
struct
sequence_track
*
impl_from_IDirectMusicTrack8
(
IDirectMusicTrack8
*
iface
)
...
...
@@ -234,10 +240,132 @@ static const IDirectMusicTrack8Vtbl dmtrack8_vtbl = {
sequence_track_Join
};
static
HRESULT
parse_curl_list
(
struct
sequence_track
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
{
HRESULT
hr
;
UINT
i
;
if
(
FAILED
(
hr
=
stream_chunk_get_array
(
stream
,
chunk
,
(
void
**
)
&
This
->
curve_items
,
&
This
->
curve_count
,
sizeof
(
*
This
->
curve_items
))))
{
/* try again with the older DMUS_IO_CURVE_ITEM size */
UINT
size
=
offsetof
(
DMUS_IO_CURVE_ITEM
,
wParamType
);
BYTE
*
buffer
;
if
(
FAILED
(
hr
=
stream_reset_chunk_data
(
stream
,
chunk
)))
return
hr
;
if
(
FAILED
(
hr
=
stream_chunk_get_array
(
stream
,
chunk
,
(
void
**
)
&
buffer
,
&
This
->
curve_count
,
size
)))
return
hr
;
if
(
!
(
This
->
curve_items
=
calloc
(
This
->
curve_count
,
sizeof
(
*
This
->
curve_items
))))
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
This
->
curve_count
;
i
++
)
memcpy
(
This
->
curve_items
+
i
,
buffer
+
size
*
i
,
size
);
free
(
buffer
);
}
return
S_OK
;
}
static
HRESULT
parse_seqt_chunk
(
struct
sequence_track
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
parent
)
{
struct
chunk_entry
chunk
=
{.
parent
=
parent
};
HRESULT
hr
;
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
{
case
DMUS_FOURCC_SEQ_LIST
:
hr
=
stream_chunk_get_array
(
stream
,
&
chunk
,
(
void
**
)
&
This
->
items
,
&
This
->
count
,
sizeof
(
*
This
->
items
));
break
;
case
DMUS_FOURCC_CURVE_LIST
:
hr
=
parse_curl_list
(
This
,
stream
,
&
chunk
);
break
;
default:
FIXME
(
"Ignoring chunk %s %s
\n
"
,
debugstr_fourcc
(
chunk
.
id
),
debugstr_fourcc
(
chunk
.
type
));
break
;
}
if
(
FAILED
(
hr
))
break
;
}
return
hr
;
}
static
inline
struct
sequence_track
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
sequence_track
,
dmobj
.
IPersistStream_iface
);
}
static
HRESULT
WINAPI
track_IPersistStream_Load
(
IPersistStream
*
iface
,
IStream
*
stream
)
{
FIXME
(
": Loading not implemented yet
\n
"
);
return
S_OK
;
struct
sequence_track
*
This
=
impl_from_IPersistStream
(
iface
);
struct
chunk_entry
chunk
=
{
0
};
HRESULT
hr
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
stream
);
if
((
hr
=
stream_get_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
{
case
DMUS_FOURCC_SEQ_TRACK
:
hr
=
parse_seqt_chunk
(
This
,
stream
,
&
chunk
);
break
;
default:
WARN
(
"Invalid seq track chunk %s %s
\n
"
,
debugstr_fourcc
(
chunk
.
id
),
debugstr_fourcc
(
chunk
.
type
));
hr
=
DMUS_E_UNSUPPORTED_STREAM
;
break
;
}
}
if
(
FAILED
(
hr
))
return
hr
;
if
(
TRACE_ON
(
dmime
))
{
UINT
i
;
TRACE
(
"Loaded DirectMusicSeqTrack %p
\n
"
,
This
);
TRACE
(
"- %u items:
\n
"
,
This
->
count
);
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
{
TRACE
(
" - DMUS_IO_SEQ_ITEM[%u]
\n
"
,
i
);
TRACE
(
" - mtTime: %ld
\n
"
,
This
->
items
[
i
].
mtTime
);
TRACE
(
" - mtDuration: %ld
\n
"
,
This
->
items
[
i
].
mtDuration
);
TRACE
(
" - dwPChannel: %ld
\n
"
,
This
->
items
[
i
].
dwPChannel
);
TRACE
(
" - nOffset: %d
\n
"
,
This
->
items
[
i
].
nOffset
);
TRACE
(
" - bStatus: %d
\n
"
,
This
->
items
[
i
].
bStatus
);
TRACE
(
" - bByte1: %#x
\n
"
,
This
->
items
[
i
].
bByte1
);
TRACE
(
" - bByte2: %#x
\n
"
,
This
->
items
[
i
].
bByte2
);
}
TRACE
(
"- %u curves:
\n
"
,
This
->
curve_count
);
for
(
i
=
0
;
i
<
This
->
curve_count
;
i
++
)
{
TRACE
(
" - DMUS_IO_CURVE_ITEM[%u]
\n
"
,
i
);
TRACE
(
" - mtStart: %ld
\n
"
,
This
->
curve_items
[
i
].
mtStart
);
TRACE
(
" - mtDuration: %ld
\n
"
,
This
->
curve_items
[
i
].
mtDuration
);
TRACE
(
" - mtResetDuration: %ld
\n
"
,
This
->
curve_items
[
i
].
mtResetDuration
);
TRACE
(
" - dwPChannel: %ld
\n
"
,
This
->
curve_items
[
i
].
dwPChannel
);
TRACE
(
" - nOffset: %d
\n
"
,
This
->
curve_items
[
i
].
nOffset
);
TRACE
(
" - nStartValue: %d
\n
"
,
This
->
curve_items
[
i
].
nStartValue
);
TRACE
(
" - nEndValue: %d
\n
"
,
This
->
curve_items
[
i
].
nEndValue
);
TRACE
(
" - nResetValue: %d
\n
"
,
This
->
curve_items
[
i
].
nResetValue
);
TRACE
(
" - bType: %d
\n
"
,
This
->
curve_items
[
i
].
bType
);
TRACE
(
" - bCurveShape: %d
\n
"
,
This
->
curve_items
[
i
].
bCurveShape
);
TRACE
(
" - bCCData: %d
\n
"
,
This
->
curve_items
[
i
].
bCCData
);
TRACE
(
" - bFlags: %d
\n
"
,
This
->
curve_items
[
i
].
bFlags
);
TRACE
(
" - wParamType: %d
\n
"
,
This
->
curve_items
[
i
].
wParamType
);
TRACE
(
" - wMergeIndex: %d
\n
"
,
This
->
curve_items
[
i
].
wMergeIndex
);
}
}
stream_skip_chunk
(
stream
,
&
chunk
);
return
S_OK
;
}
static
const
IPersistStreamVtbl
persiststream_vtbl
=
{
...
...
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