1994-07-07 16:23:58 +00:00
|
|
|
/*
|
|
|
|
* Sample MCI CDAUDIO Wine Driver for Linux
|
|
|
|
*
|
|
|
|
* Copyright 1994 Martin Ayotte
|
1994-12-10 13:02:28 +00:00
|
|
|
*
|
1994-07-07 16:23:58 +00:00
|
|
|
static char Copyright[] = "Copyright Martin Ayotte, 1994";
|
1994-12-10 13:02:28 +00:00
|
|
|
*/
|
1994-08-06 11:22:41 +00:00
|
|
|
#ifndef WINELIB
|
|
|
|
#define BUILTIN_MMSYSTEM
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef BUILTIN_MMSYSTEM
|
|
|
|
|
1994-10-17 18:12:41 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/ioctl.h>
|
1995-01-24 16:21:01 +00:00
|
|
|
#include "windows.h"
|
1994-07-07 16:23:58 +00:00
|
|
|
#include "user.h"
|
|
|
|
#include "driver.h"
|
|
|
|
#include "mmsystem.h"
|
1994-10-17 18:12:41 +00:00
|
|
|
#include "stddebug.h"
|
1994-12-10 13:02:28 +00:00
|
|
|
/* #define DEBUG_CDAUDIO */
|
1994-10-17 18:12:41 +00:00
|
|
|
#include "debug.h"
|
1994-07-07 16:23:58 +00:00
|
|
|
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
#include <linux/soundcard.h>
|
|
|
|
#include <linux/cdrom.h>
|
1994-07-23 07:57:48 +00:00
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
|
|
|
|
#define SOUND_DEV "/dev/dsp"
|
|
|
|
#define CDAUDIO_DEV "/dev/sbpcd"
|
|
|
|
|
|
|
|
#ifdef SOUND_VERSION
|
|
|
|
#define IOCTL(a,b,c) ioctl(a,b,&c)
|
|
|
|
#else
|
|
|
|
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MAX_CDAUDIODRV 2
|
|
|
|
#define MAX_CDAUDIO_TRACKS 256
|
|
|
|
|
|
|
|
#define CDFRAMES_PERSEC 75
|
|
|
|
#define CDFRAMES_PERMIN 4500
|
|
|
|
#define SECONDS_PERMIN 60
|
|
|
|
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
typedef struct {
|
|
|
|
int nUseCount; /* Incremented for each shared open */
|
|
|
|
BOOL fShareable; /* TRUE if first open was shareable */
|
|
|
|
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
|
|
|
HANDLE hCallback; /* Callback handle for pending notification */
|
|
|
|
MCI_OPEN_PARMS openParms;
|
|
|
|
DWORD dwTimeFormat;
|
|
|
|
int unixdev;
|
|
|
|
struct cdrom_subchnl sc;
|
|
|
|
int mode;
|
|
|
|
UINT nCurTrack;
|
|
|
|
DWORD dwCurFrame;
|
|
|
|
UINT nTracks;
|
|
|
|
DWORD dwTotalLen;
|
|
|
|
LPDWORD lpdwTrackLen;
|
|
|
|
LPDWORD lpdwTrackPos;
|
|
|
|
DWORD dwFirstOffset;
|
|
|
|
} LINUX_CDAUDIO;
|
|
|
|
|
|
|
|
static LINUX_CDAUDIO CDADev[MAX_CDAUDIODRV];
|
1994-07-23 07:57:48 +00:00
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
|
|
|
|
UINT CDAUDIO_GetNumberOfTracks(UINT wDevID);
|
|
|
|
BOOL CDAUDIO_GetTracksInfo(UINT wDevID);
|
|
|
|
BOOL CDAUDIO_GetCDStatus(UINT wDevID);
|
|
|
|
DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame);
|
|
|
|
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciOpen [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
UINT wDevID;
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen(%08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
wDevID = lpParms->wDeviceID;
|
|
|
|
if (CDADev[wDevID].nUseCount > 0) {
|
|
|
|
/* The driver already open on this channel */
|
Release 941030
Sun Oct 30 13:01:18 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/static.c]
Bug fix for SS_ICON controls.
* [if1632/Imakefile]
Fixed call.o dependencies.
* [objects/clipping.c] [objects/dc.c]
Fixed visible region handling. hVisRgn is always non-null now.
* [windows/dce.c]
Bug fix in GetDCEx for CS_OWNDC windows.
* [windows/nonclient.c] [windows/painting.c]
Fixes to icon window drawing.
* [windows/winpos.c]
A few fixes in SetWindowPos().
Sun Oct 30 12:50:24 1994 Michael Patra <micky@marie.physik.tu-berlin.de>
* [objects/bitblt.c]
BitBlt(): BitBlt is now able to handle any raster operation. If
the request can't be passed to XWindows directly, it's quite
slow, though.
* [*/*.c]
[misc/main.c]
Improvements of the system for handling debug messages. Options are
now also loaded from /usr/lib/X11/app-defaults/Wine (insert
*debugoptions: +xxx there if you want to have turn messages xxx on).
* [controls/menu.c]
DestroyMenu(): The whole window won't be destroyed as a sideeffect
any longer.
* [misc/file.c]
OpenFile(): Fixed bug in searching in system/window-directory.
Sun Oct 30 12:25:53 1994 Jimmy Tirtawangsa <j0t2527@tam2000.tamu.edu>
* [include/windows.h]
Bug fix for window related structures.
DCB and COMSTAT are affected. They must be packed.
* [misc/comm.c]
Bug fix for COM ports:
Dial and dialog window in terminal.exe now works.
Non sequential COM assignments in wine.conf should not break now.
Baudrate can be specified in wine.conf to overcome baudrate limitation
in mswindow. See sample wine.ini
* [include/comm.h]
add baudrate field to DosDeviceStructre
* [object/font.c]
Bug fix for font assignment.
Use pairs of foundry and family fontnames in X11 to correspond with
window's fonts.
Put font assignment ini wine.ini.
* [wine.ini]
Adding optional baudrate after port name in "serialports" section
Add new section, "fonts".
"default" is special key in "fonts" to match any unmatch window font.
Oct 29, 94 (new address) wine@trgcorp.mksinfo.qc.ca (Martin Ayotte)
* [if1632/relay.c]
* [if1632/commdlg.spec] New file.
* [misc/commdlg.c] New file.
* [include/commdlg.h] New file.
Begin of an emulated COMMDLG DLL, built-in for now.
(BTW, if you want to switch between built-in & 16bits CommDlg, only
thing you need to do is to put the real/dummy name in file relay.c)
* [controls/scroll.c]
* [controls/combo.c]
* [controls/listbox.c]
Few bug fixes and/or cosmetic.
* [misc/audio.c]
* [misc/mmaux.c]
bug fixes and flags returned to emulate SB16.
* [misc/midi.c] New file.
skeleton for 'Midi' MMSYSTEM & MCI driver.
* [misc/mcianim.c] New file.
skeleton for 'Animation1' MCI driver.
* [windows/win.c]
Add new stub for GetLastActiveWindow().
Tue Oct 25 09:17:25 1994 Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
* [if1632/call.S] [tools/build.c]
Support for ELF format. (Not complete)
Sun Oct 23 00:51:50 1994 Paul Falstad (pf@zoof)
* [if1632/user.spec]
Add stubs for ArrangeIconicWindows(), etc.
* [if1632/kernel.spec]
Add IsBad*Ptr() functions.
* [loader/signal.c]
Add test_memory(), for use with IsBad*Ptr().
* [windows/winpos.c]
Add stubs for TileChildWindows(), etc.
* [windows/win.c]
IsWindow() shouldn't crash if it's given a bad handle.
Add stub for GetLastActivePopup().
* [memory/global.c]
Implement the IsBad*Ptr() functions.
* [controls/listbox.c]
Return the full longword of the item data in LB_GETITEMDATA.
* [controls/edit.c]
Don't let the user select an area past the end of the text.
* [objects/text.c]
In DrawText(), the code to delete crlfs also removed multiple
consecutive newlines. Also, using DT_CALCRECT didn't return
the right height, and the width wasn't returned at all.
This caused MessageBoxes to be missing much of their text.
* [windows/scroll.c]
ScrollWindow[Ex] didn't work right with null LPRECT arguments.
Fri Oct 21 21:47:19 1994 Paul Falstad (pf@zoof.cts.com)
* [miscemu/int21.c]
Fixed int21 0x42 handler to properly assemble 32-bit seek ptr.
* [misc/property.c]
Fixed inverted logic in EnumProps(), and changed CallBack16()
call to use new arg format.
* [windows/win.c]
Fixed CallBack16() call in Enum[Child]Windows to use new arg
format; this fixes crashes in enum procedures.
Wed Oct 19 21:30:00 PDT 1994 martin@cs.csufresno.edu
* [misc/clipboard.c]
[windows/event.c]
[windows/message.c]
Added cut and paste between Wine and other X clients via
the PRIMARY selection. Text only this time.
* [controls/edit.c]
EDIT_LineLength, EDIT_TextLine return 0 for lines after last one.
* [windows/defwnd.c]
Send WM_SYSCOMMAND to overlapped ancestor window,
not the receiver of WM_SYSKEYDOWN
Sat Oct 22 15:01:02 1994 Thomas Sandford <t.d.g.sandford@bradford.ac.uk>
* [controls/edit.c]
ClientWidth()/ClientHeight() macros: return 0 if size would
be negative
EDIT_StrLength(): takes unsigned char* instead of char*
* [controls/listbox.c]
ListBoxWndProc(): in "case WM_MOUSEMOVE" - set lphl at start of
case instead of in each place required (it was omitted in
some places causing problems!)
* [controls/menu.c]
MENU_CalcItemSize(): don't try to find size of a text item
if the pointer is NULL
* [include/heap.h]
added definition of HEAP_LocalInit()
* [include/msdos.h]
removed buggy pointer() macro (use SAFEMAKEPTR() from segmem.h
instead)
* [loader/selector.c]
IPCCopySelector(): added missing flags to shmget() call
? does this break linux - I added these flags in a previous
patch but they were missing in the corresponding release ?
* [loader/signal.c]
win_fault(): added missing definitions of i, dump for those
not running NetBSD or linux
* [misc/dos_fs.c]
DOS_GetCurrentDir(): made temp[] static so it can be safely
returned
* [miscemu/int21.c,int25.c,int26.c]
Changed all invocations of pointer() to SAFEMAKEPTR(). Included
segmem.h where necessary.
* [windows/dialog.c]
CreateDialogIndirectParam(): Changed HEAP_Init() call to
HEAP_LocalInit(), removed redundant variables
Sat Oct 22 00:29:41 MET 1994 Dag Asheim (dash@ifi.uio.no)
* [loader/library.c] [loader/main.c] [loader/ne_image.c]
[misc/exec.c] [miscemu/int10.c] [miscemu/int21.c]
[objects/bitblt.c] [objects/metafile.c]
Rewritten more printf's to use the new debugging system, and
made wine less verbose per default. Use "-debugmsg +module"
to get (almost) the same behavior as before.
1994-10-30 16:25:19 +00:00
|
|
|
/* If the driver was opened shareable before and this open specifies */
|
1994-07-07 16:23:58 +00:00
|
|
|
/* shareable then increment the use count */
|
|
|
|
if (CDADev[wDevID].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
|
|
|
++CDADev[wDevID].nUseCount;
|
|
|
|
else
|
|
|
|
return MCIERR_MUST_USE_SHAREABLE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
CDADev[wDevID].nUseCount = 1;
|
|
|
|
CDADev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_OPEN_ELEMENT) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // MCI_OPEN_ELEMENT !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
/* return MCIERR_NO_ELEMENT_ALLOWED; */
|
|
|
|
}
|
|
|
|
memcpy(&CDADev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS));
|
|
|
|
CDADev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
|
|
|
|
CDADev[wDevID].unixdev = open (CDAUDIO_DEV, O_RDONLY, 0);
|
|
|
|
if (CDADev[wDevID].unixdev == -1) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciOpen // can't open '%s' !\n", CDAUDIO_DEV);
|
1994-07-07 16:23:58 +00:00
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
}
|
|
|
|
CDADev[wDevID].mode = 0;
|
|
|
|
CDADev[wDevID].dwTimeFormat = MCI_FORMAT_TMSF;
|
|
|
|
CDADev[wDevID].nCurTrack = 0;
|
|
|
|
CDADev[wDevID].nTracks = 0;
|
|
|
|
CDADev[wDevID].dwTotalLen = 0;
|
|
|
|
CDADev[wDevID].dwFirstOffset = 0;
|
|
|
|
CDADev[wDevID].lpdwTrackLen = NULL;
|
|
|
|
CDADev[wDevID].lpdwTrackPos = NULL;
|
|
|
|
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciOpen // error reading TracksInfo !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
/* return MCIERR_INTERNAL; */
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciClose [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciClose(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwParam, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen);
|
|
|
|
if (CDADev[wDevID].lpdwTrackPos != NULL) free(CDADev[wDevID].lpdwTrackPos);
|
|
|
|
close(CDADev[wDevID].unixdev);
|
1994-07-23 07:57:48 +00:00
|
|
|
#endif
|
1995-01-09 18:21:16 +00:00
|
|
|
return 0;
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciGetDevCaps [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
|
|
|
|
LPMCI_GETDEVCAPS_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciGetDevCaps(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
if (dwFlags & MCI_GETDEVCAPS_ITEM) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciGetDevCaps // MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
lpParms->dwItem);
|
|
|
|
switch(lpParms->dwItem) {
|
|
|
|
case MCI_GETDEVCAPS_CAN_RECORD:
|
|
|
|
lpParms->dwReturn = FALSE;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_HAS_AUDIO:
|
|
|
|
lpParms->dwReturn = TRUE;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_HAS_VIDEO:
|
|
|
|
lpParms->dwReturn = FALSE;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_DEVICE_TYPE:
|
|
|
|
lpParms->dwReturn = MCI_DEVTYPE_CD_AUDIO;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_USES_FILES:
|
|
|
|
lpParms->dwReturn = FALSE;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_COMPOUND_DEVICE:
|
|
|
|
lpParms->dwReturn = FALSE;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_CAN_EJECT:
|
|
|
|
lpParms->dwReturn = TRUE;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_CAN_PLAY:
|
|
|
|
lpParms->dwReturn = TRUE;
|
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_CAN_SAVE:
|
|
|
|
lpParms->dwReturn = FALSE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
|
|
|
}
|
|
|
|
}
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciGetDevCaps // lpParms->dwReturn=%08lX;\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwReturn);
|
1994-07-07 16:23:58 +00:00
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_INTERNAL;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciInfo [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciInfo(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
lpParms->lpstrReturn = NULL;
|
|
|
|
switch(dwFlags) {
|
|
|
|
case MCI_INFO_PRODUCT:
|
|
|
|
lpParms->lpstrReturn = "Linux CDROM 0.5";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
|
|
|
}
|
|
|
|
if (lpParms->lpstrReturn != NULL)
|
|
|
|
lpParms->dwRetSize = strlen(lpParms->lpstrReturn);
|
|
|
|
else
|
|
|
|
lpParms->dwRetSize = 0;
|
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_INTERNAL;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciStatus [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED;
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_STATUS_ITEM) {
|
|
|
|
switch(lpParms->dwItem) {
|
|
|
|
case MCI_STATUS_CURRENT_TRACK:
|
|
|
|
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
|
|
|
lpParms->dwReturn = CDADev[wDevID].nCurTrack;
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
|
1994-07-07 16:23:58 +00:00
|
|
|
return 0;
|
|
|
|
case MCI_STATUS_LENGTH:
|
|
|
|
if (CDADev[wDevID].nTracks == 0) {
|
|
|
|
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciStatus // error reading TracksInfo !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return MCIERR_INTERNAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_TRACK) {
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
lpParms->dwTrack);
|
|
|
|
if (lpParms->dwTrack > CDADev[wDevID].nTracks)
|
|
|
|
return MCIERR_OUTOFRANGE;
|
|
|
|
lpParms->dwReturn = CDADev[wDevID].lpdwTrackLen[lpParms->dwTrack];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
lpParms->dwReturn = CDADev[wDevID].dwTotalLen;
|
|
|
|
lpParms->dwReturn = CDAUDIO_CalcTime(wDevID,
|
|
|
|
CDADev[wDevID].dwTimeFormat, lpParms->dwReturn);
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn);
|
1994-07-07 16:23:58 +00:00
|
|
|
return 0;
|
|
|
|
case MCI_STATUS_MODE:
|
|
|
|
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
|
|
|
lpParms->dwReturn = CDADev[wDevID].mode;
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_MODE=%08lX !\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
lpParms->dwReturn);
|
|
|
|
return 0;
|
|
|
|
case MCI_STATUS_MEDIA_PRESENT:
|
|
|
|
lpParms->dwReturn = (CDADev[wDevID].nTracks > 0) ? TRUE : FALSE;
|
|
|
|
if (lpParms->dwReturn == FALSE)
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciStatus // MEDIA_NOT_PRESENT !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
else
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return 0;
|
|
|
|
case MCI_STATUS_NUMBER_OF_TRACKS:
|
|
|
|
lpParms->dwReturn = CDAUDIO_GetNumberOfTracks(wDevID);
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
lpParms->dwReturn);
|
|
|
|
if (lpParms->dwReturn == (WORD)-1) return MCIERR_INTERNAL;
|
|
|
|
return 0;
|
|
|
|
case MCI_STATUS_POSITION:
|
|
|
|
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
|
|
|
lpParms->dwReturn = CDADev[wDevID].dwCurFrame;
|
|
|
|
if (dwFlags & MCI_STATUS_START) {
|
|
|
|
lpParms->dwReturn = CDADev[wDevID].dwFirstOffset;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
if (dwFlags & MCI_TRACK) {
|
|
|
|
if (lpParms->dwTrack > CDADev[wDevID].nTracks)
|
|
|
|
return MCIERR_OUTOFRANGE;
|
|
|
|
lpParms->dwReturn = CDADev[wDevID].lpdwTrackPos[lpParms->dwTrack - 1];
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack);
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
lpParms->dwReturn = CDAUDIO_CalcTime(wDevID,
|
|
|
|
CDADev[wDevID].dwTimeFormat, lpParms->dwReturn);
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_POSITION=%08lX !\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
lpParms->dwReturn);
|
|
|
|
return 0;
|
|
|
|
case MCI_STATUS_READY:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_READY !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
lpParms->dwReturn = TRUE;
|
|
|
|
return 0;
|
|
|
|
case MCI_STATUS_TIME_FORMAT:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_TIME_FORMAT !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
lpParms->dwReturn = MCI_FORMAT_MILLISECONDS;
|
|
|
|
return 0;
|
|
|
|
default:
|
1995-01-09 18:21:16 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciStatus // unknown command %08lX !\n", lpParms->dwItem);
|
1994-07-07 16:23:58 +00:00
|
|
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
|
|
|
}
|
|
|
|
}
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciStatus // not MCI_STATUS_ITEM !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MMSYSERR_NOTENABLED;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_CalcTime [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame)
|
|
|
|
{
|
|
|
|
DWORD dwTime = 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
UINT wTrack;
|
|
|
|
UINT wMinutes;
|
|
|
|
UINT wSeconds;
|
|
|
|
UINT wFrames;
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_CalcTime(%u, %08lX, %lu);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFormatType, dwFrame);
|
1994-07-07 16:23:58 +00:00
|
|
|
TryAGAIN:
|
|
|
|
switch (dwFormatType) {
|
|
|
|
case MCI_FORMAT_MILLISECONDS:
|
|
|
|
dwTime = dwFrame / CDFRAMES_PERSEC * 1000;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_CalcTime // MILLISECONDS %lu\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
dwTime);
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_MSF:
|
|
|
|
wMinutes = dwFrame / CDFRAMES_PERMIN;
|
|
|
|
wSeconds = (dwFrame - CDFRAMES_PERMIN * wMinutes) / CDFRAMES_PERSEC;
|
|
|
|
wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes -
|
|
|
|
CDFRAMES_PERSEC * wSeconds;
|
|
|
|
dwTime = MCI_MAKE_MSF(wMinutes, wSeconds, wFrames);
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_CalcTime // MSF %02u:%02u:%02u -> dwTime=%lu\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
wMinutes, wSeconds, wFrames, dwTime);
|
|
|
|
break;
|
|
|
|
case MCI_FORMAT_TMSF:
|
|
|
|
for (wTrack = 0; wTrack < CDADev[wDevID].nTracks; wTrack++) {
|
|
|
|
/* dwTime += CDADev[wDevID].lpdwTrackLen[wTrack - 1];
|
|
|
|
printf("Adding trk#%u curpos=%u \n", dwTime);
|
|
|
|
if (dwTime >= dwFrame) break; */
|
|
|
|
if (CDADev[wDevID].lpdwTrackPos[wTrack - 1] >= dwFrame) break;
|
|
|
|
}
|
|
|
|
wMinutes = dwFrame / CDFRAMES_PERMIN;
|
|
|
|
wSeconds = (dwFrame - CDFRAMES_PERMIN * wMinutes) / CDFRAMES_PERSEC;
|
|
|
|
wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes -
|
|
|
|
CDFRAMES_PERSEC * wSeconds;
|
|
|
|
dwTime = MCI_MAKE_TMSF(wTrack, wMinutes, wSeconds, wFrames);
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_CalcTime // %02u-%02u:%02u:%02u\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
wTrack, wMinutes, wSeconds, wFrames);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* unknown format ! force TMSF ! ... */
|
|
|
|
dwFormatType = MCI_FORMAT_TMSF;
|
|
|
|
goto TryAGAIN;
|
|
|
|
}
|
1994-07-23 07:57:48 +00:00
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
return dwTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_CalcFrame [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime)
|
|
|
|
{
|
|
|
|
DWORD dwFrame = 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
UINT wTrack;
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_CalcFrame(%u, %08lX, %lu);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFormatType, dwTime);
|
1994-07-07 16:23:58 +00:00
|
|
|
TryAGAIN:
|
|
|
|
switch (dwFormatType) {
|
|
|
|
case MCI_FORMAT_MILLISECONDS:
|
|
|
|
dwFrame = dwTime * CDFRAMES_PERSEC / 1000;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_CalcFrame // MILLISECONDS %lu\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
dwFrame);
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_MSF:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_CalcFrame // MSF %02u:%02u:%02u\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime),
|
|
|
|
MCI_MSF_FRAME(dwTime));
|
|
|
|
dwFrame += CDFRAMES_PERMIN * MCI_MSF_MINUTE(dwTime);
|
|
|
|
dwFrame += CDFRAMES_PERSEC * MCI_MSF_SECOND(dwTime);
|
|
|
|
dwFrame += MCI_MSF_FRAME(dwTime);
|
|
|
|
break;
|
|
|
|
case MCI_FORMAT_TMSF:
|
|
|
|
wTrack = MCI_TMSF_TRACK(dwTime);
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_CalcFrame // TMSF %02u-%02u:%02u:%02u\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime),
|
|
|
|
MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_CalcFrame // TMSF trackpos[%u]=%lu\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
wTrack, CDADev[wDevID].lpdwTrackPos[wTrack - 1]);
|
|
|
|
dwFrame = CDADev[wDevID].lpdwTrackPos[wTrack - 1];
|
|
|
|
dwFrame += CDFRAMES_PERMIN * MCI_TMSF_MINUTE(dwTime);
|
|
|
|
dwFrame += CDFRAMES_PERSEC * MCI_TMSF_SECOND(dwTime);
|
|
|
|
dwFrame += MCI_TMSF_FRAME(dwTime);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* unknown format ! force TMSF ! ... */
|
|
|
|
dwFormatType = MCI_FORMAT_TMSF;
|
|
|
|
goto TryAGAIN;
|
|
|
|
}
|
1994-07-23 07:57:48 +00:00
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
return dwFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_GetNumberOfTracks [internal]
|
|
|
|
*/
|
|
|
|
UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
struct cdrom_tochdr hdr;
|
|
|
|
if (CDADev[wDevID].nTracks == 0) {
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMREADTOCHDR, &hdr)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,
|
|
|
|
"GetNumberOfTracks(%u) // Error occured !\n",
|
|
|
|
wDevID);
|
1994-07-07 16:23:58 +00:00
|
|
|
return (WORD)-1;
|
|
|
|
}
|
|
|
|
CDADev[wDevID].nTracks = hdr.cdth_trk1;
|
|
|
|
}
|
|
|
|
return CDADev[wDevID].nTracks;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return (WORD)-1;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
Release 941030
Sun Oct 30 13:01:18 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/static.c]
Bug fix for SS_ICON controls.
* [if1632/Imakefile]
Fixed call.o dependencies.
* [objects/clipping.c] [objects/dc.c]
Fixed visible region handling. hVisRgn is always non-null now.
* [windows/dce.c]
Bug fix in GetDCEx for CS_OWNDC windows.
* [windows/nonclient.c] [windows/painting.c]
Fixes to icon window drawing.
* [windows/winpos.c]
A few fixes in SetWindowPos().
Sun Oct 30 12:50:24 1994 Michael Patra <micky@marie.physik.tu-berlin.de>
* [objects/bitblt.c]
BitBlt(): BitBlt is now able to handle any raster operation. If
the request can't be passed to XWindows directly, it's quite
slow, though.
* [*/*.c]
[misc/main.c]
Improvements of the system for handling debug messages. Options are
now also loaded from /usr/lib/X11/app-defaults/Wine (insert
*debugoptions: +xxx there if you want to have turn messages xxx on).
* [controls/menu.c]
DestroyMenu(): The whole window won't be destroyed as a sideeffect
any longer.
* [misc/file.c]
OpenFile(): Fixed bug in searching in system/window-directory.
Sun Oct 30 12:25:53 1994 Jimmy Tirtawangsa <j0t2527@tam2000.tamu.edu>
* [include/windows.h]
Bug fix for window related structures.
DCB and COMSTAT are affected. They must be packed.
* [misc/comm.c]
Bug fix for COM ports:
Dial and dialog window in terminal.exe now works.
Non sequential COM assignments in wine.conf should not break now.
Baudrate can be specified in wine.conf to overcome baudrate limitation
in mswindow. See sample wine.ini
* [include/comm.h]
add baudrate field to DosDeviceStructre
* [object/font.c]
Bug fix for font assignment.
Use pairs of foundry and family fontnames in X11 to correspond with
window's fonts.
Put font assignment ini wine.ini.
* [wine.ini]
Adding optional baudrate after port name in "serialports" section
Add new section, "fonts".
"default" is special key in "fonts" to match any unmatch window font.
Oct 29, 94 (new address) wine@trgcorp.mksinfo.qc.ca (Martin Ayotte)
* [if1632/relay.c]
* [if1632/commdlg.spec] New file.
* [misc/commdlg.c] New file.
* [include/commdlg.h] New file.
Begin of an emulated COMMDLG DLL, built-in for now.
(BTW, if you want to switch between built-in & 16bits CommDlg, only
thing you need to do is to put the real/dummy name in file relay.c)
* [controls/scroll.c]
* [controls/combo.c]
* [controls/listbox.c]
Few bug fixes and/or cosmetic.
* [misc/audio.c]
* [misc/mmaux.c]
bug fixes and flags returned to emulate SB16.
* [misc/midi.c] New file.
skeleton for 'Midi' MMSYSTEM & MCI driver.
* [misc/mcianim.c] New file.
skeleton for 'Animation1' MCI driver.
* [windows/win.c]
Add new stub for GetLastActiveWindow().
Tue Oct 25 09:17:25 1994 Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
* [if1632/call.S] [tools/build.c]
Support for ELF format. (Not complete)
Sun Oct 23 00:51:50 1994 Paul Falstad (pf@zoof)
* [if1632/user.spec]
Add stubs for ArrangeIconicWindows(), etc.
* [if1632/kernel.spec]
Add IsBad*Ptr() functions.
* [loader/signal.c]
Add test_memory(), for use with IsBad*Ptr().
* [windows/winpos.c]
Add stubs for TileChildWindows(), etc.
* [windows/win.c]
IsWindow() shouldn't crash if it's given a bad handle.
Add stub for GetLastActivePopup().
* [memory/global.c]
Implement the IsBad*Ptr() functions.
* [controls/listbox.c]
Return the full longword of the item data in LB_GETITEMDATA.
* [controls/edit.c]
Don't let the user select an area past the end of the text.
* [objects/text.c]
In DrawText(), the code to delete crlfs also removed multiple
consecutive newlines. Also, using DT_CALCRECT didn't return
the right height, and the width wasn't returned at all.
This caused MessageBoxes to be missing much of their text.
* [windows/scroll.c]
ScrollWindow[Ex] didn't work right with null LPRECT arguments.
Fri Oct 21 21:47:19 1994 Paul Falstad (pf@zoof.cts.com)
* [miscemu/int21.c]
Fixed int21 0x42 handler to properly assemble 32-bit seek ptr.
* [misc/property.c]
Fixed inverted logic in EnumProps(), and changed CallBack16()
call to use new arg format.
* [windows/win.c]
Fixed CallBack16() call in Enum[Child]Windows to use new arg
format; this fixes crashes in enum procedures.
Wed Oct 19 21:30:00 PDT 1994 martin@cs.csufresno.edu
* [misc/clipboard.c]
[windows/event.c]
[windows/message.c]
Added cut and paste between Wine and other X clients via
the PRIMARY selection. Text only this time.
* [controls/edit.c]
EDIT_LineLength, EDIT_TextLine return 0 for lines after last one.
* [windows/defwnd.c]
Send WM_SYSCOMMAND to overlapped ancestor window,
not the receiver of WM_SYSKEYDOWN
Sat Oct 22 15:01:02 1994 Thomas Sandford <t.d.g.sandford@bradford.ac.uk>
* [controls/edit.c]
ClientWidth()/ClientHeight() macros: return 0 if size would
be negative
EDIT_StrLength(): takes unsigned char* instead of char*
* [controls/listbox.c]
ListBoxWndProc(): in "case WM_MOUSEMOVE" - set lphl at start of
case instead of in each place required (it was omitted in
some places causing problems!)
* [controls/menu.c]
MENU_CalcItemSize(): don't try to find size of a text item
if the pointer is NULL
* [include/heap.h]
added definition of HEAP_LocalInit()
* [include/msdos.h]
removed buggy pointer() macro (use SAFEMAKEPTR() from segmem.h
instead)
* [loader/selector.c]
IPCCopySelector(): added missing flags to shmget() call
? does this break linux - I added these flags in a previous
patch but they were missing in the corresponding release ?
* [loader/signal.c]
win_fault(): added missing definitions of i, dump for those
not running NetBSD or linux
* [misc/dos_fs.c]
DOS_GetCurrentDir(): made temp[] static so it can be safely
returned
* [miscemu/int21.c,int25.c,int26.c]
Changed all invocations of pointer() to SAFEMAKEPTR(). Included
segmem.h where necessary.
* [windows/dialog.c]
CreateDialogIndirectParam(): Changed HEAP_Init() call to
HEAP_LocalInit(), removed redundant variables
Sat Oct 22 00:29:41 MET 1994 Dag Asheim (dash@ifi.uio.no)
* [loader/library.c] [loader/main.c] [loader/ne_image.c]
[misc/exec.c] [miscemu/int10.c] [miscemu/int21.c]
[objects/bitblt.c] [objects/metafile.c]
Rewritten more printf's to use the new debugging system, and
made wine less verbose per default. Use "-debugmsg +module"
to get (almost) the same behavior as before.
1994-10-30 16:25:19 +00:00
|
|
|
* CDAUDIO_GetTracksInfo [internal]
|
1994-07-07 16:23:58 +00:00
|
|
|
*/
|
|
|
|
BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
int i, length;
|
|
|
|
int start, last_start;
|
|
|
|
int total_length = 0;
|
|
|
|
struct cdrom_tocentry entry;
|
|
|
|
if (CDADev[wDevID].nTracks == 0) {
|
|
|
|
if (CDAUDIO_GetNumberOfTracks(wDevID) == (WORD)-1) return FALSE;
|
|
|
|
}
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // nTracks=%u\n",
|
|
|
|
CDADev[wDevID].nTracks);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (CDADev[wDevID].lpdwTrackLen != NULL)
|
|
|
|
free(CDADev[wDevID].lpdwTrackLen);
|
|
|
|
CDADev[wDevID].lpdwTrackLen = (LPDWORD)malloc(
|
|
|
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
|
|
|
if (CDADev[wDevID].lpdwTrackPos != NULL)
|
|
|
|
free(CDADev[wDevID].lpdwTrackPos);
|
|
|
|
CDADev[wDevID].lpdwTrackPos = (LPDWORD)malloc(
|
|
|
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
|
|
|
if (CDADev[wDevID].lpdwTrackLen == NULL ||
|
|
|
|
CDADev[wDevID].lpdwTrackPos == NULL) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,
|
|
|
|
"CDAUDIO_GetTracksInfo // error allocating track table !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
memset(CDADev[wDevID].lpdwTrackLen, 0,
|
|
|
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
|
|
|
memset(CDADev[wDevID].lpdwTrackPos, 0,
|
|
|
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
|
|
|
for (i = 0; i <= CDADev[wDevID].nTracks; i++) {
|
|
|
|
if (i == CDADev[wDevID].nTracks)
|
|
|
|
entry.cdte_track = CDROM_LEADOUT;
|
|
|
|
else
|
|
|
|
entry.cdte_track = i + 1;
|
|
|
|
entry.cdte_format = CDROM_MSF;
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMREADTOCENTRY, &entry)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,
|
|
|
|
"CDAUDIO_GetTracksInfo // error read entry\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
start = CDFRAMES_PERSEC * (SECONDS_PERMIN *
|
|
|
|
entry.cdte_addr.msf.minute + entry.cdte_addr.msf.second) +
|
|
|
|
entry.cdte_addr.msf.frame;
|
|
|
|
if (i == 0) {
|
|
|
|
CDADev[wDevID].dwFirstOffset = last_start = start;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_GetTracksInfo // dwFirstOffset=%u\n",
|
|
|
|
start);
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
length = start - last_start;
|
|
|
|
last_start = start;
|
|
|
|
start = last_start - length;
|
|
|
|
total_length += length;
|
|
|
|
CDADev[wDevID].lpdwTrackLen[i - 1] = length;
|
|
|
|
CDADev[wDevID].lpdwTrackPos[i - 1] = start;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_GetTracksInfo // track #%u start=%u len=%u\n",
|
|
|
|
i, start, length);
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
CDADev[wDevID].dwTotalLen = total_length;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // total_len=%u\n",
|
|
|
|
total_length);
|
1994-08-06 11:22:41 +00:00
|
|
|
fflush(stdout);
|
1994-07-07 16:23:58 +00:00
|
|
|
return TRUE;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return FALSE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
Release 941030
Sun Oct 30 13:01:18 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/static.c]
Bug fix for SS_ICON controls.
* [if1632/Imakefile]
Fixed call.o dependencies.
* [objects/clipping.c] [objects/dc.c]
Fixed visible region handling. hVisRgn is always non-null now.
* [windows/dce.c]
Bug fix in GetDCEx for CS_OWNDC windows.
* [windows/nonclient.c] [windows/painting.c]
Fixes to icon window drawing.
* [windows/winpos.c]
A few fixes in SetWindowPos().
Sun Oct 30 12:50:24 1994 Michael Patra <micky@marie.physik.tu-berlin.de>
* [objects/bitblt.c]
BitBlt(): BitBlt is now able to handle any raster operation. If
the request can't be passed to XWindows directly, it's quite
slow, though.
* [*/*.c]
[misc/main.c]
Improvements of the system for handling debug messages. Options are
now also loaded from /usr/lib/X11/app-defaults/Wine (insert
*debugoptions: +xxx there if you want to have turn messages xxx on).
* [controls/menu.c]
DestroyMenu(): The whole window won't be destroyed as a sideeffect
any longer.
* [misc/file.c]
OpenFile(): Fixed bug in searching in system/window-directory.
Sun Oct 30 12:25:53 1994 Jimmy Tirtawangsa <j0t2527@tam2000.tamu.edu>
* [include/windows.h]
Bug fix for window related structures.
DCB and COMSTAT are affected. They must be packed.
* [misc/comm.c]
Bug fix for COM ports:
Dial and dialog window in terminal.exe now works.
Non sequential COM assignments in wine.conf should not break now.
Baudrate can be specified in wine.conf to overcome baudrate limitation
in mswindow. See sample wine.ini
* [include/comm.h]
add baudrate field to DosDeviceStructre
* [object/font.c]
Bug fix for font assignment.
Use pairs of foundry and family fontnames in X11 to correspond with
window's fonts.
Put font assignment ini wine.ini.
* [wine.ini]
Adding optional baudrate after port name in "serialports" section
Add new section, "fonts".
"default" is special key in "fonts" to match any unmatch window font.
Oct 29, 94 (new address) wine@trgcorp.mksinfo.qc.ca (Martin Ayotte)
* [if1632/relay.c]
* [if1632/commdlg.spec] New file.
* [misc/commdlg.c] New file.
* [include/commdlg.h] New file.
Begin of an emulated COMMDLG DLL, built-in for now.
(BTW, if you want to switch between built-in & 16bits CommDlg, only
thing you need to do is to put the real/dummy name in file relay.c)
* [controls/scroll.c]
* [controls/combo.c]
* [controls/listbox.c]
Few bug fixes and/or cosmetic.
* [misc/audio.c]
* [misc/mmaux.c]
bug fixes and flags returned to emulate SB16.
* [misc/midi.c] New file.
skeleton for 'Midi' MMSYSTEM & MCI driver.
* [misc/mcianim.c] New file.
skeleton for 'Animation1' MCI driver.
* [windows/win.c]
Add new stub for GetLastActiveWindow().
Tue Oct 25 09:17:25 1994 Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
* [if1632/call.S] [tools/build.c]
Support for ELF format. (Not complete)
Sun Oct 23 00:51:50 1994 Paul Falstad (pf@zoof)
* [if1632/user.spec]
Add stubs for ArrangeIconicWindows(), etc.
* [if1632/kernel.spec]
Add IsBad*Ptr() functions.
* [loader/signal.c]
Add test_memory(), for use with IsBad*Ptr().
* [windows/winpos.c]
Add stubs for TileChildWindows(), etc.
* [windows/win.c]
IsWindow() shouldn't crash if it's given a bad handle.
Add stub for GetLastActivePopup().
* [memory/global.c]
Implement the IsBad*Ptr() functions.
* [controls/listbox.c]
Return the full longword of the item data in LB_GETITEMDATA.
* [controls/edit.c]
Don't let the user select an area past the end of the text.
* [objects/text.c]
In DrawText(), the code to delete crlfs also removed multiple
consecutive newlines. Also, using DT_CALCRECT didn't return
the right height, and the width wasn't returned at all.
This caused MessageBoxes to be missing much of their text.
* [windows/scroll.c]
ScrollWindow[Ex] didn't work right with null LPRECT arguments.
Fri Oct 21 21:47:19 1994 Paul Falstad (pf@zoof.cts.com)
* [miscemu/int21.c]
Fixed int21 0x42 handler to properly assemble 32-bit seek ptr.
* [misc/property.c]
Fixed inverted logic in EnumProps(), and changed CallBack16()
call to use new arg format.
* [windows/win.c]
Fixed CallBack16() call in Enum[Child]Windows to use new arg
format; this fixes crashes in enum procedures.
Wed Oct 19 21:30:00 PDT 1994 martin@cs.csufresno.edu
* [misc/clipboard.c]
[windows/event.c]
[windows/message.c]
Added cut and paste between Wine and other X clients via
the PRIMARY selection. Text only this time.
* [controls/edit.c]
EDIT_LineLength, EDIT_TextLine return 0 for lines after last one.
* [windows/defwnd.c]
Send WM_SYSCOMMAND to overlapped ancestor window,
not the receiver of WM_SYSKEYDOWN
Sat Oct 22 15:01:02 1994 Thomas Sandford <t.d.g.sandford@bradford.ac.uk>
* [controls/edit.c]
ClientWidth()/ClientHeight() macros: return 0 if size would
be negative
EDIT_StrLength(): takes unsigned char* instead of char*
* [controls/listbox.c]
ListBoxWndProc(): in "case WM_MOUSEMOVE" - set lphl at start of
case instead of in each place required (it was omitted in
some places causing problems!)
* [controls/menu.c]
MENU_CalcItemSize(): don't try to find size of a text item
if the pointer is NULL
* [include/heap.h]
added definition of HEAP_LocalInit()
* [include/msdos.h]
removed buggy pointer() macro (use SAFEMAKEPTR() from segmem.h
instead)
* [loader/selector.c]
IPCCopySelector(): added missing flags to shmget() call
? does this break linux - I added these flags in a previous
patch but they were missing in the corresponding release ?
* [loader/signal.c]
win_fault(): added missing definitions of i, dump for those
not running NetBSD or linux
* [misc/dos_fs.c]
DOS_GetCurrentDir(): made temp[] static so it can be safely
returned
* [miscemu/int21.c,int25.c,int26.c]
Changed all invocations of pointer() to SAFEMAKEPTR(). Included
segmem.h where necessary.
* [windows/dialog.c]
CreateDialogIndirectParam(): Changed HEAP_Init() call to
HEAP_LocalInit(), removed redundant variables
Sat Oct 22 00:29:41 MET 1994 Dag Asheim (dash@ifi.uio.no)
* [loader/library.c] [loader/main.c] [loader/ne_image.c]
[misc/exec.c] [miscemu/int10.c] [miscemu/int21.c]
[objects/bitblt.c] [objects/metafile.c]
Rewritten more printf's to use the new debugging system, and
made wine less verbose per default. Use "-debugmsg +module"
to get (almost) the same behavior as before.
1994-10-30 16:25:19 +00:00
|
|
|
* CDAUDIO_GetCDStatus [internal]
|
1994-07-07 16:23:58 +00:00
|
|
|
*/
|
|
|
|
BOOL CDAUDIO_GetCDStatus(UINT wDevID)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
int oldmode = CDADev[wDevID].mode;
|
|
|
|
CDADev[wDevID].sc.cdsc_format = CDROM_MSF;
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMSUBCHNL, &CDADev[wDevID].sc)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_GetCDStatus // opened or no_media !\n");
|
1994-08-06 11:22:41 +00:00
|
|
|
CDADev[wDevID].mode = MCI_MODE_NOT_READY;
|
1994-07-07 16:23:58 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
switch (CDADev[wDevID].sc.cdsc_audiostatus) {
|
|
|
|
case CDROM_AUDIO_INVALID:
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_GetCDStatus // device doesn't support status !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return FALSE;
|
|
|
|
case CDROM_AUDIO_NO_STATUS:
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_STOP;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_STOP !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
case CDROM_AUDIO_PLAY:
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_PLAY;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PLAY !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
case CDROM_AUDIO_PAUSED:
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_PAUSE;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PAUSE !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
default:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // status=%02X !\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
CDADev[wDevID].sc.cdsc_audiostatus);
|
|
|
|
}
|
|
|
|
CDADev[wDevID].nCurTrack = CDADev[wDevID].sc.cdsc_trk;
|
|
|
|
CDADev[wDevID].dwCurFrame =
|
|
|
|
CDFRAMES_PERMIN * CDADev[wDevID].sc.cdsc_absaddr.msf.minute +
|
|
|
|
CDFRAMES_PERSEC * CDADev[wDevID].sc.cdsc_absaddr.msf.second +
|
|
|
|
CDADev[wDevID].sc.cdsc_absaddr.msf.frame;
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n",
|
1994-07-07 16:23:58 +00:00
|
|
|
CDADev[wDevID].sc.cdsc_trk,
|
|
|
|
CDADev[wDevID].sc.cdsc_absaddr.msf.minute,
|
|
|
|
CDADev[wDevID].sc.cdsc_absaddr.msf.second,
|
|
|
|
CDADev[wDevID].sc.cdsc_absaddr.msf.frame);
|
|
|
|
if (oldmode != CDADev[wDevID].mode && oldmode == MCI_MODE_OPEN) {
|
|
|
|
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_GetCDStatus // error updating TracksInfo !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return MCIERR_INTERNAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return FALSE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciPlay [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
int start, end;
|
|
|
|
struct cdrom_msf msf;
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED;
|
|
|
|
start = 0; end = CDADev[wDevID].dwTotalLen;
|
|
|
|
CDADev[wDevID].nCurTrack = 1;
|
|
|
|
if (dwFlags & MCI_FROM) {
|
|
|
|
start = CDAUDIO_CalcFrame(wDevID,
|
|
|
|
CDADev[wDevID].dwTimeFormat, lpParms->dwFrom);
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // MCI_FROM=%08lX -> %u \n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwFrom, start);
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
if (dwFlags & MCI_TO) {
|
|
|
|
end = CDAUDIO_CalcFrame(wDevID,
|
|
|
|
CDADev[wDevID].dwTimeFormat, lpParms->dwTo);
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciPlay // MCI_TO=%08lX -> %u \n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwTo, end);
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
start += CDADev[wDevID].dwFirstOffset;
|
|
|
|
end += CDADev[wDevID].dwFirstOffset;
|
|
|
|
msf.cdmsf_min0 = start / CDFRAMES_PERMIN;
|
|
|
|
msf.cdmsf_sec0 = (start % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
|
|
|
|
msf.cdmsf_frame0 = start % CDFRAMES_PERSEC;
|
|
|
|
msf.cdmsf_min1 = end / CDFRAMES_PERMIN;
|
|
|
|
msf.cdmsf_sec1 = (end % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
|
|
|
|
msf.cdmsf_frame1 = end % CDFRAMES_PERSEC;
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMSTART)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciPlay // motor doesn't start !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
}
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMPLAYMSF, &msf)) {
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciPlay // device doesn't play !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
}
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // msf = %d:%d:%d %d:%d:%d\n",
|
1994-07-07 16:23:58 +00:00
|
|
|
msf.cdmsf_min0, msf.cdmsf_sec0, msf.cdmsf_frame0,
|
|
|
|
msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1);
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_PLAY;
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciStop [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStop(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMSTOP)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_STOP;
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciPause [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPause(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMPAUSE)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_PAUSE;
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciResume [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciResume(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMRESUME)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_STOP;
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciSeek [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
DWORD dwRet;
|
|
|
|
MCI_PLAY_PARMS PlayParms;
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciSeek(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMRESUME)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[wDevID].mode = MCI_MODE_SEEK;
|
|
|
|
switch(dwFlags) {
|
|
|
|
case MCI_SEEK_TO_START:
|
|
|
|
PlayParms.dwFrom = 0;
|
|
|
|
break;
|
|
|
|
case MCI_SEEK_TO_END:
|
|
|
|
PlayParms.dwFrom = CDADev[wDevID].dwTotalLen;
|
|
|
|
break;
|
|
|
|
case MCI_TO:
|
|
|
|
PlayParms.dwFrom = lpParms->dwTo;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
dwRet = CDAUDIO_mciPlay(wDevID, MCI_WAIT | MCI_FROM, &PlayParms);
|
|
|
|
if (dwRet != 0) return dwRet;
|
|
|
|
dwRet = CDAUDIO_mciStop(wDevID, MCI_WAIT, (LPMCI_GENERIC_PARMS)&PlayParms);
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
return dwRet;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_mciSet [internal]
|
|
|
|
*/
|
|
|
|
DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1995-01-09 18:21:16 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciSet(%u, %08lX, %p);\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
wDevID, dwFlags, lpParms);
|
1994-07-07 16:23:58 +00:00
|
|
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
|
|
|
/*
|
1995-01-09 18:21:16 +00:00
|
|
|
printf("CDAUDIO_mciSet // dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
|
|
|
|
printf("CDAUDIO_mciSet // dwAudio=%08lX\n", lpParms->dwAudio);
|
1994-07-07 16:23:58 +00:00
|
|
|
*/
|
|
|
|
if (dwFlags & MCI_SET_TIME_FORMAT) {
|
|
|
|
switch (lpParms->dwTimeFormat) {
|
|
|
|
case MCI_FORMAT_MILLISECONDS:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_mciSet // MCI_FORMAT_MILLISECONDS !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_MSF:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciSet // MCI_FORMAT_MSF !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_TMSF:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciSet // MCI_FORMAT_TMSF !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
break;
|
|
|
|
default:
|
1994-10-17 18:12:41 +00:00
|
|
|
fprintf(stderr,"CDAUDIO_mciSet // bad time format !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
return MCIERR_BAD_TIME_FORMAT;
|
|
|
|
}
|
|
|
|
CDADev[wDevID].dwTimeFormat = lpParms->dwTimeFormat;
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_SET_DOOR_OPEN) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_mciSet // MCI_SET_DOOR_OPEN !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[wDevID].nTracks = 0;
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_SET_DOOR_CLOSED) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_mciSet // MCI_SET_DOOR_CLOSED !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
if (ioctl(CDADev[wDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[wDevID].nTracks = 0;
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION;
|
|
|
|
if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
|
|
|
|
if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION;
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
1995-01-09 18:21:16 +00:00
|
|
|
"CDAUDIO_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1994-10-17 18:12:41 +00:00
|
|
|
lpParms->dwCallback);
|
1994-07-07 16:23:58 +00:00
|
|
|
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
|
|
|
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
}
|
|
|
|
return 0;
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* CDAUDIO_DriverProc [sample driver]
|
|
|
|
*/
|
|
|
|
LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
|
|
|
|
DWORD dwParam1, DWORD dwParam2)
|
|
|
|
{
|
1994-07-23 07:57:48 +00:00
|
|
|
#ifdef linux
|
1994-07-07 16:23:58 +00:00
|
|
|
switch(wMsg) {
|
|
|
|
case DRV_LOAD:
|
|
|
|
return (LRESULT)1L;
|
|
|
|
case DRV_FREE:
|
|
|
|
return (LRESULT)1L;
|
|
|
|
case DRV_OPEN:
|
|
|
|
case MCI_OPEN_DRIVER:
|
|
|
|
case MCI_OPEN:
|
|
|
|
return CDAUDIO_mciOpen(dwParam1, (LPMCI_OPEN_PARMS)dwParam2);
|
|
|
|
case DRV_CLOSE:
|
|
|
|
case MCI_CLOSE_DRIVER:
|
|
|
|
case MCI_CLOSE:
|
|
|
|
return CDAUDIO_mciClose(dwDevID, dwParam1,
|
|
|
|
(LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case DRV_ENABLE:
|
|
|
|
return (LRESULT)1L;
|
|
|
|
case DRV_DISABLE:
|
|
|
|
return (LRESULT)1L;
|
|
|
|
case DRV_QUERYCONFIGURE:
|
|
|
|
return (LRESULT)1L;
|
|
|
|
case DRV_CONFIGURE:
|
|
|
|
MessageBox((HWND)NULL, "Sample MultiMedia Linux Driver !",
|
|
|
|
"MMLinux Driver", MB_OK);
|
|
|
|
return (LRESULT)1L;
|
|
|
|
case DRV_INSTALL:
|
|
|
|
return (LRESULT)DRVCNF_RESTART;
|
|
|
|
case DRV_REMOVE:
|
|
|
|
return (LRESULT)DRVCNF_RESTART;
|
|
|
|
case MCI_GETDEVCAPS:
|
|
|
|
return CDAUDIO_mciGetDevCaps(dwDevID, dwParam1,
|
|
|
|
(LPMCI_GETDEVCAPS_PARMS)dwParam2);
|
|
|
|
case MCI_INFO:
|
|
|
|
return CDAUDIO_mciInfo(dwDevID, dwParam1,
|
|
|
|
(LPMCI_INFO_PARMS)dwParam2);
|
|
|
|
case MCI_STATUS:
|
|
|
|
return CDAUDIO_mciStatus(dwDevID, dwParam1,
|
|
|
|
(LPMCI_STATUS_PARMS)dwParam2);
|
|
|
|
case MCI_SET:
|
|
|
|
return CDAUDIO_mciSet(dwDevID, dwParam1,
|
|
|
|
(LPMCI_SET_PARMS)dwParam2);
|
|
|
|
case MCI_PLAY:
|
|
|
|
return CDAUDIO_mciPlay(dwDevID, dwParam1,
|
|
|
|
(LPMCI_PLAY_PARMS)dwParam2);
|
|
|
|
case MCI_STOP:
|
|
|
|
return CDAUDIO_mciStop(dwDevID, dwParam1,
|
|
|
|
(LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case MCI_PAUSE:
|
|
|
|
return CDAUDIO_mciPause(dwDevID, dwParam1,
|
|
|
|
(LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case MCI_RESUME:
|
|
|
|
return CDAUDIO_mciResume(dwDevID, dwParam1,
|
|
|
|
(LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case MCI_SEEK:
|
|
|
|
return CDAUDIO_mciSeek(dwDevID, dwParam1,
|
|
|
|
(LPMCI_SEEK_PARMS)dwParam2);
|
|
|
|
case MCI_SET_DOOR_OPEN:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,
|
|
|
|
"CDAUDIO_DriverProc // MCI_SET_DOOR_OPEN !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
if (ioctl(CDADev[dwDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[dwDevID].nTracks = 0;
|
|
|
|
return 0;
|
|
|
|
case MCI_SET_DOOR_CLOSED:
|
1994-10-17 18:12:41 +00:00
|
|
|
dprintf_cdaudio(stddeb,"CDAUDIO_DriverProc // MCI_SET_DOOR_CLOSED !\n");
|
1994-07-07 16:23:58 +00:00
|
|
|
if (ioctl(CDADev[dwDevID].unixdev, CDROMEJECT, 1)) return MCIERR_HARDWARE;
|
|
|
|
CDADev[dwDevID].nTracks = 0;
|
|
|
|
return 0;
|
|
|
|
default:
|
|
|
|
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
|
|
|
}
|
1994-07-23 07:57:48 +00:00
|
|
|
#else
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
#endif
|
1994-07-07 16:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------*/
|
|
|
|
|
1994-08-06 11:22:41 +00:00
|
|
|
#endif /* #ifdef BUILTIN_MMSYSTEM */
|