mciqtz32: Implement MCI_DGV_PLAY_REPEAT.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
532926b5f7
commit
71fbaba426
@ -359,6 +359,18 @@ static DWORD CALLBACK MCIQTZ_notifyThread(LPVOID parm)
|
|||||||
}
|
}
|
||||||
} while (hr == S_OK && event_code != EC_COMPLETE);
|
} while (hr == S_OK && event_code != EC_COMPLETE);
|
||||||
if (hr == S_OK && event_code == EC_COMPLETE) {
|
if (hr == S_OK && event_code == EC_COMPLETE) {
|
||||||
|
/* Repeat the music by seeking and running again */
|
||||||
|
if (wma->mci_flags & MCI_DGV_PLAY_REPEAT) {
|
||||||
|
TRACE("repeat media as requested\n");
|
||||||
|
IMediaControl_Stop(wma->pmctrl);
|
||||||
|
IMediaSeeking_SetPositions(wma->seek,
|
||||||
|
&wma->seek_start,
|
||||||
|
AM_SEEKING_AbsolutePositioning,
|
||||||
|
&wma->seek_stop,
|
||||||
|
AM_SEEKING_AbsolutePositioning);
|
||||||
|
IMediaControl_Run(wma->pmctrl);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
old = InterlockedExchangePointer(&wma->callback, NULL);
|
old = InterlockedExchangePointer(&wma->callback, NULL);
|
||||||
if (old)
|
if (old)
|
||||||
mciDriverNotify(old, wma->notify_devid, MCI_NOTIFY_SUCCESSFUL);
|
mciDriverNotify(old, wma->notify_devid, MCI_NOTIFY_SUCCESSFUL);
|
||||||
@ -387,9 +399,8 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
|||||||
{
|
{
|
||||||
WINE_MCIQTZ* wma;
|
WINE_MCIQTZ* wma;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
REFERENCE_TIME time1 = 0, time2 = 0;
|
|
||||||
GUID format;
|
GUID format;
|
||||||
DWORD pos1;
|
DWORD start_flags;
|
||||||
|
|
||||||
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
|
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
|
||||||
|
|
||||||
@ -408,23 +419,29 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
|||||||
mciDriverNotify(old, wma->notify_devid, MCI_NOTIFY_ABORTED);
|
mciDriverNotify(old, wma->notify_devid, MCI_NOTIFY_ABORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wma->mci_flags = dwFlags;
|
||||||
IMediaSeeking_GetTimeFormat(wma->seek, &format);
|
IMediaSeeking_GetTimeFormat(wma->seek, &format);
|
||||||
if (dwFlags & MCI_FROM) {
|
if (dwFlags & MCI_FROM) {
|
||||||
if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME))
|
if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME))
|
||||||
time1 = lpParms->dwFrom * 10000;
|
wma->seek_start = lpParms->dwFrom * 10000;
|
||||||
else
|
else
|
||||||
time1 = lpParms->dwFrom;
|
wma->seek_start = lpParms->dwFrom;
|
||||||
pos1 = AM_SEEKING_AbsolutePositioning;
|
start_flags = AM_SEEKING_AbsolutePositioning;
|
||||||
} else
|
} else {
|
||||||
pos1 = AM_SEEKING_NoPositioning;
|
wma->seek_start = 0;
|
||||||
|
start_flags = AM_SEEKING_NoPositioning;
|
||||||
|
}
|
||||||
if (dwFlags & MCI_TO) {
|
if (dwFlags & MCI_TO) {
|
||||||
if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME))
|
if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME))
|
||||||
time2 = lpParms->dwTo * 10000;
|
wma->seek_stop = lpParms->dwTo * 10000;
|
||||||
else
|
else
|
||||||
time2 = lpParms->dwTo;
|
wma->seek_stop = lpParms->dwTo;
|
||||||
} else
|
} else {
|
||||||
IMediaSeeking_GetDuration(wma->seek, &time2);
|
wma->seek_stop = 0;
|
||||||
IMediaSeeking_SetPositions(wma->seek, &time1, pos1, &time2, AM_SEEKING_AbsolutePositioning);
|
IMediaSeeking_GetDuration(wma->seek, &wma->seek_stop);
|
||||||
|
}
|
||||||
|
IMediaSeeking_SetPositions(wma->seek, &wma->seek_start, start_flags,
|
||||||
|
&wma->seek_stop, AM_SEEKING_AbsolutePositioning);
|
||||||
|
|
||||||
hr = IMediaControl_Run(wma->pmctrl);
|
hr = IMediaControl_Run(wma->pmctrl);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
|
@ -37,6 +37,9 @@ typedef struct {
|
|||||||
IBasicVideo* vidbasic;
|
IBasicVideo* vidbasic;
|
||||||
IBasicAudio* audio;
|
IBasicAudio* audio;
|
||||||
DWORD time_format;
|
DWORD time_format;
|
||||||
|
DWORD mci_flags;
|
||||||
|
REFERENCE_TIME seek_start;
|
||||||
|
REFERENCE_TIME seek_stop;
|
||||||
UINT command_table;
|
UINT command_table;
|
||||||
HWND parent;
|
HWND parent;
|
||||||
MCIDEVICEID notify_devid;
|
MCIDEVICEID notify_devid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user