1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 20:06:18 +00:00
Commit Graph

562 Commits

Author SHA1 Message Date
Yuxuan Shui
28b94c4d42 dmime: Handle MIDI control events in MIDI files.
Adding them to the seqtrack, and also implementing playing them from the seqtrack.
2024-03-06 22:04:20 +01:00
Yuxuan Shui
5ff94358a0 dmime: Parse note on/off events and generate a seqtrack. 2024-03-06 22:04:20 +01:00
Yuxuan Shui
1df0e34293 dmime/tests: Call the correct QueryInterface function for DirectMusic track. 2024-03-06 22:04:20 +01:00
Yuxuan Shui
f0fc4a0d89 dmime: Parse MIDI Set Tempo meta events and generate a tempotrack. 2024-03-01 23:14:22 +01:00
Yuxuan Shui
1b1f216278 dmime: Implement setting TempoParam for tempotracks.
And add some tests.
2024-03-01 23:14:22 +01:00
Yuxuan Shui
6a3f067eca dmime: Use linked list for tempotrack.
Preparation for supporting setting TempoParam on tempotracks.
2024-03-01 23:14:22 +01:00
Yuxuan Shui
29f73d6669 dmime: Add a stub chordtrack for MIDI segments. 2024-02-28 21:56:24 +01:00
Yuxuan Shui
05347b9703 dmime: Parse MIDI program change events and generate a bandtrack. 2024-02-28 21:56:24 +01:00
Yuxuan Shui
aebcb1a996 dmime: Better MIDI parsing interface.
MIDI tracks don't map one-to-one to segment tracks, so it doesn't make sense to use a
"get_next_track()" interface.
2024-02-28 21:56:22 +01:00
Yuxuan Shui
5613917974 dmime/tests: Improve error reporting from expect_track.
Include a line number of the call site.
2024-02-22 12:45:55 +01:00
Yuxuan Shui
8710a1cb0a dmime: Read through a MIDI file.
Add a dummy track parser, that reads through MIDI tracks and events. To make sure we understand the
file structure correctly, no actual tracks or events are generated.

Also add test cases to make sure we read through a MIDI file correctly.
2024-02-22 12:45:52 +01:00
Yuxuan Shui
813b35c9d1 dmime: Don't skip chunk for MIDI files.
MIDI files aren't RIFF, calling stream_skip_chunk on it is invalid.
2024-02-22 12:45:51 +01:00
Paul Gofman
bbe1c7532a dmime: Force debug info in critical sections. 2024-02-15 11:23:57 +01:00
Yuxuan Shui
d93275c6ca dmime: Parse MIDI headers. 2024-02-14 20:54:23 +01:00
Yuxuan Shui
4434c17c94 dmime/tests: Add MIDI loading test.
Besides a seq track and a tempo track, Windows also adds a "fake" band
track to segments loaded from MIDI files, which handles soundfont
loading etc.
2024-02-14 20:54:18 +01:00
Eric Pouech
36d6fe591b dmime: Use sent duration in loop's playback.
When playing a loop, and if no end of loop point has been defined
(meaning = play whole segment), don't rely on segment's length for
wave tracks as their length is always 1.  Compute segment length in
this case by grabbing each track's playback length in segment state's
internal graph.  This feature is only activated for messages generated
by wave tracks, but could be extended if needed to other types of
messages.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-07 22:34:25 +01:00
Eric Pouech
ef2830b620 dmime: Generate track flags while in loop.
Store track_flags inside segment state so that they can be reused in
subsequent calls.  The start/seek/loop flags are now properly set when
calling IDirectMusicTrack_Play().

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-07 22:34:18 +01:00
Eric Pouech
dfaa45069e dmime: Add IDirectMusicGraph interface to segment state.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-07 22:34:18 +01:00
Eric Pouech
425c270d27 dmime: Add tests about segment state's graph interface.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-07 22:34:17 +01:00
Eric Pouech
ed92095f28 dmime: Fully implement IDirectMusicSegmentState::GetRepeats().
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-07 22:34:17 +01:00
Eric Pouech
8169c4d040 dmime/tests: Add some tests about end-points.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-29 10:42:48 +01:00
Eric Pouech
7d1cfb9e01 dmime: Remove unused fields in segment.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-29 10:42:48 +01:00
Eric Pouech
1bdf94a409 dmime: Fix IDirectMusicAudioPath::GetObjectInPath() prototype.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-29 10:42:48 +01:00
Eric Pouech
b2441ad699 dmime/tests: Add some tests for loops on wave tracks.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-29 10:42:48 +01:00
Eric Pouech
7aef55a996 dmime/tests: Fix copy & paste errors.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-29 10:42:48 +01:00
Yuxuan Shui
8daf207bf7 dmime: Semi-support creating an audio path from config. 2024-01-22 10:12:47 +01:00
Yuxuan Shui
e9a52308bb dmime: IDirectMusicPerformance::CreateAudioPath should fail when config is NULL. 2024-01-22 10:12:47 +01:00
Yuxuan Shui
289dfacfd4 dmime: Parse AudioPathConfig. 2024-01-22 10:12:46 +01:00
Yuxuan Shui
a300815c0f dmime: AudioPathConfig is not AudioPath.
AudioPaths are created from IDirectMusicPerformance::CreateAudioPath and CreateStandardAudioPath, and
don't have an IDirectMusicObject or an IPersistStream interface. On the other hand AudioPathConfigs
are loaded from files, and do have IDirectMusicObject and IPersistStream.

They were somehow confused with each other and implemented in the same struct, this commit fixes that.
2024-01-22 10:12:44 +01:00
Rémi Bernon
e7ded5ddc1 dmime: Avoid leaking track references in segment Clone and Load.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56117
2024-01-04 20:44:46 +01:00
Yuxuan Shui
91a29134ff dmime: Fix handling of curve PMSG.
DMUS_PMSG::dwType is the type of the message, but we are comparing it to
curve types. We should be using DMUS_CURVE_PMSG::bType instead.
2023-12-27 14:59:49 +01:00
Rémi Bernon
930776022d dmime/tests: Remove some unnecessary and spuriously failing waits.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637
2023-12-22 18:14:53 +01:00
Rémi Bernon
3ad341b603 dmime/tests: Add optional notification sequence on segment stop.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637
2023-12-22 18:14:53 +01:00
Rémi Bernon
cbf48daecf dmime/tests: Allow small time variation in test_segment_state.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637
2023-12-22 18:14:53 +01:00
Rémi Bernon
2f86a5d6cb dmime/tests: Allow small time variation in test_performance_time.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637
2023-12-22 18:14:53 +01:00
Rémi Bernon
6447b11b17 dmime/tests: Check reference time and allow 0.5 tick difference.
Renaming check_music_time to check_reference_time, as it's truly
reference time values that are passed.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637
2023-12-22 18:14:50 +01:00
Eric Pouech
6343dc6c95 dmime: Add Release() on some codepaths.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-11-28 00:08:41 +01:00
Anton Baskanov
bb7b49647b dmime: Requeue the note message instead of directly queueing MIDI note-off. 2023-11-23 22:51:07 +01:00
Anton Baskanov
433e0fc026 dmime/tests: Test output tool note requeueing. 2023-11-23 22:51:07 +01:00
Anton Baskanov
fd3607ed57 dmime/tests: Move scale_music_time() and check_dmus_note_pmsg() up. 2023-11-23 22:51:07 +01:00
Anton Baskanov
00a77f0137 dmime: Correctly requeue messages with changed time. 2023-11-23 22:51:07 +01:00
Anton Baskanov
fcf82e3352 dmime: Always queue messages with non-immediate delivery type. 2023-11-23 22:51:07 +01:00
Anton Baskanov
be77443b7c dmime: Don't queue messages with immediate delivery type. 2023-11-23 22:51:07 +01:00
Anton Baskanov
a6929a54ba dmime: Factor out timeout computation. 2023-11-23 22:51:07 +01:00
Michael Stefaniuc
b3382916c6 dmime: Remove superfluous casts to self. 2023-11-14 11:31:27 +01:00
Michael Stefaniuc
e283883057 dmime/tests: Remove superfluous casts to self. 2023-11-14 11:31:27 +01:00
Michael Stefaniuc
c3ef2e6efb dmime: Remove redundant NULL check before free(). 2023-11-14 11:31:27 +01:00
Rémi Bernon
99aa613f26 dmime: Implement segment state repeat and looping. 2023-11-13 22:37:51 +01:00
Rémi Bernon
eada40789d dmime: Split segment_state_play_chunk helper. 2023-11-13 22:37:51 +01:00
Rémi Bernon
051418c0c0 dmime: Send MIDI_SYSTEM_RESET message on performance reset. 2023-11-13 22:37:51 +01:00