Added win32 enhanced functionality to timer callbacks.
This commit is contained in:
parent
b02ffc7546
commit
8deb379f59
|
@ -753,8 +753,11 @@ typedef void (CALLBACK *LPTIMECALLBACK16)(UINT16 uTimerID, UINT16 uMessage, DWOR
|
||||||
typedef void (CALLBACK *LPTIMECALLBACK32)(UINT32 uTimerID, UINT32 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
|
typedef void (CALLBACK *LPTIMECALLBACK32)(UINT32 uTimerID, UINT32 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
|
||||||
DECL_WINELIB_TYPE(LPTIMECALLBACK)
|
DECL_WINELIB_TYPE(LPTIMECALLBACK)
|
||||||
|
|
||||||
#define TIME_ONESHOT 0 /* program timer for single event */
|
#define TIME_ONESHOT 0x0000 /* program timer for single event */
|
||||||
#define TIME_PERIODIC 1 /* program for continuous periodic event */
|
#define TIME_PERIODIC 0x0001 /* program for continuous periodic event */
|
||||||
|
#define TIME_CALLBACK_FUNCTION 0x0000 /* callback is function */
|
||||||
|
#define TIME_CALLBACK_EVENT_SET 0x0010 /* callback is event - use SetEvent */
|
||||||
|
#define TIME_CALLBACK_EVENT_PULSE 0x0020/* callback is event - use PulseEvent */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT16 wPeriodMin; /* minimum period supported */
|
UINT16 wPeriodMin; /* minimum period supported */
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include "mmsystem.h"
|
#include "mmsystem.h"
|
||||||
|
|
||||||
#define MAX_MIDIINDRV (1)
|
#define MAX_MIDIINDRV (16)
|
||||||
/* For now I'm making 16 the maximum number of midi devices one can
|
/* For now I'm making 16 the maximum number of midi devices one can
|
||||||
* have. This should be more than enough for everybody. But as a purist,
|
* have. This should be more than enough for everybody. But as a purist,
|
||||||
* I intend to make it unbounded in the future, as soon as I figure
|
* I intend to make it unbounded in the future, as soon as I figure
|
||||||
|
|
|
@ -92,8 +92,8 @@ BOOL32 MULTIMEDIA_Init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numsynthdevs > MAX_MIDIOUTDRV) {
|
if (numsynthdevs > MAX_MIDIOUTDRV) {
|
||||||
ERR(midi, "MAX_MIDIOUTDRV was enough for the number of devices. "
|
ERR(midi, "MAX_MIDIOUTDRV (%d) was enough for the number of devices (%d). "
|
||||||
"Some FM devices will not be available.\n");
|
"Some FM devices will not be available.\n",MAX_MIDIOUTDRV,numsynthdevs);
|
||||||
numsynthdevs = MAX_MIDIOUTDRV;
|
numsynthdevs = MAX_MIDIOUTDRV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,8 +167,8 @@ BOOL32 MULTIMEDIA_Init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nummididevs > MAX_MIDIINDRV) {
|
if (nummididevs > MAX_MIDIINDRV) {
|
||||||
ERR(midi, "MAX_MIDIINDRV was not enough for the number of devices. "
|
ERR(midi, "MAX_MIDIINDRV (%d) was not enough for the number of devices (%d). "
|
||||||
"Some MIDI devices will not be available.\n");
|
"Some MIDI devices will not be available.\n",MAX_MIDIINDRV,nummididevs);
|
||||||
nummididevs = MAX_MIDIINDRV;
|
nummididevs = MAX_MIDIINDRV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,13 +72,25 @@ static void TIME_TriggerCallBack(LPTIMERENTRY lpTimer, DWORD dwCurrent)
|
||||||
* PostMessage), and must reside in DLL (therefore uses stack of active application). So I
|
* PostMessage), and must reside in DLL (therefore uses stack of active application). So I
|
||||||
* guess current implementation via SetTimer has to be improved upon.
|
* guess current implementation via SetTimer has to be improved upon.
|
||||||
*/
|
*/
|
||||||
|
switch (lpTimer->wFlags & 0x30) {
|
||||||
|
case TIME_CALLBACK_FUNCTION:
|
||||||
if (lpTimer->isWin32)
|
if (lpTimer->isWin32)
|
||||||
lpTimer->lpFunc(lpTimer->wTimerID,0,lpTimer->dwUser,0,0);
|
lpTimer->lpFunc(lpTimer->wTimerID,0,lpTimer->dwUser,0,0);
|
||||||
else
|
else
|
||||||
Callbacks->CallTimeFuncProc(lpTimer->lpFunc,
|
Callbacks->CallTimeFuncProc(lpTimer->lpFunc,
|
||||||
lpTimer->wTimerID,0,
|
lpTimer->wTimerID,0,
|
||||||
lpTimer->dwUser,0,0);
|
lpTimer->dwUser,0,0);
|
||||||
|
break;
|
||||||
|
case TIME_CALLBACK_EVENT_SET:
|
||||||
|
SetEvent((HANDLE32)lpTimer->lpFunc);
|
||||||
|
break;
|
||||||
|
case TIME_CALLBACK_EVENT_PULSE:
|
||||||
|
PulseEvent((HANDLE32)lpTimer->lpFunc);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
FIXME(mmtime,"Unknown callback type 0x%04x for mmtime callback (%p),ignored.\n",lpTimer->wFlags,lpTimer->lpFunc);
|
||||||
|
break;
|
||||||
|
}
|
||||||
TRACE(mmtime, "after CallBack16 !\n");
|
TRACE(mmtime, "after CallBack16 !\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
@ -328,12 +340,12 @@ DWORD WINAPI timeGetTime()
|
||||||
{
|
{
|
||||||
DWORD dwNewTick = GetTickCount();
|
DWORD dwNewTick = GetTickCount();
|
||||||
|
|
||||||
|
StartMMTime();
|
||||||
#ifdef USE_FAKE_MM_TIMERS
|
#ifdef USE_FAKE_MM_TIMERS
|
||||||
if (bUseFakeTimers) {
|
if (bUseFakeTimers) {
|
||||||
if (wInCallBackLoop++) {
|
if (wInCallBackLoop++) {
|
||||||
DWORD dwDelta;
|
DWORD dwDelta;
|
||||||
|
|
||||||
StartMMTime();
|
|
||||||
|
|
||||||
if (dwNewTick < dwLastCBTick) {
|
if (dwNewTick < dwLastCBTick) {
|
||||||
ERR(mmtime, "dwNewTick(%lu) < dwLastCBTick(%lu)\n", dwNewTick, dwLastCBTick);
|
ERR(mmtime, "dwNewTick(%lu) < dwLastCBTick(%lu)\n", dwNewTick, dwLastCBTick);
|
||||||
|
@ -357,7 +369,5 @@ DWORD WINAPI timeGetTime()
|
||||||
wInCallBackLoop--;
|
wInCallBackLoop--;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
TRACE(mmtime, "Time = %ld\n", dwNewTick);
|
|
||||||
|
|
||||||
return dwNewTick;
|
return dwNewTick;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue