| 1 | /*
|
|---|
| 2 | * Timer MM apis
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 5 | *
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 | #include <os2win.h>
|
|---|
| 11 | #include "misc.h"
|
|---|
| 12 |
|
|---|
| 13 | #include "os2timer.h"
|
|---|
| 14 |
|
|---|
| 15 | /******************************************************************************/
|
|---|
| 16 | UINT WIN32API mmsystemGetVersion(void)
|
|---|
| 17 | {
|
|---|
| 18 | dprintf(("WINMM:mmsystemGetVersion\n"));
|
|---|
| 19 | return 4;
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | /******************************************************************************/
|
|---|
| 23 | MMRESULT WIN32API timeGetDevCaps(LPTIMECAPS ptc, UINT cbtc)
|
|---|
| 24 | {
|
|---|
| 25 | dprintf(("WINMM:timeGetDevCaps Not really Implemented\n"));
|
|---|
| 26 | ptc->wPeriodMin = 1;
|
|---|
| 27 | ptc->wPeriodMax = 20;
|
|---|
| 28 | return TIMERR_NOERROR;
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | /******************************************************************************/
|
|---|
| 32 | MMRESULT WIN32API timeBeginPeriod(UINT cMilliseconds)
|
|---|
| 33 | {
|
|---|
| 34 | dprintf(("WINMM:timeBeginPeriod %d ms\n", cMilliseconds));
|
|---|
| 35 | return TIMERR_NOERROR;
|
|---|
| 36 | }
|
|---|
| 37 | /******************************************************************************/
|
|---|
| 38 | /******************************************************************************/
|
|---|
| 39 | MMRESULT WIN32API timeEndPeriod(UINT cMilliseconds)
|
|---|
| 40 | {
|
|---|
| 41 | dprintf(("WINMM:timeEndPeriod %d ms\n", cMilliseconds));
|
|---|
| 42 | return TIMERR_NOERROR;
|
|---|
| 43 | }
|
|---|
| 44 | /******************************************************************************/
|
|---|
| 45 | /******************************************************************************/
|
|---|
| 46 | MMRESULT WIN32API timeKillEvent(UINT IDEvent)
|
|---|
| 47 | {
|
|---|
| 48 | dprintf(("WINMM:timeKillEvent Not Implemented\n"));
|
|---|
| 49 | delete((OS2Timer *)IDEvent);
|
|---|
| 50 | return TIMERR_NOERROR;
|
|---|
| 51 | }
|
|---|
| 52 | /******************************************************************************/
|
|---|
| 53 | /******************************************************************************/
|
|---|
| 54 | MMRESULT WIN32API timeSetEvent(UINT wDelay, UINT wResolution, LPTIMECALLBACK lptc,
|
|---|
| 55 | DWORD dwUser, UINT fuEvent)
|
|---|
| 56 | {
|
|---|
| 57 | OS2Timer *timer;
|
|---|
| 58 |
|
|---|
| 59 | dprintf(("WINMM:timeSetEvent %d\n", wDelay));
|
|---|
| 60 |
|
|---|
| 61 | timer = new OS2Timer();
|
|---|
| 62 | if(timer == NULL) {
|
|---|
| 63 | return(0);
|
|---|
| 64 | }
|
|---|
| 65 | if(timer->StartTimer(wDelay, wResolution, lptc, dwUser, fuEvent) == FALSE) {
|
|---|
| 66 | dprintf(("WINMM:timeSetEvent: couldn't start timer!\n"));
|
|---|
| 67 | delete(timer);
|
|---|
| 68 | return(0);
|
|---|
| 69 | }
|
|---|
| 70 | return(MMRESULT)timer;
|
|---|
| 71 | }
|
|---|
| 72 |
|
|---|
| 73 | /******************************************************************************/
|
|---|
| 74 | MMRESULT WIN32API timeGetSystemTime( LPMMTIME arg1, UINT arg2)
|
|---|
| 75 | {
|
|---|
| 76 | dprintf(("WINMM:timeGetSystemTime\n"));
|
|---|
| 77 | return O32_timeGetSystemTime(arg1, arg2);
|
|---|
| 78 | }
|
|---|