| 1 | /* $Id: winmm.cpp,v 1.4 1999-08-19 18:46:05 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Timer MM apis
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | *
|
|---|
| 8 | *
|
|---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 10 | *
|
|---|
| 11 | */
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | /****************************************************************************
|
|---|
| 15 | * Includes *
|
|---|
| 16 | ****************************************************************************/
|
|---|
| 17 |
|
|---|
| 18 | #include <os2win.h>
|
|---|
| 19 | #include <odinwrap.h>
|
|---|
| 20 | #include "misc.h"
|
|---|
| 21 |
|
|---|
| 22 | #include "os2timer.h"
|
|---|
| 23 |
|
|---|
| 24 | ODINDEBUGCHANNEL(WINMM-WINMM)
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | /******************************************************************************/
|
|---|
| 28 | ODINFUNCTION0(UINT, mmsystemGetVersion)
|
|---|
| 29 | {
|
|---|
| 30 | return 4;
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | /******************************************************************************/
|
|---|
| 34 | ODINFUNCTION2(MMRESULT, timeGetDevCaps,
|
|---|
| 35 | LPTIMECAPS, ptc,
|
|---|
| 36 | UINT, cbtc)
|
|---|
| 37 | {
|
|---|
| 38 | dprintf(("WINMM:timeGetDevCaps Not really Implemented\n"));
|
|---|
| 39 | ptc->wPeriodMin = 1;
|
|---|
| 40 | ptc->wPeriodMax = 20;
|
|---|
| 41 | return TIMERR_NOERROR;
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | /******************************************************************************/
|
|---|
| 45 | ODINFUNCTION1(MMRESULT, timeBeginPeriod,
|
|---|
| 46 | UINT, cMilliseconds)
|
|---|
| 47 | {
|
|---|
| 48 | dprintf(("WINMM: timeBeginPeriod not implemented.\n"));
|
|---|
| 49 | return TIMERR_NOERROR;
|
|---|
| 50 | }
|
|---|
| 51 | /******************************************************************************/
|
|---|
| 52 | /******************************************************************************/
|
|---|
| 53 | ODINFUNCTION1(MMRESULT, timeEndPeriod,
|
|---|
| 54 | UINT, cMilliseconds)
|
|---|
| 55 | {
|
|---|
| 56 | dprintf(("WINMM: timeEndPeriod not implemented.\n"));
|
|---|
| 57 | return TIMERR_NOERROR;
|
|---|
| 58 | }
|
|---|
| 59 | /******************************************************************************/
|
|---|
| 60 | /******************************************************************************/
|
|---|
| 61 | ODINFUNCTION1(MMRESULT, timeKillEvent,
|
|---|
| 62 | UINT, IDEvent)
|
|---|
| 63 | {
|
|---|
| 64 | dprintf(("WINMM:timeKillEvent Not Implemented\n"));
|
|---|
| 65 | delete((OS2Timer *)IDEvent);
|
|---|
| 66 | return TIMERR_NOERROR;
|
|---|
| 67 | }
|
|---|
| 68 | /******************************************************************************/
|
|---|
| 69 | /******************************************************************************/
|
|---|
| 70 | ODINFUNCTION5(MMRESULT, timeSetEvent,
|
|---|
| 71 | UINT, wDelay,
|
|---|
| 72 | UINT, wResolution,
|
|---|
| 73 | LPTIMECALLBACK, lptc,
|
|---|
| 74 | DWORD, dwUser,
|
|---|
| 75 | UINT, fuEvent)
|
|---|
| 76 | {
|
|---|
| 77 | OS2Timer *timer;
|
|---|
| 78 |
|
|---|
| 79 | timer = new OS2Timer();
|
|---|
| 80 | if(timer == NULL)
|
|---|
| 81 | return(0);
|
|---|
| 82 |
|
|---|
| 83 | if(timer->StartTimer(wDelay, wResolution, lptc, dwUser, fuEvent) == FALSE)
|
|---|
| 84 | {
|
|---|
| 85 | dprintf(("WINMM:timeSetEvent: couldn't start timer!\n"));
|
|---|
| 86 | delete(timer);
|
|---|
| 87 | return(0);
|
|---|
| 88 | }
|
|---|
| 89 | return(MMRESULT)timer;
|
|---|
| 90 | }
|
|---|
| 91 |
|
|---|
| 92 | /******************************************************************************/
|
|---|
| 93 | ODINFUNCTION2(MMRESULT, timeGetSystemTime,
|
|---|
| 94 | LPMMTIME, arg1,
|
|---|
| 95 | UINT, arg2)
|
|---|
| 96 | {
|
|---|
| 97 | return O32_timeGetSystemTime(arg1, arg2);
|
|---|
| 98 | }
|
|---|
| 99 |
|
|---|