2 * Sample MCI ANIMATION Wine Driver for Linux
4 * Copyright 1994 Martin Ayotte
11 #include <sys/ioctl.h>
20 #define ANIMFRAMES_PERSEC 30
21 #define ANIMFRAMES_PERMIN 1800
22 #define SECONDS_PERMIN 60
25 int nUseCount
; /* Incremented for each shared open */
26 BOOL16 fShareable
; /* TRUE if first open was shareable */
27 WORD wNotifyDeviceID
; /* MCI device ID with a pending notification */
28 HANDLE16 hCallback
; /* Callback handle for pending notification */
29 MCI_OPEN_PARMS16 openParms
;
40 static LINUX_ANIM AnimDev
[MAX_ANIMDRV
];
43 /*-----------------------------------------------------------------------*/
45 /**************************************************************************
46 * ANIM_mciOpen [internal]
48 static DWORD
ANIM_mciOpen(UINT16 wDevID
, DWORD dwFlags
, LPMCI_OPEN_PARMS16 lpParms
)
50 LPSTR lpstrElementName
;
53 TRACE(mcianim
,"(%04X, %08lX, %p);\n",
54 wDevID
, dwFlags
, lpParms
);
55 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
56 if (AnimDev
[wDevID
].nUseCount
> 0) {
57 /* The driver already open on this channel */
58 /* If the driver was opened shareable before and this open specifies */
59 /* shareable then increment the use count */
60 if (AnimDev
[wDevID
].fShareable
&& (dwFlags
& MCI_OPEN_SHAREABLE
))
61 ++AnimDev
[wDevID
].nUseCount
;
63 return MCIERR_MUST_USE_SHAREABLE
;
66 AnimDev
[wDevID
].nUseCount
= 1;
67 AnimDev
[wDevID
].fShareable
= dwFlags
& MCI_OPEN_SHAREABLE
;
69 TRACE(mcianim
,"wDevID=%04X\n", wDevID
);
70 lpParms
->wDeviceID
= wDevID
;
71 TRACE(mcianim
,"lpParms->wDevID=%04X\n", lpParms
->wDeviceID
);
72 if (dwFlags
& MCI_OPEN_ELEMENT
) {
73 lpstrElementName
= (LPSTR
)PTR_SEG_TO_LIN(lpParms
->lpstrElementName
);
74 TRACE(mcianim
,"MCI_OPEN_ELEMENT '%s' !\n",
76 if (strlen(lpstrElementName
) > 0) {
77 strcpy(str
, lpstrElementName
);
81 memcpy(&AnimDev
[wDevID
].openParms
, lpParms
, sizeof(MCI_OPEN_PARMS16
));
82 AnimDev
[wDevID
].wNotifyDeviceID
= lpParms
->wDeviceID
;
83 AnimDev
[wDevID
].mode
= 0;
84 AnimDev
[wDevID
].dwTimeFormat
= MCI_FORMAT_TMSF
;
85 AnimDev
[wDevID
].nCurTrack
= 0;
86 AnimDev
[wDevID
].nTracks
= 0;
87 AnimDev
[wDevID
].dwTotalLen
= 0;
88 AnimDev
[wDevID
].lpdwTrackLen
= NULL
;
89 AnimDev
[wDevID
].lpdwTrackPos
= NULL
;
91 Moved to mmsystem.c mciOpen routine
93 if (dwFlags & MCI_NOTIFY) {
94 TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
96 mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
97 AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
103 /**************************************************************************
104 * ANIM_mciClose [internal]
106 static DWORD
ANIM_mciClose(UINT16 wDevID
, DWORD dwParam
, LPMCI_GENERIC_PARMS lpParms
)
108 TRACE(mcianim
,"(%u, %08lX, %p);\n",
109 wDevID
, dwParam
, lpParms
);
110 if (AnimDev
[wDevID
].lpdwTrackLen
!= NULL
) free(AnimDev
[wDevID
].lpdwTrackLen
);
111 if (AnimDev
[wDevID
].lpdwTrackPos
!= NULL
) free(AnimDev
[wDevID
].lpdwTrackPos
);
115 /**************************************************************************
116 * ANIM_mciGetDevCaps [internal]
118 static DWORD
ANIM_mciGetDevCaps(UINT16 wDevID
, DWORD dwFlags
,
119 LPMCI_GETDEVCAPS_PARMS lpParms
)
121 TRACE(mcianim
,"(%u, %08lX, %p);\n",
122 wDevID
, dwFlags
, lpParms
);
123 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
124 if (dwFlags
& MCI_GETDEVCAPS_ITEM
) {
125 TRACE(mcianim
, "MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n",
127 switch(lpParms
->dwItem
) {
128 case MCI_GETDEVCAPS_CAN_RECORD
:
129 lpParms
->dwReturn
= FALSE
;
131 case MCI_GETDEVCAPS_HAS_AUDIO
:
132 lpParms
->dwReturn
= FALSE
;
134 case MCI_GETDEVCAPS_HAS_VIDEO
:
135 lpParms
->dwReturn
= FALSE
;
137 case MCI_GETDEVCAPS_DEVICE_TYPE
:
138 lpParms
->dwReturn
= MCI_DEVTYPE_ANIMATION
;
140 case MCI_GETDEVCAPS_USES_FILES
:
141 lpParms
->dwReturn
= TRUE
;
143 case MCI_GETDEVCAPS_COMPOUND_DEVICE
:
144 lpParms
->dwReturn
= FALSE
;
146 case MCI_GETDEVCAPS_CAN_EJECT
:
147 lpParms
->dwReturn
= TRUE
;
149 case MCI_GETDEVCAPS_CAN_PLAY
:
150 lpParms
->dwReturn
= FALSE
;
152 case MCI_GETDEVCAPS_CAN_SAVE
:
153 lpParms
->dwReturn
= FALSE
;
156 return MCIERR_UNRECOGNIZED_COMMAND
;
159 TRACE(mcianim
, "lpParms->dwReturn=%08lX;\n",
165 /**************************************************************************
166 * ANIM_CalcTime [internal]
168 static DWORD
ANIM_CalcTime(UINT16 wDevID
, DWORD dwFormatType
, DWORD dwFrame
)
175 TRACE(mcianim
,"(%u, %08lX, %lu);\n",
176 wDevID
, dwFormatType
, dwFrame
);
178 switch (dwFormatType
) {
179 case MCI_FORMAT_MILLISECONDS
:
180 dwTime
= dwFrame
/ ANIMFRAMES_PERSEC
* 1000;
181 TRACE(mcianim
, "MILLISECONDS %lu\n", dwTime
);
184 wMinutes
= dwFrame
/ ANIMFRAMES_PERMIN
;
185 wSeconds
= (dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
) / ANIMFRAMES_PERSEC
;
186 wFrames
= dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
-
187 ANIMFRAMES_PERSEC
* wSeconds
;
188 dwTime
= MCI_MAKE_MSF(wMinutes
, wSeconds
, wFrames
);
189 TRACE(mcianim
,"MSF %02u:%02u:%02u -> dwTime=%lu\n",
190 wMinutes
, wSeconds
, wFrames
, dwTime
);
193 /* unknown format ! force TMSF ! ... */
194 dwFormatType
= MCI_FORMAT_TMSF
;
195 case MCI_FORMAT_TMSF
:
196 for (wTrack
= 0; wTrack
< AnimDev
[wDevID
].nTracks
; wTrack
++) {
197 /* dwTime += AnimDev[wDevID].lpdwTrackLen[wTrack - 1];
198 TRACE(mcianim, "Adding trk#%u curpos=%u \n", dwTime);
199 if (dwTime >= dwFrame) break; */
200 if (AnimDev
[wDevID
].lpdwTrackPos
[wTrack
- 1] >= dwFrame
) break;
202 wMinutes
= dwFrame
/ ANIMFRAMES_PERMIN
;
203 wSeconds
= (dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
) / ANIMFRAMES_PERSEC
;
204 wFrames
= dwFrame
- ANIMFRAMES_PERMIN
* wMinutes
-
205 ANIMFRAMES_PERSEC
* wSeconds
;
206 dwTime
= MCI_MAKE_TMSF(wTrack
, wMinutes
, wSeconds
, wFrames
);
207 TRACE(mcianim
, "%02u-%02u:%02u:%02u\n",
208 wTrack
, wMinutes
, wSeconds
, wFrames
);
215 /**************************************************************************
216 * ANIM_CalcFrame [internal]
218 static DWORD
ANIM_CalcFrame(UINT16 wDevID
, DWORD dwFormatType
, DWORD dwTime
)
222 TRACE(mcianim
,"(%u, %08lX, %lu);\n",
223 wDevID
, dwFormatType
, dwTime
);
225 switch (dwFormatType
) {
226 case MCI_FORMAT_MILLISECONDS
:
227 dwFrame
= dwTime
* ANIMFRAMES_PERSEC
/ 1000;
228 TRACE(mcianim
, "MILLISECONDS %lu\n", dwFrame
);
231 TRACE(mcianim
, "MSF %02u:%02u:%02u\n",
232 MCI_MSF_MINUTE(dwTime
), MCI_MSF_SECOND(dwTime
),
233 MCI_MSF_FRAME(dwTime
));
234 dwFrame
+= ANIMFRAMES_PERMIN
* MCI_MSF_MINUTE(dwTime
);
235 dwFrame
+= ANIMFRAMES_PERSEC
* MCI_MSF_SECOND(dwTime
);
236 dwFrame
+= MCI_MSF_FRAME(dwTime
);
239 /* unknown format ! force TMSF ! ... */
240 dwFormatType
= MCI_FORMAT_TMSF
;
241 case MCI_FORMAT_TMSF
:
242 wTrack
= MCI_TMSF_TRACK(dwTime
);
243 TRACE(mcianim
, "TMSF %02u-%02u:%02u:%02u\n",
244 MCI_TMSF_TRACK(dwTime
), MCI_TMSF_MINUTE(dwTime
),
245 MCI_TMSF_SECOND(dwTime
), MCI_TMSF_FRAME(dwTime
));
246 TRACE(mcianim
, "TMSF trackpos[%u]=%lu\n",
247 wTrack
, AnimDev
[wDevID
].lpdwTrackPos
[wTrack
- 1]);
248 dwFrame
= AnimDev
[wDevID
].lpdwTrackPos
[wTrack
- 1];
249 dwFrame
+= ANIMFRAMES_PERMIN
* MCI_TMSF_MINUTE(dwTime
);
250 dwFrame
+= ANIMFRAMES_PERSEC
* MCI_TMSF_SECOND(dwTime
);
251 dwFrame
+= MCI_TMSF_FRAME(dwTime
);
258 /**************************************************************************
259 * ANIM_mciInfo [internal]
261 static DWORD
ANIM_mciInfo(UINT16 wDevID
, DWORD dwFlags
, LPMCI_INFO_PARMS16 lpParms
)
263 TRACE(mcianim
,"(%u, %08lX, %p);\n",
264 wDevID
, dwFlags
, lpParms
);
265 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
266 lpParms
->lpstrReturn
= NULL
;
268 case MCI_INFO_PRODUCT
:
269 lpParms
->lpstrReturn
= "Linux ANIMATION 0.5";
272 lpParms
->lpstrReturn
=
273 (LPSTR
)AnimDev
[wDevID
].openParms
.lpstrElementName
;
275 case MCI_ANIM_INFO_TEXT
:
276 lpParms
->lpstrReturn
= "Animation Window";
279 return MCIERR_UNRECOGNIZED_COMMAND
;
281 if (lpParms
->lpstrReturn
!= NULL
)
282 lpParms
->dwRetSize
= strlen(lpParms
->lpstrReturn
);
284 lpParms
->dwRetSize
= 0;
288 /**************************************************************************
289 * ANIM_mciStatus [internal]
291 static DWORD
ANIM_mciStatus(UINT16 wDevID
, DWORD dwFlags
, LPMCI_STATUS_PARMS lpParms
)
293 TRACE(mcianim
,"(%u, %08lX, %p);\n",
294 wDevID
, dwFlags
, lpParms
);
295 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
296 if (dwFlags
& MCI_NOTIFY
) {
297 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
298 lpParms
->dwCallback
);
299 mciDriverNotify((HWND16
)LOWORD(lpParms
->dwCallback
),
300 AnimDev
[wDevID
].wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
302 if (dwFlags
& MCI_STATUS_ITEM
) {
303 switch(lpParms
->dwItem
) {
304 case MCI_STATUS_CURRENT_TRACK
:
305 lpParms
->dwReturn
= AnimDev
[wDevID
].nCurTrack
;
306 TRACE(mcianim
,"CURRENT_TRACK=%lu!\n", lpParms
->dwReturn
);
308 case MCI_STATUS_LENGTH
:
309 if (dwFlags
& MCI_TRACK
) {
310 TRACE(mcianim
,"MCI_TRACK #%lu LENGTH=??? !\n",
312 if (lpParms
->dwTrack
> AnimDev
[wDevID
].nTracks
)
313 return MCIERR_OUTOFRANGE
;
314 lpParms
->dwReturn
= AnimDev
[wDevID
].lpdwTrackLen
[lpParms
->dwTrack
];
317 lpParms
->dwReturn
= AnimDev
[wDevID
].dwTotalLen
;
318 lpParms
->dwReturn
= ANIM_CalcTime(wDevID
,
319 AnimDev
[wDevID
].dwTimeFormat
, lpParms
->dwReturn
);
320 TRACE(mcianim
,"LENGTH=%lu !\n", lpParms
->dwReturn
);
322 case MCI_STATUS_MODE
:
323 lpParms
->dwReturn
= AnimDev
[wDevID
].mode
;
324 TRACE(mcianim
,"MCI_STATUS_MODE=%08lX !\n",
327 case MCI_STATUS_MEDIA_PRESENT
:
328 lpParms
->dwReturn
= TRUE
;
329 TRACE(mcianim
,"MCI_STATUS_MEDIA_PRESENT !\n");
331 case MCI_STATUS_NUMBER_OF_TRACKS
:
332 lpParms
->dwReturn
= 1;
333 TRACE(mcianim
,"MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n",
335 if (lpParms
->dwReturn
== (WORD
)-1) return MCIERR_INTERNAL
;
337 case MCI_STATUS_POSITION
:
338 lpParms
->dwReturn
= AnimDev
[wDevID
].dwCurFrame
;
339 if (dwFlags
& MCI_STATUS_START
) {
340 lpParms
->dwReturn
= 0;
341 TRACE(mcianim
,"get MCI_STATUS_START !\n");
343 if (dwFlags
& MCI_TRACK
) {
344 if (lpParms
->dwTrack
> AnimDev
[wDevID
].nTracks
)
345 return MCIERR_OUTOFRANGE
;
346 lpParms
->dwReturn
= AnimDev
[wDevID
].lpdwTrackPos
[lpParms
->dwTrack
- 1];
347 TRACE(mcianim
,"get MCI_TRACK #%lu !\n", lpParms
->dwTrack
);
349 lpParms
->dwReturn
= ANIM_CalcTime(wDevID
,
350 AnimDev
[wDevID
].dwTimeFormat
, lpParms
->dwReturn
);
351 TRACE(mcianim
,"MCI_STATUS_POSITION=%08lX !\n",
354 case MCI_STATUS_READY
:
355 TRACE(mcianim
,"MCI_STATUS_READY !\n");
356 lpParms
->dwReturn
= TRUE
;
358 case MCI_STATUS_TIME_FORMAT
:
359 TRACE(mcianim
,"MCI_STATUS_TIME_FORMAT !\n");
360 lpParms
->dwReturn
= MCI_FORMAT_MILLISECONDS
;
363 WARN(mcianim
,"Unknown command %08lX !\n", lpParms
->dwItem
);
364 return MCIERR_UNRECOGNIZED_COMMAND
;
367 WARN(mcianim
,"Not MCI_STATUS_ITEM !\n");
372 /**************************************************************************
373 * ANIM_mciPlay [internal]
375 static DWORD
ANIM_mciPlay(UINT16 wDevID
, DWORD dwFlags
, LPMCI_PLAY_PARMS lpParms
)
378 TRACE(mcianim
,"(%u, %08lX, %p);\n",
379 wDevID
, dwFlags
, lpParms
);
380 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
381 start
= 0; end
= AnimDev
[wDevID
].dwTotalLen
;
382 AnimDev
[wDevID
].nCurTrack
= 1;
383 if (dwFlags
& MCI_FROM
) {
384 start
= ANIM_CalcFrame(wDevID
,
385 AnimDev
[wDevID
].dwTimeFormat
, lpParms
->dwFrom
);
386 TRACE(mcianim
,"MCI_FROM=%08lX -> %u \n",
387 lpParms
->dwFrom
, start
);
389 if (dwFlags
& MCI_TO
) {
390 end
= ANIM_CalcFrame(wDevID
,
391 AnimDev
[wDevID
].dwTimeFormat
, lpParms
->dwTo
);
392 TRACE(mcianim
, "MCI_TO=%08lX -> %u \n",
395 AnimDev
[wDevID
].mode
= MCI_MODE_PLAY
;
396 if (dwFlags
& MCI_NOTIFY
) {
397 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
398 lpParms
->dwCallback
);
399 mciDriverNotify((HWND16
)LOWORD(lpParms
->dwCallback
),
400 AnimDev
[wDevID
].wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
405 /**************************************************************************
406 * ANIM_mciStop [internal]
408 static DWORD
ANIM_mciStop(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
410 TRACE(mcianim
,"(%u, %08lX, %p);\n",
411 wDevID
, dwFlags
, lpParms
);
412 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
413 AnimDev
[wDevID
].mode
= MCI_MODE_STOP
;
414 if (dwFlags
& MCI_NOTIFY
) {
415 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
416 lpParms
->dwCallback
);
417 mciDriverNotify((HWND16
)LOWORD(lpParms
->dwCallback
),
418 AnimDev
[wDevID
].wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
423 /**************************************************************************
424 * ANIM_mciPause [internal]
426 static DWORD
ANIM_mciPause(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
428 TRACE(mcianim
,"(%u, %08lX, %p);\n",
429 wDevID
, dwFlags
, lpParms
);
430 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
431 AnimDev
[wDevID
].mode
= MCI_MODE_PAUSE
;
432 if (dwFlags
& MCI_NOTIFY
) {
433 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
434 lpParms
->dwCallback
);
435 mciDriverNotify((HWND16
)LOWORD(lpParms
->dwCallback
),
436 AnimDev
[wDevID
].wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
441 /**************************************************************************
442 * ANIM_mciResume [internal]
444 static DWORD
ANIM_mciResume(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
446 TRACE(mcianim
,"(%u, %08lX, %p);\n",
447 wDevID
, dwFlags
, lpParms
);
448 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
449 AnimDev
[wDevID
].mode
= MCI_MODE_STOP
;
450 if (dwFlags
& MCI_NOTIFY
) {
451 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
452 lpParms
->dwCallback
);
453 mciDriverNotify((HWND16
)LOWORD(lpParms
->dwCallback
),
454 AnimDev
[wDevID
].wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
459 /**************************************************************************
460 * ANIM_mciSeek [internal]
462 static DWORD
ANIM_mciSeek(UINT16 wDevID
, DWORD dwFlags
, LPMCI_SEEK_PARMS lpParms
)
465 MCI_PLAY_PARMS PlayParms
;
466 TRACE(mcianim
,"(%u, %08lX, %p);\n",
467 wDevID
, dwFlags
, lpParms
);
468 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
469 AnimDev
[wDevID
].mode
= MCI_MODE_SEEK
;
471 case MCI_SEEK_TO_START
:
472 PlayParms
.dwFrom
= 0;
474 case MCI_SEEK_TO_END
:
475 PlayParms
.dwFrom
= AnimDev
[wDevID
].dwTotalLen
;
478 PlayParms
.dwFrom
= lpParms
->dwTo
;
481 dwRet
= ANIM_mciPlay(wDevID
, MCI_WAIT
| MCI_FROM
, &PlayParms
);
482 if (dwRet
!= 0) return dwRet
;
483 dwRet
= ANIM_mciStop(wDevID
, MCI_WAIT
, (LPMCI_GENERIC_PARMS
)&PlayParms
);
484 if (dwFlags
& MCI_NOTIFY
) {
485 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
486 lpParms
->dwCallback
);
487 mciDriverNotify((HWND16
)LOWORD(lpParms
->dwCallback
),
488 AnimDev
[wDevID
].wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
494 /**************************************************************************
495 * ANIM_mciSet [internal]
497 static DWORD
ANIM_mciSet(UINT16 wDevID
, DWORD dwFlags
, LPMCI_SET_PARMS lpParms
)
499 TRACE(mcianim
,"(%u, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
500 if (lpParms
== NULL
) return MCIERR_INTERNAL
;
502 TRACE(mcianim,"(dwTimeFormat=%08lX)\n", lpParms->dwTimeFormat);
503 TRACE(mcianim,"(dwAudio=%08lX)\n", lpParms->dwAudio);
505 if (dwFlags
& MCI_SET_TIME_FORMAT
) {
506 switch (lpParms
->dwTimeFormat
) {
507 case MCI_FORMAT_MILLISECONDS
:
508 TRACE(mcianim
, "MCI_FORMAT_MILLISECONDS !\n");
511 TRACE(mcianim
,"MCI_FORMAT_MSF !\n");
513 case MCI_FORMAT_TMSF
:
514 TRACE(mcianim
,"MCI_FORMAT_TMSF !\n");
517 WARN(mcianim
,"Bad time format !\n");
518 return MCIERR_BAD_TIME_FORMAT
;
520 AnimDev
[wDevID
].dwTimeFormat
= lpParms
->dwTimeFormat
;
522 if (dwFlags
& MCI_SET_VIDEO
) return MCIERR_UNSUPPORTED_FUNCTION
;
523 if (dwFlags
& MCI_SET_ON
) return MCIERR_UNSUPPORTED_FUNCTION
;
524 if (dwFlags
& MCI_SET_OFF
) return MCIERR_UNSUPPORTED_FUNCTION
;
525 if (dwFlags
& MCI_NOTIFY
) {
526 TRACE(mcianim
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
527 lpParms
->dwCallback
);
528 mciDriverNotify((HWND16
)LOWORD(lpParms
->dwCallback
),
529 AnimDev
[wDevID
].wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
535 /**************************************************************************
536 * ANIM_DriverProc [sample driver]
538 LONG
ANIM_DriverProc(DWORD dwDevID
, HDRVR16 hDriv
, WORD wMsg
,
539 DWORD dwParam1
, DWORD dwParam2
)
547 case MCI_OPEN_DRIVER
:
549 return ANIM_mciOpen(dwDevID
, dwParam1
,
550 (LPMCI_OPEN_PARMS16
)PTR_SEG_TO_LIN(dwParam2
));
552 case MCI_CLOSE_DRIVER
:
554 return ANIM_mciClose(dwDevID
, dwParam1
,
555 (LPMCI_GENERIC_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
560 case DRV_QUERYCONFIGURE
:
563 MessageBox16(0, "Sample MultiMedia Linux Driver !",
564 "MMLinux Driver", MB_OK
);
567 return DRVCNF_RESTART
;
569 return DRVCNF_RESTART
;
571 return ANIM_mciGetDevCaps(dwDevID
, dwParam1
,
572 (LPMCI_GETDEVCAPS_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
574 return ANIM_mciInfo(dwDevID
, dwParam1
,
575 (LPMCI_INFO_PARMS16
)PTR_SEG_TO_LIN(dwParam2
));
577 return ANIM_mciStatus(dwDevID
, dwParam1
,
578 (LPMCI_STATUS_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
580 return ANIM_mciSet(dwDevID
, dwParam1
,
581 (LPMCI_SET_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
583 return ANIM_mciPlay(dwDevID
, dwParam1
,
584 (LPMCI_PLAY_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
586 return ANIM_mciStop(dwDevID
, dwParam1
,
587 (LPMCI_GENERIC_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
589 return ANIM_mciPause(dwDevID
, dwParam1
,
590 (LPMCI_GENERIC_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
592 return ANIM_mciResume(dwDevID
, dwParam1
,
593 (LPMCI_GENERIC_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
595 return ANIM_mciSeek(dwDevID
, dwParam1
,
596 (LPMCI_SEEK_PARMS
)PTR_SEG_TO_LIN(dwParam2
));
598 return DefDriverProc(dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
603 /*-----------------------------------------------------------------------*/