1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 * Sample MCI CDAUDIO Wine Driver for Linux
5 * Copyright 1994 Martin Ayotte
13 #include <sys/ioctl.h>
17 #include "multimedia.h"
20 #ifdef HAVE_LINUX_CDROM_H
21 # include <linux/cdrom.h>
23 #ifdef HAVE_LINUX_UCDROM_H
24 # include <linux/ucdrom.h>
26 #ifdef HAVE_SYS_CDIO_H
27 # include <sys/cdio.h>
30 #if defined(__NetBSD__)
31 # define CDAUDIO_DEV "/dev/rcd0d"
32 #elif defined(__FreeBSD__)
33 # define CDAUDIO_DEV "/dev/rcd0c"
35 # define CDAUDIO_DEV "/dev/cdrom"
38 #define MAX_CDAUDIODRV (1)
39 #define MAX_CDAUDIO_TRACKS 256
41 #define CDFRAMES_PERSEC 75
42 #define CDFRAMES_PERMIN 4500
43 #define SECONDS_PERMIN 60
45 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
47 int nUseCount
; /* Incremented for each shared open */
48 BOOL16 fShareable
; /* TRUE if first open was shareable */
49 WORD wNotifyDeviceID
; /* MCI device ID with a pending notification */
50 HANDLE16 hCallback
; /* Callback handle for pending notification */
51 MCI_OPEN_PARMS16 openParms
;
55 struct cdrom_subchnl sc
;
57 struct cd_sub_channel_info sc
;
71 static WINE_CDAUDIO CDADev
[MAX_CDAUDIODRV
];
74 #ifndef CDROM_DATA_TRACK
75 #define CDROM_DATA_TRACK 0x04
78 /*-----------------------------------------------------------------------*/
80 /**************************************************************************
81 * CDAUDIO_mciGetOpenDrv [internal]
83 static WINE_CDAUDIO
* CDAUDIO_mciGetOpenDrv(UINT16 wDevID
)
85 if (wDevID
>= MAX_CDAUDIODRV
|| CDADev
[wDevID
].nUseCount
== 0 ||
86 CDADev
[wDevID
].unixdev
== 0) {
87 WARN(cdaudio
, "Invalid wDevID=%u\n", wDevID
);
90 return &CDADev
[wDevID
];
93 /**************************************************************************
94 * CDAUDIO_GetNumberOfTracks [internal]
96 static UINT16
CDAUDIO_GetNumberOfTracks(WINE_CDAUDIO
* wcda
)
98 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
100 struct cdrom_tochdr hdr
;
102 struct ioc_toc_header hdr
;
105 if (wcda
->nTracks
== 0) {
107 if (ioctl(wcda
->unixdev
, CDROMREADTOCHDR
, &hdr
)) {
109 if (ioctl(wcda
->unixdev
, CDIOREADTOCHEADER
, &hdr
)) {
111 WARN(cdaudio
, "(%p) -- Error occured !\n", wcda
);
115 wcda
->nTracks
= hdr
.cdth_trk1
;
117 wcda
->nTracks
= hdr
.ending_track
- hdr
.starting_track
+ 1;
120 return wcda
->nTracks
;
127 /**************************************************************************
128 * CDAUDIO_GetTracksInfo [internal]
130 static BOOL32
CDAUDIO_GetTracksInfo(WINE_CDAUDIO
* wcda
)
132 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
134 int start
, last_start
= 0;
135 int total_length
= 0;
137 struct cdrom_tocentry entry
;
139 struct ioc_read_toc_entry entry
;
140 struct cd_toc_entry toc_buffer
;
143 if (wcda
->nTracks
== 0) {
144 if (CDAUDIO_GetNumberOfTracks(wcda
) == (WORD
)-1) return FALSE
;
146 TRACE(cdaudio
,"nTracks=%u\n", wcda
->nTracks
);
148 if (wcda
->lpdwTrackLen
!= NULL
)
149 free(wcda
->lpdwTrackLen
);
150 wcda
->lpdwTrackLen
= (LPDWORD
)malloc((wcda
->nTracks
+ 1) * sizeof(DWORD
));
151 if (wcda
->lpdwTrackPos
!= NULL
)
152 free(wcda
->lpdwTrackPos
);
153 wcda
->lpdwTrackPos
= (LPDWORD
)malloc((wcda
->nTracks
+ 1) * sizeof(DWORD
));
154 if (wcda
->lpbTrackFlags
!= NULL
)
155 free(wcda
->lpbTrackFlags
);
156 wcda
->lpbTrackFlags
= (LPBYTE
)malloc((wcda
->nTracks
+ 1) * sizeof(BYTE
));
157 if (wcda
->lpdwTrackLen
== NULL
|| wcda
->lpdwTrackPos
== NULL
||
158 wcda
->lpbTrackFlags
== NULL
)
160 WARN(cdaudio
, "error allocating track table !\n");
163 memset(wcda
->lpdwTrackLen
, 0, (wcda
->nTracks
+ 1) * sizeof(DWORD
));
164 memset(wcda
->lpdwTrackPos
, 0, (wcda
->nTracks
+ 1) * sizeof(DWORD
));
165 memset(wcda
->lpbTrackFlags
, 0, (wcda
->nTracks
+ 1) * sizeof(BYTE
));
166 for (i
= 0; i
<= wcda
->nTracks
; i
++) {
167 if (i
== wcda
->nTracks
)
169 entry
.cdte_track
= CDROM_LEADOUT
;
172 entry
.starting_track
= LEADOUT
; /* XXX */
176 entry
.cdte_track
= i
+ 1;
178 entry
.starting_track
= i
+ 1;
181 entry
.cdte_format
= CDROM_MSF
;
183 bzero((char *)&toc_buffer
, sizeof(toc_buffer
));
184 entry
.address_format
= CD_MSF_FORMAT
;
185 entry
.data_len
= sizeof(toc_buffer
);
186 entry
.data
= &toc_buffer
;
189 if (ioctl(wcda
->unixdev
, CDROMREADTOCENTRY
, &entry
)) {
191 if (ioctl(wcda
->unixdev
, CDIOREADTOCENTRYS
, &entry
)) {
193 WARN(cdaudio
, "error read entry\n");
197 start
= CDFRAMES_PERSEC
* (SECONDS_PERMIN
*
198 entry
.cdte_addr
.msf
.minute
+ entry
.cdte_addr
.msf
.second
) +
199 entry
.cdte_addr
.msf
.frame
;
201 start
= CDFRAMES_PERSEC
* (SECONDS_PERMIN
*
202 toc_buffer
.addr
.msf
.minute
+ toc_buffer
.addr
.msf
.second
) +
203 toc_buffer
.addr
.msf
.frame
;
207 wcda
->dwFirstOffset
= start
;
208 TRACE(cdaudio
, "dwFirstOffset=%u\n", start
);
210 length
= start
- last_start
;
212 start
= last_start
- length
;
213 total_length
+= length
;
214 wcda
->lpdwTrackLen
[i
- 1] = length
;
215 wcda
->lpdwTrackPos
[i
- 1] = start
;
216 TRACE(cdaudio
, "track #%u start=%u len=%u\n", i
, start
, length
);
218 wcda
->lpbTrackFlags
[i
] =
220 (entry
.cdte_adr
<< 4) | (entry
.cdte_ctrl
& 0x0f);
222 (toc_buffer
.addr_type
<< 4) | (toc_buffer
.control
& 0x0f);
224 TRACE(cdaudio
, "track #%u flags=%02x\n", i
+ 1, wcda
->lpbTrackFlags
[i
]);
226 wcda
->dwTotalLen
= total_length
;
227 TRACE(cdaudio
,"total_len=%u\n", total_length
);
234 /**************************************************************************
235 * CDAUDIO_mciOpen [internal]
237 static DWORD
CDAUDIO_mciOpen(UINT16 wDevID
, DWORD dwFlags
, LPMCI_OPEN_PARMS32A lpOpenParms
)
239 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
243 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpOpenParms
);
245 if (lpOpenParms
== NULL
) return MCIERR_NULL_PARAMETER_BLOCK
;
246 if (wDevID
> MAX_CDAUDIODRV
) return MCIERR_INVALID_DEVICE_ID
;
248 dwDeviceID
= lpOpenParms
->wDeviceID
;
250 wcda
= &CDADev
[wDevID
];
252 if (wcda
->nUseCount
> 0) {
253 /* The driver already open on this channel */
254 /* If the driver was opened shareable before and this open specifies */
255 /* shareable then increment the use count */
256 if (wcda
->fShareable
&& (dwFlags
& MCI_OPEN_SHAREABLE
))
259 return MCIERR_MUST_USE_SHAREABLE
;
262 wcda
->fShareable
= dwFlags
& MCI_OPEN_SHAREABLE
;
264 if (dwFlags
& MCI_OPEN_ELEMENT
) {
265 TRACE(cdaudio
,"MCI_OPEN_ELEMENT !\n");
266 /* return MCIERR_NO_ELEMENT_ALLOWED; */
269 wcda
->openParms
.dwCallback
= lpOpenParms
->dwCallback
;
270 wcda
->openParms
.wDeviceID
= (WORD
)lpOpenParms
->wDeviceID
;
271 wcda
->openParms
.wReserved0
= 0; /*????*/
272 wcda
->openParms
.lpstrDeviceType
= lpOpenParms
->lpstrDeviceType
;
273 wcda
->openParms
.lpstrElementName
= lpOpenParms
->lpstrElementName
;
274 wcda
->openParms
.lpstrAlias
= lpOpenParms
->lpstrAlias
;
276 wcda
->wNotifyDeviceID
= dwDeviceID
;
277 wcda
->unixdev
= open (CDAUDIO_DEV
, O_RDONLY
, 0);
278 if (wcda
->unixdev
== -1) {
279 WARN(cdaudio
,"can't open '%s'!. errno=%d\n", CDAUDIO_DEV
, errno
);
280 perror( "can't open\n" );
281 return MCIERR_HARDWARE
;
284 wcda
->mciMode
= MCI_MODE_STOP
;
285 wcda
->dwTimeFormat
= MCI_FORMAT_TMSF
;
288 wcda
->dwTotalLen
= 0;
289 wcda
->dwFirstOffset
= 0;
290 wcda
->lpdwTrackLen
= NULL
;
291 wcda
->lpdwTrackPos
= NULL
;
292 wcda
->lpbTrackFlags
= NULL
;
293 if (!CDAUDIO_GetTracksInfo(&CDADev
[wDevID
])) {
294 WARN(cdaudio
,"error reading TracksInfo !\n");
295 /* return MCIERR_INTERNAL; */
299 Moved to mmsystem.c mciOpen routine
301 if (dwFlags & MCI_NOTIFY) {
302 TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
303 lpParms->dwCallback);
304 mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
305 wcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
310 return MCIERR_HARDWARE
;
314 /**************************************************************************
315 * CDAUDIO_mciClose [internal]
317 static DWORD
CDAUDIO_mciClose(UINT16 wDevID
, DWORD dwParam
, LPMCI_GENERIC_PARMS lpParms
)
319 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
320 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
322 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwParam
, lpParms
);
324 if (wcda
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
326 if (--wcda
->nUseCount
== 0) {
327 if (wcda
->lpdwTrackLen
!= NULL
) free(wcda
->lpdwTrackLen
);
328 if (wcda
->lpdwTrackPos
!= NULL
) free(wcda
->lpdwTrackPos
);
329 if (wcda
->lpbTrackFlags
!= NULL
) free(wcda
->lpbTrackFlags
);
330 close(wcda
->unixdev
);
336 /**************************************************************************
337 * CDAUDIO_mciGetDevCaps [internal]
339 static DWORD
CDAUDIO_mciGetDevCaps(UINT16 wDevID
, DWORD dwFlags
,
340 LPMCI_GETDEVCAPS_PARMS lpParms
)
342 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
343 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
345 if (lpParms
== NULL
) return MCIERR_NULL_PARAMETER_BLOCK
;
347 if (dwFlags
& MCI_GETDEVCAPS_ITEM
) {
348 TRACE(cdaudio
, "MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n", lpParms
->dwItem
);
350 switch(lpParms
->dwItem
) {
351 case MCI_GETDEVCAPS_CAN_RECORD
:
352 lpParms
->dwReturn
= FALSE
;
354 case MCI_GETDEVCAPS_HAS_AUDIO
:
355 lpParms
->dwReturn
= TRUE
;
357 case MCI_GETDEVCAPS_HAS_VIDEO
:
358 lpParms
->dwReturn
= FALSE
;
360 case MCI_GETDEVCAPS_DEVICE_TYPE
:
361 lpParms
->dwReturn
= MCI_DEVTYPE_CD_AUDIO
;
363 case MCI_GETDEVCAPS_USES_FILES
:
364 lpParms
->dwReturn
= FALSE
;
366 case MCI_GETDEVCAPS_COMPOUND_DEVICE
:
367 lpParms
->dwReturn
= FALSE
;
369 case MCI_GETDEVCAPS_CAN_EJECT
:
370 lpParms
->dwReturn
= TRUE
;
372 case MCI_GETDEVCAPS_CAN_PLAY
:
373 lpParms
->dwReturn
= TRUE
;
375 case MCI_GETDEVCAPS_CAN_SAVE
:
376 lpParms
->dwReturn
= FALSE
;
379 return MCIERR_UNRECOGNIZED_COMMAND
;
382 TRACE(cdaudio
, "lpParms->dwReturn=%08lX;\n", lpParms
->dwReturn
);
385 return MCIERR_INTERNAL
;
389 /**************************************************************************
390 * CDAUDIO_mciInfo [internal]
392 static DWORD
CDAUDIO_mciInfo(UINT16 wDevID
, DWORD dwFlags
, LPMCI_INFO_PARMS16 lpParms
)
394 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
397 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
399 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
401 if (lpParms
== NULL
|| lpParms
->lpstrReturn
== NULL
) {
402 ret
= MCIERR_NULL_PARAMETER_BLOCK
;
403 } else if (wcda
== NULL
) {
404 ret
= MCIERR_INVALID_DEVICE_ID
;
406 TRACE(cdaudio
, "buf=%p, len=%lu\n", lpParms
->lpstrReturn
, lpParms
->dwRetSize
);
409 case MCI_INFO_PRODUCT
:
410 str
= "Wine's audio CDROM";
413 WARN(cdaudio
, "Don't know this info command (%lu)\n", dwFlags
);
414 ret
= MCIERR_UNRECOGNIZED_COMMAND
;
418 ret
= MCI_WriteString(lpParms
->lpstrReturn
, lpParms
->dwRetSize
, str
);
420 lpParms
->lpstrReturn
[0] = 0;
425 return MCIERR_INTERNAL
;
430 /**************************************************************************
431 * CDAUDIO_CalcFrame [internal]
433 static DWORD
CDAUDIO_CalcFrame(WINE_CDAUDIO
* wcda
, DWORD dwTime
)
436 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
439 TRACE(cdaudio
,"(%p, %08lX, %lu);\n", wcda
, wcda
->dwTimeFormat
, dwTime
);
441 switch (wcda
->dwTimeFormat
) {
442 case MCI_FORMAT_MILLISECONDS
:
443 dwFrame
= dwTime
* CDFRAMES_PERSEC
/ 1000;
444 TRACE(cdaudio
, "MILLISECONDS %lu\n", dwFrame
);
447 TRACE(cdaudio
, "MSF %02u:%02u:%02u\n",
448 MCI_MSF_MINUTE(dwTime
), MCI_MSF_SECOND(dwTime
), MCI_MSF_FRAME(dwTime
));
449 dwFrame
+= CDFRAMES_PERMIN
* MCI_MSF_MINUTE(dwTime
);
450 dwFrame
+= CDFRAMES_PERSEC
* MCI_MSF_SECOND(dwTime
);
451 dwFrame
+= MCI_MSF_FRAME(dwTime
);
453 case MCI_FORMAT_TMSF
:
455 /* unknown format ! force TMSF ! ... */
456 wTrack
= MCI_TMSF_TRACK(dwTime
);
457 TRACE(cdaudio
, "MSF %02u-%02u:%02u:%02u\n",
458 MCI_TMSF_TRACK(dwTime
), MCI_TMSF_MINUTE(dwTime
),
459 MCI_TMSF_SECOND(dwTime
), MCI_TMSF_FRAME(dwTime
));
460 TRACE(cdaudio
, "TMSF trackpos[%u]=%lu\n",
461 wTrack
, wcda
->lpdwTrackPos
[wTrack
- 1]);
462 dwFrame
= wcda
->lpdwTrackPos
[wTrack
- 1];
463 dwFrame
+= CDFRAMES_PERMIN
* MCI_TMSF_MINUTE(dwTime
);
464 dwFrame
+= CDFRAMES_PERSEC
* MCI_TMSF_SECOND(dwTime
);
465 dwFrame
+= MCI_TMSF_FRAME(dwTime
);
473 /**************************************************************************
474 * CDAUDIO_GetCDStatus [internal]
476 static BOOL32
CDAUDIO_GetCDStatus(WINE_CDAUDIO
* wcda
)
478 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
479 int oldmode
= wcda
->cdMode
;
481 wcda
->sc
.cdsc_format
= CDROM_MSF
;
483 struct ioc_read_subchannel read_sc
;
485 read_sc
.address_format
= CD_MSF_FORMAT
;
486 read_sc
.data_format
= CD_CURRENT_POSITION
;
488 read_sc
.data_len
= sizeof(wcda
->sc
);
489 read_sc
.data
= (struct cd_sub_channel_info
*)&wcda
->sc
;
492 if (ioctl(wcda
->unixdev
, CDROMSUBCHNL
, &wcda
->sc
)) {
494 if (ioctl(wcda
->unixdev
, CDIOCREADSUBCHANNEL
, &read_sc
)) {
496 TRACE(cdaudio
,"opened or no_media !\n");
497 wcda
->cdMode
= MCI_MODE_OPEN
; /* was NOT_READY */
502 wcda
->sc
.cdsc_audiostatus
504 wcda
->sc
.header
.audio_status
508 case CDROM_AUDIO_INVALID
:
510 case CD_AS_AUDIO_INVALID
:
512 WARN(cdaudio
, "device doesn't support status, using MCI status.\n");
516 case CDROM_AUDIO_NO_STATUS
:
518 case CD_AS_NO_STATUS
:
520 wcda
->cdMode
= MCI_MODE_STOP
;
521 TRACE(cdaudio
,"MCI_MODE_STOP !\n");
524 case CDROM_AUDIO_PLAY
:
526 case CD_AS_PLAY_IN_PROGRESS
:
528 wcda
->cdMode
= MCI_MODE_PLAY
;
529 TRACE(cdaudio
,"MCI_MODE_PLAY !\n");
532 case CDROM_AUDIO_PAUSED
:
534 case CD_AS_PLAY_PAUSED
:
536 wcda
->cdMode
= MCI_MODE_PAUSE
;
537 TRACE(cdaudio
,"MCI_MODE_PAUSE !\n");
541 TRACE(cdaudio
,"status=%02X !\n",
542 wcda
->sc
.cdsc_audiostatus
);
544 TRACE(cdaudio
,"status=%02X !\n",
545 wcda
->sc
.header
.audio_status
);
549 wcda
->nCurTrack
= wcda
->sc
.cdsc_trk
;
551 CDFRAMES_PERMIN
* wcda
->sc
.cdsc_absaddr
.msf
.minute
+
552 CDFRAMES_PERSEC
* wcda
->sc
.cdsc_absaddr
.msf
.second
+
553 wcda
->sc
.cdsc_absaddr
.msf
.frame
;
555 wcda
->nCurTrack
= wcda
->sc
.what
.position
.track_number
;
557 CDFRAMES_PERMIN
* wcda
->sc
.what
.position
.absaddr
.msf
.minute
+
558 CDFRAMES_PERSEC
* wcda
->sc
.what
.position
.absaddr
.msf
.second
+
559 wcda
->sc
.what
.position
.absaddr
.msf
.frame
;
562 TRACE(cdaudio
,"%02u-%02u:%02u:%02u \n",
564 wcda
->sc
.cdsc_absaddr
.msf
.minute
,
565 wcda
->sc
.cdsc_absaddr
.msf
.second
,
566 wcda
->sc
.cdsc_absaddr
.msf
.frame
);
568 TRACE(cdaudio
,"%02u-%02u:%02u:%02u \n",
569 wcda
->sc
.what
.position
.track_number
,
570 wcda
->sc
.what
.position
.absaddr
.msf
.minute
,
571 wcda
->sc
.what
.position
.absaddr
.msf
.second
,
572 wcda
->sc
.what
.position
.absaddr
.msf
.frame
);
575 if (oldmode
!= wcda
->cdMode
&& oldmode
== MCI_MODE_OPEN
) {
576 if (!CDAUDIO_GetTracksInfo(wcda
)) {
577 WARN(cdaudio
, "error updating TracksInfo !\n");
578 return MCIERR_INTERNAL
;
588 /**************************************************************************
589 * CDAUDIO_CalcTime [internal]
591 static DWORD
CDAUDIO_CalcTime(WINE_CDAUDIO
* wcda
, DWORD dwFrame
)
594 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
600 TRACE(cdaudio
,"(%p, %08lX, %lu);\n", wcda
, wcda
->dwTimeFormat
, dwFrame
);
602 switch (wcda
->dwTimeFormat
) {
603 case MCI_FORMAT_MILLISECONDS
:
604 dwTime
= dwFrame
/ CDFRAMES_PERSEC
* 1000;
605 TRACE(cdaudio
, "MILLISECONDS %lu\n", dwTime
);
608 wMinutes
= dwFrame
/ CDFRAMES_PERMIN
;
609 wSeconds
= (dwFrame
- CDFRAMES_PERMIN
* wMinutes
) / CDFRAMES_PERSEC
;
610 wFrames
= dwFrame
- CDFRAMES_PERMIN
* wMinutes
- CDFRAMES_PERSEC
* wSeconds
;
611 dwTime
= MCI_MAKE_MSF(wMinutes
, wSeconds
, wFrames
);
612 TRACE(cdaudio
,"MSF %02u:%02u:%02u -> dwTime=%lu\n",wMinutes
, wSeconds
, wFrames
, dwTime
);
614 case MCI_FORMAT_TMSF
:
616 /* unknown format ! force TMSF ! ... */
617 for (wTrack
= 0; wTrack
< wcda
->nTracks
; wTrack
++) {
618 /* dwTime += wcda->lpdwTrackLen[wTrack - 1];
619 TRACE(cdaudio, "Adding trk#%u curpos=%u \n", dwTime);
620 if (dwTime >= dwFrame) break; */
621 if (wcda
->lpdwTrackPos
[wTrack
- 1] >= dwFrame
) break;
623 wMinutes
= dwFrame
/ CDFRAMES_PERMIN
;
624 wSeconds
= (dwFrame
- CDFRAMES_PERMIN
* wMinutes
) / CDFRAMES_PERSEC
;
625 wFrames
= dwFrame
- CDFRAMES_PERMIN
* wMinutes
- CDFRAMES_PERSEC
* wSeconds
;
626 dwTime
= MCI_MAKE_TMSF(wTrack
, wMinutes
, wSeconds
, wFrames
);
627 TRACE(cdaudio
, "%02u-%02u:%02u:%02u\n", wTrack
, wMinutes
, wSeconds
, wFrames
);
635 /**************************************************************************
636 * CDAUDIO_mciStatus [internal]
638 static DWORD
CDAUDIO_mciStatus(UINT16 wDevID
, DWORD dwFlags
, LPMCI_STATUS_PARMS lpParms
)
640 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
641 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
644 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
646 if (lpParms
== NULL
) {
647 ret
= MCIERR_NULL_PARAMETER_BLOCK
;
648 } else if (wcda
== NULL
) {
649 ret
= MCIERR_INVALID_DEVICE_ID
;
651 if (dwFlags
& MCI_NOTIFY
) {
652 TRACE(cdaudio
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms
->dwCallback
);
653 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
654 wcda
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
656 if (dwFlags
& MCI_STATUS_ITEM
) {
657 switch(lpParms
->dwItem
) {
658 case MCI_STATUS_CURRENT_TRACK
:
659 if (!CDAUDIO_GetCDStatus(wcda
)) return MCIERR_INTERNAL
;
660 lpParms
->dwReturn
= wcda
->nCurTrack
;
661 TRACE(cdaudio
,"CURRENT_TRACK=%lu!\n", lpParms
->dwReturn
);
663 case MCI_STATUS_LENGTH
:
664 if (wcda
->nTracks
== 0) {
665 if (!CDAUDIO_GetTracksInfo(wcda
)) {
666 WARN(cdaudio
, "error reading TracksInfo !\n");
667 return MCIERR_INTERNAL
;
670 if (dwFlags
& MCI_TRACK
) {
671 TRACE(cdaudio
,"MCI_TRACK #%lu LENGTH=??? !\n", lpParms
->dwTrack
);
672 if (lpParms
->dwTrack
> wcda
->nTracks
)
673 return MCIERR_OUTOFRANGE
;
674 lpParms
->dwReturn
= wcda
->lpdwTrackLen
[lpParms
->dwTrack
- 1];
676 lpParms
->dwReturn
= wcda
->dwTotalLen
;
678 lpParms
->dwReturn
= CDAUDIO_CalcTime(wcda
, lpParms
->dwReturn
);
679 TRACE(cdaudio
,"LENGTH=%lu !\n", lpParms
->dwReturn
);
681 case MCI_STATUS_MODE
:
682 if (!CDAUDIO_GetCDStatus(wcda
)) return MCIERR_INTERNAL
;
683 lpParms
->dwReturn
= wcda
->cdMode
;
684 if (!lpParms
->dwReturn
) lpParms
->dwReturn
= wcda
->mciMode
;
685 TRACE(cdaudio
,"MCI_STATUS_MODE=%08lX !\n", lpParms
->dwReturn
);
687 case MCI_STATUS_MEDIA_PRESENT
:
688 if (!CDAUDIO_GetCDStatus(wcda
)) return MCIERR_INTERNAL
;
689 lpParms
->dwReturn
= (wcda
->nTracks
> 0) ? TRUE
: FALSE
;
690 TRACE(cdaudio
,"MCI_STATUS_MEDIA_PRESENT =%s!\n", lpParms
->dwReturn
? "Y" : "N");
692 case MCI_STATUS_NUMBER_OF_TRACKS
:
693 lpParms
->dwReturn
= CDAUDIO_GetNumberOfTracks(wcda
);
694 TRACE(cdaudio
,"MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n", lpParms
->dwReturn
);
695 if (lpParms
->dwReturn
== (WORD
)-1) return MCIERR_INTERNAL
;
697 case MCI_STATUS_POSITION
:
698 if (!CDAUDIO_GetCDStatus(wcda
)) return MCIERR_INTERNAL
;
699 lpParms
->dwReturn
= wcda
->dwCurFrame
;
700 if (dwFlags
& MCI_STATUS_START
) {
701 lpParms
->dwReturn
= wcda
->dwFirstOffset
;
702 TRACE(cdaudio
,"get MCI_STATUS_START !\n");
704 if (dwFlags
& MCI_TRACK
) {
705 if (lpParms
->dwTrack
> wcda
->nTracks
)
706 return MCIERR_OUTOFRANGE
;
707 lpParms
->dwReturn
= wcda
->lpdwTrackPos
[lpParms
->dwTrack
- 1];
708 TRACE(cdaudio
,"get MCI_TRACK #%lu !\n", lpParms
->dwTrack
);
710 lpParms
->dwReturn
= CDAUDIO_CalcTime(wcda
, lpParms
->dwReturn
);
711 TRACE(cdaudio
,"MCI_STATUS_POSITION=%08lX !\n", lpParms
->dwReturn
);
713 case MCI_STATUS_READY
:
714 TRACE(cdaudio
,"MCI_STATUS_READY !\n");
715 lpParms
->dwReturn
= TRUE
;
717 case MCI_STATUS_TIME_FORMAT
:
718 lpParms
->dwReturn
= wcda
->dwTimeFormat
;
719 TRACE(cdaudio
,"MCI_STATUS_TIME_FORMAT =%08lx!\n", lpParms
->dwReturn
);
721 /* FIXME: the constant used here are not defined in mmsystem.h */
722 /* MCI_CDA_STATUS_TYPE_TRACK is very likely to be 0x00004001 */
723 case MCI_CDA_STATUS_TYPE_TRACK
:
724 if (!(dwFlags
& MCI_TRACK
)) return MCIERR_MISSING_PARAMETER
;
725 lpParms
->dwReturn
= (wcda
->lpbTrackFlags
[lpParms
->dwTrack
- 1] &
726 CDROM_DATA_TRACK
) ? MCI_CDA_TRACK_OTHER
: MCI_CDA_TRACK_AUDIO
;
727 TRACE(cdaudio
, "MCI_CDA_STATUS_TYPE_TRACK[%ld]=%08lx\n", lpParms
->dwTrack
, lpParms
->dwReturn
);
730 WARN(cdaudio
, "unknown command %08lX !\n", lpParms
->dwItem
);
731 return MCIERR_UNRECOGNIZED_COMMAND
;
735 WARN(cdaudio
, "not MCI_STATUS_ITEM !\n");
738 return MMSYSERR_NOTENABLED
;
743 /**************************************************************************
744 * CDAUDIO_mciPlay [internal]
746 static DWORD
CDAUDIO_mciPlay(UINT16 wDevID
, DWORD dwFlags
, LPMCI_PLAY_PARMS lpParms
)
748 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
750 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
753 struct cdrom_msf msf
;
755 struct ioc_play_msf msf
;
758 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
760 if (lpParms
== NULL
) {
761 ret
= MCIERR_NULL_PARAMETER_BLOCK
;
762 } else if (wcda
== NULL
) {
763 ret
= MCIERR_INVALID_DEVICE_ID
;
766 end
= wcda
->dwTotalLen
;
768 if (dwFlags
& MCI_FROM
) {
769 start
= CDAUDIO_CalcFrame(wcda
, lpParms
->dwFrom
);
770 TRACE(cdaudio
,"MCI_FROM=%08lX -> %u \n", lpParms
->dwFrom
, start
);
772 if (dwFlags
& MCI_TO
) {
773 end
= CDAUDIO_CalcFrame(wcda
, lpParms
->dwTo
);
774 TRACE(cdaudio
, "MCI_TO=%08lX -> %u \n", lpParms
->dwTo
, end
);
776 start
+= wcda
->dwFirstOffset
;
777 end
+= wcda
->dwFirstOffset
;
779 msf
.cdmsf_min0
= start
/ CDFRAMES_PERMIN
;
780 msf
.cdmsf_sec0
= (start
% CDFRAMES_PERMIN
) / CDFRAMES_PERSEC
;
781 msf
.cdmsf_frame0
= start
% CDFRAMES_PERSEC
;
782 msf
.cdmsf_min1
= end
/ CDFRAMES_PERMIN
;
783 msf
.cdmsf_sec1
= (end
% CDFRAMES_PERMIN
) / CDFRAMES_PERSEC
;
784 msf
.cdmsf_frame1
= end
% CDFRAMES_PERSEC
;
786 msf
.start_m
= start
/ CDFRAMES_PERMIN
;
787 msf
.start_s
= (start
% CDFRAMES_PERMIN
) / CDFRAMES_PERSEC
;
788 msf
.start_f
= start
% CDFRAMES_PERSEC
;
789 msf
.end_m
= end
/ CDFRAMES_PERMIN
;
790 msf
.end_s
= (end
% CDFRAMES_PERMIN
) / CDFRAMES_PERSEC
;
791 msf
.end_f
= end
% CDFRAMES_PERSEC
;
794 if (ioctl(wcda
->unixdev
, CDROMSTART
)) {
796 if (ioctl(wcda
->unixdev
, CDIOCSTART
, NULL
)) {
798 WARN(cdaudio
, "motor doesn't start !\n");
799 return MCIERR_HARDWARE
;
802 if (ioctl(wcda
->unixdev
, CDROMPLAYMSF
, &msf
)) {
804 if (ioctl(wcda
->unixdev
, CDIOCPLAYMSF
, &msf
)) {
806 WARN(cdaudio
, "device doesn't play !\n");
807 return MCIERR_HARDWARE
;
810 TRACE(cdaudio
,"msf = %d:%d:%d %d:%d:%d\n",
811 msf
.cdmsf_min0
, msf
.cdmsf_sec0
, msf
.cdmsf_frame0
,
812 msf
.cdmsf_min1
, msf
.cdmsf_sec1
, msf
.cdmsf_frame1
);
814 TRACE(cdaudio
,"msf = %d:%d:%d %d:%d:%d\n",
815 msf
.start_m
, msf
.start_s
, msf
.start_f
,
816 msf
.end_m
, msf
.end_s
, msf
.end_f
);
818 wcda
->mciMode
= MCI_MODE_PLAY
;
819 if (dwFlags
& MCI_NOTIFY
) {
820 TRACE(cdaudio
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms
->dwCallback
);
822 mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
823 wcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
830 return MCIERR_HARDWARE
;
834 /**************************************************************************
835 * CDAUDIO_mciStop [internal]
837 static DWORD
CDAUDIO_mciStop(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
839 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
840 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
842 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
844 if (wcda
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
847 if (ioctl(wcda
->unixdev
, CDROMSTOP
))
849 if (ioctl(wcda
->unixdev
, CDIOCSTOP
, NULL
))
851 return MCIERR_HARDWARE
;
852 wcda
->mciMode
= MCI_MODE_STOP
;
853 if (lpParms
&& (dwFlags
& MCI_NOTIFY
)) {
854 TRACE(cdaudio
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms
->dwCallback
);
855 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
856 wcda
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
860 return MCIERR_HARDWARE
;
864 /**************************************************************************
865 * CDAUDIO_mciPause [internal]
867 static DWORD
CDAUDIO_mciPause(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
869 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
870 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
872 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
874 if (wcda
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
877 if (ioctl(wcda
->unixdev
, CDROMPAUSE
))
879 if (ioctl(wcda
->unixdev
, CDIOCPAUSE
, NULL
))
881 return MCIERR_HARDWARE
;
882 wcda
->mciMode
= MCI_MODE_PAUSE
;
883 if (lpParms
&& (dwFlags
& MCI_NOTIFY
)) {
884 TRACE(cdaudio
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms
->dwCallback
);
885 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
886 wcda
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
890 return MCIERR_HARDWARE
;
894 /**************************************************************************
895 * CDAUDIO_mciResume [internal]
897 static DWORD
CDAUDIO_mciResume(UINT16 wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
899 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
900 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
902 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
904 if (wcda
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
907 if (ioctl(wcda
->unixdev
, CDROMRESUME
))
909 if (ioctl(wcda
->unixdev
, CDIOCRESUME
, NULL
))
911 return MCIERR_HARDWARE
;
912 wcda
->mciMode
= MCI_MODE_STOP
;
913 if (lpParms
&& (dwFlags
& MCI_NOTIFY
)) {
914 TRACE(cdaudio
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms
->dwCallback
);
915 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
916 wcda
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
920 return MCIERR_HARDWARE
;
924 /**************************************************************************
925 * CDAUDIO_mciSeek [internal]
927 static DWORD
CDAUDIO_mciSeek(UINT16 wDevID
, DWORD dwFlags
, LPMCI_SEEK_PARMS lpParms
)
929 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
931 MCI_PLAY_PARMS PlayParms
;
932 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
934 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
936 if (wcda
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
937 if (lpParms
== NULL
) return MCIERR_NULL_PARAMETER_BLOCK
;
940 if (ioctl(wcda
->unixdev
, CDROMRESUME
)) {
942 if (ioctl(wcda
->unixdev
, CDIOCRESUME
, NULL
)) {
944 perror("ioctl CDROMRESUME");
945 return MCIERR_HARDWARE
;
947 wcda
->mciMode
= MCI_MODE_SEEK
;
949 case MCI_SEEK_TO_START
:
950 PlayParms
.dwFrom
= 0;
952 case MCI_SEEK_TO_END
:
953 PlayParms
.dwFrom
= wcda
->dwTotalLen
;
956 PlayParms
.dwFrom
= lpParms
->dwTo
;
959 dwRet
= CDAUDIO_mciPlay(wDevID
, MCI_WAIT
| MCI_FROM
, &PlayParms
);
960 if (dwRet
!= 0) return dwRet
;
961 dwRet
= CDAUDIO_mciStop(wDevID
, MCI_WAIT
, (LPMCI_GENERIC_PARMS
)&PlayParms
);
962 if (dwFlags
& MCI_NOTIFY
) {
963 TRACE(cdaudio
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms
->dwCallback
);
964 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
965 wcda
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
969 return MCIERR_HARDWARE
;
973 /**************************************************************************
974 * CDAUDIO_mciSetDoor [internal]
976 static DWORD
CDAUDIO_mciSetDoor(UINT16 wDevID
, int open
)
978 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
980 TRACE(cdaudio
, "(%04x, %s) !\n", wDevID
, (open
) ? "OPEN" : "CLOSE");
982 if (wcda
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
986 if (ioctl(wcda
->unixdev
, CDROMEJECT
)) return MCIERR_HARDWARE
;
987 wcda
->mciMode
= MCI_MODE_OPEN
;
989 if (ioctl(wcda
->unixdev
, CDROMEJECT
, 1)) return MCIERR_HARDWARE
;
990 wcda
->mciMode
= MCI_MODE_STOP
;
993 if (ioctl(wcda
->unixdev
, CDIOCALLOW
, NULL
)) return MCIERR_HARDWARE
;
995 if (ioctl(wcda
->unixdev
, CDIOCEJECT
, NULL
)) return MCIERR_HARDWARE
;
996 wcda
->mciMode
= MCI_MODE_OPEN
;
998 if (ioctl(wcda
->unixdev
, CDIOCCLOSE
, NULL
)) return MCIERR_HARDWARE
;
999 wcda
->mciMode
= MCI_MODE_STOP
;
1001 if (ioctl(wcda
->unixdev
, CDIOCPREVENT
, NULL
)) return MCIERR_HARDWARE
;
1007 /**************************************************************************
1008 * CDAUDIO_mciSet [internal]
1010 static DWORD
CDAUDIO_mciSet(UINT16 wDevID
, DWORD dwFlags
, LPMCI_SET_PARMS lpParms
)
1012 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
1013 WINE_CDAUDIO
* wcda
= CDAUDIO_mciGetOpenDrv(wDevID
);
1015 TRACE(cdaudio
,"(%04X, %08lX, %p);\n", wDevID
, dwFlags
, lpParms
);
1017 if (wcda
== NULL
) return MCIERR_INVALID_DEVICE_ID
;
1018 if (lpParms
== NULL
) return MCIERR_NULL_PARAMETER_BLOCK
;;
1020 TRACE(cdaudio,"dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
1021 TRACE(cdaudio,"dwAudio=%08lX\n", lpParms->dwAudio);
1023 if (dwFlags
& MCI_SET_TIME_FORMAT
) {
1024 switch (lpParms
->dwTimeFormat
) {
1025 case MCI_FORMAT_MILLISECONDS
:
1026 TRACE(cdaudio
, "MCI_FORMAT_MILLISECONDS !\n");
1028 case MCI_FORMAT_MSF
:
1029 TRACE(cdaudio
,"MCI_FORMAT_MSF !\n");
1031 case MCI_FORMAT_TMSF
:
1032 TRACE(cdaudio
,"MCI_FORMAT_TMSF !\n");
1035 WARN(cdaudio
, "bad time format !\n");
1036 return MCIERR_BAD_TIME_FORMAT
;
1038 wcda
->dwTimeFormat
= lpParms
->dwTimeFormat
;
1040 if (dwFlags
& MCI_SET_DOOR_OPEN
) {
1041 CDAUDIO_mciSetDoor(wDevID
, TRUE
);
1043 if (dwFlags
& MCI_SET_DOOR_CLOSED
) {
1044 CDAUDIO_mciSetDoor(wDevID
, TRUE
);
1046 if (dwFlags
& MCI_SET_VIDEO
) return MCIERR_UNSUPPORTED_FUNCTION
;
1047 if (dwFlags
& MCI_SET_ON
) return MCIERR_UNSUPPORTED_FUNCTION
;
1048 if (dwFlags
& MCI_SET_OFF
) return MCIERR_UNSUPPORTED_FUNCTION
;
1049 if (dwFlags
& MCI_NOTIFY
) {
1050 TRACE(cdaudio
, "MCI_NOTIFY_SUCCESSFUL %08lX !\n",
1051 lpParms
->dwCallback
);
1052 mciDriverNotify16((HWND16
)LOWORD(lpParms
->dwCallback
),
1053 wcda
->wNotifyDeviceID
, MCI_NOTIFY_SUCCESSFUL
);
1057 return MCIERR_HARDWARE
;
1061 /**************************************************************************
1062 * MCICDAUDIO_DriverProc32 [sample driver]
1064 LONG
MCICDAUDIO_DriverProc32(DWORD dwDevID
, HDRVR16 hDriv
, DWORD wMsg
,
1065 DWORD dwParam1
, DWORD dwParam2
)
1067 #if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
1069 case DRV_LOAD
: return 1;
1070 case DRV_FREE
: return 1;
1071 case DRV_OPEN
: return 1;
1072 case DRV_CLOSE
: return 1;
1073 case DRV_ENABLE
: return 1;
1074 case DRV_DISABLE
: return 1;
1075 case DRV_QUERYCONFIGURE
: return 1;
1076 case DRV_CONFIGURE
: MessageBox16(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK
); return 1;
1077 case DRV_INSTALL
: return DRVCNF_RESTART
;
1078 case DRV_REMOVE
: return DRVCNF_RESTART
;
1081 case MCI_OPEN_DRIVER
: return CDAUDIO_mciOpen(dwDevID
, dwParam1
, (LPMCI_OPEN_PARMS32A
)dwParam2
);
1083 case MCI_CLOSE_DRIVER
: return CDAUDIO_mciClose(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
1084 case MCI_GETDEVCAPS
: return CDAUDIO_mciGetDevCaps(dwDevID
, dwParam1
, (LPMCI_GETDEVCAPS_PARMS
)dwParam2
);
1085 case MCI_INFO
: return CDAUDIO_mciInfo(dwDevID
, dwParam1
, (LPMCI_INFO_PARMS16
)dwParam2
);
1086 case MCI_STATUS
: return CDAUDIO_mciStatus(dwDevID
, dwParam1
, (LPMCI_STATUS_PARMS
)dwParam2
);
1087 case MCI_SET
: return CDAUDIO_mciSet(dwDevID
, dwParam1
, (LPMCI_SET_PARMS
)dwParam2
);
1088 case MCI_PLAY
: return CDAUDIO_mciPlay(dwDevID
, dwParam1
, (LPMCI_PLAY_PARMS
)dwParam2
);
1089 case MCI_STOP
: return CDAUDIO_mciStop(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
1090 case MCI_PAUSE
: return CDAUDIO_mciPause(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
1091 case MCI_RESUME
: return CDAUDIO_mciResume(dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
)dwParam2
);
1092 case MCI_SEEK
: return CDAUDIO_mciSeek(dwDevID
, dwParam1
, (LPMCI_SEEK_PARMS
)dwParam2
);
1093 /* FIXME: I wonder if those two next items are really called ? */
1094 case MCI_SET_DOOR_OPEN
: return CDAUDIO_mciSetDoor(dwDevID
, TRUE
);
1095 case MCI_SET_DOOR_CLOSED
: return CDAUDIO_mciSetDoor(dwDevID
, FALSE
);
1112 WARN(cdaudio
, "Unsupported command=%s\n", MCI_CommandToString(wMsg
));
1115 * This is incorrect according to Microsoft...
1116 * http://support.microsoft.com/support/kb/articles/q137/5/79.asp
1120 FIXME(cdaudio, "Shouldn't receive a MCI_OPEN or CLOSE message\n");
1124 TRACE(cdaudio
, "Sending msg=%s to default driver proc\n", MCI_CommandToString(wMsg
));
1125 return DefDriverProc32(dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
1127 return MCIERR_UNRECOGNIZED_COMMAND
;
1129 return MCIERR_HARDWARE
;
1133 /*-----------------------------------------------------------------------*/