Rebase against 6558611fa2d24447297cb62d168b924c33839c43.

This commit is contained in:
Alistair Leslie-Hughes
2023-09-20 08:16:07 +10:00
parent 53515d7e75
commit c4da0a8993
9 changed files with 3930 additions and 5031 deletions

View File

@@ -1,19 +1,19 @@
From 87bf08071997f446498bdea2d18d1bb539a1990e Mon Sep 17 00:00:00 2001
From cdbd2714d5454e6518b699e3cdbedd3e0a1243c5 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 2 Dec 2022 14:41:30 +1100
Subject: [PATCH] dmime: Implement IDirectMusicSegment8 Download
---
dlls/dmime/dmime_private.h | 2 +
dlls/dmime/performance.c | 7 +++
dlls/dmime/segment.c | 87 ++++++++++++++++++++++++++++++++++++--
3 files changed, 93 insertions(+), 3 deletions(-)
dlls/dmime/performance.c | 7 ++++
dlls/dmime/segment.c | 80 +++++++++++++++++++++++++++++++++++++-
3 files changed, 88 insertions(+), 1 deletion(-)
diff --git a/dlls/dmime/dmime_private.h b/dlls/dmime/dmime_private.h
index 6102fd5ec2f..da40b58ad9b 100644
index eacde4b46be..cd34378b66e 100644
--- a/dlls/dmime/dmime_private.h
+++ b/dlls/dmime/dmime_private.h
@@ -71,6 +71,8 @@ extern void set_audiopath_perf_pointer(IDirectMusicAudioPath*,IDirectMusicPerfor
@@ -70,6 +70,8 @@ extern void set_audiopath_perf_pointer(IDirectMusicAudioPath*,IDirectMusicPerfor
extern void set_audiopath_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*);
extern void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*);
@@ -23,10 +23,10 @@ index 6102fd5ec2f..da40b58ad9b 100644
* Auxiliary definitions
*/
diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c
index 1f8de0837d5..622939f3553 100644
index d8624427423..a707de39d50 100644
--- a/dlls/dmime/performance.c
+++ b/dlls/dmime/performance.c
@@ -253,6 +253,13 @@ static inline struct performance *impl_from_IDirectMusicPerformance8(IDirectMusi
@@ -251,6 +251,13 @@ static inline struct performance *impl_from_IDirectMusicPerformance8(IDirectMusi
return CONTAINING_RECORD(iface, struct performance, IDirectMusicPerformance8_iface);
}
@@ -41,34 +41,31 @@ index 1f8de0837d5..622939f3553 100644
static HRESULT WINAPI performance_QueryInterface(IDirectMusicPerformance8 *iface, REFIID riid, void **ret_iface)
{
diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c
index 39a5333fbbb..ce49ddc9940 100644
index a72ec786623..ebee90eee92 100644
--- a/dlls/dmime/segment.c
+++ b/dlls/dmime/segment.c
@@ -37,6 +37,7 @@ typedef struct IDirectMusicSegment8Impl {
@@ -54,6 +54,7 @@ struct segment
PCMWAVEFORMAT wave_format;
void *wave_data;
int data_size;
+ IDirectSoundBuffer *buffer;
} IDirectMusicSegment8Impl;
};
IDirectMusicSegment8Impl *create_segment(void);
@@ -90,6 +91,8 @@ static ULONG WINAPI IDirectMusicSegment8Impl_Release(IDirectMusicSegment8 *iface
TRACE("(%p) ref=%ld\n", This, ref);
static struct segment *segment_create(void);
@@ -114,6 +115,8 @@ static ULONG WINAPI segment_Release(IDirectMusicSegment8 *iface)
track_entry_destroy(entry);
}
if (!ref) {
+ if (This->buffer)
+ IDirectSoundBuffer_Release(This->buffer);
if (This->wave_data)
free(This->wave_data);
@@ -559,9 +562,87 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_Compose(IDirectMusicSegment8 *ifa
static HRESULT WINAPI IDirectMusicSegment8Impl_Download(IDirectMusicSegment8 *iface,
IUnknown *pAudioPath)
@@ -517,7 +520,82 @@ static HRESULT WINAPI segment_Compose(IDirectMusicSegment8 *iface, MUSIC_TIME mt
static HRESULT WINAPI segment_Download(IDirectMusicSegment8 *iface, IUnknown *pAudioPath)
{
- IDirectMusicSegment8Impl *This = impl_from_IDirectMusicSegment8(iface);
- FIXME("(%p, %p): stub\n", This, pAudioPath);
- return S_OK;
+ IDirectMusicSegment8Impl *This = impl_from_IDirectMusicSegment8(iface);
struct segment *This = impl_from_IDirectMusicSegment8(iface);
- FIXME("(%p, %p): stub\n", This, pAudioPath);
+ IDirectMusicPerformance8 *perf;
+ IDirectMusicAudioPath *audio;
+ IDirectSound *dsound;
@@ -145,13 +142,9 @@ index 39a5333fbbb..ce49ddc9940 100644
+ hr = IDirectSoundBuffer_Unlock(This->buffer, data, This->data_size, NULL, 0);
+ TRACE("IDirectSoundBuffer_Unlock hr 0x%08lx\n", hr);
+
+ /*hr = IDirectSoundBuffer_Play(This->buffer, 0, 0, 0);
+ TRACE("IDirectSoundBuffer_Play hr 0x%08lx\n", hr);*/
+
+ return S_OK;
return S_OK;
}
static HRESULT WINAPI IDirectMusicSegment8Impl_Unload(IDirectMusicSegment8 *iface,
--
2.40.1

View File

@@ -1,4 +1,4 @@
From 43007318a6303312b6226c9ede009e4299826af3 Mon Sep 17 00:00:00 2001
From ea9bd0ec85254305b5783e1890ded6b21d200f41 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Mon, 12 Dec 2022 15:20:10 +1100
Subject: [PATCH] dmime: Play a sound in IDirectMusicPerformance8 PlaySegmentEx
@@ -10,10 +10,10 @@ Subject: [PATCH] dmime: Play a sound in IDirectMusicPerformance8 PlaySegmentEx
3 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/dlls/dmime/dmime_private.h b/dlls/dmime/dmime_private.h
index da40b58ad9b..4532528f535 100644
index cd34378b66e..c83f6675333 100644
--- a/dlls/dmime/dmime_private.h
+++ b/dlls/dmime/dmime_private.h
@@ -72,6 +72,7 @@ extern void set_audiopath_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffe
@@ -71,6 +71,7 @@ extern void set_audiopath_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffe
extern void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*);
extern IDirectSound *get_dsound_interface(IDirectMusicPerformance8*);
@@ -22,10 +22,10 @@ index da40b58ad9b..4532528f535 100644
/*****************************************************************************
* Auxiliary definitions
diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c
index 622939f3553..c7b149f0686 100644
index a707de39d50..2b09814cd6b 100644
--- a/dlls/dmime/performance.c
+++ b/dlls/dmime/performance.c
@@ -1028,13 +1028,26 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
@@ -1053,13 +1053,26 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
WCHAR *pwzSegmentName, IUnknown *pTransition, DWORD dwFlags, __int64 i64StartTime,
IDirectMusicSegmentState **ppSegmentState, IUnknown *pFrom, IUnknown *pAudioPath)
{
@@ -59,22 +59,22 @@ index 622939f3553..c7b149f0686 100644
static HRESULT WINAPI performance_StopEx(IDirectMusicPerformance8 *iface, IUnknown *pObjectToStop,
diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c
index ce49ddc9940..ad121736acd 100644
index ebee90eee92..8482cb21d34 100644
--- a/dlls/dmime/segment.c
+++ b/dlls/dmime/segment.c
@@ -47,6 +47,12 @@ static inline IDirectMusicSegment8Impl *impl_from_IDirectMusicSegment8(IDirectMu
return CONTAINING_RECORD(iface, IDirectMusicSegment8Impl, IDirectMusicSegment8_iface);
@@ -64,6 +64,12 @@ static inline struct segment *impl_from_IDirectMusicSegment8(IDirectMusicSegment
return CONTAINING_RECORD(iface, struct segment, IDirectMusicSegment8_iface);
}
+IDirectSoundBuffer *get_segment_buffer(IDirectMusicSegment8 *iface)
+{
+ IDirectMusicSegment8Impl *This = impl_from_IDirectMusicSegment8(iface);
+ struct segment *This = impl_from_IDirectMusicSegment8(iface);
+ return This->buffer;
+}
+
static HRESULT WINAPI IDirectMusicSegment8Impl_QueryInterface(IDirectMusicSegment8 *iface,
REFIID riid, void **ret_iface)
static HRESULT WINAPI segment_QueryInterface(IDirectMusicSegment8 *iface, REFIID riid, void **ret_iface)
{
struct segment *This = impl_from_IDirectMusicSegment8(iface);
--
2.40.1