Commit c227e8bb authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmime: Pass IDirectMusicPerformance8 to segment state functions.

parent 8d6cd1b5
...@@ -73,9 +73,9 @@ extern void set_audiopath_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffe ...@@ -73,9 +73,9 @@ extern void set_audiopath_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffe
extern void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*); extern void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*);
extern HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, extern HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time,
IDirectMusicPerformance *performance, IDirectMusicSegmentState **ret_iface); IDirectMusicPerformance8 *performance, IDirectMusicSegmentState **ret_iface);
extern HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance *performance); extern HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance);
extern HRESULT segment_state_end_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance *performance); extern HRESULT segment_state_end_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance);
extern HRESULT wave_track_create_from_chunk(IStream *stream, struct chunk_entry *parent, extern HRESULT wave_track_create_from_chunk(IStream *stream, struct chunk_entry *parent,
IDirectMusicTrack8 **ret_iface); IDirectMusicTrack8 **ret_iface);
......
...@@ -1196,7 +1196,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface, ...@@ -1196,7 +1196,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
if (FAILED(hr = IUnknown_QueryInterface(source, &IID_IDirectMusicSegment, (void **)&segment))) if (FAILED(hr = IUnknown_QueryInterface(source, &IID_IDirectMusicSegment, (void **)&segment)))
return hr; return hr;
if (FAILED(hr = segment_state_create(segment, start_time, (IDirectMusicPerformance *)iface, &state))) if (FAILED(hr = segment_state_create(segment, start_time, iface, &state)))
{ {
IDirectMusicSegment_Release(segment); IDirectMusicSegment_Release(segment);
return hr; return hr;
...@@ -1213,7 +1213,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface, ...@@ -1213,7 +1213,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
hr = performance_send_dirty_pmsg(This, start_time); hr = performance_send_dirty_pmsg(This, start_time);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = segment_state_play(state, (IDirectMusicPerformance *)iface); hr = segment_state_play(state, iface);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = performance_send_notification_pmsg(This, start_time + length, This->notification_segment, hr = performance_send_notification_pmsg(This, start_time + length, This->notification_segment,
...@@ -1767,7 +1767,8 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface, ...@@ -1767,7 +1767,8 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
if (IsEqualGUID(&notif->guidNotificationType, &GUID_NOTIFICATION_SEGMENT) if (IsEqualGUID(&notif->guidNotificationType, &GUID_NOTIFICATION_SEGMENT)
&& notif->dwNotificationOption == DMUS_NOTIFICATION_SEGEND) && notif->dwNotificationOption == DMUS_NOTIFICATION_SEGEND)
{ {
if (FAILED(hr = segment_state_end_play((IDirectMusicSegmentState *)notif->punkUser, performance))) if (FAILED(hr = segment_state_end_play((IDirectMusicSegmentState *)notif->punkUser,
(IDirectMusicPerformance8 *)performance)))
WARN("Failed to end segment state %p, hr %#lx\n", notif->punkUser, hr); WARN("Failed to end segment state %p, hr %#lx\n", notif->punkUser, hr);
} }
......
...@@ -209,7 +209,7 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface) ...@@ -209,7 +209,7 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface)
} }
HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time,
IDirectMusicPerformance *performance, IDirectMusicSegmentState **ret_iface) IDirectMusicPerformance8 *performance, IDirectMusicSegmentState **ret_iface)
{ {
IDirectMusicSegmentState *iface; IDirectMusicSegmentState *iface;
struct segment_state *This; struct segment_state *This;
...@@ -225,7 +225,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time ...@@ -225,7 +225,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
This->segment = segment; This->segment = segment;
IDirectMusicSegment_AddRef(This->segment); IDirectMusicSegment_AddRef(This->segment);
if (SUCCEEDED(hr = IDirectMusicPerformance_GetGlobalParam(performance, &GUID_PerfAutoDownload, if (SUCCEEDED(hr = IDirectMusicPerformance8_GetGlobalParam(performance, &GUID_PerfAutoDownload,
&This->auto_download, sizeof(This->auto_download))) && This->auto_download) &This->auto_download, sizeof(This->auto_download))) && This->auto_download)
hr = IDirectMusicSegment_SetParam(segment, &GUID_DownloadToAudioPath, -1, hr = IDirectMusicSegment_SetParam(segment, &GUID_DownloadToAudioPath, -1,
DMUS_SEG_ALLTRACKS, 0, performance); DMUS_SEG_ALLTRACKS, 0, performance);
...@@ -247,7 +247,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time ...@@ -247,7 +247,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
if (!(entry = malloc(sizeof(*entry)))) if (!(entry = malloc(sizeof(*entry))))
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
else if (SUCCEEDED(hr = IDirectMusicTrack_InitPlay(track, iface, performance, else if (SUCCEEDED(hr = IDirectMusicTrack_InitPlay(track, iface, (IDirectMusicPerformance *)performance,
&entry->state_data, track_id, 0))) &entry->state_data, track_id, 0)))
{ {
entry->track = track; entry->track = track;
...@@ -268,7 +268,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time ...@@ -268,7 +268,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
return hr; return hr;
} }
HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance *performance) HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance)
{ {
struct segment_state *This = impl_from_IDirectMusicSegmentState8((IDirectMusicSegmentState8 *)iface); struct segment_state *This = impl_from_IDirectMusicSegmentState8((IDirectMusicSegmentState8 *)iface);
DWORD track_flags = DMUS_TRACKF_DIRTY | DMUS_TRACKF_START | DMUS_TRACKF_SEEK; DWORD track_flags = DMUS_TRACKF_DIRTY | DMUS_TRACKF_START | DMUS_TRACKF_SEEK;
...@@ -279,7 +279,7 @@ HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerforma ...@@ -279,7 +279,7 @@ HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerforma
LIST_FOR_EACH_ENTRY(entry, &This->tracks, struct track_entry, entry) LIST_FOR_EACH_ENTRY(entry, &This->tracks, struct track_entry, entry)
{ {
if (FAILED(hr = IDirectMusicTrack_Play(entry->track, entry->state_data, start_time, if (FAILED(hr = IDirectMusicTrack_Play(entry->track, entry->state_data, start_time,
end_time, 0, track_flags, performance, iface, entry->track_id))) end_time, 0, track_flags, (IDirectMusicPerformance *)performance, iface, entry->track_id)))
{ {
WARN("Failed to play track %p, hr %#lx\n", entry->track, hr); WARN("Failed to play track %p, hr %#lx\n", entry->track, hr);
break; break;
...@@ -289,7 +289,7 @@ HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerforma ...@@ -289,7 +289,7 @@ HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerforma
return hr; return hr;
} }
HRESULT segment_state_end_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance *performance) HRESULT segment_state_end_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance)
{ {
struct segment_state *This = impl_from_IDirectMusicSegmentState8((IDirectMusicSegmentState8 *)iface); struct segment_state *This = impl_from_IDirectMusicSegmentState8((IDirectMusicSegmentState8 *)iface);
struct track_entry *entry, *next; struct track_entry *entry, *next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment