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
29f73d66
Commit
29f73d66
authored
Feb 15, 2024
by
Yuxuan Shui
Committed by
Alexandre Julliard
Feb 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Add a stub chordtrack for MIDI segments.
parent
05347b97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
midi.c
dlls/dmime/midi.c
+11
-9
dmime.c
dlls/dmime/tests/dmime.c
+5
-5
No files found.
dlls/dmime/midi.c
View file @
29f73d66
...
@@ -40,6 +40,7 @@ struct midi_event
...
@@ -40,6 +40,7 @@ struct midi_event
struct
midi_parser
struct
midi_parser
{
{
IDirectMusicTrack
*
chordtrack
;
IDirectMusicTrack
*
bandtrack
;
IDirectMusicTrack
*
bandtrack
;
MUSIC_TIME
time
;
MUSIC_TIME
time
;
IStream
*
stream
;
IStream
*
stream
;
...
@@ -221,13 +222,16 @@ static HRESULT midi_parser_parse(struct midi_parser *parser, IDirectMusicSegment
...
@@ -221,13 +222,16 @@ static HRESULT midi_parser_parse(struct midi_parser *parser, IDirectMusicSegment
music_length
=
(
ULONGLONG
)
music_length
*
DMUS_PPQ
/
parser
->
division
+
1
;
music_length
=
(
ULONGLONG
)
music_length
*
DMUS_PPQ
/
parser
->
division
+
1
;
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectMusicSegment8_SetLength
(
segment
,
music_length
);
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectMusicSegment8_SetLength
(
segment
,
music_length
);
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectMusicSegment8_InsertTrack
(
segment
,
parser
->
bandtrack
,
0xffff
);
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectMusicSegment8_InsertTrack
(
segment
,
parser
->
bandtrack
,
0xffff
);
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectMusicSegment8_InsertTrack
(
segment
,
parser
->
chordtrack
,
0xffff
);
return
hr
;
return
hr
;
}
}
static
void
midi_parser_destroy
(
struct
midi_parser
*
parser
)
static
void
midi_parser_destroy
(
struct
midi_parser
*
parser
)
{
{
IStream_Release
(
parser
->
stream
);
IStream_Release
(
parser
->
stream
);
IDirectMusicTrack_Release
(
parser
->
bandtrack
);
if
(
parser
->
bandtrack
)
IDirectMusicTrack_Release
(
parser
->
bandtrack
);
if
(
parser
->
chordtrack
)
IDirectMusicTrack_Release
(
parser
->
chordtrack
);
free
(
parser
);
free
(
parser
);
}
}
...
@@ -267,18 +271,16 @@ static HRESULT midi_parser_new(IStream *stream, struct midi_parser **out_parser)
...
@@ -267,18 +271,16 @@ static HRESULT midi_parser_new(IStream *stream, struct midi_parser **out_parser)
parser
=
calloc
(
1
,
sizeof
(
struct
midi_parser
));
parser
=
calloc
(
1
,
sizeof
(
struct
midi_parser
));
if
(
!
parser
)
return
E_OUTOFMEMORY
;
if
(
!
parser
)
return
E_OUTOFMEMORY
;
IStream_AddRef
(
stream
);
parser
->
stream
=
stream
;
parser
->
stream
=
stream
;
parser
->
division
=
division
;
parser
->
division
=
division
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicBandTrack
,
NULL
,
CLSCTX_INPROC_SERVER
,
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicBandTrack
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicTrack
,
(
void
**
)
&
parser
->
bandtrack
);
&
IID_IDirectMusicTrack
,
(
void
**
)
&
parser
->
bandtrack
);
if
(
FAILED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicChordTrack
,
NULL
,
CLSCTX_INPROC_SERVER
,
free
(
parser
);
&
IID_IDirectMusicTrack
,
(
void
**
)
&
parser
->
chordtrack
);
return
hr
;
if
(
FAILED
(
hr
))
midi_parser_destroy
(
parser
);
}
else
*
out_parser
=
parser
;
*
out_parser
=
parser
;
IStream_AddRef
(
stream
);
return
hr
;
return
hr
;
}
}
...
...
dlls/dmime/tests/dmime.c
View file @
29f73d66
...
@@ -1681,7 +1681,7 @@ static void test_midi(void)
...
@@ -1681,7 +1681,7 @@ static void test_midi(void)
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
todo_wine
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
todo_wine
expect_track
(
segment
,
TempoTrack
,
-
1
,
2
);
todo_wine
expect_track
(
segment
,
TempoTrack
,
-
1
,
2
);
todo_wine
expect_track
(
segment
,
TimeSigTrack
,
-
1
,
3
);
todo_wine
expect_track
(
segment
,
TimeSigTrack
,
-
1
,
3
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
4
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
4
);
...
@@ -1723,7 +1723,7 @@ static void test_midi(void)
...
@@ -1723,7 +1723,7 @@ static void test_midi(void)
IStream_Release
(
stream
);
IStream_Release
(
stream
);
/* TempoTrack and TimeSigTrack seems to be optional. */
/* TempoTrack and TimeSigTrack seems to be optional. */
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
todo_wine
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
2
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
2
);
IDirectMusicSegment_Release
(
segment
);
IDirectMusicSegment_Release
(
segment
);
...
@@ -1759,7 +1759,7 @@ static void test_midi(void)
...
@@ -1759,7 +1759,7 @@ static void test_midi(void)
IPersistStream_Release
(
persist
);
IPersistStream_Release
(
persist
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
todo_wine
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
todo_wine
expect_track
(
segment
,
TempoTrack
,
-
1
,
2
);
todo_wine
expect_track
(
segment
,
TempoTrack
,
-
1
,
2
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
3
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
3
);
IDirectMusicSegment_Release
(
segment
);
IDirectMusicSegment_Release
(
segment
);
...
@@ -1795,7 +1795,7 @@ static void test_midi(void)
...
@@ -1795,7 +1795,7 @@ static void test_midi(void)
IPersistStream_Release
(
persist
);
IPersistStream_Release
(
persist
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
todo_wine
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
/* there is no tempo track. */
/* there is no tempo track. */
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
2
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
2
);
IDirectMusicSegment_Release
(
segment
);
IDirectMusicSegment_Release
(
segment
);
...
@@ -1832,7 +1832,7 @@ static void test_midi(void)
...
@@ -1832,7 +1832,7 @@ static void test_midi(void)
IPersistStream_Release
(
persist
);
IPersistStream_Release
(
persist
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
expect_track
(
segment
,
BandTrack
,
-
1
,
0
);
todo_wine
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
expect_track
(
segment
,
ChordTrack
,
-
1
,
1
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
2
);
todo_wine
expect_track
(
segment
,
SeqTrack
,
-
1
,
2
);
hr
=
test_tool_create
(
message_types
,
ARRAY_SIZE
(
message_types
),
&
tool
);
hr
=
test_tool_create
(
message_types
,
ARRAY_SIZE
(
message_types
),
&
tool
);
...
...
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