1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 * Sample MCI ANIMATION Wine Driver for Linux
5 * Copyright 1994 Martin Ayotte
12 #include <sys/ioctl.h>
14 #include "wine/winuser16.h"
17 #include "multimedia.h"
22 #define ANIMFRAMES_PERSEC 30
23 #define ANIMFRAMES_PERMIN 1800
24 #define SECONDS_PERMIN 60
27 int nUseCount
; /* Incremented for each shared open */
28 BOOL16 fShareable
; /* TRUE if first open was shareable */
29 WORD wNotifyDeviceID
; /* MCI device ID with a pending notification */
30 HANDLE16 hCallback
; /* Callback handle for pending notification */
31 MCI_OPEN_PARMSA openParms
;
42 static WINE_MCIANIM AnimDev
[MAX_ANIMDRV
];
44 /*-----------------------------------------------------------------------*/
46 /**************************************************************************
47 * ANIM_mciGetOpenDrv [internal]
49 static WINE_MCIANIM
* ANIM_mciGetOpenDrv(UINT16 wDevID
)
51 if (wDevID
>= MAX_ANIMDRV
|| AnimDev
[wDevID
].nUseCount
== 0) {
52 WARN(mcianim
, "Invalid wDevID=%u\n", wDevID
);
55 return &AnimDev
[wDevID
];
58 /**************************************************************************
59 * ANIM_mciOpen [internal]
61 static DWORD
ANIM_mciOpen(UINT16 wDevID
, DWORD dwFlags
, LPMCI_OPEN_PARMSA lpOpenParms
)
66 TRACE(mcianim
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpOpenParms
);
68 if (lpOpenParms
== NULL
) return MCIERR_INTERNAL
;
69 if (wDevID
>= MAX_ANIMDRV
) return MCIERR_INVALID_DEVICE_ID
;
71 wma
= &AnimDev
[wDevID
];
73 if (wma
->nUseCount
> 0) {
74 /* The driver already open on this channel */
75 /* If the driver was opened shareable before and this open specifies */
76 /* shareable then increment the use count */
77 if (wma
->fShareable
&& (dwFlags
& MCI_OPEN_SHAREABLE
))
80 return MCIERR_MUST_USE_SHAREABLE
;
83 wma
->fShareable
= dwFlags
& MCI_OPEN_SHAREABLE
;
86 dwDeviceID
= lpOpenParms
->wDeviceID
;
88 TRACE(mcianim
,"wDevID=%04X\n", wDevID
);
89 /* FIXME this is not consistent with other implementations */
90 lpOpenParms
->wDeviceID
= wDevID
;
92 /*TRACE(mcianim,"lpParms->wDevID=%04X\n", lpParms->wDeviceID);*/
93 if (dwFlags
& MCI_OPEN_ELEMENT
) {
94 TRACE(mcianim
,"MCI_OPEN_ELEMENT '%s' !\n", lpOpenParms
->lpstrElementName
);
95 if (lpOpenParms
->lpstrElementName
&& strlen(lpOpenParms
->lpstrElementName
) > 0) {
97 FIXME(mcianim
, "element is not opened\n");
99 memcpy(&wma
->openParms
, lpOpenParms
, sizeof(MCI_OPEN_PARMSA
));
100 wma
->wNotifyDeviceID
= dwDeviceID
;
102 wma
->dwTimeFormat
= MCI_FORMAT_TMSF
;
106 wma
->lpdwTrackLen
= NULL
;
107 wma
->lpdwTrackPos
= NULL
;
109 Moved to mmsystem.c mciOpen routine
111 if (dwFlags & MCI_NOTIFY) {
112 TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
113 lpParms->dwCallback);
114 mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
115 wma->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
121 /**************************************************************************
122 * ANIM_mciClose [internal]
124 static DWORD
ANIM_mciClose(UINT16 wDevID
, DWORD dwParam
, LPMCI_GENERIC_PARMS lpParms
)
126 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
128 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwParam
, lpParms
);
130 if (wma
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
132 if (--wma
->nUseCount
== 0) {
133 if (wma
->lpdwTrackLen
!= NULL
) free(wma
->lpdwTrackLen
);
134 if (wma
->lpdwTrackPos
!= NULL
) free(wma
->lpdwTrackPos
);
139 /**************************************************************************
140 * ANIM_mciGetDevCaps [internal]
142 static DWORD
ANIM_mciGetDevCaps(UINT16 wDevID
, DWORD dwFlags
,
143 LPMCI_GETDEVCAPS_PARMS lpParms
)
145 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
147 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
149 if (lpParms
== NULL
) return MCIERR_NULL_PARAMETER_BLOCK
;
150 if (wma
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
152 if (dwFlags
& MCI_GETDEVCAPS_ITEM
) {
153 TRACE(mcianim
, "MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n", lpParms
->dwItem
);
154 switch(lpParms
->dwItem
) {
155 case MCI_GETDEVCAPS_CAN_RECORD
:
156 lpParms
->dwReturn
= FALSE
;
158 case MCI_GETDEVCAPS_HAS_AUDIO
:
159 lpParms
->dwReturn
= FALSE
;
161 case MCI_GETDEVCAPS_HAS_VIDEO
:
162 lpParms
->dwReturn
= FALSE
;
164 case MCI_GETDEVCAPS_DEVICE_TYPE
:
165 lpParms
->dwReturn
= MCI_DEVTYPE_ANIMATION
;
167 case MCI_GETDEVCAPS_USES_FILES
:
168 lpParms
->dwReturn
= TRUE
;
170 case MCI_GETDEVCAPS_COMPOUND_DEVICE
:
171 lpParms
->dwReturn
= FALSE
;
173 case MCI_GETDEVCAPS_CAN_EJECT
:
174 lpParms
->dwReturn
= TRUE
;
176 case MCI_GETDEVCAPS_CAN_PLAY
:
177 lpParms
->dwReturn
= FALSE
;
179 case MCI_GETDEVCAPS_CAN_SAVE
:
180 lpParms
->dwReturn
= FALSE
;
183 return MCIERR_UNRECOGNIZED_COMMAND
;
186 TRACE(mcianim
, "lpParms->dwReturn=%08lX;\n", lpParms
->dwReturn
);
191 /**************************************************************************
192 * ANIM_CalcTime [internal]
194 static DWORD
ANIM_CalcTime(WINE_MCIANIM
* wma
, DWORD dwFormatType
, DWORD dwFrame
)
202 TRACE(mcianim
,"(%p, %08lX, %lu);\n", wma
, dwFormatType
, dwFrame
);
204 switch (dwFormatType
) {
205 case MCI_FORMAT_MILLISECONDS
:
206 dwTime
= dwFrame
/ ANIMFRAMES_PERSEC
* 1000;
207 TRACE(mcianim
, "MILLISECONDS %lu\n", dwTime
);
210 wMinutes
= dwFrame
/ ANIMFRAMES_PERMIN
;
211 wSeconds
= (dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
) / ANIMFRAMES_PERSEC
;
212 wFrames
= dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
-
213 ANIMFRAMES_PERSEC
* wSeconds
;
214 dwTime
= MCI_MAKE_MSF(wMinutes
, wSeconds
, wFrames
);
215 TRACE(mcianim
,"MSF %02u:%02u:%02u -> dwTime=%lu\n",
216 wMinutes
, wSeconds
, wFrames
, dwTime
);
219 /* unknown format ! force TMSF ! ... */
220 dwFormatType
= MCI_FORMAT_TMSF
;
221 case MCI_FORMAT_TMSF
:
222 for (wTrack
= 0; wTrack
< wma
->nTracks
; wTrack
++) {
223 /* dwTime += wma->lpdwTrackLen[wTrack - 1];
224 TRACE(mcianim, "Adding trk#%u curpos=%u \n", dwTime);
225 if (dwTime >= dwFrame) break; */
226 if (wma
->lpdwTrackPos
[wTrack
- 1] >= dwFrame
) break;
228 wMinutes
= dwFrame
/ ANIMFRAMES_PERMIN
;
229 wSeconds
= (dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
) / ANIMFRAMES_PERSEC
;
230 wFrames
= dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
-
231 ANIMFRAMES_PERSEC
* wSeconds
;
232 dwTime
= MCI_MAKE_TMSF(wTrack
, wMinutes
, wSeconds
, wFrames
);
233 TRACE(mcianim
, "%02u-%02u:%02u:%02u\n",
234 wTrack
, wMinutes
, wSeconds
, wFrames
);
241 /**************************************************************************
242 * ANIM_CalcFrame [internal]
244 static DWORD
ANIM_CalcFrame(WINE_MCIANIM
* wma
, DWORD dwFormatType
, DWORD dwTime
)
249 TRACE(mcianim
,"(%p, %08lX, %lu);\n", wma
, dwFormatType
, dwTime
);
251 switch (dwFormatType
) {
252 case MCI_FORMAT_MILLISECONDS
:
253 dwFrame
= dwTime
* ANIMFRAMES_PERSEC
/ 1000;
254 TRACE(mcianim
, "MILLISECONDS %lu\n", dwFrame
);
257 TRACE(mcianim
, "MSF %02u:%02u:%02u\n",
258 MCI_MSF_MINUTE(dwTime
), MCI_MSF_SECOND(dwTime
),
259 MCI_MSF_FRAME(dwTime
));
260 dwFrame
+= ANIMFRAMES_PERMIN
* MCI_MSF_MINUTE(dwTime
);
261 dwFrame
+= ANIMFRAMES_PERSEC
* MCI_MSF_SECOND(dwTime
);
262 dwFrame
+= MCI_MSF_FRAME(dwTime
);
265 /* unknown format ! force TMSF ! ... */
266 dwFormatType
= MCI_FORMAT_TMSF
;
267 case MCI_FORMAT_TMSF
:
268 wTrack
= MCI_TMSF_TRACK(dwTime
);
269 TRACE(mcianim
, "TMSF %02u-%02u:%02u:%02u\n",
270 MCI_TMSF_TRACK(dwTime
), MCI_TMSF_MINUTE(dwTime
),
271 MCI_TMSF_SECOND(dwTime
), MCI_TMSF_FRAME(dwTime
));
272 TRACE(mcianim
, "TMSF trackpos[%u]=%lu\n",
273 wTrack
, wma
->lpdwTrackPos
[wTrack
- 1]);
274 dwFrame
= wma
->lpdwTrackPos
[wTrack
- 1];
275 dwFrame
+= ANIMFRAMES_PERMIN
* MCI_TMSF_MINUTE(dwTime
);
276 dwFrame
+= ANIMFRAMES_PERSEC
* MCI_TMSF_SECOND(dwTime
);
277 dwFrame
+= MCI_TMSF_FRAME(dwTime
);
284 /**************************************************************************
285 * ANIM_mciInfo [internal]
287 static DWORD
ANIM_mciInfo(UINT16 wDevID
, DWORD dwFlags
, LPMCI_INFO_PARMS16 lpParms
)
289 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
293 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
295 if (lpParms
== NULL
|| lpParms
->lpstrReturn
== NULL
) {
296 ret
= MCIERR_NULL_PARAMETER_BLOCK
;
297 } else if (wma
== NULL
) {
298 ret
= MCIERR_INVALID_DEVICE_ID
;
300 TRACE(mcianim
, "buf=%p, len=%lu\n", lpParms
->lpstrReturn
, lpParms
->dwRetSize
);
303 case MCI_INFO_PRODUCT
:
304 str
= "Wine's animation";
307 str
= wma
->openParms
.lpstrElementName
;
309 case MCI_ANIM_INFO_TEXT
:
310 str
= "Animation Window";
313 WARN(mcianim
, "Don't know this info command (%lu)\n", dwFlags
);
314 ret
= MCIERR_UNRECOGNIZED_COMMAND
;
318 ret
= MCI_WriteString(lpParms
->lpstrReturn
, lpParms
->dwRetSize
, str
);
320 lpParms
->lpstrReturn
[0] = 0;
326 /**************************************************************************
327 * ANIM_mciStatus [internal]
329 static DWORD
ANIM_mciStatus(UINT16 wDevID
, DWORD dwFlags
, LPMCI_STATUS_PARMS lpParms
)
331 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
333 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
335 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
336 if (wma
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
338 if (dwFlags
& MCI_NOTIFY
) {
339 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
340 lpParms
->dwCallback
);
341 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
342 wma
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
344 if (dwFlags
& MCI_STATUS_ITEM
) {
345 switch(lpParms
->dwItem
) {
346 case MCI_STATUS_CURRENT_TRACK
:
347 lpParms
->dwReturn
= wma
->nCurTrack
;
348 TRACE(mcianim
,"CURRENT_TRACK=%lu!\n", lpParms
->dwReturn
);
350 case MCI_STATUS_LENGTH
:
351 if (dwFlags
& MCI_TRACK
) {
352 TRACE(mcianim
,"MCI_TRACK #%lu LENGTH=??? !\n",
354 if (lpParms
->dwTrack
> wma
->nTracks
)
355 return MCIERR_OUTOFRANGE
;
356 lpParms
->dwReturn
= wma
->lpdwTrackLen
[lpParms
->dwTrack
];
359 lpParms
->dwReturn
= wma
->dwTotalLen
;
360 lpParms
->dwReturn
= ANIM_CalcTime(wma
, wma
->dwTimeFormat
, lpParms
->dwReturn
);
361 TRACE(mcianim
,"LENGTH=%lu !\n", lpParms
->dwReturn
);
363 case MCI_STATUS_MODE
:
364 lpParms
->dwReturn
= wma
->mode
;
365 TRACE(mcianim
,"MCI_STATUS_MODE=%08lX !\n",
368 case MCI_STATUS_MEDIA_PRESENT
:
369 lpParms
->dwReturn
= TRUE
;
370 TRACE(mcianim
,"MCI_STATUS_MEDIA_PRESENT !\n");
372 case MCI_STATUS_NUMBER_OF_TRACKS
:
373 lpParms
->dwReturn
= 1;
374 TRACE(mcianim
,"MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n",
376 if (lpParms
->dwReturn
== (WORD
)-1) return MCIERR_INTERNAL
;
378 case MCI_STATUS_POSITION
:
379 lpParms
->dwReturn
= wma
->dwCurFrame
;
380 if (dwFlags
& MCI_STATUS_START
) {
381 lpParms
->dwReturn
= 0;
382 TRACE(mcianim
,"get MCI_STATUS_START !\n");
384 if (dwFlags
& MCI_TRACK
) {
385 if (lpParms
->dwTrack
> wma
->nTracks
)
386 return MCIERR_OUTOFRANGE
;
387 lpParms
->dwReturn
= wma
->lpdwTrackPos
[lpParms
->dwTrack
- 1];
388 TRACE(mcianim
,"get MCI_TRACK #%lu !\n", lpParms
->dwTrack
);
390 lpParms
->dwReturn
= ANIM_CalcTime(wma
, wma
->dwTimeFormat
, lpParms
->dwReturn
);
391 TRACE(mcianim
,"MCI_STATUS_POSITION=%08lX !\n",
394 case MCI_STATUS_READY
:
395 TRACE(mcianim
,"MCI_STATUS_READY !\n");
396 lpParms
->dwReturn
= TRUE
;
398 case MCI_STATUS_TIME_FORMAT
:
399 TRACE(mcianim
,"MCI_STATUS_TIME_FORMAT !\n");
400 lpParms
->dwReturn
= MCI_FORMAT_MILLISECONDS
;
403 WARN(mcianim
,"Unknown command %08lX !\n", lpParms
->dwItem
);
404 return MCIERR_UNRECOGNIZED_COMMAND
;
407 WARN(mcianim
,"Not MCI_STATUS_ITEM !\n");
412 /**************************************************************************
413 * ANIM_mciPlay [internal]
415 static DWORD
ANIM_mciPlay(UINT16 wDevID
, DWORD dwFlags
, LPMCI_PLAY_PARMS lpParms
)
417 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
420 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
422 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
423 if (wma
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
425 start
= 0; end
= wma
->dwTotalLen
;
427 if (dwFlags
& MCI_FROM
) {
428 start
= ANIM_CalcFrame(wma
, wma
->dwTimeFormat
, lpParms
->dwFrom
);
429 TRACE(mcianim
,"MCI_FROM=%08lX -> %u \n", lpParms
->dwFrom
, start
);
431 if (dwFlags
& MCI_TO
) {
432 end
= ANIM_CalcFrame(wma
, wma
->dwTimeFormat
, lpParms
->dwTo
);
433 TRACE(mcianim
, "MCI_TO=%08lX -> %u \n", lpParms
->dwTo
, end
);
435 wma
->mode
= MCI_MODE_PLAY
;
436 if (dwFlags
& MCI_NOTIFY
) {
437 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
438 lpParms
->dwCallback
);
439 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
440 wma
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
445 /**************************************************************************
446 * ANIM_mciStop [internal]
448 static DWORD
ANIM_mciStop(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
450 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
452 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
454 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
455 if (wma
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
457 wma
->mode
= MCI_MODE_STOP
;
458 if (dwFlags
& MCI_NOTIFY
) {
459 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
460 lpParms
->dwCallback
);
461 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
462 wma
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
467 /**************************************************************************
468 * ANIM_mciPause [internal]
470 static DWORD
ANIM_mciPause(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
472 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
474 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
475 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
476 wma
->mode
= MCI_MODE_PAUSE
;
477 if (dwFlags
& MCI_NOTIFY
) {
478 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
479 lpParms
->dwCallback
);
480 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
481 wma
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
486 /**************************************************************************
487 * ANIM_mciResume [internal]
489 static DWORD
ANIM_mciResume(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
491 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
493 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
494 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
495 wma
->mode
= MCI_MODE_STOP
;
496 if (dwFlags
& MCI_NOTIFY
) {
497 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
498 lpParms
->dwCallback
);
499 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
500 wma
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
505 /**************************************************************************
506 * ANIM_mciSeek [internal]
508 static DWORD
ANIM_mciSeek(UINT16 wDevID
, DWORD dwFlags
, LPMCI_SEEK_PARMS lpParms
)
510 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
512 MCI_PLAY_PARMS PlayParms
;
514 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
516 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
517 wma
->mode
= MCI_MODE_SEEK
;
519 case MCI_SEEK_TO_START
:
520 PlayParms
.dwFrom
= 0;
522 case MCI_SEEK_TO_END
:
523 PlayParms
.dwFrom
= wma
->dwTotalLen
;
526 PlayParms
.dwFrom
= lpParms
->dwTo
;
529 dwRet
= ANIM_mciPlay(wDevID
, MCI_WAIT
| MCI_FROM
, &PlayParms
);
530 if (dwRet
!= 0) return dwRet
;
531 dwRet
= ANIM_mciStop(wDevID
, MCI_WAIT
, (LPMCI_GENERIC_PARMS
)&PlayParms
);
532 if (dwFlags
& MCI_NOTIFY
) {
533 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
534 lpParms
->dwCallback
);
535 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
536 wma
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
542 /**************************************************************************
543 * ANIM_mciSet [internal]
545 static DWORD
ANIM_mciSet(UINT16 wDevID
, DWORD dwFlags
, LPMCI_SET_PARMS lpParms
)
547 WINE_MCIANIM
* wma
= ANIM_mciGetOpenDrv(wDevID
);
549 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
550 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
551 if (wma
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
553 TRACE(mcianim,"(dwTimeFormat=%08lX)\n", lpParms->dwTimeFormat);
554 TRACE(mcianim,"(dwAudio=%08lX)\n", lpParms->dwAudio);
556 if (dwFlags
& MCI_SET_TIME_FORMAT
) {
557 switch (lpParms
->dwTimeFormat
) {
558 case MCI_FORMAT_MILLISECONDS
:
559 TRACE(mcianim
, "MCI_FORMAT_MILLISECONDS !\n");
562 TRACE(mcianim
,"MCI_FORMAT_MSF !\n");
564 case MCI_FORMAT_TMSF
:
565 TRACE(mcianim
,"MCI_FORMAT_TMSF !\n");
568 WARN(mcianim
,"Bad time format !\n");
569 return MCIERR_BAD_TIME_FORMAT
;
571 wma
->dwTimeFormat
= lpParms
->dwTimeFormat
;
573 if (dwFlags
& MCI_SET_VIDEO
) return MCIERR_UNSUPPORTED_FUNCTION
;
574 if (dwFlags
& MCI_SET_ON
) return MCIERR_UNSUPPORTED_FUNCTION
;
575 if (dwFlags
& MCI_SET_OFF
) return MCIERR_UNSUPPORTED_FUNCTION
;
576 if (dwFlags
& MCI_NOTIFY
) {
577 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
578 lpParms
->dwCallback
);
579 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
580 wma
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
585 /**************************************************************************
586 * ANIM_DriverProc32 [sample driver]
588 LONG
MCIANIM_DriverProc(DWORD dwDevID
, HDRVR16 hDriv
, DWORD wMsg
,
589 DWORD dwParam1
, DWORD dwParam2
)
592 case DRV_LOAD
: return 1;
593 case DRV_FREE
: return 1;
594 case DRV_OPEN
: return 1;
595 case DRV_CLOSE
: return 1;
596 case DRV_ENABLE
: return 1;
597 case DRV_DISABLE
: return 1;
598 case DRV_QUERYCONFIGURE
: return 1;
599 case DRV_CONFIGURE
: MessageBoxA(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK
); return 1;
600 case DRV_INSTALL
: return DRVCNF_RESTART
;
601 case DRV_REMOVE
: return DRVCNF_RESTART
;
603 case MCI_OPEN_DRIVER
: return ANIM_mciOpen(dwDevID
, dwParam1
, (LPMCI_OPEN_PARMSA
)dwParam2
);
604 case MCI_CLOSE_DRIVER
: return ANIM_mciClose(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
605 case MCI_GETDEVCAPS
: return ANIM_mciGetDevCaps(dwDevID
, dwParam1
, (LPMCI_GETDEVCAPS_PARMS
)dwParam2
);
606 case MCI_INFO
: return ANIM_mciInfo(dwDevID
, dwParam1
, (LPMCI_INFO_PARMS16
)dwParam2
);
607 case MCI_STATUS
: return ANIM_mciStatus(dwDevID
, dwParam1
, (LPMCI_STATUS_PARMS
)dwParam2
);
608 case MCI_SET
: return ANIM_mciSet(dwDevID
, dwParam1
, (LPMCI_SET_PARMS
)dwParam2
);
609 case MCI_PLAY
: return ANIM_mciPlay(dwDevID
, dwParam1
, (LPMCI_PLAY_PARMS
)dwParam2
);
610 case MCI_STOP
: return ANIM_mciStop(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
611 case MCI_PAUSE
: return ANIM_mciPause(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
612 case MCI_RESUME
: return ANIM_mciResume(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
613 case MCI_SEEK
: return ANIM_mciSeek(dwDevID
, dwParam1
, (LPMCI_SEEK_PARMS
)dwParam2
);
630 WARN(mcianim
, "Unsupported command=%s\n", MCI_CommandToString(wMsg
));
634 FIXME(mcianim
, "Shouldn't receive a MCI_OPEN or CLOSE message\n");
637 TRACE(mcianim
, "Sending msg=%s to default driver proc\n", MCI_CommandToString(wMsg
));
638 return DefDriverProc(dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
640 return MCIERR_UNRECOGNIZED_COMMAND
;
644 /*-----------------------------------------------------------------------*/