Added win32 enhanced functionality to timer callbacks.

This commit is contained in:
Marcus Meissner 1998-10-11 10:51:17 +00:00 committed by Alexandre Julliard
parent b02ffc7546
commit 8deb379f59
4 changed files with 31 additions and 18 deletions

View File

@ -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);
DECL_WINELIB_TYPE(LPTIMECALLBACK)
#define TIME_ONESHOT 0 /* program timer for single event */
#define TIME_PERIODIC 1 /* program for continuous periodic event */
#define TIME_ONESHOT 0x0000 /* program timer for single 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 {
UINT16 wPeriodMin; /* minimum period supported */

View File

@ -11,7 +11,7 @@
#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
* 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

View File

@ -92,8 +92,8 @@ BOOL32 MULTIMEDIA_Init(void)
}
if (numsynthdevs > MAX_MIDIOUTDRV) {
ERR(midi, "MAX_MIDIOUTDRV was enough for the number of devices. "
"Some FM devices will not be available.\n");
ERR(midi, "MAX_MIDIOUTDRV (%d) was enough for the number of devices (%d). "
"Some FM devices will not be available.\n",MAX_MIDIOUTDRV,numsynthdevs);
numsynthdevs = MAX_MIDIOUTDRV;
}
@ -167,8 +167,8 @@ BOOL32 MULTIMEDIA_Init(void)
}
if (nummididevs > MAX_MIDIINDRV) {
ERR(midi, "MAX_MIDIINDRV was not enough for the number of devices. "
"Some MIDI devices will not be available.\n");
ERR(midi, "MAX_MIDIINDRV (%d) was not enough for the number of devices (%d). "
"Some MIDI devices will not be available.\n",MAX_MIDIINDRV,nummididevs);
nummididevs = MAX_MIDIINDRV;
}

View File

@ -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
* guess current implementation via SetTimer has to be improved upon.
*/
if (lpTimer->isWin32)
lpTimer->lpFunc(lpTimer->wTimerID,0,lpTimer->dwUser,0,0);
else
Callbacks->CallTimeFuncProc(lpTimer->lpFunc,
lpTimer->wTimerID,0,
lpTimer->dwUser,0,0);
switch (lpTimer->wFlags & 0x30) {
case TIME_CALLBACK_FUNCTION:
if (lpTimer->isWin32)
lpTimer->lpFunc(lpTimer->wTimerID,0,lpTimer->dwUser,0,0);
else
Callbacks->CallTimeFuncProc(lpTimer->lpFunc,
lpTimer->wTimerID,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");
fflush(stdout);
}
@ -328,12 +340,12 @@ DWORD WINAPI timeGetTime()
{
DWORD dwNewTick = GetTickCount();
StartMMTime();
#ifdef USE_FAKE_MM_TIMERS
if (bUseFakeTimers) {
if (wInCallBackLoop++) {
DWORD dwDelta;
StartMMTime();
if (dwNewTick < dwLastCBTick) {
ERR(mmtime, "dwNewTick(%lu) < dwLastCBTick(%lu)\n", dwNewTick, dwLastCBTick);
@ -357,7 +369,5 @@ DWORD WINAPI timeGetTime()
wInCallBackLoop--;
}
#endif
TRACE(mmtime, "Time = %ld\n", dwNewTick);
return dwNewTick;
}