Release 970525
Tue May 20 19:20:23 1997 Pablo Saratxaga <srtxg@linux.chanae.stben.be> * [resources/sysres_Es.rc] Updated CHOOSE_FONT, CHOOSE_COLOR, EDITMENU for Spanish. Mon May 19 22:06:04 1997 Michiel van Loon <mfvl@xs4all.nl> * [multimedia/mcistring.c] Corrected bug for device!element command. * [multimedia/mmaux.c] Replaced printf and fprintf calls by dprintf_mmaux. * [multimedia/audio.c] Corrected debugmessage in wodGetVolume. Include code for MCI_CUE command. * [multimedia/mmsystem.c] Added the MCIERR_SEQ error messages. * [if1632/mmsystem.spec] [multimedia/audio.c] [multimedia/mmsystem.c] Changed call structure of waveInOpen and waveOutOpen. * [multimedia/mmsystem.c] [multimedia/audio.c] [multimedia/midi.c] [multimedia/mmaux.c] [multimedia/mcicda.c] [multimedia/mcianim.c] [multimedia/mcistring.c] [include/mmsystem.h] Changed the deviceID scheme. * [include/queue.h] [include/win16drv.h] [msdos/dpmi.c] [windows/user.c] [windows/driver.c] [graphic/wing.c] [graphics/x11drv/bitmap.c] [misc/wsprintf.c] [misc/crtdll.c] Removed compiler warnings. Mon May 19 01:32:24 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [controls/menu.c] [windows/win.c] [windows/graphics.c] Popup menu shade, new system menu implementation, ModifyMenu() fixes, better check mark painting. * [windows/mdi.c] MDI client fix for Win32. Sat May 17 12:02:11 1997 Albrecht Kleine <kleine@ak.sax.de> * [objects/metafile.c] Added handling of META_DIBBITBLT, META_SETTEXTJUSTIFICATION plus bugfix in META_EXTTEXTOUT (start_of_text etc.) Thu May 15 22:52:00 1997 Jimen Ching <jching@flex.com> * [loader/ne_image.c] Make sure dgroup is valid by checking pModule->flags consistently.
This commit is contained in:
parent
84c70f55b5
commit
7ff1c415b4
17
ANNOUNCE
17
ANNOUNCE
|
@ -1,13 +1,13 @@
|
||||||
This is release 970509 of Wine, the MS Windows emulator. This is still a
|
This is release 970525 of Wine, the MS Windows emulator. This is still a
|
||||||
developer's only release. There are many bugs and many unimplemented API
|
developer's only release. There are many bugs and many unimplemented API
|
||||||
features. Most applications still do not work correctly.
|
features. Most applications still do not work correctly.
|
||||||
|
|
||||||
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
|
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
|
||||||
forget to include a ChangeLog entry.
|
forget to include a ChangeLog entry.
|
||||||
|
|
||||||
WHAT'S NEW with Wine-970509: (see ChangeLog for details)
|
WHAT'S NEW with Wine-970525: (see ChangeLog for details)
|
||||||
- Better local heap implementation.
|
- Many fixes to multimedia code.
|
||||||
- Improvements to -managed mode.
|
- Better menus.
|
||||||
- Lots of bug fixes.
|
- Lots of bug fixes.
|
||||||
|
|
||||||
See the README file in the distribution for installation instructions.
|
See the README file in the distribution for installation instructions.
|
||||||
|
@ -16,11 +16,10 @@ Because of lags created by using mirror, this message may reach you before
|
||||||
the release is available at the ftp sites. The sources will be available
|
the release is available at the ftp sites. The sources will be available
|
||||||
from the following locations:
|
from the following locations:
|
||||||
|
|
||||||
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-970509.tar.gz
|
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-970525.tar.gz
|
||||||
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970509.tar.gz
|
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970525.tar.gz
|
||||||
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970509.tar.gz
|
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970525.tar.gz
|
||||||
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-970509.tar.gz
|
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-970525.tar.gz
|
||||||
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-970509.tar.gz
|
|
||||||
|
|
||||||
It should also be available from any site that mirrors tsx-11 or sunsite.
|
It should also be available from any site that mirrors tsx-11 or sunsite.
|
||||||
|
|
||||||
|
|
2
BUGS
2
BUGS
|
@ -40,8 +40,6 @@ Miscellaneous:
|
||||||
* 32-bit Freecell segfaults when started from the Progman (looks like
|
* 32-bit Freecell segfaults when started from the Progman (looks like
|
||||||
a problem with cards.dll).
|
a problem with cards.dll).
|
||||||
|
|
||||||
* Word 6.0 often segfaults when system menu is double-clicked.
|
|
||||||
|
|
||||||
* Edit controls are prone to show blank space when, in fact, there is a
|
* Edit controls are prone to show blank space when, in fact, there is a
|
||||||
text there.
|
text there.
|
||||||
|
|
||||||
|
|
54
ChangeLog
54
ChangeLog
|
@ -1,3 +1,57 @@
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Tue May 20 19:20:23 1997 Pablo Saratxaga <srtxg@linux.chanae.stben.be>
|
||||||
|
|
||||||
|
* [resources/sysres_Es.rc]
|
||||||
|
Updated CHOOSE_FONT, CHOOSE_COLOR, EDITMENU for Spanish.
|
||||||
|
|
||||||
|
Mon May 19 22:06:04 1997 Michiel van Loon <mfvl@xs4all.nl>
|
||||||
|
|
||||||
|
* [multimedia/mcistring.c]
|
||||||
|
Corrected bug for device!element command.
|
||||||
|
|
||||||
|
* [multimedia/mmaux.c]
|
||||||
|
Replaced printf and fprintf calls by dprintf_mmaux.
|
||||||
|
|
||||||
|
* [multimedia/audio.c]
|
||||||
|
Corrected debugmessage in wodGetVolume.
|
||||||
|
Include code for MCI_CUE command.
|
||||||
|
|
||||||
|
* [multimedia/mmsystem.c]
|
||||||
|
Added the MCIERR_SEQ error messages.
|
||||||
|
|
||||||
|
* [if1632/mmsystem.spec] [multimedia/audio.c] [multimedia/mmsystem.c]
|
||||||
|
Changed call structure of waveInOpen and waveOutOpen.
|
||||||
|
|
||||||
|
* [multimedia/mmsystem.c] [multimedia/audio.c] [multimedia/midi.c]
|
||||||
|
[multimedia/mmaux.c] [multimedia/mcicda.c] [multimedia/mcianim.c]
|
||||||
|
[multimedia/mcistring.c] [include/mmsystem.h]
|
||||||
|
Changed the deviceID scheme.
|
||||||
|
|
||||||
|
* [include/queue.h] [include/win16drv.h] [msdos/dpmi.c]
|
||||||
|
[windows/user.c] [windows/driver.c] [graphic/wing.c]
|
||||||
|
[graphics/x11drv/bitmap.c] [misc/wsprintf.c] [misc/crtdll.c]
|
||||||
|
Removed compiler warnings.
|
||||||
|
|
||||||
|
Mon May 19 01:32:24 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
|
||||||
|
|
||||||
|
* [controls/menu.c] [windows/win.c] [windows/graphics.c]
|
||||||
|
Popup menu shade, new system menu implementation,
|
||||||
|
ModifyMenu() fixes, better check mark painting.
|
||||||
|
|
||||||
|
* [windows/mdi.c]
|
||||||
|
MDI client fix for Win32.
|
||||||
|
|
||||||
|
Sat May 17 12:02:11 1997 Albrecht Kleine <kleine@ak.sax.de>
|
||||||
|
|
||||||
|
* [objects/metafile.c]
|
||||||
|
Added handling of META_DIBBITBLT, META_SETTEXTJUSTIFICATION
|
||||||
|
plus bugfix in META_EXTTEXTOUT (start_of_text etc.)
|
||||||
|
|
||||||
|
Thu May 15 22:52:00 1997 Jimen Ching <jching@flex.com>
|
||||||
|
|
||||||
|
* [loader/ne_image.c]
|
||||||
|
Make sure dgroup is valid by checking pModule->flags consistently.
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Tue May 6 19:12:20 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
|
Tue May 6 19:12:20 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ install_libwine.a: dummy
|
||||||
$(INSTALL_DATA) libwine.a $(libdir)
|
$(INSTALL_DATA) libwine.a $(libdir)
|
||||||
|
|
||||||
libwine.so.1.0: $(COMMONSUBDIRS) $(LIBSUBDIRS) dummy
|
libwine.so.1.0: $(COMMONSUBDIRS) $(LIBSUBDIRS) dummy
|
||||||
$(CC) -shared -Wl,-soname,libwine.so.1 -o$@ $(COMMONOBJS) $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
|
$(CC) -shared -Wl,-soname,libwine.so -o$@ $(COMMONOBJS) $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
|
||||||
|
|
||||||
install_libwine.so.1.0: dummy
|
install_libwine.so.1.0: dummy
|
||||||
$(INSTALL_DATA) libwine.so.1.0 $(libdir)
|
$(INSTALL_DATA) libwine.so.1.0 $(libdir)
|
||||||
|
|
|
@ -413,7 +413,7 @@ static void CB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
|
||||||
else if (infoPtr->state & BUTTON_3STATE) y += 2 * checkBoxHeight;
|
else if (infoPtr->state & BUTTON_3STATE) y += 2 * checkBoxHeight;
|
||||||
|
|
||||||
GRAPH_DrawBitmap( hDC, hbitmapCheckBoxes, rbox.left, rbox.top + delta,
|
GRAPH_DrawBitmap( hDC, hbitmapCheckBoxes, rbox.left, rbox.top + delta,
|
||||||
x, y, checkBoxWidth, checkBoxHeight );
|
x, y, checkBoxWidth, checkBoxHeight, FALSE );
|
||||||
if( textlen && action != ODA_SELECT )
|
if( textlen && action != ODA_SELECT )
|
||||||
{
|
{
|
||||||
if (wndPtr->dwStyle & WS_DISABLED)
|
if (wndPtr->dwStyle & WS_DISABLED)
|
||||||
|
|
|
@ -108,7 +108,7 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND32 hwnd, HDC32 hdc,
|
||||||
GRAPH_DrawBitmap( hdc, infoPtr->hbitmapWallPaper,
|
GRAPH_DrawBitmap( hdc, infoPtr->hbitmapWallPaper,
|
||||||
x, y, 0, 0,
|
x, y, 0, 0,
|
||||||
infoPtr->bitmapSize.cx,
|
infoPtr->bitmapSize.cx,
|
||||||
infoPtr->bitmapSize.cy );
|
infoPtr->bitmapSize.cy, FALSE );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -116,8 +116,9 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND32 hwnd, HDC32 hdc,
|
||||||
y = (rect.top + rect.bottom - infoPtr->bitmapSize.cy) / 2;
|
y = (rect.top + rect.bottom - infoPtr->bitmapSize.cy) / 2;
|
||||||
if (x < 0) x = 0;
|
if (x < 0) x = 0;
|
||||||
if (y < 0) y = 0;
|
if (y < 0) y = 0;
|
||||||
GRAPH_DrawBitmap( hdc, infoPtr->hbitmapWallPaper, x, y, 0, 0,
|
GRAPH_DrawBitmap( hdc, infoPtr->hbitmapWallPaper,
|
||||||
infoPtr->bitmapSize.cx, infoPtr->bitmapSize.cy );
|
x, y, 0, 0, infoPtr->bitmapSize.cx,
|
||||||
|
infoPtr->bitmapSize.cy, FALSE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -724,6 +724,7 @@ static INT32 LISTBOX_FindString( WND *wnd, LB_DESCR *descr, INT32 start,
|
||||||
item = descr->items + start + 1;
|
item = descr->items + start + 1;
|
||||||
if (HAS_STRINGS(descr))
|
if (HAS_STRINGS(descr))
|
||||||
{
|
{
|
||||||
|
if (!str) return LB_ERR;
|
||||||
if (exact)
|
if (exact)
|
||||||
{
|
{
|
||||||
for (i = start + 1; i < descr->nb_items; i++, item++)
|
for (i = start + 1; i < descr->nb_items; i++, item++)
|
||||||
|
@ -1915,6 +1916,11 @@ static LRESULT LISTBOX_HandleKeyDown( WND *wnd, LB_DESCR *descr, WPARAM32 wParam
|
||||||
!descr->items[descr->focus_item].selected,
|
!descr->items[descr->focus_item].selected,
|
||||||
(descr->style & LBS_NOTIFY) != 0 );
|
(descr->style & LBS_NOTIFY) != 0 );
|
||||||
}
|
}
|
||||||
|
else if (descr->selected_item == -1)
|
||||||
|
{
|
||||||
|
LISTBOX_SetSelection( wnd, descr, descr->focus_item, TRUE,
|
||||||
|
(descr->style & LBS_NOTIFY) != 0 );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (caret >= 0)
|
if (caret >= 0)
|
||||||
|
|
1801
controls/menu.c
1801
controls/menu.c
File diff suppressed because it is too large
Load Diff
|
@ -76,7 +76,7 @@ static WNDCLASS32A WIDGETS_BuiltinClasses32[BIC32_NB_CLASSES] =
|
||||||
ComboLBWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ComboLBox" },
|
ComboLBWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ComboLBox" },
|
||||||
/* BIC32_POPUPMENU */
|
/* BIC32_POPUPMENU */
|
||||||
{ CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc,
|
{ CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc,
|
||||||
0, sizeof(HMENU32), 0, 0, IDC_ARROW, 0, 0, POPUPMENU_CLASS_NAME },
|
0, sizeof(HMENU32), 0, 0, IDC_ARROW, NULL_BRUSH, 0, POPUPMENU_CLASS_NAME },
|
||||||
/* BIC32_SCROLL */
|
/* BIC32_SCROLL */
|
||||||
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
|
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
|
||||||
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, IDC_ARROW, 0, 0, "ScrollBar"},
|
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, IDC_ARROW, 0, 0, "ScrollBar"},
|
||||||
|
|
|
@ -1531,7 +1531,7 @@ void DEBUG_Disasm( DBG_ADDR *addr, int display )
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seg)
|
if (seg)
|
||||||
fprintf(stderr,"%s:%d",seg, displ);
|
fprintf(stderr,"%s:0x%x",seg, displ);
|
||||||
else
|
else
|
||||||
db_task_printsym(displ, short_addr ? WORD : LONG);
|
db_task_printsym(displ, short_addr ? WORD : LONG);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
----- Information in this file is obsolete. -----
|
||||||
|
|
||||||
Winsock
|
Winsock
|
||||||
|
|
||||||
Platform 1.
|
Platform 1.
|
||||||
|
|
11
files/file.c
11
files/file.c
|
@ -981,10 +981,17 @@ LONG _hwrite32( HFILE32 hFile, LPCSTR buffer, LONG count )
|
||||||
if (count == 0) /* Expand or truncate at current position */
|
if (count == 0) /* Expand or truncate at current position */
|
||||||
result = ftruncate( file->unix_handle,
|
result = ftruncate( file->unix_handle,
|
||||||
lseek( file->unix_handle, 0, SEEK_CUR ) );
|
lseek( file->unix_handle, 0, SEEK_CUR ) );
|
||||||
else
|
else for (;;)
|
||||||
|
{
|
||||||
result = write( file->unix_handle, buffer, count );
|
result = write( file->unix_handle, buffer, count );
|
||||||
|
if (result != -1) break;
|
||||||
|
if (errno != EINTR)
|
||||||
|
{
|
||||||
|
FILE_SetDosError();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (result == -1) FILE_SetDosError();
|
|
||||||
FILE_ReleaseFile( file );
|
FILE_ReleaseFile( file );
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
extern void CLIPPING_UpdateGCRegion(DC* );
|
||||||
|
|
||||||
typedef enum WING_DITHER_TYPE
|
typedef enum WING_DITHER_TYPE
|
||||||
{
|
{
|
||||||
WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4
|
WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
extern void CLIPPING_UpdateGCRegion(DC* );
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* X11DRV_BITMAP_Init
|
* X11DRV_BITMAP_Init
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -332,6 +332,9 @@ BOOL32 X11DRV_GetTextMetrics(DC *dc, TEXTMETRIC32A *metrics)
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* X11DRV_FONT_SelectObject
|
* X11DRV_FONT_SelectObject
|
||||||
|
*
|
||||||
|
* FIXME: the fonts should not be cached by hfont only, because
|
||||||
|
* metrics may be different in an other DC.
|
||||||
*/
|
*/
|
||||||
HFONT32 X11DRV_FONT_SelectObject( DC * dc, HFONT32 hfont, FONTOBJ * font )
|
HFONT32 X11DRV_FONT_SelectObject( DC * dc, HFONT32 hfont, FONTOBJ * font )
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ type win16
|
||||||
401 pascal WAVEOUTGETNUMDEVS() waveOutGetNumDevs
|
401 pascal WAVEOUTGETNUMDEVS() waveOutGetNumDevs
|
||||||
402 pascal WAVEOUTGETDEVCAPS(word segptr word) waveOutGetDevCaps
|
402 pascal WAVEOUTGETDEVCAPS(word segptr word) waveOutGetDevCaps
|
||||||
403 pascal WAVEOUTGETERRORTEXT(word ptr word) waveOutGetErrorText
|
403 pascal WAVEOUTGETERRORTEXT(word ptr word) waveOutGetErrorText
|
||||||
404 pascal WAVEOUTOPEN(ptr word ptr long long long) waveOutOpen
|
404 pascal WAVEOUTOPEN(ptr word segptr long long long) waveOutOpen
|
||||||
405 pascal WAVEOUTCLOSE(word) waveOutClose
|
405 pascal WAVEOUTCLOSE(word) waveOutClose
|
||||||
406 pascal WAVEOUTPREPAREHEADER(word segptr word) waveOutPrepareHeader
|
406 pascal WAVEOUTPREPAREHEADER(word segptr word) waveOutPrepareHeader
|
||||||
407 pascal WAVEOUTUNPREPAREHEADER(word segptr word) waveOutUnprepareHeader
|
407 pascal WAVEOUTUNPREPAREHEADER(word segptr word) waveOutUnprepareHeader
|
||||||
|
@ -76,7 +76,7 @@ type win16
|
||||||
501 pascal WAVEINGETNUMDEVS() waveInGetNumDevs
|
501 pascal WAVEINGETNUMDEVS() waveInGetNumDevs
|
||||||
502 pascal WAVEINGETDEVCAPS(word segptr word) waveInGetDevCaps
|
502 pascal WAVEINGETDEVCAPS(word segptr word) waveInGetDevCaps
|
||||||
503 pascal WAVEINGETERRORTEXT(word ptr word) waveInGetErrorText
|
503 pascal WAVEINGETERRORTEXT(word ptr word) waveInGetErrorText
|
||||||
504 pascal WAVEINOPEN(ptr word ptr long long long) waveInOpen
|
504 pascal WAVEINOPEN(ptr word segptr long long long) waveInOpen
|
||||||
505 pascal WAVEINCLOSE(word) waveInClose
|
505 pascal WAVEINCLOSE(word) waveInClose
|
||||||
506 pascal WAVEINPREPAREHEADER(word segptr word) waveInPrepareHeader
|
506 pascal WAVEINPREPAREHEADER(word segptr word) waveInPrepareHeader
|
||||||
507 pascal WAVEINUNPREPAREHEADER(word segptr word) waveInUnprepareHeader
|
507 pascal WAVEINUNPREPAREHEADER(word segptr word) waveInUnprepareHeader
|
||||||
|
|
|
@ -50,7 +50,7 @@ type win16
|
||||||
107 pascal16 WSAAsyncGetServByName(word word ptr ptr segptr word)
|
107 pascal16 WSAAsyncGetServByName(word word ptr ptr segptr word)
|
||||||
WSAAsyncGetServByName
|
WSAAsyncGetServByName
|
||||||
108 pascal16 WSACancelAsyncRequest(word) WSACancelAsyncRequest
|
108 pascal16 WSACancelAsyncRequest(word) WSACancelAsyncRequest
|
||||||
109 pascal16 WSASetBlockingHook() WSASetBlockingHook
|
109 pascal16 WSASetBlockingHook(segptr) WSASetBlockingHook16
|
||||||
110 pascal16 WSAUnhookBlockingHook() WSAUnhookBlockingHook
|
110 pascal16 WSAUnhookBlockingHook() WSAUnhookBlockingHook
|
||||||
111 pascal16 WSAGetLastError() WSAGetLastError
|
111 pascal16 WSAGetLastError() WSAGetLastError
|
||||||
112 pascal WSASetLastError(word) WSASetLastError
|
112 pascal WSASetLastError(word) WSASetLastError
|
||||||
|
|
|
@ -40,7 +40,7 @@ base 0
|
||||||
106 stub WSAAsyncGetServByPort
|
106 stub WSAAsyncGetServByPort
|
||||||
107 stub WSAAsyncGetServByName
|
107 stub WSAAsyncGetServByName
|
||||||
108 stub WSACancelAsyncRequest
|
108 stub WSACancelAsyncRequest
|
||||||
109 stub WSASetBlockingHook
|
109 stdcall WSASetBlockingHook(ptr) WSASetBlockingHook32
|
||||||
110 stub WSAUnhookBlockingHook
|
110 stub WSAUnhookBlockingHook
|
||||||
111 stub WSAGetLastError
|
111 stub WSAGetLastError
|
||||||
112 stub WSASetLastError
|
112 stub WSASetLastError
|
||||||
|
|
|
@ -42,7 +42,7 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
|
||||||
|
|
||||||
#define XCREATEIMAGE(image,width,height,bpp) \
|
#define XCREATEIMAGE(image,width,height,bpp) \
|
||||||
{ \
|
{ \
|
||||||
int width_bytes = DIB_GetImageWidthBytesX11( (width), (bpp) ); \
|
int width_bytes = DIB_GetXImageWidthBytes( (width), (bpp) ); \
|
||||||
(image) = XCreateImage(display, DefaultVisualOfScreen(screen), \
|
(image) = XCreateImage(display, DefaultVisualOfScreen(screen), \
|
||||||
(bpp), ZPixmap, 0, xmalloc( (height)*width_bytes ),\
|
(bpp), ZPixmap, 0, xmalloc( (height)*width_bytes ),\
|
||||||
(width), (height), 32, width_bytes ); \
|
(width), (height), 32, width_bytes ); \
|
||||||
|
@ -55,8 +55,8 @@ extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
|
||||||
extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
|
extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
|
||||||
|
|
||||||
/* objects/dib.c */
|
/* objects/dib.c */
|
||||||
extern int DIB_GetImageWidthBytes( int width, int depth );
|
extern int DIB_GetDIBWidthBytes( int width, int depth );
|
||||||
extern int DIB_GetImageWidthBytesX11( int width, int depth );
|
extern int DIB_GetXImageWidthBytes( int width, int depth );
|
||||||
extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
|
extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
|
||||||
|
|
||||||
/* objects/oembitmap.c */
|
/* objects/oembitmap.c */
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#define COLOR_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
|
#define COLOR_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
|
||||||
|
|
||||||
#define COLOR_PRIVATE 0x1000 /* private colormap, identity mapping */
|
#define COLOR_PRIVATE 0x1000 /* private colormap, identity mapping */
|
||||||
|
#define COLOR_WHITESET 0x2000
|
||||||
|
|
||||||
#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */
|
#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */
|
||||||
#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */
|
#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */
|
||||||
|
@ -22,6 +23,7 @@ extern BOOL32 COLOR_IsSolid( COLORREF color );
|
||||||
extern Colormap COLOR_GetColormap();
|
extern Colormap COLOR_GetColormap();
|
||||||
extern UINT16 COLOR_GetSystemPaletteSize();
|
extern UINT16 COLOR_GetSystemPaletteSize();
|
||||||
extern UINT16 COLOR_GetSystemPaletteFlags();
|
extern UINT16 COLOR_GetSystemPaletteFlags();
|
||||||
|
extern BOOL32 COLOR_GetMonoPlane( int* );
|
||||||
|
|
||||||
extern COLORREF COLOR_LookupNearestColor( PALETTEENTRY*, int, COLORREF );
|
extern COLORREF COLOR_LookupNearestColor( PALETTEENTRY*, int, COLORREF );
|
||||||
extern int COLOR_PaletteLookupPixel( PALETTEENTRY*, int, int* , COLORREF, BOOL32 );
|
extern int COLOR_PaletteLookupPixel( PALETTEENTRY*, int, int* , COLORREF, BOOL32 );
|
||||||
|
|
149
include/debug.h
149
include/debug.h
|
@ -53,6 +53,7 @@
|
||||||
#undef DEBUG_MESSAGE
|
#undef DEBUG_MESSAGE
|
||||||
#undef DEBUG_METAFILE
|
#undef DEBUG_METAFILE
|
||||||
#undef DEBUG_MIDI
|
#undef DEBUG_MIDI
|
||||||
|
#undef DEBUG_MMAUX
|
||||||
#undef DEBUG_MMIO
|
#undef DEBUG_MMIO
|
||||||
#undef DEBUG_MMSYS
|
#undef DEBUG_MMSYS
|
||||||
#undef DEBUG_MMTIME
|
#undef DEBUG_MMTIME
|
||||||
|
@ -135,6 +136,7 @@
|
||||||
#define DEBUG_MESSAGE
|
#define DEBUG_MESSAGE
|
||||||
#define DEBUG_METAFILE
|
#define DEBUG_METAFILE
|
||||||
#define DEBUG_MIDI
|
#define DEBUG_MIDI
|
||||||
|
#define DEBUG_MMAUX
|
||||||
#define DEBUG_MMIO
|
#define DEBUG_MMIO
|
||||||
#define DEBUG_MMSYS
|
#define DEBUG_MMSYS
|
||||||
#define DEBUG_MMTIME
|
#define DEBUG_MMTIME
|
||||||
|
@ -407,6 +409,11 @@ short debug_msg_enabled[]={
|
||||||
#else
|
#else
|
||||||
0,
|
0,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef DEBUG_MMAUX
|
||||||
|
1,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif
|
||||||
#ifdef DEBUG_MMIO
|
#ifdef DEBUG_MMIO
|
||||||
1,
|
1,
|
||||||
#else
|
#else
|
||||||
|
@ -1186,8 +1193,21 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_mmio if(!debug_msg_enabled[47]) ; else fprintf
|
#define dprintf_mmaux if(!debug_msg_enabled[47]) ; else fprintf
|
||||||
#define debugging_mmio debug_msg_enabled[47]
|
#define debugging_mmaux debug_msg_enabled[47]
|
||||||
|
#else
|
||||||
|
#ifdef DEBUG_MMAUX
|
||||||
|
#define dprintf_mmaux fprintf
|
||||||
|
#define debugging_mmaux 1
|
||||||
|
#else
|
||||||
|
#define dprintf_mmaux while(0) fprintf
|
||||||
|
#define debugging_mmaux 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_RUNTIME
|
||||||
|
#define dprintf_mmio if(!debug_msg_enabled[48]) ; else fprintf
|
||||||
|
#define debugging_mmio debug_msg_enabled[48]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_MMIO
|
#ifdef DEBUG_MMIO
|
||||||
#define dprintf_mmio fprintf
|
#define dprintf_mmio fprintf
|
||||||
|
@ -1199,8 +1219,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_mmsys if(!debug_msg_enabled[48]) ; else fprintf
|
#define dprintf_mmsys if(!debug_msg_enabled[49]) ; else fprintf
|
||||||
#define debugging_mmsys debug_msg_enabled[48]
|
#define debugging_mmsys debug_msg_enabled[49]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_MMSYS
|
#ifdef DEBUG_MMSYS
|
||||||
#define dprintf_mmsys fprintf
|
#define dprintf_mmsys fprintf
|
||||||
|
@ -1212,8 +1232,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_mmtime if(!debug_msg_enabled[49]) ; else fprintf
|
#define dprintf_mmtime if(!debug_msg_enabled[50]) ; else fprintf
|
||||||
#define debugging_mmtime debug_msg_enabled[49]
|
#define debugging_mmtime debug_msg_enabled[50]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_MMTIME
|
#ifdef DEBUG_MMTIME
|
||||||
#define dprintf_mmtime fprintf
|
#define dprintf_mmtime fprintf
|
||||||
|
@ -1225,8 +1245,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_module if(!debug_msg_enabled[50]) ; else fprintf
|
#define dprintf_module if(!debug_msg_enabled[51]) ; else fprintf
|
||||||
#define debugging_module debug_msg_enabled[50]
|
#define debugging_module debug_msg_enabled[51]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_MODULE
|
#ifdef DEBUG_MODULE
|
||||||
#define dprintf_module fprintf
|
#define dprintf_module fprintf
|
||||||
|
@ -1238,8 +1258,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_msg if(!debug_msg_enabled[51]) ; else fprintf
|
#define dprintf_msg if(!debug_msg_enabled[52]) ; else fprintf
|
||||||
#define debugging_msg debug_msg_enabled[51]
|
#define debugging_msg debug_msg_enabled[52]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_MSG
|
#ifdef DEBUG_MSG
|
||||||
#define dprintf_msg fprintf
|
#define dprintf_msg fprintf
|
||||||
|
@ -1251,8 +1271,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_nonclient if(!debug_msg_enabled[52]) ; else fprintf
|
#define dprintf_nonclient if(!debug_msg_enabled[53]) ; else fprintf
|
||||||
#define debugging_nonclient debug_msg_enabled[52]
|
#define debugging_nonclient debug_msg_enabled[53]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_NONCLIENT
|
#ifdef DEBUG_NONCLIENT
|
||||||
#define dprintf_nonclient fprintf
|
#define dprintf_nonclient fprintf
|
||||||
|
@ -1264,8 +1284,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_ole if(!debug_msg_enabled[53]) ; else fprintf
|
#define dprintf_ole if(!debug_msg_enabled[54]) ; else fprintf
|
||||||
#define debugging_ole debug_msg_enabled[53]
|
#define debugging_ole debug_msg_enabled[54]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_OLE
|
#ifdef DEBUG_OLE
|
||||||
#define dprintf_ole fprintf
|
#define dprintf_ole fprintf
|
||||||
|
@ -1277,8 +1297,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_palette if(!debug_msg_enabled[54]) ; else fprintf
|
#define dprintf_palette if(!debug_msg_enabled[55]) ; else fprintf
|
||||||
#define debugging_palette debug_msg_enabled[54]
|
#define debugging_palette debug_msg_enabled[55]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_PALETTE
|
#ifdef DEBUG_PALETTE
|
||||||
#define dprintf_palette fprintf
|
#define dprintf_palette fprintf
|
||||||
|
@ -1290,8 +1310,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_profile if(!debug_msg_enabled[55]) ; else fprintf
|
#define dprintf_profile if(!debug_msg_enabled[56]) ; else fprintf
|
||||||
#define debugging_profile debug_msg_enabled[55]
|
#define debugging_profile debug_msg_enabled[56]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_PROFILE
|
#ifdef DEBUG_PROFILE
|
||||||
#define dprintf_profile fprintf
|
#define dprintf_profile fprintf
|
||||||
|
@ -1303,8 +1323,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_prop if(!debug_msg_enabled[56]) ; else fprintf
|
#define dprintf_prop if(!debug_msg_enabled[57]) ; else fprintf
|
||||||
#define debugging_prop debug_msg_enabled[56]
|
#define debugging_prop debug_msg_enabled[57]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_PROP
|
#ifdef DEBUG_PROP
|
||||||
#define dprintf_prop fprintf
|
#define dprintf_prop fprintf
|
||||||
|
@ -1316,8 +1336,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_reg if(!debug_msg_enabled[57]) ; else fprintf
|
#define dprintf_reg if(!debug_msg_enabled[58]) ; else fprintf
|
||||||
#define debugging_reg debug_msg_enabled[57]
|
#define debugging_reg debug_msg_enabled[58]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_REG
|
#ifdef DEBUG_REG
|
||||||
#define dprintf_reg fprintf
|
#define dprintf_reg fprintf
|
||||||
|
@ -1329,8 +1349,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_region if(!debug_msg_enabled[58]) ; else fprintf
|
#define dprintf_region if(!debug_msg_enabled[59]) ; else fprintf
|
||||||
#define debugging_region debug_msg_enabled[58]
|
#define debugging_region debug_msg_enabled[59]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_REGION
|
#ifdef DEBUG_REGION
|
||||||
#define dprintf_region fprintf
|
#define dprintf_region fprintf
|
||||||
|
@ -1342,8 +1362,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_relay if(!debug_msg_enabled[59]) ; else fprintf
|
#define dprintf_relay if(!debug_msg_enabled[60]) ; else fprintf
|
||||||
#define debugging_relay debug_msg_enabled[59]
|
#define debugging_relay debug_msg_enabled[60]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_RELAY
|
#ifdef DEBUG_RELAY
|
||||||
#define dprintf_relay fprintf
|
#define dprintf_relay fprintf
|
||||||
|
@ -1355,8 +1375,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_resource if(!debug_msg_enabled[60]) ; else fprintf
|
#define dprintf_resource if(!debug_msg_enabled[61]) ; else fprintf
|
||||||
#define debugging_resource debug_msg_enabled[60]
|
#define debugging_resource debug_msg_enabled[61]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_RESOURCE
|
#ifdef DEBUG_RESOURCE
|
||||||
#define dprintf_resource fprintf
|
#define dprintf_resource fprintf
|
||||||
|
@ -1368,8 +1388,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_scroll if(!debug_msg_enabled[61]) ; else fprintf
|
#define dprintf_scroll if(!debug_msg_enabled[62]) ; else fprintf
|
||||||
#define debugging_scroll debug_msg_enabled[61]
|
#define debugging_scroll debug_msg_enabled[62]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_SCROLL
|
#ifdef DEBUG_SCROLL
|
||||||
#define dprintf_scroll fprintf
|
#define dprintf_scroll fprintf
|
||||||
|
@ -1381,8 +1401,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_selector if(!debug_msg_enabled[62]) ; else fprintf
|
#define dprintf_selector if(!debug_msg_enabled[63]) ; else fprintf
|
||||||
#define debugging_selector debug_msg_enabled[62]
|
#define debugging_selector debug_msg_enabled[63]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_SELECTOR
|
#ifdef DEBUG_SELECTOR
|
||||||
#define dprintf_selector fprintf
|
#define dprintf_selector fprintf
|
||||||
|
@ -1394,8 +1414,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_sem if(!debug_msg_enabled[63]) ; else fprintf
|
#define dprintf_sem if(!debug_msg_enabled[64]) ; else fprintf
|
||||||
#define debugging_sem debug_msg_enabled[63]
|
#define debugging_sem debug_msg_enabled[64]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_SEM
|
#ifdef DEBUG_SEM
|
||||||
#define dprintf_sem fprintf
|
#define dprintf_sem fprintf
|
||||||
|
@ -1407,8 +1427,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_sendmsg if(!debug_msg_enabled[64]) ; else fprintf
|
#define dprintf_sendmsg if(!debug_msg_enabled[65]) ; else fprintf
|
||||||
#define debugging_sendmsg debug_msg_enabled[64]
|
#define debugging_sendmsg debug_msg_enabled[65]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_SENDMSG
|
#ifdef DEBUG_SENDMSG
|
||||||
#define dprintf_sendmsg fprintf
|
#define dprintf_sendmsg fprintf
|
||||||
|
@ -1420,8 +1440,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_shm if(!debug_msg_enabled[65]) ; else fprintf
|
#define dprintf_shm if(!debug_msg_enabled[66]) ; else fprintf
|
||||||
#define debugging_shm debug_msg_enabled[65]
|
#define debugging_shm debug_msg_enabled[66]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_SHM
|
#ifdef DEBUG_SHM
|
||||||
#define dprintf_shm fprintf
|
#define dprintf_shm fprintf
|
||||||
|
@ -1433,8 +1453,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_stress if(!debug_msg_enabled[66]) ; else fprintf
|
#define dprintf_stress if(!debug_msg_enabled[67]) ; else fprintf
|
||||||
#define debugging_stress debug_msg_enabled[66]
|
#define debugging_stress debug_msg_enabled[67]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_STRESS
|
#ifdef DEBUG_STRESS
|
||||||
#define dprintf_stress fprintf
|
#define dprintf_stress fprintf
|
||||||
|
@ -1446,8 +1466,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_string if(!debug_msg_enabled[67]) ; else fprintf
|
#define dprintf_string if(!debug_msg_enabled[68]) ; else fprintf
|
||||||
#define debugging_string debug_msg_enabled[67]
|
#define debugging_string debug_msg_enabled[68]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_STRING
|
#ifdef DEBUG_STRING
|
||||||
#define dprintf_string fprintf
|
#define dprintf_string fprintf
|
||||||
|
@ -1459,8 +1479,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_task if(!debug_msg_enabled[68]) ; else fprintf
|
#define dprintf_task if(!debug_msg_enabled[69]) ; else fprintf
|
||||||
#define debugging_task debug_msg_enabled[68]
|
#define debugging_task debug_msg_enabled[69]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_TASK
|
#ifdef DEBUG_TASK
|
||||||
#define dprintf_task fprintf
|
#define dprintf_task fprintf
|
||||||
|
@ -1472,8 +1492,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_text if(!debug_msg_enabled[69]) ; else fprintf
|
#define dprintf_text if(!debug_msg_enabled[70]) ; else fprintf
|
||||||
#define debugging_text debug_msg_enabled[69]
|
#define debugging_text debug_msg_enabled[70]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_TEXT
|
#ifdef DEBUG_TEXT
|
||||||
#define dprintf_text fprintf
|
#define dprintf_text fprintf
|
||||||
|
@ -1485,8 +1505,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_timer if(!debug_msg_enabled[70]) ; else fprintf
|
#define dprintf_timer if(!debug_msg_enabled[71]) ; else fprintf
|
||||||
#define debugging_timer debug_msg_enabled[70]
|
#define debugging_timer debug_msg_enabled[71]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_TIMER
|
#ifdef DEBUG_TIMER
|
||||||
#define dprintf_timer fprintf
|
#define dprintf_timer fprintf
|
||||||
|
@ -1498,8 +1518,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_toolhelp if(!debug_msg_enabled[71]) ; else fprintf
|
#define dprintf_toolhelp if(!debug_msg_enabled[72]) ; else fprintf
|
||||||
#define debugging_toolhelp debug_msg_enabled[71]
|
#define debugging_toolhelp debug_msg_enabled[72]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_TOOLHELP
|
#ifdef DEBUG_TOOLHELP
|
||||||
#define dprintf_toolhelp fprintf
|
#define dprintf_toolhelp fprintf
|
||||||
|
@ -1511,8 +1531,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_ver if(!debug_msg_enabled[72]) ; else fprintf
|
#define dprintf_ver if(!debug_msg_enabled[73]) ; else fprintf
|
||||||
#define debugging_ver debug_msg_enabled[72]
|
#define debugging_ver debug_msg_enabled[73]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_VER
|
#ifdef DEBUG_VER
|
||||||
#define dprintf_ver fprintf
|
#define dprintf_ver fprintf
|
||||||
|
@ -1524,8 +1544,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_virtual if(!debug_msg_enabled[73]) ; else fprintf
|
#define dprintf_virtual if(!debug_msg_enabled[74]) ; else fprintf
|
||||||
#define debugging_virtual debug_msg_enabled[73]
|
#define debugging_virtual debug_msg_enabled[74]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_VIRTUAL
|
#ifdef DEBUG_VIRTUAL
|
||||||
#define dprintf_virtual fprintf
|
#define dprintf_virtual fprintf
|
||||||
|
@ -1537,8 +1557,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_vxd if(!debug_msg_enabled[74]) ; else fprintf
|
#define dprintf_vxd if(!debug_msg_enabled[75]) ; else fprintf
|
||||||
#define debugging_vxd debug_msg_enabled[74]
|
#define debugging_vxd debug_msg_enabled[75]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_VXD
|
#ifdef DEBUG_VXD
|
||||||
#define dprintf_vxd fprintf
|
#define dprintf_vxd fprintf
|
||||||
|
@ -1550,8 +1570,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_win if(!debug_msg_enabled[75]) ; else fprintf
|
#define dprintf_win if(!debug_msg_enabled[76]) ; else fprintf
|
||||||
#define debugging_win debug_msg_enabled[75]
|
#define debugging_win debug_msg_enabled[76]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_WIN
|
#ifdef DEBUG_WIN
|
||||||
#define dprintf_win fprintf
|
#define dprintf_win fprintf
|
||||||
|
@ -1563,8 +1583,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_win16drv if(!debug_msg_enabled[76]) ; else fprintf
|
#define dprintf_win16drv if(!debug_msg_enabled[77]) ; else fprintf
|
||||||
#define debugging_win16drv debug_msg_enabled[76]
|
#define debugging_win16drv debug_msg_enabled[77]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_WIN16DRV
|
#ifdef DEBUG_WIN16DRV
|
||||||
#define dprintf_win16drv fprintf
|
#define dprintf_win16drv fprintf
|
||||||
|
@ -1576,8 +1596,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_win32 if(!debug_msg_enabled[77]) ; else fprintf
|
#define dprintf_win32 if(!debug_msg_enabled[78]) ; else fprintf
|
||||||
#define debugging_win32 debug_msg_enabled[77]
|
#define debugging_win32 debug_msg_enabled[78]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_WIN32
|
#ifdef DEBUG_WIN32
|
||||||
#define dprintf_win32 fprintf
|
#define dprintf_win32 fprintf
|
||||||
|
@ -1589,8 +1609,8 @@ extern short debug_msg_enabled[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
#define dprintf_winsock if(!debug_msg_enabled[78]) ; else fprintf
|
#define dprintf_winsock if(!debug_msg_enabled[79]) ; else fprintf
|
||||||
#define debugging_winsock debug_msg_enabled[78]
|
#define debugging_winsock debug_msg_enabled[79]
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_WINSOCK
|
#ifdef DEBUG_WINSOCK
|
||||||
#define dprintf_winsock fprintf
|
#define dprintf_winsock fprintf
|
||||||
|
@ -1652,6 +1672,7 @@ static char *debug_msg_name[] = {
|
||||||
"message",
|
"message",
|
||||||
"metafile",
|
"metafile",
|
||||||
"midi",
|
"midi",
|
||||||
|
"mmaux",
|
||||||
"mmio",
|
"mmio",
|
||||||
"mmsys",
|
"mmsys",
|
||||||
"mmtime",
|
"mmtime",
|
||||||
|
|
|
@ -18,7 +18,7 @@ extern void GRAPH_DrawRectangle( HDC32 hdc, INT32 x, INT32 y,
|
||||||
INT32 width, INT32 height, HPEN32 hPen);
|
INT32 width, INT32 height, HPEN32 hPen);
|
||||||
extern BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
|
extern BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
|
||||||
INT32 xdest, INT32 ydest, INT32 xsrc,
|
INT32 xdest, INT32 ydest, INT32 xsrc,
|
||||||
INT32 ysrc, INT32 width, INT32 height );
|
INT32 ysrc, INT32 width, INT32 height, BOOL32 bMono );
|
||||||
extern BOOL32 GRAPH_SelectClipMask( HDC32 hdc, HBITMAP32 hMono,
|
extern BOOL32 GRAPH_SelectClipMask( HDC32 hdc, HBITMAP32 hMono,
|
||||||
INT32 x, INT32 y );
|
INT32 x, INT32 y );
|
||||||
|
|
||||||
|
|
|
@ -31,15 +31,15 @@ typedef struct tagMDIWCL
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
WORD nActiveChildren;
|
UINT16 nActiveChildren;
|
||||||
HWND16 hwndChildMaximized;
|
HWND16 hwndChildMaximized;
|
||||||
HWND16 hwndActiveChild;
|
HWND16 hwndActiveChild;
|
||||||
HMENU16 hWindowMenu;
|
HMENU16 hWindowMenu;
|
||||||
WORD idFirstChild;
|
UINT32 idFirstChild;
|
||||||
WORD nTotalCreated;
|
|
||||||
LPSTR frameTitle;
|
LPSTR frameTitle;
|
||||||
WORD sbNeedUpdate;
|
UINT16 nTotalCreated;
|
||||||
WORD sbRecalc;
|
UINT16 mdiFlags;
|
||||||
|
UINT16 sbRecalc; /* SB_xxx flags for scrollbar fixup */
|
||||||
HWND16 self;
|
HWND16 self;
|
||||||
} MDICLIENTINFO;
|
} MDICLIENTINFO;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#define __WINE_MENU_H
|
#define __WINE_MENU_H
|
||||||
|
|
||||||
extern BOOL32 MENU_Init(void);
|
extern BOOL32 MENU_Init(void);
|
||||||
extern HMENU32 MENU_GetDefSysMenu(void);
|
extern HMENU32 MENU_GetSysMenu(HWND32 hWndOwner, HMENU32 hSysPopup);
|
||||||
extern void MENU_InitSysMenuPopup(HMENU32 hmenu, DWORD style, DWORD clsStyle);
|
extern void MENU_InitSysMenuPopup(HMENU32 hmenu, DWORD style, DWORD clsStyle);
|
||||||
extern UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,
|
extern UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,
|
||||||
INT32 orgX, INT32 orgY );
|
INT32 orgX, INT32 orgY );
|
||||||
|
|
|
@ -1485,6 +1485,7 @@ typedef struct {
|
||||||
LPWAVEFORMAT lpFormat;
|
LPWAVEFORMAT lpFormat;
|
||||||
DWORD dwCallBack;
|
DWORD dwCallBack;
|
||||||
DWORD dwInstance;
|
DWORD dwInstance;
|
||||||
|
UINT16 uDeviceID;
|
||||||
} WAVEOPENDESC, *LPWAVEOPENDESC;
|
} WAVEOPENDESC, *LPWAVEOPENDESC;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -75,8 +75,8 @@ typedef struct tagMESSAGEQUEUE
|
||||||
|
|
||||||
extern void QUEUE_DumpQueue( HQUEUE16 hQueue );
|
extern void QUEUE_DumpQueue( HQUEUE16 hQueue );
|
||||||
extern void QUEUE_WalkQueues(void);
|
extern void QUEUE_WalkQueues(void);
|
||||||
extern BOOL32 QUEUE_IsDoomedQueue( HQUEUE16 hQueue );
|
extern BOOL32 QUEUE_IsExitingQueue( HQUEUE16 hQueue );
|
||||||
extern void QUEUE_SetDoomedQueue( HQUEUE16 hQueue );
|
extern void QUEUE_SetExitingQueue( HQUEUE16 hQueue );
|
||||||
extern MESSAGEQUEUE *QUEUE_GetSysQueue(void);
|
extern MESSAGEQUEUE *QUEUE_GetSysQueue(void);
|
||||||
extern void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit );
|
extern void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit );
|
||||||
extern void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit );
|
extern void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit );
|
||||||
|
@ -95,5 +95,6 @@ extern int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND32 hwnd,
|
||||||
extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos );
|
extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos );
|
||||||
extern void hardware_event( WORD message, WORD wParam, LONG lParam,
|
extern void hardware_event( WORD message, WORD wParam, LONG lParam,
|
||||||
int xPos, int yPos, DWORD time, DWORD extraInfo );
|
int xPos, int yPos, DWORD time, DWORD extraInfo );
|
||||||
|
extern void QUEUE_FlushMessages( HQUEUE16 hQueue );
|
||||||
|
|
||||||
#endif /* __WINE_QUEUE_H */
|
#endif /* __WINE_QUEUE_H */
|
||||||
|
|
|
@ -123,6 +123,7 @@
|
||||||
#undef DEBUG_MESSAGE
|
#undef DEBUG_MESSAGE
|
||||||
#undef DEBUG_METAFILE
|
#undef DEBUG_METAFILE
|
||||||
#undef DEBUG_MIDI
|
#undef DEBUG_MIDI
|
||||||
|
#undef DEBUG_MMAUX
|
||||||
#undef DEBUG_MMIO
|
#undef DEBUG_MMIO
|
||||||
#undef DEBUG_MMSYS
|
#undef DEBUG_MMSYS
|
||||||
#undef DEBUG_MMTIME
|
#undef DEBUG_MMTIME
|
||||||
|
@ -205,6 +206,7 @@
|
||||||
#define DEBUG_MESSAGE
|
#define DEBUG_MESSAGE
|
||||||
#define DEBUG_METAFILE
|
#define DEBUG_METAFILE
|
||||||
#define DEBUG_MIDI
|
#define DEBUG_MIDI
|
||||||
|
#define DEBUG_MMAUX
|
||||||
#define DEBUG_MMIO
|
#define DEBUG_MMIO
|
||||||
#define DEBUG_MMSYS
|
#define DEBUG_MMSYS
|
||||||
#define DEBUG_MMTIME
|
#define DEBUG_MMTIME
|
||||||
|
|
|
@ -281,7 +281,13 @@ BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
|
||||||
|
|
||||||
offset = rep->offset;
|
offset = rep->offset;
|
||||||
|
|
||||||
switch (rep->address_type)
|
/* Apparently, high bit of address_type is sometimes set; */
|
||||||
|
/* we ignore it for now */
|
||||||
|
if (rep->address_type & 0x80)
|
||||||
|
fprintf( stderr, "Warning: reloc addr type = 0x%02x\n",
|
||||||
|
rep->address_type );
|
||||||
|
|
||||||
|
switch (rep->address_type & 0x7f)
|
||||||
{
|
{
|
||||||
case NE_RADDR_LOWBYTE:
|
case NE_RADDR_LOWBYTE:
|
||||||
do {
|
do {
|
||||||
|
@ -415,12 +421,16 @@ void NE_FixupPrologs( NE_MODULE *pModule )
|
||||||
{
|
{
|
||||||
if (*p & 0x0002)
|
if (*p & 0x0002)
|
||||||
{
|
{
|
||||||
if (pModule->flags & NE_FFLAGS_MULTIPLEDATA) {
|
if (pModule->flags & NE_FFLAGS_MULTIPLEDATA)
|
||||||
|
{
|
||||||
/* can this happen? */
|
/* can this happen? */
|
||||||
fprintf( stderr, "FixupPrologs got confused\n" );
|
fprintf( stderr, "FixupPrologs got confused\n" );
|
||||||
}
|
}
|
||||||
*fixup_ptr = 0xb8; /* MOV AX, */
|
else if (pModule->flags & NE_FFLAGS_SINGLEDATA)
|
||||||
*(WORD *)(fixup_ptr+1) = dgroup;
|
{
|
||||||
|
*fixup_ptr = 0xb8; /* MOV AX, */
|
||||||
|
*(WORD *)(fixup_ptr+1) = dgroup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -872,7 +872,7 @@ HGLOBAL32 GlobalAlloc32(UINT32 flags, DWORD size)
|
||||||
pintern=HeapAlloc(GetProcessHeap(), 0, sizeof(GLOBAL32_INTERN));
|
pintern=HeapAlloc(GetProcessHeap(), 0, sizeof(GLOBAL32_INTERN));
|
||||||
if(size)
|
if(size)
|
||||||
{
|
{
|
||||||
palloc=HeapAlloc(GetProcessHeap(), 0, size+sizeof(HGLOBAL32));
|
palloc=HeapAlloc(GetProcessHeap(), hpflags, size+sizeof(HGLOBAL32));
|
||||||
*(HGLOBAL32 *)palloc=INTERN_TO_HANDLE(pintern);
|
*(HGLOBAL32 *)palloc=INTERN_TO_HANDLE(pintern);
|
||||||
pintern->Pointer=palloc+sizeof(HGLOBAL32);
|
pintern->Pointer=palloc+sizeof(HGLOBAL32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,8 @@ static BOOL32 FILEDLG_ScanDir(HWND16 hWnd, LPSTR newPath)
|
||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
GetDlgItemText32A( hWnd, edt1, str + len, sizeof(str) - len );
|
GetDlgItemText32A( hWnd, edt1, str + len, sizeof(str) - len );
|
||||||
if (!DlgDirList32A( hWnd, str, lst1, 0, 0x0000 )) return FALSE;
|
if (!DlgDirList32A( hWnd, str, lst1, 0, 0x0000 )) return FALSE;
|
||||||
return DlgDirList32A( hWnd, "*.*", lst2, stc1, 0x8010 );
|
strcpy( str, "*.*" );
|
||||||
|
return DlgDirList32A( hWnd, str, lst2, stc1, 0x8010 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -409,7 +410,8 @@ static LONG FILEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
|
||||||
lpofn->nFilterIndex, tmpstr);
|
lpofn->nFilterIndex, tmpstr);
|
||||||
SetDlgItemText32A( hWnd, edt1, tmpstr );
|
SetDlgItemText32A( hWnd, edt1, tmpstr );
|
||||||
/* get drive list */
|
/* get drive list */
|
||||||
DlgDirListComboBox32A(hWnd, "", cmb2, 0, 0xC000);
|
*tmpstr = 0;
|
||||||
|
DlgDirListComboBox32A(hWnd, tmpstr, cmb2, 0, 0xC000);
|
||||||
/* read initial directory */
|
/* read initial directory */
|
||||||
if (PTR_SEG_TO_LIN(lpofn->lpstrInitialDir) != NULL)
|
if (PTR_SEG_TO_LIN(lpofn->lpstrInitialDir) != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include "crtdll.h"
|
#include "crtdll.h"
|
||||||
#include "drive.h"
|
#include "drive.h"
|
||||||
|
|
||||||
|
extern INT32 WIN32_wsprintf32W( DWORD *args );
|
||||||
|
|
||||||
UINT32 CRTDLL_argc_dll; /* CRTDLL.23 */
|
UINT32 CRTDLL_argc_dll; /* CRTDLL.23 */
|
||||||
LPSTR *CRTDLL_argv_dll; /* CRTDLL.24 */
|
LPSTR *CRTDLL_argv_dll; /* CRTDLL.24 */
|
||||||
LPSTR CRTDLL_acmdln_dll; /* CRTDLL.38 */
|
LPSTR CRTDLL_acmdln_dll; /* CRTDLL.38 */
|
||||||
|
|
|
@ -628,19 +628,31 @@ INT16 WINSOCK_ioctlsocket(SOCKET16 s, UINT32 cmd, UINT32 *argp)
|
||||||
|
|
||||||
switch( cmd )
|
switch( cmd )
|
||||||
{
|
{
|
||||||
case WS_FIONREAD: newcmd=FIONREAD; break;
|
case WS_FIONREAD:
|
||||||
case WS_FIONBIO: newcmd=FIONBIO;
|
newcmd=FIONREAD;
|
||||||
if( pws->p_aop && *argp == 0 )
|
break;
|
||||||
{
|
|
||||||
pwsi->err = WSAEINVAL;
|
case WS_FIONBIO:
|
||||||
return SOCKET_ERROR;
|
newcmd=FIONBIO;
|
||||||
}
|
if( pws->p_aop && *argp == 0 )
|
||||||
break;
|
{
|
||||||
case WS_SIOCATMARK: newcmd=SIOCATMARK; break;
|
pwsi->err = WSAEINVAL;
|
||||||
|
return SOCKET_ERROR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WS_SIOCATMARK:
|
||||||
|
newcmd=SIOCATMARK;
|
||||||
|
break;
|
||||||
|
|
||||||
case WS_IOW('f',125,u_long):
|
case WS_IOW('f',125,u_long):
|
||||||
fprintf(stderr,"Warning: WS1.1 shouldn't be using async I/O\n");
|
fprintf(stderr,"Warning: WS1.1 shouldn't be using async I/O\n");
|
||||||
pwsi->err = WSAEINVAL; return SOCKET_ERROR;
|
pwsi->err = WSAEINVAL;
|
||||||
default: fprintf(stderr,"Warning: Unknown WS_IOCTL cmd (%08x)\n", cmd);
|
return SOCKET_ERROR;
|
||||||
|
|
||||||
|
default:
|
||||||
|
/* Netscape tries hard to use bogus ioctl 0x667e */
|
||||||
|
dprintf_winsock(stddeb,"\tunknown WS_IOCTL cmd (%08x)\n", cmd);
|
||||||
}
|
}
|
||||||
if( ioctl(pws->fd, newcmd, (char*)argp ) == 0 ) return 0;
|
if( ioctl(pws->fd, newcmd, (char*)argp ) == 0 ) return 0;
|
||||||
pwsi->err = (errno == EBADF) ? WSAENOTSOCK : wsaErrno();
|
pwsi->err = (errno == EBADF) ? WSAENOTSOCK : wsaErrno();
|
||||||
|
@ -1429,7 +1441,7 @@ INT16 WSACancelBlockingCall(void)
|
||||||
return SOCKET_ERROR;
|
return SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
FARPROC16 WSASetBlockingHook(FARPROC16 lpBlockFunc)
|
FARPROC16 WSASetBlockingHook16(FARPROC16 lpBlockFunc)
|
||||||
{
|
{
|
||||||
FARPROC16 prev;
|
FARPROC16 prev;
|
||||||
LPWSINFO pwsi = wsi_find(GetCurrentTask());
|
LPWSINFO pwsi = wsi_find(GetCurrentTask());
|
||||||
|
@ -1445,6 +1457,12 @@ FARPROC16 WSASetBlockingHook(FARPROC16 lpBlockFunc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FARPROC32 WSASetBlockingHook32(FARPROC32 lpBlockFunc)
|
||||||
|
{
|
||||||
|
fprintf( stderr, "Empty stub WSASetBlockingHook32(%p)\n", lpBlockFunc );
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
INT16 WSAUnhookBlockingHook(void)
|
INT16 WSAUnhookBlockingHook(void)
|
||||||
{
|
{
|
||||||
LPWSINFO pwsi = wsi_find(GetCurrentTask());
|
LPWSINFO pwsi = wsi_find(GetCurrentTask());
|
||||||
|
|
|
@ -524,7 +524,7 @@ INT32 wsprintf32A( LPSTR buffer, LPCSTR spec, ... )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emulator version */
|
/* Emulator version */
|
||||||
INT32 WIN32_wsprintf32A( int *args )
|
INT32 WIN32_wsprintf32A( DWORD *args )
|
||||||
{
|
{
|
||||||
return wvsprintf32A( (LPSTR)args[0], (LPCSTR)args[1], (LPCVOID)&args[2] );
|
return wvsprintf32A( (LPSTR)args[0], (LPCSTR)args[1], (LPCVOID)&args[2] );
|
||||||
}
|
}
|
||||||
|
@ -546,7 +546,7 @@ INT32 wsprintf32W( LPWSTR buffer, LPCWSTR spec, ... )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emulator version */
|
/* Emulator version */
|
||||||
INT32 WIN32_wsprintf32W( int *args )
|
INT32 WIN32_wsprintf32W( DWORD *args )
|
||||||
{
|
{
|
||||||
return wvsprintf32W( (LPWSTR)args[0], (LPCWSTR)args[1], (LPCVOID)&args[2]);
|
return wvsprintf32W( (LPWSTR)args[0], (LPCWSTR)args[1], (LPCVOID)&args[2]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#define DOS_GET_DRIVE(reg) ((reg) ? (reg) - 1 : DRIVE_GetCurrentDrive())
|
#define DOS_GET_DRIVE(reg) ((reg) ? (reg) - 1 : DRIVE_GetCurrentDrive())
|
||||||
|
|
||||||
|
void CreateBPB(int drive, BYTE *data); /* defined in int21.c */
|
||||||
|
|
||||||
|
|
||||||
/* Structure for real-mode callbacks */
|
/* Structure for real-mode callbacks */
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -26,10 +26,9 @@
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
int MMSYSTEM_DevIDToIndex(UINT16);
|
|
||||||
|
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
#define SOUND_DEV "/dev/dsp"
|
#define SOUND_DEV "/dev/dsp"
|
||||||
|
#define MIXER_DEV "/dev/mixer"
|
||||||
|
|
||||||
#ifdef SOUND_VERSION
|
#ifdef SOUND_VERSION
|
||||||
#define IOCTL(a,b,c) ((-1==ioctl(a,b,&c))&&(perror("ioctl:"#b":"#c),0))
|
#define IOCTL(a,b,c) ((-1==ioctl(a,b,&c))&&(perror("ioctl:"#b":"#c),0))
|
||||||
|
@ -37,42 +36,43 @@ int MMSYSTEM_DevIDToIndex(UINT16);
|
||||||
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
|
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_WAVOUTDRV 2
|
#define MAX_WAVOUTDRV (1)
|
||||||
#define MAX_WAVINDRV 2
|
#define MAX_WAVINDRV (1)
|
||||||
#define MAX_MCIWAVDRV 2
|
#define MAX_MCIWAVDRV (1)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int unixdev;
|
int unixdev;
|
||||||
int state;
|
int state;
|
||||||
DWORD bufsize;
|
DWORD bufsize;
|
||||||
WAVEOPENDESC waveDesc;
|
WAVEOPENDESC waveDesc;
|
||||||
WORD wFlags;
|
WORD wFlags;
|
||||||
PCMWAVEFORMAT Format;
|
PCMWAVEFORMAT Format;
|
||||||
LPWAVEHDR lpQueueHdr;
|
LPWAVEHDR lpQueueHdr;
|
||||||
DWORD dwTotalPlayed;
|
DWORD dwTotalPlayed;
|
||||||
} LINUX_WAVEOUT;
|
} LINUX_WAVEOUT;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int unixdev;
|
int unixdev;
|
||||||
int state;
|
int state;
|
||||||
DWORD bufsize; /* Linux '/dev/dsp' give us that size */
|
DWORD bufsize; /* Linux '/dev/dsp' give us that size */
|
||||||
WAVEOPENDESC waveDesc;
|
WAVEOPENDESC waveDesc;
|
||||||
WORD wFlags;
|
WORD wFlags;
|
||||||
PCMWAVEFORMAT Format;
|
PCMWAVEFORMAT Format;
|
||||||
LPWAVEHDR lpQueueHdr;
|
LPWAVEHDR lpQueueHdr;
|
||||||
DWORD dwTotalRecorded;
|
DWORD dwTotalRecorded;
|
||||||
} LINUX_WAVEIN;
|
} LINUX_WAVEIN;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int nUseCount; /* Incremented for each shared open */
|
int nUseCount; /* Incremented for each shared open */
|
||||||
BOOL16 fShareable; /* TRUE if first open was shareable */
|
BOOL16 fShareable; /* TRUE if first open was shareable */
|
||||||
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
||||||
HANDLE16 hCallback; /* Callback handle for pending notification */
|
HANDLE16 hCallback; /* Callback handle for pending notification */
|
||||||
HMMIO16 hFile; /* mmio file handle open as Element */
|
HMMIO16 hFile; /* mmio file handle open as Element */
|
||||||
MCI_WAVE_OPEN_PARMS openParms;
|
MCI_WAVE_OPEN_PARMS openParms;
|
||||||
PCMWAVEFORMAT WaveFormat;
|
PCMWAVEFORMAT WaveFormat;
|
||||||
WAVEHDR WaveHdr;
|
WAVEHDR WaveHdr;
|
||||||
} LINUX_MCIWAVE;
|
BOOL16 fInput; /* FALSE = Output, TRUE = Input */
|
||||||
|
} LINUX_MCIWAVE;
|
||||||
|
|
||||||
static LINUX_WAVEOUT WOutDev[MAX_WAVOUTDRV];
|
static LINUX_WAVEOUT WOutDev[MAX_WAVOUTDRV];
|
||||||
static LINUX_WAVEIN WInDev[MAX_WAVOUTDRV];
|
static LINUX_WAVEIN WInDev[MAX_WAVOUTDRV];
|
||||||
|
@ -85,12 +85,14 @@ static LINUX_MCIWAVE MCIWavDev[MAX_MCIWAVDRV];
|
||||||
static DWORD WAVE_NotifyClient(UINT16 wDevID, WORD wMsg,
|
static DWORD WAVE_NotifyClient(UINT16 wDevID, WORD wMsg,
|
||||||
DWORD dwParam1, DWORD dwParam2)
|
DWORD dwParam1, DWORD dwParam2)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
dprintf_mciwave(stddeb,"WAVE_NotifyClient // wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2);
|
||||||
|
|
||||||
if (WInDev[index].wFlags != DCB_NULL && !DriverCallback(
|
if (wDevID > MAX_WAVOUTDRV) return MCIERR_INTERNAL;
|
||||||
WInDev[index].waveDesc.dwCallBack, WInDev[index].wFlags,
|
|
||||||
WInDev[index].waveDesc.hWave, wMsg,
|
if (WInDev[wDevID].wFlags != DCB_NULL && !DriverCallback(
|
||||||
WInDev[index].waveDesc.dwInstance, dwParam1, dwParam2)) {
|
WInDev[wDevID].waveDesc.dwCallBack, WInDev[wDevID].wFlags,
|
||||||
|
WInDev[wDevID].waveDesc.hWave, wMsg,
|
||||||
|
WInDev[wDevID].waveDesc.dwInstance, dwParam1, dwParam2)) {
|
||||||
dprintf_mciwave(stddeb,"WAVE_NotifyClient // can't notify client !\n");
|
dprintf_mciwave(stddeb,"WAVE_NotifyClient // can't notify client !\n");
|
||||||
return MMSYSERR_NOERROR;
|
return MMSYSERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
@ -99,11 +101,11 @@ static DWORD WAVE_NotifyClient(UINT16 wDevID, WORD wMsg,
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* WAVE_mciOpen */
|
* WAVE_mciOpen [internal]*/
|
||||||
static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms)
|
static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
HLOCAL16 hFormat;
|
||||||
HLOCAL16 hFormat;
|
LPWAVEFORMAT lpFormat;
|
||||||
LPPCMWAVEFORMAT lpWaveFormat;
|
LPPCMWAVEFORMAT lpWaveFormat;
|
||||||
HLOCAL16 hDesc;
|
HLOCAL16 hDesc;
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
@ -115,23 +117,22 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lp
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
|
||||||
wDevID = lpParms->wDeviceID;
|
if (MCIWavDev[wDevID].nUseCount > 0) {
|
||||||
index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
|
|
||||||
if (MCIWavDev[index].nUseCount > 0) {
|
|
||||||
/* The driver already open on this channel */
|
/* The driver already open on this channel */
|
||||||
/* If the driver was opened shareable before and this open specifies */
|
/* If the driver was opened shareable before and this open specifies */
|
||||||
/* shareable then increment the use count */
|
/* shareable then increment the use count */
|
||||||
if (MCIWavDev[index].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
if (MCIWavDev[wDevID].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
||||||
++MCIWavDev[index].nUseCount;
|
++MCIWavDev[wDevID].nUseCount;
|
||||||
else
|
else
|
||||||
return MCIERR_MUST_USE_SHAREABLE;
|
return MCIERR_MUST_USE_SHAREABLE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MCIWavDev[index].nUseCount = 1;
|
MCIWavDev[wDevID].nUseCount = 1;
|
||||||
MCIWavDev[index].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
MCIWavDev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
||||||
}
|
}
|
||||||
lpParms->wDeviceID = wDevID;
|
|
||||||
|
MCIWavDev[wDevID].fInput = FALSE;
|
||||||
|
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciOpen // wDevID=%04X\n", wDevID);
|
dprintf_mciwave(stddeb,"WAVE_mciOpen // wDevID=%04X\n", wDevID);
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciOpen // before OPEN_ELEMENT\n");
|
dprintf_mciwave(stddeb,"WAVE_mciOpen // before OPEN_ELEMENT\n");
|
||||||
if (dwFlags & MCI_OPEN_ELEMENT) {
|
if (dwFlags & MCI_OPEN_ELEMENT) {
|
||||||
|
@ -141,20 +142,20 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lp
|
||||||
if (strlen(lpstrElementName) > 0) {
|
if (strlen(lpstrElementName) > 0) {
|
||||||
strcpy(str, lpstrElementName);
|
strcpy(str, lpstrElementName);
|
||||||
CharUpper32A(str);
|
CharUpper32A(str);
|
||||||
MCIWavDev[index].hFile = mmioOpen(str, NULL,
|
MCIWavDev[wDevID].hFile = mmioOpen(str, NULL,
|
||||||
MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
|
MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
|
||||||
if (MCIWavDev[index].hFile == 0) {
|
if (MCIWavDev[wDevID].hFile == 0) {
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciOpen // can't find file='%s' !\n", str);
|
dprintf_mciwave(stddeb,"WAVE_mciOpen // can't find file='%s' !\n", str);
|
||||||
return MCIERR_FILE_NOT_FOUND;
|
return MCIERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
MCIWavDev[index].hFile = 0;
|
MCIWavDev[wDevID].hFile = 0;
|
||||||
}
|
}
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciOpen // hFile=%u\n", MCIWavDev[index].hFile);
|
dprintf_mciwave(stddeb,"WAVE_mciOpen // hFile=%u\n", MCIWavDev[wDevID].hFile);
|
||||||
memcpy(&MCIWavDev[index].openParms, lpParms, sizeof(MCI_WAVE_OPEN_PARMS));
|
memcpy(&MCIWavDev[wDevID].openParms, lpParms, sizeof(MCI_WAVE_OPEN_PARMS));
|
||||||
MCIWavDev[index].wNotifyDeviceID = lpParms->wDeviceID;
|
MCIWavDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
|
||||||
lpWaveFormat = &MCIWavDev[index].WaveFormat;
|
lpWaveFormat = &MCIWavDev[wDevID].WaveFormat;
|
||||||
hDesc = USER_HEAP_ALLOC(sizeof(WAVEOPENDESC));
|
hDesc = USER_HEAP_ALLOC(sizeof(WAVEOPENDESC));
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hDesc);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hDesc);
|
||||||
lpDesc->hWave = 0;
|
lpDesc->hWave = 0;
|
||||||
|
@ -166,10 +167,10 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lp
|
||||||
lpWaveFormat->wf.nAvgBytesPerSec = 11025;
|
lpWaveFormat->wf.nAvgBytesPerSec = 11025;
|
||||||
lpWaveFormat->wf.nBlockAlign = 1;
|
lpWaveFormat->wf.nBlockAlign = 1;
|
||||||
*/
|
*/
|
||||||
if (MCIWavDev[index].hFile != 0) {
|
if (MCIWavDev[wDevID].hFile != 0) {
|
||||||
MMCKINFO mmckInfo;
|
MMCKINFO mmckInfo;
|
||||||
MMCKINFO ckMainRIFF;
|
MMCKINFO ckMainRIFF;
|
||||||
if (mmioDescend(MCIWavDev[index].hFile, &ckMainRIFF, NULL, 0) != 0) {
|
if (mmioDescend(MCIWavDev[wDevID].hFile, &ckMainRIFF, NULL, 0) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
|
@ -181,19 +182,19 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lp
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
mmckInfo.ckid = mmioFOURCC('f', 'm', 't', ' ');
|
mmckInfo.ckid = mmioFOURCC('f', 'm', 't', ' ');
|
||||||
if (mmioDescend(MCIWavDev[index].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) {
|
if (mmioDescend(MCIWavDev[wDevID].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"WAVE_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
|
"WAVE_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
|
||||||
(LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
|
(LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
|
||||||
mmckInfo.cksize);
|
mmckInfo.cksize);
|
||||||
if (mmioRead(MCIWavDev[index].hFile, (HPSTR) lpWaveFormat,
|
if (mmioRead(MCIWavDev[wDevID].hFile, (HPSTR) lpWaveFormat,
|
||||||
(long) sizeof(PCMWAVEFORMAT)) != (long) sizeof(PCMWAVEFORMAT)) {
|
(long) sizeof(PCMWAVEFORMAT)) != (long) sizeof(PCMWAVEFORMAT)) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a');
|
mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a');
|
||||||
if (mmioDescend(MCIWavDev[index].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) {
|
if (mmioDescend(MCIWavDev[wDevID].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
|
@ -205,39 +206,107 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lp
|
||||||
lpWaveFormat->wf.nChannels, lpWaveFormat->wf.nSamplesPerSec);
|
lpWaveFormat->wf.nChannels, lpWaveFormat->wf.nSamplesPerSec);
|
||||||
lpWaveFormat->wBitsPerSample = 0;
|
lpWaveFormat->wBitsPerSample = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lpWaveFormat->wf.nAvgBytesPerSec =
|
lpWaveFormat->wf.nAvgBytesPerSec =
|
||||||
lpWaveFormat->wf.nSamplesPerSec * lpWaveFormat->wf.nBlockAlign;
|
lpWaveFormat->wf.nSamplesPerSec * lpWaveFormat->wf.nBlockAlign;
|
||||||
hFormat = USER_HEAP_ALLOC(sizeof(PCMWAVEFORMAT));
|
hFormat = USER_HEAP_ALLOC(sizeof(PCMWAVEFORMAT));
|
||||||
lpDesc->lpFormat = (LPWAVEFORMAT) USER_HEAP_LIN_ADDR(hFormat);
|
lpFormat = (LPWAVEFORMAT) USER_HEAP_LIN_ADDR(hFormat);
|
||||||
memcpy(lpDesc->lpFormat, lpWaveFormat, sizeof(PCMWAVEFORMAT));
|
memcpy(lpFormat, lpWaveFormat, sizeof(PCMWAVEFORMAT));
|
||||||
|
lpDesc->lpFormat = (LPWAVEFORMAT)USER_HEAP_SEG_ADDR(hFormat);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_SEG_ADDR(hDesc);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_SEG_ADDR(hDesc);
|
||||||
dwRet = wodMessage(index, WODM_OPEN, 0, (DWORD)lpDesc, CALLBACK_NULL);
|
|
||||||
dwRet = widMessage(index, WIDM_OPEN, 0, (DWORD)lpDesc, CALLBACK_NULL);
|
/*
|
||||||
|
By default the device will be opened for output, the MCI_CUE function is there to
|
||||||
|
change from output to input and back
|
||||||
|
*/
|
||||||
|
|
||||||
|
dwRet = wodMessage(wDevID, WODM_OPEN, 0, (DWORD)lpDesc, CALLBACK_NULL);
|
||||||
|
|
||||||
USER_HEAP_FREE(hFormat);
|
USER_HEAP_FREE(hFormat);
|
||||||
USER_HEAP_FREE(hDesc);
|
USER_HEAP_FREE(hDesc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* WAVE_mciCue [internal]
|
||||||
|
*/
|
||||||
|
|
||||||
|
static DWORD WAVE_mciCue(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
FIXME
|
||||||
|
|
||||||
|
This routine is far from complete. At the moment only a check is done on the
|
||||||
|
MCI_WAVE_INPUT flag. No explicit check on MCI_WAVE_OUTPUT is done since that
|
||||||
|
is the default.
|
||||||
|
|
||||||
|
The flags MCI_NOTIFY (and the callback parameter in lpParms) and MCI_WAIT are
|
||||||
|
ignored
|
||||||
|
*/
|
||||||
|
|
||||||
|
DWORD dwRet;
|
||||||
|
HLOCAL16 hDesc;
|
||||||
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
|
dprintf_mciwave(stddeb,"WAVE_mciCue(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
|
||||||
|
|
||||||
|
/* always close elements ? */
|
||||||
|
|
||||||
|
if (MCIWavDev[wDevID].hFile != 0) {
|
||||||
|
mmioClose(MCIWavDev[wDevID].hFile, 0);
|
||||||
|
MCIWavDev[wDevID].hFile = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hDesc = USER_HEAP_ALLOC(sizeof(WAVEOPENDESC));
|
||||||
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hDesc);
|
||||||
|
|
||||||
|
dwRet = MMSYSERR_NOERROR; /* assume success */
|
||||||
|
|
||||||
|
if ((dwParam & MCI_WAVE_INPUT) && !MCIWavDev[wDevID].fInput) {
|
||||||
|
|
||||||
|
/* FIXME this is just a hack WOutDev should be hidden here */
|
||||||
|
memcpy(lpDesc,&WOutDev[wDevID].waveDesc,sizeof(WAVEOPENDESC));
|
||||||
|
|
||||||
|
dwRet = wodMessage(wDevID, WODM_CLOSE, 0, 0L, 0L);
|
||||||
|
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
||||||
|
dwRet = widMessage(wDevID, WIDM_OPEN, 0, (DWORD)lpDesc, CALLBACK_NULL);
|
||||||
|
}
|
||||||
|
else if (MCIWavDev[wDevID].fInput) {
|
||||||
|
/* FIXME this is just a hack WInDev should be hidden here */
|
||||||
|
memcpy(lpDesc,&WInDev[wDevID].waveDesc,sizeof(WAVEOPENDESC));
|
||||||
|
|
||||||
|
dwRet = widMessage(wDevID, WIDM_CLOSE, 0, 0L, 0L);
|
||||||
|
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
||||||
|
dwRet = wodMessage(wDevID, WODM_OPEN, 0, (DWORD)lpDesc, CALLBACK_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
USER_HEAP_FREE(hDesc);
|
||||||
|
|
||||||
|
return dwRet;
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* WAVE_mciClose [internal]
|
* WAVE_mciClose [internal]
|
||||||
*/
|
*/
|
||||||
static DWORD WAVE_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD WAVE_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
|
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"WAVE_mciClose(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
|
"WAVE_mciClose(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
|
||||||
MCIWavDev[index].nUseCount--;
|
MCIWavDev[wDevID].nUseCount--;
|
||||||
if (MCIWavDev[index].nUseCount == 0) {
|
if (MCIWavDev[wDevID].nUseCount == 0) {
|
||||||
if (MCIWavDev[index].hFile != 0) {
|
if (MCIWavDev[wDevID].hFile != 0) {
|
||||||
mmioClose(MCIWavDev[index].hFile, 0);
|
mmioClose(MCIWavDev[wDevID].hFile, 0);
|
||||||
MCIWavDev[index].hFile = 0;
|
MCIWavDev[wDevID].hFile = 0;
|
||||||
}
|
|
||||||
dwRet = wodMessage(index, WODM_CLOSE, 0, 0L, 0L);
|
|
||||||
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
|
||||||
dwRet = widMessage(index, WIDM_CLOSE, 0, 0L, 0L);
|
|
||||||
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
|
||||||
}
|
}
|
||||||
|
if (MCIWavDev[wDevID].fInput)
|
||||||
|
dwRet = widMessage(wDevID, WIDM_CLOSE, 0, 0L, 0L);
|
||||||
|
else
|
||||||
|
dwRet = wodMessage(wDevID, WODM_CLOSE, 0, 0L, 0L);
|
||||||
|
|
||||||
|
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +316,6 @@ static DWORD WAVE_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpP
|
||||||
*/
|
*/
|
||||||
static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int start, end;
|
int start, end;
|
||||||
LONG bufsize, count;
|
LONG bufsize, count;
|
||||||
HGLOBAL16 hData;
|
HGLOBAL16 hData;
|
||||||
|
@ -255,13 +323,20 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
LPWAVEHDR lpWaveHdr;
|
LPWAVEHDR lpWaveHdr;
|
||||||
LPWAVEHDR lp16WaveHdr;
|
LPWAVEHDR lp16WaveHdr;
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
|
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"WAVE_mciPlay(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
"WAVE_mciPlay(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (MCIWavDev[index].hFile == 0) {
|
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciPlay // can't find file='%08lx' !\n",
|
if (MCIWavDev[wDevID].fInput) {
|
||||||
MCIWavDev[index].openParms.lpstrElementName);
|
dprintf_mciwave(stddeb,"WAVE_mciPlay // cannot play on input device\n");
|
||||||
|
return MCIERR_NONAPPLICABLE_FUNCTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MCIWavDev[wDevID].hFile == 0) {
|
||||||
|
dprintf_mciwave(stddeb,"WAVE_mciPlay // can't find file='%08lx' !\n",
|
||||||
|
MCIWavDev[wDevID].openParms.lpstrElementName);
|
||||||
return MCIERR_FILE_NOT_FOUND;
|
return MCIERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
start = 1; end = 99999;
|
start = 1; end = 99999;
|
||||||
if (dwFlags & MCI_FROM) {
|
if (dwFlags & MCI_FROM) {
|
||||||
start = lpParms->dwFrom;
|
start = lpParms->dwFrom;
|
||||||
|
@ -290,7 +365,7 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bufsize = 64000;
|
bufsize = 64000;
|
||||||
lpWaveHdr = &MCIWavDev[index].WaveHdr;
|
lpWaveHdr = &MCIWavDev[wDevID].WaveHdr;
|
||||||
hData = GlobalAlloc16(GMEM_MOVEABLE, bufsize);
|
hData = GlobalAlloc16(GMEM_MOVEABLE, bufsize);
|
||||||
lpWaveHdr->lpData = (LPSTR) WIN16_GlobalLock16(hData);
|
lpWaveHdr->lpData = (LPSTR) WIN16_GlobalLock16(hData);
|
||||||
lpWaveHdr->dwUser = 0L;
|
lpWaveHdr->dwUser = 0L;
|
||||||
|
@ -300,9 +375,9 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
lp16WaveHdr = (LPWAVEHDR) USER_HEAP_SEG_ADDR(hWaveHdr);
|
lp16WaveHdr = (LPWAVEHDR) USER_HEAP_SEG_ADDR(hWaveHdr);
|
||||||
memcpy(PTR_SEG_TO_LIN(lp16WaveHdr), lpWaveHdr, sizeof(WAVEHDR));
|
memcpy(PTR_SEG_TO_LIN(lp16WaveHdr), lpWaveHdr, sizeof(WAVEHDR));
|
||||||
lpWaveHdr = PTR_SEG_TO_LIN(lp16WaveHdr);
|
lpWaveHdr = PTR_SEG_TO_LIN(lp16WaveHdr);
|
||||||
dwRet = wodMessage(index, WODM_PREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
dwRet = wodMessage(wDevID, WODM_PREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
||||||
while(TRUE) {
|
while(TRUE) {
|
||||||
count = mmioRead(MCIWavDev[index].hFile,
|
count = mmioRead(MCIWavDev[wDevID].hFile,
|
||||||
PTR_SEG_TO_LIN(lpWaveHdr->lpData), bufsize);
|
PTR_SEG_TO_LIN(lpWaveHdr->lpData), bufsize);
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciPlay // mmioRead bufsize=%ld count=%ld\n", bufsize, count);
|
dprintf_mciwave(stddeb,"WAVE_mciPlay // mmioRead bufsize=%ld count=%ld\n", bufsize, count);
|
||||||
if (count < 1) break;
|
if (count < 1) break;
|
||||||
|
@ -310,9 +385,9 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
/* lpWaveHdr->dwBytesRecorded = count; */
|
/* lpWaveHdr->dwBytesRecorded = count; */
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciPlay // before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n",
|
dprintf_mciwave(stddeb,"WAVE_mciPlay // before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n",
|
||||||
lpWaveHdr, lpWaveHdr->dwBufferLength, lpWaveHdr->dwBytesRecorded);
|
lpWaveHdr, lpWaveHdr->dwBufferLength, lpWaveHdr->dwBytesRecorded);
|
||||||
dwRet = wodMessage(index, WODM_WRITE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
dwRet = wodMessage(wDevID, WODM_WRITE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
||||||
}
|
}
|
||||||
dwRet = wodMessage(index, WODM_UNPREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
dwRet = wodMessage(wDevID, WODM_UNPREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
||||||
if (lpWaveHdr->lpData != NULL) {
|
if (lpWaveHdr->lpData != NULL) {
|
||||||
GlobalUnlock16(hData);
|
GlobalUnlock16(hData);
|
||||||
GlobalFree16(hData);
|
GlobalFree16(hData);
|
||||||
|
@ -322,7 +397,7 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
dprintf_mciwave(stddeb,"WAVE_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
MCIWavDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -333,8 +408,7 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
*/
|
*/
|
||||||
static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
|
static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
int start, end;
|
||||||
int start, end;
|
|
||||||
LONG bufsize;
|
LONG bufsize;
|
||||||
HGLOBAL16 hData;
|
HGLOBAL16 hData;
|
||||||
HLOCAL16 hWaveHdr;
|
HLOCAL16 hWaveHdr;
|
||||||
|
@ -344,11 +418,17 @@ static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP
|
||||||
|
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"WAVE_mciRecord(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
"WAVE_mciRecord(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (MCIWavDev[index].hFile == 0) {
|
|
||||||
|
if (!MCIWavDev[wDevID].fInput) {
|
||||||
|
dprintf_mciwave(stddeb,"WAVE_mciPlay // cannot record on output device\n");
|
||||||
|
return MCIERR_NONAPPLICABLE_FUNCTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MCIWavDev[wDevID].hFile == 0) {
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciRecord // can't find file='%08lx' !\n",
|
dprintf_mciwave(stddeb,"WAVE_mciRecord // can't find file='%08lx' !\n",
|
||||||
MCIWavDev[index].openParms.lpstrElementName);
|
MCIWavDev[wDevID].openParms.lpstrElementName);
|
||||||
return MCIERR_FILE_NOT_FOUND;
|
return MCIERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
start = 1; end = 99999;
|
start = 1; end = 99999;
|
||||||
if (dwFlags & MCI_FROM) {
|
if (dwFlags & MCI_FROM) {
|
||||||
start = lpParms->dwFrom;
|
start = lpParms->dwFrom;
|
||||||
|
@ -360,7 +440,7 @@ static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciRecord // MCI_TO=%d \n", end);
|
dprintf_mciwave(stddeb,"WAVE_mciRecord // MCI_TO=%d \n", end);
|
||||||
}
|
}
|
||||||
bufsize = 64000;
|
bufsize = 64000;
|
||||||
lpWaveHdr = &MCIWavDev[index].WaveHdr;
|
lpWaveHdr = &MCIWavDev[wDevID].WaveHdr;
|
||||||
hData = GlobalAlloc16(GMEM_MOVEABLE, bufsize);
|
hData = GlobalAlloc16(GMEM_MOVEABLE, bufsize);
|
||||||
lpWaveHdr->lpData = (LPSTR) WIN16_GlobalLock16(hData);
|
lpWaveHdr->lpData = (LPSTR) WIN16_GlobalLock16(hData);
|
||||||
lpWaveHdr->dwBufferLength = bufsize;
|
lpWaveHdr->dwBufferLength = bufsize;
|
||||||
|
@ -371,18 +451,18 @@ static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP
|
||||||
lp16WaveHdr = (LPWAVEHDR) USER_HEAP_SEG_ADDR(hWaveHdr);
|
lp16WaveHdr = (LPWAVEHDR) USER_HEAP_SEG_ADDR(hWaveHdr);
|
||||||
memcpy(PTR_SEG_TO_LIN(lp16WaveHdr), lpWaveHdr, sizeof(WAVEHDR));
|
memcpy(PTR_SEG_TO_LIN(lp16WaveHdr), lpWaveHdr, sizeof(WAVEHDR));
|
||||||
lpWaveHdr = PTR_SEG_TO_LIN(lp16WaveHdr);
|
lpWaveHdr = PTR_SEG_TO_LIN(lp16WaveHdr);
|
||||||
dwRet = widMessage(index, WIDM_PREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
dwRet = widMessage(wDevID, WIDM_PREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciRecord // after WIDM_PREPARE \n");
|
dprintf_mciwave(stddeb,"WAVE_mciRecord // after WIDM_PREPARE \n");
|
||||||
while(TRUE) {
|
while(TRUE) {
|
||||||
lpWaveHdr->dwBytesRecorded = 0;
|
lpWaveHdr->dwBytesRecorded = 0;
|
||||||
dwRet = widMessage(index, WIDM_START, 0, 0L, 0L);
|
dwRet = widMessage(wDevID, WIDM_START, 0, 0L, 0L);
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"WAVE_mciRecord // after WIDM_START lpWaveHdr=%p dwBytesRecorded=%lu\n",
|
"WAVE_mciRecord // after WIDM_START lpWaveHdr=%p dwBytesRecorded=%lu\n",
|
||||||
lpWaveHdr, lpWaveHdr->dwBytesRecorded);
|
lpWaveHdr, lpWaveHdr->dwBytesRecorded);
|
||||||
if (lpWaveHdr->dwBytesRecorded == 0) break;
|
if (lpWaveHdr->dwBytesRecorded == 0) break;
|
||||||
}
|
}
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciRecord // before WIDM_UNPREPARE \n");
|
dprintf_mciwave(stddeb,"WAVE_mciRecord // before WIDM_UNPREPARE \n");
|
||||||
dwRet = widMessage(index, WIDM_UNPREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
dwRet = widMessage(wDevID, WIDM_UNPREPARE, 0, (DWORD)lp16WaveHdr, sizeof(WAVEHDR));
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciRecord // after WIDM_UNPREPARE \n");
|
dprintf_mciwave(stddeb,"WAVE_mciRecord // after WIDM_UNPREPARE \n");
|
||||||
if (lpWaveHdr->lpData != NULL) {
|
if (lpWaveHdr->lpData != NULL) {
|
||||||
GlobalUnlock16(hData);
|
GlobalUnlock16(hData);
|
||||||
|
@ -393,7 +473,7 @@ static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
dprintf_mciwave(stddeb,"WAVE_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
MCIWavDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -509,7 +589,6 @@ static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
||||||
*/
|
*/
|
||||||
static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"WAVE_mciStatus(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
"WAVE_mciStatus(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
@ -597,7 +676,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
MCIWavDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -658,7 +737,6 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
|
||||||
*/
|
*/
|
||||||
static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
|
static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"WAVE_mciInfo(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
"WAVE_mciInfo(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
@ -669,7 +747,7 @@ static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms
|
||||||
break;
|
break;
|
||||||
case MCI_INFO_FILE:
|
case MCI_INFO_FILE:
|
||||||
lpParms->lpstrReturn =
|
lpParms->lpstrReturn =
|
||||||
(LPSTR)MCIWavDev[index].openParms.lpstrElementName;
|
(LPSTR)MCIWavDev[wDevID].openParms.lpstrElementName;
|
||||||
break;
|
break;
|
||||||
case MCI_WAVE_INPUT:
|
case MCI_WAVE_INPUT:
|
||||||
lpParms->lpstrReturn = "Linux Sound System 0.5";
|
lpParms->lpstrReturn = "Linux Sound System 0.5";
|
||||||
|
@ -704,8 +782,9 @@ static DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS lpCaps, DWORD dwSize)
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"wodGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
"wodGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
||||||
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
|
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
|
||||||
|
if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
|
||||||
audio = open (SOUND_DEV, O_WRONLY, 0);
|
audio = open (SOUND_DEV, O_WRONLY, 0);
|
||||||
if (audio == -1) return MMSYSERR_NOTENABLED;
|
if (audio == -1) return MMSYSERR_ALLOCATED ;
|
||||||
#ifdef EMULATE_SB16
|
#ifdef EMULATE_SB16
|
||||||
lpCaps->wMid = 0x0002;
|
lpCaps->wMid = 0x0002;
|
||||||
lpCaps->wPid = 0x0104;
|
lpCaps->wPid = 0x0104;
|
||||||
|
@ -777,10 +856,11 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
|
||||||
return MMSYSERR_ALLOCATED;
|
return MMSYSERR_ALLOCATED;
|
||||||
}
|
}
|
||||||
WOutDev[wDevID].unixdev = 0;
|
WOutDev[wDevID].unixdev = 0;
|
||||||
|
if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
|
||||||
audio = open (SOUND_DEV, O_WRONLY, 0);
|
audio = open (SOUND_DEV, O_WRONLY, 0);
|
||||||
if (audio == -1) {
|
if (audio == -1) {
|
||||||
dprintf_mciwave(stddeb,"Linux 'wodOpen' // can't open !\n");
|
dprintf_mciwave(stddeb,"Linux 'wodOpen' // can't open !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_ALLOCATED ;
|
||||||
}
|
}
|
||||||
IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
|
IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
|
||||||
if (abuf_size < 1024 || abuf_size > 65536) {
|
if (abuf_size < 1024 || abuf_size > 65536) {
|
||||||
|
@ -810,7 +890,10 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
|
||||||
WOutDev[wDevID].dwTotalPlayed = 0;
|
WOutDev[wDevID].dwTotalPlayed = 0;
|
||||||
WOutDev[wDevID].bufsize = abuf_size;
|
WOutDev[wDevID].bufsize = abuf_size;
|
||||||
memcpy(&WOutDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC));
|
memcpy(&WOutDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC));
|
||||||
|
dprintf_mciwave(stddeb,"Linux 'wodOpen' // lpDesc->lpFormat = %p\n",lpDesc->lpFormat);
|
||||||
lpFormat = (LPWAVEFORMAT) PTR_SEG_TO_LIN(lpDesc->lpFormat);
|
lpFormat = (LPWAVEFORMAT) PTR_SEG_TO_LIN(lpDesc->lpFormat);
|
||||||
|
/* lpFormat = lpDesc->lpFormat; */
|
||||||
|
dprintf_mciwave(stddeb,"Linux 'wodOpen' // lpFormat = %p\n",lpFormat);
|
||||||
if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
|
if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
|
||||||
dprintf_mciwave(stddeb,"Linux 'wodOpen' // Bad format %04X !\n",
|
dprintf_mciwave(stddeb,"Linux 'wodOpen' // Bad format %04X !\n",
|
||||||
lpFormat->wFormatTag);
|
lpFormat->wFormatTag);
|
||||||
|
@ -1042,7 +1125,7 @@ static DWORD wodGetVolume(WORD wDevID, LPDWORD lpdwVol)
|
||||||
int volume, left, right;
|
int volume, left, right;
|
||||||
dprintf_mciwave(stddeb,"wodGetVolume(%u, %p);\n", wDevID, lpdwVol);
|
dprintf_mciwave(stddeb,"wodGetVolume(%u, %p);\n", wDevID, lpdwVol);
|
||||||
if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
|
if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
|
||||||
if ((mixer = open("/dev/mixer", O_RDONLY)) < 0) {
|
if ((mixer = open(MIXER_DEV, O_RDONLY)) < 0) {
|
||||||
dprintf_mciwave(stddeb, "Linux 'wodGetVolume' // mixer device not available !\n");
|
dprintf_mciwave(stddeb, "Linux 'wodGetVolume' // mixer device not available !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
|
@ -1053,7 +1136,7 @@ static DWORD wodGetVolume(WORD wDevID, LPDWORD lpdwVol)
|
||||||
close(mixer);
|
close(mixer);
|
||||||
left = volume & 0x7F;
|
left = volume & 0x7F;
|
||||||
right = (volume >> 8) & 0x7F;
|
right = (volume >> 8) & 0x7F;
|
||||||
printf("Linux 'AUX_GetVolume' // left=%d right=%d !\n", left, right);
|
dprintf_mciwave(stddeb,"Linux 'wodGetVolume' // left=%d right=%d !\n", left, right);
|
||||||
*lpdwVol = MAKELONG(left << 9, right << 9);
|
*lpdwVol = MAKELONG(left << 9, right << 9);
|
||||||
return MMSYSERR_NOERROR;
|
return MMSYSERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
@ -1069,7 +1152,7 @@ static DWORD wodSetVolume(WORD wDevID, DWORD dwParam)
|
||||||
dprintf_mciwave(stddeb,"wodSetVolume(%u, %08lX);\n", wDevID, dwParam);
|
dprintf_mciwave(stddeb,"wodSetVolume(%u, %08lX);\n", wDevID, dwParam);
|
||||||
volume = (LOWORD(dwParam) >> 9 & 0x7F) +
|
volume = (LOWORD(dwParam) >> 9 & 0x7F) +
|
||||||
((HIWORD(dwParam) >> 9 & 0x7F) << 8);
|
((HIWORD(dwParam) >> 9 & 0x7F) << 8);
|
||||||
if ((mixer = open("/dev/mixer", O_WRONLY)) < 0) {
|
if ((mixer = open(MIXER_DEV, O_WRONLY)) < 0) {
|
||||||
dprintf_mciwave(stddeb, "Linux 'wodSetVolume' // mixer device not available !\n");
|
dprintf_mciwave(stddeb, "Linux 'wodSetVolume' // mixer device not available !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
|
@ -1114,13 +1197,13 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
|
||||||
case WODM_GETNUMDEVS:
|
case WODM_GETNUMDEVS:
|
||||||
return 1L;
|
return 1L;
|
||||||
case WODM_GETPITCH:
|
case WODM_GETPITCH:
|
||||||
return 0L;
|
return MMSYSERR_NOTSUPPORTED;
|
||||||
case WODM_SETPITCH:
|
case WODM_SETPITCH:
|
||||||
return 0L;
|
return MMSYSERR_NOTSUPPORTED;
|
||||||
case WODM_GETPLAYBACKRATE:
|
case WODM_GETPLAYBACKRATE:
|
||||||
return 0L;
|
return MMSYSERR_NOTSUPPORTED;
|
||||||
case WODM_SETPLAYBACKRATE:
|
case WODM_SETPLAYBACKRATE:
|
||||||
return 0L;
|
return MMSYSERR_NOTSUPPORTED;
|
||||||
case WODM_GETVOLUME:
|
case WODM_GETVOLUME:
|
||||||
return wodGetVolume(wDevID, (LPDWORD)PTR_SEG_TO_LIN(dwParam1));
|
return wodGetVolume(wDevID, (LPDWORD)PTR_SEG_TO_LIN(dwParam1));
|
||||||
case WODM_SETVOLUME:
|
case WODM_SETVOLUME:
|
||||||
|
@ -1156,12 +1239,13 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS lpCaps, DWORD dwSize)
|
||||||
dprintf_mciwave(stddeb,
|
dprintf_mciwave(stddeb,
|
||||||
"widGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
"widGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
||||||
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
|
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
|
||||||
|
if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
|
||||||
audio = open (SOUND_DEV, O_RDONLY, 0);
|
audio = open (SOUND_DEV, O_RDONLY, 0);
|
||||||
if (audio == -1) return MMSYSERR_NOTENABLED;
|
if (audio == -1) return MMSYSERR_ALLOCATED ;
|
||||||
#ifdef EMULATE_SB16
|
#ifdef EMULATE_SB16
|
||||||
lpCaps->wMid = 0x0002;
|
lpCaps->wMid = 0x0002;
|
||||||
lpCaps->wPid = 0x0004;
|
lpCaps->wPid = 0x0004;
|
||||||
strcpy(lpCaps->szPname, "SB16 Wave Out");
|
strcpy(lpCaps->szPname, "SB16 Wave In");
|
||||||
#else
|
#else
|
||||||
lpCaps->wMid = 0x00FF; /* Manufac ID */
|
lpCaps->wMid = 0x00FF; /* Manufac ID */
|
||||||
lpCaps->wPid = 0x0001; /* Product ID */
|
lpCaps->wPid = 0x0001; /* Product ID */
|
||||||
|
@ -1225,10 +1309,11 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
|
||||||
return MMSYSERR_ALLOCATED;
|
return MMSYSERR_ALLOCATED;
|
||||||
}
|
}
|
||||||
WInDev[wDevID].unixdev = 0;
|
WInDev[wDevID].unixdev = 0;
|
||||||
|
if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
|
||||||
audio = open (SOUND_DEV, O_RDONLY, 0);
|
audio = open (SOUND_DEV, O_RDONLY, 0);
|
||||||
if (audio == -1) {
|
if (audio == -1) {
|
||||||
dprintf_mciwave(stddeb,"Linux 'widOpen' // can't open !\n");
|
dprintf_mciwave(stddeb,"Linux 'widOpen' // can't open !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_ALLOCATED;
|
||||||
}
|
}
|
||||||
IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
|
IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
|
||||||
if (abuf_size < 1024 || abuf_size > 65536) {
|
if (abuf_size < 1024 || abuf_size > 65536) {
|
||||||
|
@ -1258,7 +1343,8 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
|
||||||
WInDev[wDevID].bufsize = abuf_size;
|
WInDev[wDevID].bufsize = abuf_size;
|
||||||
WInDev[wDevID].dwTotalRecorded = 0;
|
WInDev[wDevID].dwTotalRecorded = 0;
|
||||||
memcpy(&WInDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC));
|
memcpy(&WInDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC));
|
||||||
lpFormat = lpDesc->lpFormat;
|
lpFormat = (LPWAVEFORMAT) PTR_SEG_TO_LIN(lpDesc->lpFormat);
|
||||||
|
/* lpFormat = lpDesc->lpFormat; */
|
||||||
if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
|
if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
|
||||||
dprintf_mciwave(stddeb,"Linux 'widOpen' // Bad format %04X !\n",
|
dprintf_mciwave(stddeb,"Linux 'widOpen' // Bad format %04X !\n",
|
||||||
lpFormat->wFormatTag);
|
lpFormat->wFormatTag);
|
||||||
|
@ -1619,6 +1705,8 @@ LONG WAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
|
||||||
case MCI_OPEN_DRIVER:
|
case MCI_OPEN_DRIVER:
|
||||||
case MCI_OPEN:
|
case MCI_OPEN:
|
||||||
return WAVE_mciOpen(dwDevID, dwParam1, (LPMCI_WAVE_OPEN_PARMS)PTR_SEG_TO_LIN(dwParam2));
|
return WAVE_mciOpen(dwDevID, dwParam1, (LPMCI_WAVE_OPEN_PARMS)PTR_SEG_TO_LIN(dwParam2));
|
||||||
|
case MCI_CUE:
|
||||||
|
return WAVE_mciCue(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)PTR_SEG_TO_LIN(dwParam2));
|
||||||
case MCI_CLOSE_DRIVER:
|
case MCI_CLOSE_DRIVER:
|
||||||
case MCI_CLOSE:
|
case MCI_CLOSE:
|
||||||
return WAVE_mciClose(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)PTR_SEG_TO_LIN(dwParam2));
|
return WAVE_mciClose(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)PTR_SEG_TO_LIN(dwParam2));
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
int MMSYSTEM_DevIDToIndex(UINT16);
|
|
||||||
|
|
||||||
#define MAX_ANIMDRV 2
|
#define MAX_ANIMDRV 2
|
||||||
|
|
||||||
#define ANIMFRAMES_PERSEC 30
|
#define ANIMFRAMES_PERSEC 30
|
||||||
|
@ -54,24 +52,24 @@ static LINUX_ANIM AnimDev[MAX_ANIMDRV];
|
||||||
static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
|
static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
LPSTR lpstrElementName;
|
LPSTR lpstrElementName;
|
||||||
char str[128];
|
char str[128];
|
||||||
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciOpen(%04X, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciOpen(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (AnimDev[index].nUseCount > 0) {
|
if (AnimDev[wDevID].nUseCount > 0) {
|
||||||
/* The driver already open on this channel */
|
/* The driver already open on this channel */
|
||||||
/* If the driver was opened shareable before and this open specifies */
|
/* If the driver was opened shareable before and this open specifies */
|
||||||
/* shareable then increment the use count */
|
/* shareable then increment the use count */
|
||||||
if (AnimDev[index].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
if (AnimDev[wDevID].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
||||||
++AnimDev[index].nUseCount;
|
++AnimDev[wDevID].nUseCount;
|
||||||
else
|
else
|
||||||
return MCIERR_MUST_USE_SHAREABLE;
|
return MCIERR_MUST_USE_SHAREABLE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AnimDev[index].nUseCount = 1;
|
AnimDev[wDevID].nUseCount = 1;
|
||||||
AnimDev[index].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
AnimDev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
||||||
}
|
}
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciOpen // wDevID=%04X\n", wDevID);
|
dprintf_mcianim(stddeb,"ANIM_mciOpen // wDevID=%04X\n", wDevID);
|
||||||
lpParms->wDeviceID = wDevID;
|
lpParms->wDeviceID = wDevID;
|
||||||
|
@ -85,21 +83,21 @@ static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms
|
||||||
CharUpper32A(str);
|
CharUpper32A(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy(&AnimDev[index].openParms, lpParms, sizeof(MCI_OPEN_PARMS));
|
memcpy(&AnimDev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS));
|
||||||
AnimDev[index].wNotifyDeviceID = lpParms->wDeviceID;
|
AnimDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
|
||||||
AnimDev[index].mode = 0;
|
AnimDev[wDevID].mode = 0;
|
||||||
AnimDev[index].dwTimeFormat = MCI_FORMAT_TMSF;
|
AnimDev[wDevID].dwTimeFormat = MCI_FORMAT_TMSF;
|
||||||
AnimDev[index].nCurTrack = 0;
|
AnimDev[wDevID].nCurTrack = 0;
|
||||||
AnimDev[index].nTracks = 0;
|
AnimDev[wDevID].nTracks = 0;
|
||||||
AnimDev[index].dwTotalLen = 0;
|
AnimDev[wDevID].dwTotalLen = 0;
|
||||||
AnimDev[index].lpdwTrackLen = NULL;
|
AnimDev[wDevID].lpdwTrackLen = NULL;
|
||||||
AnimDev[index].lpdwTrackPos = NULL;
|
AnimDev[wDevID].lpdwTrackPos = NULL;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mcianim(stddeb,
|
dprintf_mcianim(stddeb,
|
||||||
"ANIM_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -113,11 +111,10 @@ static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms
|
||||||
static DWORD ANIM_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD ANIM_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciClose(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciClose(%u, %08lX, %p);\n",
|
||||||
wDevID, dwParam, lpParms);
|
wDevID, dwParam, lpParms);
|
||||||
if (AnimDev[index].lpdwTrackLen != NULL) free(AnimDev[index].lpdwTrackLen);
|
if (AnimDev[wDevID].lpdwTrackLen != NULL) free(AnimDev[wDevID].lpdwTrackLen);
|
||||||
if (AnimDev[index].lpdwTrackPos != NULL) free(AnimDev[index].lpdwTrackPos);
|
if (AnimDev[wDevID].lpdwTrackPos != NULL) free(AnimDev[wDevID].lpdwTrackPos);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -185,7 +182,6 @@ static DWORD ANIM_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame)
|
||||||
{
|
{
|
||||||
DWORD dwTime = 0;
|
DWORD dwTime = 0;
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
UINT16 wTrack;
|
UINT16 wTrack;
|
||||||
UINT16 wMinutes;
|
UINT16 wMinutes;
|
||||||
UINT16 wSeconds;
|
UINT16 wSeconds;
|
||||||
|
@ -212,11 +208,11 @@ static DWORD ANIM_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame)
|
||||||
/* unknown format ! force TMSF ! ... */
|
/* unknown format ! force TMSF ! ... */
|
||||||
dwFormatType = MCI_FORMAT_TMSF;
|
dwFormatType = MCI_FORMAT_TMSF;
|
||||||
case MCI_FORMAT_TMSF:
|
case MCI_FORMAT_TMSF:
|
||||||
for (wTrack = 0; wTrack < AnimDev[index].nTracks; wTrack++) {
|
for (wTrack = 0; wTrack < AnimDev[wDevID].nTracks; wTrack++) {
|
||||||
/* dwTime += AnimDev[index].lpdwTrackLen[wTrack - 1];
|
/* dwTime += AnimDev[wDevID].lpdwTrackLen[wTrack - 1];
|
||||||
printf("Adding trk#%u curpos=%u \n", dwTime);
|
printf("Adding trk#%u curpos=%u \n", dwTime);
|
||||||
if (dwTime >= dwFrame) break; */
|
if (dwTime >= dwFrame) break; */
|
||||||
if (AnimDev[index].lpdwTrackPos[wTrack - 1] >= dwFrame) break;
|
if (AnimDev[wDevID].lpdwTrackPos[wTrack - 1] >= dwFrame) break;
|
||||||
}
|
}
|
||||||
wMinutes = dwFrame / ANIMFRAMES_PERMIN;
|
wMinutes = dwFrame / ANIMFRAMES_PERMIN;
|
||||||
wSeconds = (dwFrame - ANIMFRAMES_PERMIN * wMinutes) / ANIMFRAMES_PERSEC;
|
wSeconds = (dwFrame - ANIMFRAMES_PERMIN * wMinutes) / ANIMFRAMES_PERSEC;
|
||||||
|
@ -240,7 +236,6 @@ static DWORD ANIM_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime)
|
||||||
{
|
{
|
||||||
DWORD dwFrame = 0;
|
DWORD dwFrame = 0;
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
UINT16 wTrack;
|
UINT16 wTrack;
|
||||||
dprintf_mcianim(stddeb,"ANIM_CalcFrame(%u, %08lX, %lu);\n",
|
dprintf_mcianim(stddeb,"ANIM_CalcFrame(%u, %08lX, %lu);\n",
|
||||||
wDevID, dwFormatType, dwTime);
|
wDevID, dwFormatType, dwTime);
|
||||||
|
@ -271,8 +266,8 @@ static DWORD ANIM_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime)
|
||||||
MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
|
MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
|
||||||
dprintf_mcianim(stddeb,
|
dprintf_mcianim(stddeb,
|
||||||
"ANIM_CalcFrame // TMSF trackpos[%u]=%lu\n",
|
"ANIM_CalcFrame // TMSF trackpos[%u]=%lu\n",
|
||||||
wTrack, AnimDev[index].lpdwTrackPos[wTrack - 1]);
|
wTrack, AnimDev[wDevID].lpdwTrackPos[wTrack - 1]);
|
||||||
dwFrame = AnimDev[index].lpdwTrackPos[wTrack - 1];
|
dwFrame = AnimDev[wDevID].lpdwTrackPos[wTrack - 1];
|
||||||
dwFrame += ANIMFRAMES_PERMIN * MCI_TMSF_MINUTE(dwTime);
|
dwFrame += ANIMFRAMES_PERMIN * MCI_TMSF_MINUTE(dwTime);
|
||||||
dwFrame += ANIMFRAMES_PERSEC * MCI_TMSF_SECOND(dwTime);
|
dwFrame += ANIMFRAMES_PERSEC * MCI_TMSF_SECOND(dwTime);
|
||||||
dwFrame += MCI_TMSF_FRAME(dwTime);
|
dwFrame += MCI_TMSF_FRAME(dwTime);
|
||||||
|
@ -289,7 +284,6 @@ static DWORD ANIM_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime)
|
||||||
static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
|
static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciInfo(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciInfo(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
@ -300,7 +294,7 @@ static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms
|
||||||
break;
|
break;
|
||||||
case MCI_INFO_FILE:
|
case MCI_INFO_FILE:
|
||||||
lpParms->lpstrReturn =
|
lpParms->lpstrReturn =
|
||||||
(LPSTR)AnimDev[index].openParms.lpstrElementName;
|
(LPSTR)AnimDev[wDevID].openParms.lpstrElementName;
|
||||||
break;
|
break;
|
||||||
case MCI_ANIM_INFO_TEXT:
|
case MCI_ANIM_INFO_TEXT:
|
||||||
lpParms->lpstrReturn = "Animation Window";
|
lpParms->lpstrReturn = "Animation Window";
|
||||||
|
@ -324,7 +318,6 @@ static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms
|
||||||
static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStatus(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciStatus(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
@ -333,30 +326,30 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
|
||||||
"ANIM_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_STATUS_ITEM) {
|
if (dwFlags & MCI_STATUS_ITEM) {
|
||||||
switch(lpParms->dwItem) {
|
switch(lpParms->dwItem) {
|
||||||
case MCI_STATUS_CURRENT_TRACK:
|
case MCI_STATUS_CURRENT_TRACK:
|
||||||
lpParms->dwReturn = AnimDev[index].nCurTrack;
|
lpParms->dwReturn = AnimDev[wDevID].nCurTrack;
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
|
dprintf_mcianim(stddeb,"ANIM_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_LENGTH:
|
case MCI_STATUS_LENGTH:
|
||||||
if (dwFlags & MCI_TRACK) {
|
if (dwFlags & MCI_TRACK) {
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n",
|
dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n",
|
||||||
lpParms->dwTrack);
|
lpParms->dwTrack);
|
||||||
if (lpParms->dwTrack > AnimDev[index].nTracks)
|
if (lpParms->dwTrack > AnimDev[wDevID].nTracks)
|
||||||
return MCIERR_OUTOFRANGE;
|
return MCIERR_OUTOFRANGE;
|
||||||
lpParms->dwReturn = AnimDev[index].lpdwTrackLen[lpParms->dwTrack];
|
lpParms->dwReturn = AnimDev[wDevID].lpdwTrackLen[lpParms->dwTrack];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lpParms->dwReturn = AnimDev[index].dwTotalLen;
|
lpParms->dwReturn = AnimDev[wDevID].dwTotalLen;
|
||||||
lpParms->dwReturn = ANIM_CalcTime(wDevID,
|
lpParms->dwReturn = ANIM_CalcTime(wDevID,
|
||||||
AnimDev[index].dwTimeFormat, lpParms->dwReturn);
|
AnimDev[wDevID].dwTimeFormat, lpParms->dwReturn);
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn);
|
dprintf_mcianim(stddeb,"ANIM_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_MODE:
|
case MCI_STATUS_MODE:
|
||||||
lpParms->dwReturn = AnimDev[index].mode;
|
lpParms->dwReturn = AnimDev[wDevID].mode;
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_MODE=%08lX !\n",
|
dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_MODE=%08lX !\n",
|
||||||
lpParms->dwReturn);
|
lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -371,19 +364,19 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
|
||||||
if (lpParms->dwReturn == (WORD)-1) return MCIERR_INTERNAL;
|
if (lpParms->dwReturn == (WORD)-1) return MCIERR_INTERNAL;
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_POSITION:
|
case MCI_STATUS_POSITION:
|
||||||
lpParms->dwReturn = AnimDev[index].dwCurFrame;
|
lpParms->dwReturn = AnimDev[wDevID].dwCurFrame;
|
||||||
if (dwFlags & MCI_STATUS_START) {
|
if (dwFlags & MCI_STATUS_START) {
|
||||||
lpParms->dwReturn = 0;
|
lpParms->dwReturn = 0;
|
||||||
dprintf_mcianim(stddeb,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n");
|
dprintf_mcianim(stddeb,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n");
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_TRACK) {
|
if (dwFlags & MCI_TRACK) {
|
||||||
if (lpParms->dwTrack > AnimDev[index].nTracks)
|
if (lpParms->dwTrack > AnimDev[wDevID].nTracks)
|
||||||
return MCIERR_OUTOFRANGE;
|
return MCIERR_OUTOFRANGE;
|
||||||
lpParms->dwReturn = AnimDev[index].lpdwTrackPos[lpParms->dwTrack - 1];
|
lpParms->dwReturn = AnimDev[wDevID].lpdwTrackPos[lpParms->dwTrack - 1];
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack);
|
dprintf_mcianim(stddeb,"ANIM_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack);
|
||||||
}
|
}
|
||||||
lpParms->dwReturn = ANIM_CalcTime(wDevID,
|
lpParms->dwReturn = ANIM_CalcTime(wDevID,
|
||||||
AnimDev[index].dwTimeFormat, lpParms->dwReturn);
|
AnimDev[wDevID].dwTimeFormat, lpParms->dwReturn);
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_POSITION=%08lX !\n",
|
dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_POSITION=%08lX !\n",
|
||||||
lpParms->dwReturn);
|
lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -414,33 +407,32 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
|
||||||
static DWORD ANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
static DWORD ANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int start, end;
|
int start, end;
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciPlay(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciPlay(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
start = 0; end = AnimDev[index].dwTotalLen;
|
start = 0; end = AnimDev[wDevID].dwTotalLen;
|
||||||
AnimDev[index].nCurTrack = 1;
|
AnimDev[wDevID].nCurTrack = 1;
|
||||||
if (dwFlags & MCI_FROM) {
|
if (dwFlags & MCI_FROM) {
|
||||||
start = ANIM_CalcFrame(wDevID,
|
start = ANIM_CalcFrame(wDevID,
|
||||||
AnimDev[index].dwTimeFormat, lpParms->dwFrom);
|
AnimDev[wDevID].dwTimeFormat, lpParms->dwFrom);
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciPlay // MCI_FROM=%08lX -> %u \n",
|
dprintf_mcianim(stddeb,"ANIM_mciPlay // MCI_FROM=%08lX -> %u \n",
|
||||||
lpParms->dwFrom, start);
|
lpParms->dwFrom, start);
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_TO) {
|
if (dwFlags & MCI_TO) {
|
||||||
end = ANIM_CalcFrame(wDevID,
|
end = ANIM_CalcFrame(wDevID,
|
||||||
AnimDev[index].dwTimeFormat, lpParms->dwTo);
|
AnimDev[wDevID].dwTimeFormat, lpParms->dwTo);
|
||||||
dprintf_mcianim(stddeb,
|
dprintf_mcianim(stddeb,
|
||||||
"ANIM_mciPlay // MCI_TO=%08lX -> %u \n",
|
"ANIM_mciPlay // MCI_TO=%08lX -> %u \n",
|
||||||
lpParms->dwTo, end);
|
lpParms->dwTo, end);
|
||||||
}
|
}
|
||||||
AnimDev[index].mode = MCI_MODE_PLAY;
|
AnimDev[wDevID].mode = MCI_MODE_PLAY;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mcianim(stddeb,
|
dprintf_mcianim(stddeb,
|
||||||
"ANIM_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -454,17 +446,16 @@ static DWORD ANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
static DWORD ANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD ANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciStop(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciStop(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
AnimDev[index].mode = MCI_MODE_STOP;
|
AnimDev[wDevID].mode = MCI_MODE_STOP;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mcianim(stddeb,
|
dprintf_mcianim(stddeb,
|
||||||
"ANIM_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -478,17 +469,16 @@ static DWORD ANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa
|
||||||
static DWORD ANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD ANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciPause(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciPause(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
AnimDev[index].mode = MCI_MODE_PAUSE;
|
AnimDev[wDevID].mode = MCI_MODE_PAUSE;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mcianim(stddeb,
|
dprintf_mcianim(stddeb,
|
||||||
"ANIM_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -502,17 +492,16 @@ static DWORD ANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
|
||||||
static DWORD ANIM_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD ANIM_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciResume(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciResume(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
AnimDev[index].mode = MCI_MODE_STOP;
|
AnimDev[wDevID].mode = MCI_MODE_STOP;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_mcianim(stddeb,
|
dprintf_mcianim(stddeb,
|
||||||
"ANIM_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -526,19 +515,18 @@ static DWORD ANIM_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp
|
||||||
static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
|
static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
MCI_PLAY_PARMS PlayParms;
|
MCI_PLAY_PARMS PlayParms;
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciSeek(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciSeek(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
AnimDev[index].mode = MCI_MODE_SEEK;
|
AnimDev[wDevID].mode = MCI_MODE_SEEK;
|
||||||
switch(dwFlags) {
|
switch(dwFlags) {
|
||||||
case MCI_SEEK_TO_START:
|
case MCI_SEEK_TO_START:
|
||||||
PlayParms.dwFrom = 0;
|
PlayParms.dwFrom = 0;
|
||||||
break;
|
break;
|
||||||
case MCI_SEEK_TO_END:
|
case MCI_SEEK_TO_END:
|
||||||
PlayParms.dwFrom = AnimDev[index].dwTotalLen;
|
PlayParms.dwFrom = AnimDev[wDevID].dwTotalLen;
|
||||||
break;
|
break;
|
||||||
case MCI_TO:
|
case MCI_TO:
|
||||||
PlayParms.dwFrom = lpParms->dwTo;
|
PlayParms.dwFrom = lpParms->dwTo;
|
||||||
|
@ -552,7 +540,7 @@ static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
|
||||||
"ANIM_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return dwRet;
|
return dwRet;
|
||||||
#else
|
#else
|
||||||
|
@ -567,7 +555,6 @@ static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
|
||||||
static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_mcianim(stddeb,"ANIM_mciSet(%u, %08lX, %p);\n",
|
dprintf_mcianim(stddeb,"ANIM_mciSet(%u, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
@ -591,7 +578,7 @@ static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
||||||
fprintf(stderr,"ANIM_mciSet // bad time format !\n");
|
fprintf(stderr,"ANIM_mciSet // bad time format !\n");
|
||||||
return MCIERR_BAD_TIME_FORMAT;
|
return MCIERR_BAD_TIME_FORMAT;
|
||||||
}
|
}
|
||||||
AnimDev[index].dwTimeFormat = lpParms->dwTimeFormat;
|
AnimDev[wDevID].dwTimeFormat = lpParms->dwTimeFormat;
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION;
|
if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION;
|
||||||
if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
|
if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
|
||||||
|
@ -601,7 +588,7 @@ static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
||||||
"ANIM_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"ANIM_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
AnimDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
#include <sys/cdio.h>
|
#include <sys/cdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int MMSYSTEM_DevIDToIndex(UINT16);
|
|
||||||
|
|
||||||
#define SOUND_DEV "/dev/dsp"
|
#define SOUND_DEV "/dev/dsp"
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#define CDAUDIO_DEV "/dev/rcd0c"
|
#define CDAUDIO_DEV "/dev/rcd0c"
|
||||||
|
@ -40,7 +38,7 @@ int MMSYSTEM_DevIDToIndex(UINT16);
|
||||||
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
|
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_CDAUDIODRV 2
|
#define MAX_CDAUDIODRV (1)
|
||||||
#define MAX_CDAUDIO_TRACKS 256
|
#define MAX_CDAUDIO_TRACKS 256
|
||||||
|
|
||||||
#define CDFRAMES_PERSEC 75
|
#define CDFRAMES_PERSEC 75
|
||||||
|
@ -84,14 +82,14 @@ static LINUX_CDAUDIO CDADev[MAX_CDAUDIODRV];
|
||||||
static UINT16 CDAUDIO_GetNumberOfTracks(UINT16 wDevID)
|
static UINT16 CDAUDIO_GetNumberOfTracks(UINT16 wDevID)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
struct cdrom_tochdr hdr;
|
struct cdrom_tochdr hdr;
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
struct ioc_toc_header hdr;
|
struct ioc_toc_header hdr;
|
||||||
#endif
|
#endif
|
||||||
if (CDADev[index].nTracks == 0) {
|
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (CDADev[wDevID].nTracks == 0) {
|
||||||
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMREADTOCHDR
|
CDROMREADTOCHDR
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
|
@ -104,12 +102,12 @@ static UINT16 CDAUDIO_GetNumberOfTracks(UINT16 wDevID)
|
||||||
return (WORD)-1;
|
return (WORD)-1;
|
||||||
}
|
}
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDADev[index].nTracks = hdr.cdth_trk1;
|
CDADev[wDevID].nTracks = hdr.cdth_trk1;
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDADev[index].nTracks = hdr.ending_track - hdr.starting_track + 1;
|
CDADev[wDevID].nTracks = hdr.ending_track - hdr.starting_track + 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return CDADev[index].nTracks;
|
return CDADev[wDevID].nTracks;
|
||||||
#else
|
#else
|
||||||
return (WORD)-1;
|
return (WORD)-1;
|
||||||
#endif
|
#endif
|
||||||
|
@ -122,7 +120,6 @@ static UINT16 CDAUDIO_GetNumberOfTracks(UINT16 wDevID)
|
||||||
static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID)
|
static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int i, length;
|
int i, length;
|
||||||
int start, last_start = 0;
|
int start, last_start = 0;
|
||||||
int total_length = 0;
|
int total_length = 0;
|
||||||
|
@ -132,31 +129,32 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID)
|
||||||
struct ioc_read_toc_entry entry;
|
struct ioc_read_toc_entry entry;
|
||||||
struct cd_toc_entry toc_buffer;
|
struct cd_toc_entry toc_buffer;
|
||||||
#endif
|
#endif
|
||||||
if (CDADev[index].nTracks == 0) {
|
|
||||||
|
if (CDADev[wDevID].nTracks == 0) {
|
||||||
if (CDAUDIO_GetNumberOfTracks(wDevID) == (WORD)-1) return FALSE;
|
if (CDAUDIO_GetNumberOfTracks(wDevID) == (WORD)-1) return FALSE;
|
||||||
}
|
}
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // nTracks=%u\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // nTracks=%u\n",
|
||||||
CDADev[index].nTracks);
|
CDADev[wDevID].nTracks);
|
||||||
if (CDADev[index].lpdwTrackLen != NULL)
|
if (CDADev[wDevID].lpdwTrackLen != NULL)
|
||||||
free(CDADev[index].lpdwTrackLen);
|
free(CDADev[wDevID].lpdwTrackLen);
|
||||||
CDADev[index].lpdwTrackLen = (LPDWORD)malloc(
|
CDADev[wDevID].lpdwTrackLen = (LPDWORD)malloc(
|
||||||
(CDADev[index].nTracks + 1) * sizeof(DWORD));
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
||||||
if (CDADev[index].lpdwTrackPos != NULL)
|
if (CDADev[wDevID].lpdwTrackPos != NULL)
|
||||||
free(CDADev[index].lpdwTrackPos);
|
free(CDADev[wDevID].lpdwTrackPos);
|
||||||
CDADev[index].lpdwTrackPos = (LPDWORD)malloc(
|
CDADev[wDevID].lpdwTrackPos = (LPDWORD)malloc(
|
||||||
(CDADev[index].nTracks + 1) * sizeof(DWORD));
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
||||||
if (CDADev[index].lpdwTrackLen == NULL ||
|
if (CDADev[wDevID].lpdwTrackLen == NULL ||
|
||||||
CDADev[index].lpdwTrackPos == NULL) {
|
CDADev[wDevID].lpdwTrackPos == NULL) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_GetTracksInfo // error allocating track table !\n");
|
"CDAUDIO_GetTracksInfo // error allocating track table !\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
memset(CDADev[index].lpdwTrackLen, 0,
|
memset(CDADev[wDevID].lpdwTrackLen, 0,
|
||||||
(CDADev[index].nTracks + 1) * sizeof(DWORD));
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
||||||
memset(CDADev[index].lpdwTrackPos, 0,
|
memset(CDADev[wDevID].lpdwTrackPos, 0,
|
||||||
(CDADev[index].nTracks + 1) * sizeof(DWORD));
|
(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
|
||||||
for (i = 0; i <= CDADev[index].nTracks; i++) {
|
for (i = 0; i <= CDADev[wDevID].nTracks; i++) {
|
||||||
if (i == CDADev[index].nTracks)
|
if (i == CDADev[wDevID].nTracks)
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
entry.cdte_track = CDROM_LEADOUT;
|
entry.cdte_track = CDROM_LEADOUT;
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
|
@ -177,7 +175,7 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID)
|
||||||
entry.data_len = sizeof(toc_buffer);
|
entry.data_len = sizeof(toc_buffer);
|
||||||
entry.data = &toc_buffer;
|
entry.data = &toc_buffer;
|
||||||
#endif
|
#endif
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMREADTOCENTRY
|
CDROMREADTOCENTRY
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
|
@ -199,7 +197,7 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID)
|
||||||
#endif
|
#endif
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
last_start = start;
|
last_start = start;
|
||||||
CDADev[index].dwFirstOffset = start;
|
CDADev[wDevID].dwFirstOffset = start;
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_GetTracksInfo // dwFirstOffset=%u\n",
|
"CDAUDIO_GetTracksInfo // dwFirstOffset=%u\n",
|
||||||
start);
|
start);
|
||||||
|
@ -209,17 +207,16 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID)
|
||||||
last_start = start;
|
last_start = start;
|
||||||
start = last_start - length;
|
start = last_start - length;
|
||||||
total_length += length;
|
total_length += length;
|
||||||
CDADev[index].lpdwTrackLen[i - 1] = length;
|
CDADev[wDevID].lpdwTrackLen[i - 1] = length;
|
||||||
CDADev[index].lpdwTrackPos[i - 1] = start;
|
CDADev[wDevID].lpdwTrackPos[i - 1] = start;
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_GetTracksInfo // track #%u start=%u len=%u\n",
|
"CDAUDIO_GetTracksInfo // track #%u start=%u len=%u\n",
|
||||||
i, start, length);
|
i, start, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CDADev[index].dwTotalLen = total_length;
|
CDADev[wDevID].dwTotalLen = total_length;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // total_len=%u\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // total_len=%u\n",
|
||||||
total_length);
|
total_length);
|
||||||
fflush(stdout);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -233,46 +230,42 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID)
|
||||||
static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
|
static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index;
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
|
||||||
wDevID = lpParms->wDeviceID;
|
if (CDADev[wDevID].nUseCount > 0) {
|
||||||
index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
|
|
||||||
if (CDADev[index].nUseCount > 0) {
|
|
||||||
/* The driver already open on this channel */
|
/* The driver already open on this channel */
|
||||||
/* If the driver was opened shareable before and this open specifies */
|
/* If the driver was opened shareable before and this open specifies */
|
||||||
/* shareable then increment the use count */
|
/* shareable then increment the use count */
|
||||||
if (CDADev[index].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
if (CDADev[wDevID].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
||||||
++CDADev[index].nUseCount;
|
++CDADev[wDevID].nUseCount;
|
||||||
else
|
else
|
||||||
return MCIERR_MUST_USE_SHAREABLE;
|
return MCIERR_MUST_USE_SHAREABLE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CDADev[index].nUseCount = 1;
|
CDADev[wDevID].nUseCount = 1;
|
||||||
CDADev[index].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
CDADev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_OPEN_ELEMENT) {
|
if (dwFlags & MCI_OPEN_ELEMENT) {
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // MCI_OPEN_ELEMENT !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // MCI_OPEN_ELEMENT !\n");
|
||||||
/* return MCIERR_NO_ELEMENT_ALLOWED; */
|
/* return MCIERR_NO_ELEMENT_ALLOWED; */
|
||||||
}
|
}
|
||||||
memcpy(&CDADev[index].openParms, lpParms, sizeof(MCI_OPEN_PARMS));
|
memcpy(&CDADev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS));
|
||||||
CDADev[index].wNotifyDeviceID = lpParms->wDeviceID;
|
CDADev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
|
||||||
CDADev[index].unixdev = open (CDAUDIO_DEV, O_RDONLY, 0);
|
CDADev[wDevID].unixdev = open (CDAUDIO_DEV, O_RDONLY, 0);
|
||||||
if (CDADev[index].unixdev == -1) {
|
if (CDADev[wDevID].unixdev == -1) {
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // can't open '%s' !\n", CDAUDIO_DEV);
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // can't open '%s' !\n", CDAUDIO_DEV);
|
||||||
return MCIERR_HARDWARE;
|
return MCIERR_HARDWARE;
|
||||||
}
|
}
|
||||||
CDADev[index].mode = 0;
|
CDADev[wDevID].mode = 0;
|
||||||
CDADev[index].dwTimeFormat = MCI_FORMAT_TMSF;
|
CDADev[wDevID].dwTimeFormat = MCI_FORMAT_TMSF;
|
||||||
CDADev[index].nCurTrack = 0;
|
CDADev[wDevID].nCurTrack = 0;
|
||||||
CDADev[index].nTracks = 0;
|
CDADev[wDevID].nTracks = 0;
|
||||||
CDADev[index].dwTotalLen = 0;
|
CDADev[wDevID].dwTotalLen = 0;
|
||||||
CDADev[index].dwFirstOffset = 0;
|
CDADev[wDevID].dwFirstOffset = 0;
|
||||||
CDADev[index].lpdwTrackLen = NULL;
|
CDADev[wDevID].lpdwTrackLen = NULL;
|
||||||
CDADev[index].lpdwTrackPos = NULL;
|
CDADev[wDevID].lpdwTrackPos = NULL;
|
||||||
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // error reading TracksInfo !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // error reading TracksInfo !\n");
|
||||||
/* return MCIERR_INTERNAL; */
|
/* return MCIERR_INTERNAL; */
|
||||||
|
@ -282,7 +275,7 @@ static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpPa
|
||||||
"CDAUDIO_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -296,12 +289,11 @@ static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpPa
|
||||||
static DWORD CDAUDIO_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD CDAUDIO_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciClose(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciClose(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwParam, lpParms);
|
wDevID, dwParam, lpParms);
|
||||||
if (CDADev[index].lpdwTrackLen != NULL) free(CDADev[index].lpdwTrackLen);
|
if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen);
|
||||||
if (CDADev[index].lpdwTrackPos != NULL) free(CDADev[index].lpdwTrackPos);
|
if (CDADev[wDevID].lpdwTrackPos != NULL) free(CDADev[wDevID].lpdwTrackPos);
|
||||||
close(CDADev[index].unixdev);
|
close(CDADev[wDevID].unixdev);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -396,7 +388,6 @@ static DWORD CDAUDIO_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime)
|
||||||
{
|
{
|
||||||
DWORD dwFrame = 0;
|
DWORD dwFrame = 0;
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
UINT16 wTrack;
|
UINT16 wTrack;
|
||||||
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_CalcFrame(%04X, %08lX, %lu);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_CalcFrame(%04X, %08lX, %lu);\n",
|
||||||
|
@ -429,8 +420,8 @@ static DWORD CDAUDIO_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime)
|
||||||
MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
|
MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_CalcFrame // TMSF trackpos[%u]=%lu\n",
|
"CDAUDIO_CalcFrame // TMSF trackpos[%u]=%lu\n",
|
||||||
wTrack, CDADev[index].lpdwTrackPos[wTrack - 1]);
|
wTrack, CDADev[wDevID].lpdwTrackPos[wTrack - 1]);
|
||||||
dwFrame = CDADev[index].lpdwTrackPos[wTrack - 1];
|
dwFrame = CDADev[wDevID].lpdwTrackPos[wTrack - 1];
|
||||||
dwFrame += CDFRAMES_PERMIN * MCI_TMSF_MINUTE(dwTime);
|
dwFrame += CDFRAMES_PERMIN * MCI_TMSF_MINUTE(dwTime);
|
||||||
dwFrame += CDFRAMES_PERSEC * MCI_TMSF_SECOND(dwTime);
|
dwFrame += CDFRAMES_PERSEC * MCI_TMSF_SECOND(dwTime);
|
||||||
dwFrame += MCI_TMSF_FRAME(dwTime);
|
dwFrame += MCI_TMSF_FRAME(dwTime);
|
||||||
|
@ -447,35 +438,34 @@ static DWORD CDAUDIO_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime)
|
||||||
static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID)
|
static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
int oldmode = CDADev[wDevID].mode;
|
||||||
int oldmode = CDADev[index].mode;
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
struct ioc_read_subchannel read_sc;
|
struct ioc_read_subchannel read_sc;
|
||||||
|
|
||||||
read_sc.address_format = CD_MSF_FORMAT;
|
read_sc.address_format = CD_MSF_FORMAT;
|
||||||
read_sc.data_format = CD_CURRENT_POSITION;
|
read_sc.data_format = CD_CURRENT_POSITION;
|
||||||
read_sc.track = 0;
|
read_sc.track = 0;
|
||||||
read_sc.data_len = sizeof(CDADev[index].sc);
|
read_sc.data_len = sizeof(CDADev[wDevID].sc);
|
||||||
read_sc.data = (struct cd_sub_channel_info *)&CDADev[index].sc;
|
read_sc.data = (struct cd_sub_channel_info *)&CDADev[wDevID].sc;
|
||||||
#elif linux
|
#elif linux
|
||||||
CDADev[index].sc.cdsc_format = CDROM_MSF;
|
CDADev[wDevID].sc.cdsc_format = CDROM_MSF;
|
||||||
#endif
|
#endif
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMSUBCHNL, &CDADev[index].sc
|
CDROMSUBCHNL, &CDADev[wDevID].sc
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDIOCREADSUBCHANNEL, &read_sc
|
CDIOCREADSUBCHANNEL, &read_sc
|
||||||
#endif
|
#endif
|
||||||
)) {
|
)) {
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // opened or no_media !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // opened or no_media !\n");
|
||||||
CDADev[index].mode = MCI_MODE_NOT_READY;
|
CDADev[wDevID].mode = MCI_MODE_NOT_READY;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
switch (
|
switch (
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDADev[index].sc.cdsc_audiostatus
|
CDADev[wDevID].sc.cdsc_audiostatus
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDADev[index].sc.header.audio_status
|
CDADev[wDevID].sc.header.audio_status
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
|
@ -485,9 +475,9 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID)
|
||||||
#endif
|
#endif
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // device doesn't support status, returning NOT_READY.\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // device doesn't support status, returning NOT_READY.\n");
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDADev[index].mode = MCI_MODE_NOT_READY;
|
CDADev[wDevID].mode = MCI_MODE_NOT_READY;
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDADev[index].mode = MCI_MODE_STOP;
|
CDADev[wDevID].mode = MCI_MODE_STOP;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
|
@ -495,7 +485,7 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID)
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
case CD_AS_NO_STATUS:
|
case CD_AS_NO_STATUS:
|
||||||
#endif
|
#endif
|
||||||
CDADev[index].mode = MCI_MODE_STOP;
|
CDADev[wDevID].mode = MCI_MODE_STOP;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_STOP !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_STOP !\n");
|
||||||
break;
|
break;
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
|
@ -503,7 +493,7 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID)
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
case CD_AS_PLAY_IN_PROGRESS:
|
case CD_AS_PLAY_IN_PROGRESS:
|
||||||
#endif
|
#endif
|
||||||
CDADev[index].mode = MCI_MODE_PLAY;
|
CDADev[wDevID].mode = MCI_MODE_PLAY;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PLAY !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PLAY !\n");
|
||||||
break;
|
break;
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
|
@ -511,45 +501,45 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID)
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
case CD_AS_PLAY_PAUSED:
|
case CD_AS_PLAY_PAUSED:
|
||||||
#endif
|
#endif
|
||||||
CDADev[index].mode = MCI_MODE_PAUSE;
|
CDADev[wDevID].mode = MCI_MODE_PAUSE;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PAUSE !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PAUSE !\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // status=%02X !\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // status=%02X !\n",
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDADev[index].sc.cdsc_audiostatus
|
CDADev[wDevID].sc.cdsc_audiostatus
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDADev[index].sc.header.audio_status
|
CDADev[wDevID].sc.header.audio_status
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDADev[index].nCurTrack = CDADev[index].sc.cdsc_trk;
|
CDADev[wDevID].nCurTrack = CDADev[wDevID].sc.cdsc_trk;
|
||||||
CDADev[index].dwCurFrame =
|
CDADev[wDevID].dwCurFrame =
|
||||||
CDFRAMES_PERMIN * CDADev[index].sc.cdsc_absaddr.msf.minute +
|
CDFRAMES_PERMIN * CDADev[wDevID].sc.cdsc_absaddr.msf.minute +
|
||||||
CDFRAMES_PERSEC * CDADev[index].sc.cdsc_absaddr.msf.second +
|
CDFRAMES_PERSEC * CDADev[wDevID].sc.cdsc_absaddr.msf.second +
|
||||||
CDADev[index].sc.cdsc_absaddr.msf.frame;
|
CDADev[wDevID].sc.cdsc_absaddr.msf.frame;
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDADev[index].nCurTrack = CDADev[index].sc.what.position.track_number;
|
CDADev[wDevID].nCurTrack = CDADev[wDevID].sc.what.position.track_number;
|
||||||
CDADev[index].dwCurFrame =
|
CDADev[wDevID].dwCurFrame =
|
||||||
CDFRAMES_PERMIN * CDADev[index].sc.what.position.absaddr.msf.minute +
|
CDFRAMES_PERMIN * CDADev[wDevID].sc.what.position.absaddr.msf.minute +
|
||||||
CDFRAMES_PERSEC * CDADev[index].sc.what.position.absaddr.msf.second +
|
CDFRAMES_PERSEC * CDADev[wDevID].sc.what.position.absaddr.msf.second +
|
||||||
CDADev[index].sc.what.position.absaddr.msf.frame;
|
CDADev[wDevID].sc.what.position.absaddr.msf.frame;
|
||||||
#endif
|
#endif
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n",
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDADev[index].sc.cdsc_trk,
|
CDADev[wDevID].sc.cdsc_trk,
|
||||||
CDADev[index].sc.cdsc_absaddr.msf.minute,
|
CDADev[wDevID].sc.cdsc_absaddr.msf.minute,
|
||||||
CDADev[index].sc.cdsc_absaddr.msf.second,
|
CDADev[wDevID].sc.cdsc_absaddr.msf.second,
|
||||||
CDADev[index].sc.cdsc_absaddr.msf.frame
|
CDADev[wDevID].sc.cdsc_absaddr.msf.frame
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDADev[index].sc.what.position.track_number,
|
CDADev[wDevID].sc.what.position.track_number,
|
||||||
CDADev[index].sc.what.position.absaddr.msf.minute,
|
CDADev[wDevID].sc.what.position.absaddr.msf.minute,
|
||||||
CDADev[index].sc.what.position.absaddr.msf.second,
|
CDADev[wDevID].sc.what.position.absaddr.msf.second,
|
||||||
CDADev[index].sc.what.position.absaddr.msf.frame
|
CDADev[wDevID].sc.what.position.absaddr.msf.frame
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
if (oldmode != CDADev[index].mode && oldmode == MCI_MODE_OPEN) {
|
if (oldmode != CDADev[wDevID].mode && oldmode == MCI_MODE_OPEN) {
|
||||||
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // error updating TracksInfo !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // error updating TracksInfo !\n");
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
|
@ -569,11 +559,11 @@ static DWORD CDAUDIO_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame)
|
||||||
{
|
{
|
||||||
DWORD dwTime = 0;
|
DWORD dwTime = 0;
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
UINT16 wTrack;
|
UINT16 wTrack;
|
||||||
UINT16 wMinutes;
|
UINT16 wMinutes;
|
||||||
UINT16 wSeconds;
|
UINT16 wSeconds;
|
||||||
UINT16 wFrames;
|
UINT16 wFrames;
|
||||||
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_CalcTime(%04X, %08lX, %lu);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_CalcTime(%04X, %08lX, %lu);\n",
|
||||||
wDevID, dwFormatType, dwFrame);
|
wDevID, dwFormatType, dwFrame);
|
||||||
|
|
||||||
|
@ -597,11 +587,11 @@ static DWORD CDAUDIO_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame)
|
||||||
/* unknown format ! force TMSF ! ... */
|
/* unknown format ! force TMSF ! ... */
|
||||||
dwFormatType = MCI_FORMAT_TMSF;
|
dwFormatType = MCI_FORMAT_TMSF;
|
||||||
case MCI_FORMAT_TMSF:
|
case MCI_FORMAT_TMSF:
|
||||||
for (wTrack = 0; wTrack < CDADev[index].nTracks; wTrack++) {
|
for (wTrack = 0; wTrack < CDADev[wDevID].nTracks; wTrack++) {
|
||||||
/* dwTime += CDADev[index].lpdwTrackLen[wTrack - 1];
|
/* dwTime += CDADev[wDevID].lpdwTrackLen[wTrack - 1];
|
||||||
printf("Adding trk#%u curpos=%u \n", dwTime);
|
printf("Adding trk#%u curpos=%u \n", dwTime);
|
||||||
if (dwTime >= dwFrame) break; */
|
if (dwTime >= dwFrame) break; */
|
||||||
if (CDADev[index].lpdwTrackPos[wTrack - 1] >= dwFrame) break;
|
if (CDADev[wDevID].lpdwTrackPos[wTrack - 1] >= dwFrame) break;
|
||||||
}
|
}
|
||||||
wMinutes = dwFrame / CDFRAMES_PERMIN;
|
wMinutes = dwFrame / CDFRAMES_PERMIN;
|
||||||
wSeconds = (dwFrame - CDFRAMES_PERMIN * wMinutes) / CDFRAMES_PERSEC;
|
wSeconds = (dwFrame - CDFRAMES_PERMIN * wMinutes) / CDFRAMES_PERSEC;
|
||||||
|
@ -624,27 +614,26 @@ static DWORD CDAUDIO_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame)
|
||||||
static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (CDADev[index].unixdev == 0) return MMSYSERR_NOTENABLED;
|
if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_STATUS_ITEM) {
|
if (dwFlags & MCI_STATUS_ITEM) {
|
||||||
switch(lpParms->dwItem) {
|
switch(lpParms->dwItem) {
|
||||||
case MCI_STATUS_CURRENT_TRACK:
|
case MCI_STATUS_CURRENT_TRACK:
|
||||||
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
||||||
lpParms->dwReturn = CDADev[index].nCurTrack;
|
lpParms->dwReturn = CDADev[wDevID].nCurTrack;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_LENGTH:
|
case MCI_STATUS_LENGTH:
|
||||||
if (CDADev[index].nTracks == 0) {
|
if (CDADev[wDevID].nTracks == 0) {
|
||||||
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
if (!CDAUDIO_GetTracksInfo(wDevID)) {
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // error reading TracksInfo !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // error reading TracksInfo !\n");
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
|
@ -653,24 +642,24 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
|
||||||
if (dwFlags & MCI_TRACK) {
|
if (dwFlags & MCI_TRACK) {
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n",
|
||||||
lpParms->dwTrack);
|
lpParms->dwTrack);
|
||||||
if (lpParms->dwTrack > CDADev[index].nTracks)
|
if (lpParms->dwTrack > CDADev[wDevID].nTracks)
|
||||||
return MCIERR_OUTOFRANGE;
|
return MCIERR_OUTOFRANGE;
|
||||||
lpParms->dwReturn = CDADev[index].lpdwTrackLen[lpParms->dwTrack];
|
lpParms->dwReturn = CDADev[wDevID].lpdwTrackLen[lpParms->dwTrack];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lpParms->dwReturn = CDADev[index].dwTotalLen;
|
lpParms->dwReturn = CDADev[wDevID].dwTotalLen;
|
||||||
lpParms->dwReturn = CDAUDIO_CalcTime(wDevID,
|
lpParms->dwReturn = CDAUDIO_CalcTime(wDevID,
|
||||||
CDADev[index].dwTimeFormat, lpParms->dwReturn);
|
CDADev[wDevID].dwTimeFormat, lpParms->dwReturn);
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn);
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_MODE:
|
case MCI_STATUS_MODE:
|
||||||
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
||||||
lpParms->dwReturn = CDADev[index].mode;
|
lpParms->dwReturn = CDADev[wDevID].mode;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_MODE=%08lX !\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_MODE=%08lX !\n",
|
||||||
lpParms->dwReturn);
|
lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_MEDIA_PRESENT:
|
case MCI_STATUS_MEDIA_PRESENT:
|
||||||
lpParms->dwReturn = (CDADev[index].nTracks > 0) ? TRUE : FALSE;
|
lpParms->dwReturn = (CDADev[wDevID].nTracks > 0) ? TRUE : FALSE;
|
||||||
if (lpParms->dwReturn == FALSE)
|
if (lpParms->dwReturn == FALSE)
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MEDIA_NOT_PRESENT !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MEDIA_NOT_PRESENT !\n");
|
||||||
else
|
else
|
||||||
|
@ -684,19 +673,19 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_POSITION:
|
case MCI_STATUS_POSITION:
|
||||||
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
|
||||||
lpParms->dwReturn = CDADev[index].dwCurFrame;
|
lpParms->dwReturn = CDADev[wDevID].dwCurFrame;
|
||||||
if (dwFlags & MCI_STATUS_START) {
|
if (dwFlags & MCI_STATUS_START) {
|
||||||
lpParms->dwReturn = CDADev[index].dwFirstOffset;
|
lpParms->dwReturn = CDADev[wDevID].dwFirstOffset;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n");
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_TRACK) {
|
if (dwFlags & MCI_TRACK) {
|
||||||
if (lpParms->dwTrack > CDADev[index].nTracks)
|
if (lpParms->dwTrack > CDADev[wDevID].nTracks)
|
||||||
return MCIERR_OUTOFRANGE;
|
return MCIERR_OUTOFRANGE;
|
||||||
lpParms->dwReturn = CDADev[index].lpdwTrackPos[lpParms->dwTrack - 1];
|
lpParms->dwReturn = CDADev[wDevID].lpdwTrackPos[lpParms->dwTrack - 1];
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack);
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack);
|
||||||
}
|
}
|
||||||
lpParms->dwReturn = CDAUDIO_CalcTime(wDevID,
|
lpParms->dwReturn = CDAUDIO_CalcTime(wDevID,
|
||||||
CDADev[index].dwTimeFormat, lpParms->dwReturn);
|
CDADev[wDevID].dwTimeFormat, lpParms->dwReturn);
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_POSITION=%08lX !\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_POSITION=%08lX !\n",
|
||||||
lpParms->dwReturn);
|
lpParms->dwReturn);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -706,7 +695,7 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
|
||||||
return 0;
|
return 0;
|
||||||
case MCI_STATUS_TIME_FORMAT:
|
case MCI_STATUS_TIME_FORMAT:
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_TIME_FORMAT !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_TIME_FORMAT !\n");
|
||||||
lpParms->dwReturn = CDADev[index].dwTimeFormat;
|
lpParms->dwReturn = CDADev[wDevID].dwTimeFormat;
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // unknown command %08lX !\n", lpParms->dwItem);
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // unknown command %08lX !\n", lpParms->dwItem);
|
||||||
|
@ -727,34 +716,34 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
|
||||||
static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int start, end;
|
int start, end;
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
struct cdrom_msf msf;
|
struct cdrom_msf msf;
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
struct ioc_play_msf msf;
|
struct ioc_play_msf msf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (CDADev[index].unixdev == 0) return MMSYSERR_NOTENABLED;
|
if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED;
|
||||||
start = 0; end = CDADev[index].dwTotalLen;
|
start = 0; end = CDADev[wDevID].dwTotalLen;
|
||||||
CDADev[index].nCurTrack = 1;
|
CDADev[wDevID].nCurTrack = 1;
|
||||||
if (dwFlags & MCI_FROM) {
|
if (dwFlags & MCI_FROM) {
|
||||||
start = CDAUDIO_CalcFrame(wDevID,
|
start = CDAUDIO_CalcFrame(wDevID,
|
||||||
CDADev[index].dwTimeFormat, lpParms->dwFrom);
|
CDADev[wDevID].dwTimeFormat, lpParms->dwFrom);
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // MCI_FROM=%08lX -> %u \n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // MCI_FROM=%08lX -> %u \n",
|
||||||
lpParms->dwFrom, start);
|
lpParms->dwFrom, start);
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_TO) {
|
if (dwFlags & MCI_TO) {
|
||||||
end = CDAUDIO_CalcFrame(wDevID,
|
end = CDAUDIO_CalcFrame(wDevID,
|
||||||
CDADev[index].dwTimeFormat, lpParms->dwTo);
|
CDADev[wDevID].dwTimeFormat, lpParms->dwTo);
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciPlay // MCI_TO=%08lX -> %u \n",
|
"CDAUDIO_mciPlay // MCI_TO=%08lX -> %u \n",
|
||||||
lpParms->dwTo, end);
|
lpParms->dwTo, end);
|
||||||
}
|
}
|
||||||
start += CDADev[index].dwFirstOffset;
|
start += CDADev[wDevID].dwFirstOffset;
|
||||||
end += CDADev[index].dwFirstOffset;
|
end += CDADev[wDevID].dwFirstOffset;
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
msf.cdmsf_min0 = start / CDFRAMES_PERMIN;
|
msf.cdmsf_min0 = start / CDFRAMES_PERMIN;
|
||||||
msf.cdmsf_sec0 = (start % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
|
msf.cdmsf_sec0 = (start % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
|
||||||
|
@ -770,7 +759,7 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa
|
||||||
msf.end_s = (end % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
|
msf.end_s = (end % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
|
||||||
msf.end_f = end % CDFRAMES_PERSEC;
|
msf.end_f = end % CDFRAMES_PERSEC;
|
||||||
#endif
|
#endif
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMSTART
|
CDROMSTART
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
|
@ -780,7 +769,7 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // motor doesn't start !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // motor doesn't start !\n");
|
||||||
return MCIERR_HARDWARE;
|
return MCIERR_HARDWARE;
|
||||||
}
|
}
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMPLAYMSF
|
CDROMPLAYMSF
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
|
@ -799,14 +788,14 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa
|
||||||
msf.end_m, msf.end_s, msf.end_f
|
msf.end_m, msf.end_s, msf.end_f
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
CDADev[index].mode = MCI_MODE_PLAY;
|
CDADev[wDevID].mode = MCI_MODE_PLAY;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
/*
|
/*
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -821,24 +810,23 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa
|
||||||
static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciStop(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciStop(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMSTOP
|
CDROMSTOP
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDIOCSTOP
|
CDIOCSTOP
|
||||||
#endif
|
#endif
|
||||||
)) return MCIERR_HARDWARE;
|
)) return MCIERR_HARDWARE;
|
||||||
CDADev[index].mode = MCI_MODE_STOP;
|
CDADev[wDevID].mode = MCI_MODE_STOP;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -852,24 +840,23 @@ static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l
|
||||||
static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciPause(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciPause(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMPAUSE
|
CDROMPAUSE
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDIOCPAUSE
|
CDIOCPAUSE
|
||||||
#endif
|
#endif
|
||||||
)) return MCIERR_HARDWARE;
|
)) return MCIERR_HARDWARE;
|
||||||
CDADev[index].mode = MCI_MODE_PAUSE;
|
CDADev[wDevID].mode = MCI_MODE_PAUSE;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -883,24 +870,23 @@ static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS
|
||||||
static DWORD CDAUDIO_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD CDAUDIO_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciResume(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciResume(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMRESUME
|
CDROMRESUME
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
CDIOCRESUME
|
CDIOCRESUME
|
||||||
#endif
|
#endif
|
||||||
)) return MCIERR_HARDWARE;
|
)) return MCIERR_HARDWARE;
|
||||||
CDADev[index].mode = MCI_MODE_STOP;
|
CDADev[wDevID].mode = MCI_MODE_STOP;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -914,13 +900,12 @@ static DWORD CDAUDIO_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS
|
||||||
static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
|
static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
MCI_PLAY_PARMS PlayParms;
|
MCI_PLAY_PARMS PlayParms;
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciSeek(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciSeek(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (ioctl(CDADev[index].unixdev,
|
if (ioctl(CDADev[wDevID].unixdev,
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
CDROMRESUME
|
CDROMRESUME
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
|
@ -930,13 +915,13 @@ static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa
|
||||||
perror("ioctl CDROMRESUME");
|
perror("ioctl CDROMRESUME");
|
||||||
return MCIERR_HARDWARE;
|
return MCIERR_HARDWARE;
|
||||||
}
|
}
|
||||||
CDADev[index].mode = MCI_MODE_SEEK;
|
CDADev[wDevID].mode = MCI_MODE_SEEK;
|
||||||
switch(dwFlags) {
|
switch(dwFlags) {
|
||||||
case MCI_SEEK_TO_START:
|
case MCI_SEEK_TO_START:
|
||||||
PlayParms.dwFrom = 0;
|
PlayParms.dwFrom = 0;
|
||||||
break;
|
break;
|
||||||
case MCI_SEEK_TO_END:
|
case MCI_SEEK_TO_END:
|
||||||
PlayParms.dwFrom = CDADev[index].dwTotalLen;
|
PlayParms.dwFrom = CDADev[wDevID].dwTotalLen;
|
||||||
break;
|
break;
|
||||||
case MCI_TO:
|
case MCI_TO:
|
||||||
PlayParms.dwFrom = lpParms->dwTo;
|
PlayParms.dwFrom = lpParms->dwTo;
|
||||||
|
@ -950,7 +935,7 @@ static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa
|
||||||
"CDAUDIO_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return dwRet;
|
return dwRet;
|
||||||
#else
|
#else
|
||||||
|
@ -965,7 +950,6 @@ static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa
|
||||||
static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciSet(%04X, %08lX, %p);\n",
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciSet(%04X, %08lX, %p);\n",
|
||||||
wDevID, dwFlags, lpParms);
|
wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
@ -989,32 +973,32 @@ static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParm
|
||||||
dprintf_cdaudio(stddeb,"CDAUDIO_mciSet // bad time format !\n");
|
dprintf_cdaudio(stddeb,"CDAUDIO_mciSet // bad time format !\n");
|
||||||
return MCIERR_BAD_TIME_FORMAT;
|
return MCIERR_BAD_TIME_FORMAT;
|
||||||
}
|
}
|
||||||
CDADev[index].dwTimeFormat = lpParms->dwTimeFormat;
|
CDADev[wDevID].dwTimeFormat = lpParms->dwTimeFormat;
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_SET_DOOR_OPEN) {
|
if (dwFlags & MCI_SET_DOOR_OPEN) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciSet // MCI_SET_DOOR_OPEN !\n");
|
"CDAUDIO_mciSet // MCI_SET_DOOR_OPEN !\n");
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
if (ioctl(CDADev[index].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
|
||||||
if (ioctl(CDADev[index].unixdev, CDIOCEJECT)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDIOCEJECT)) return MCIERR_HARDWARE;
|
||||||
if (ioctl(CDADev[index].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
|
||||||
#elif linux
|
#elif linux
|
||||||
if (ioctl(CDADev[index].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
|
||||||
#endif
|
#endif
|
||||||
CDADev[index].nTracks = 0;
|
CDADev[wDevID].nTracks = 0;
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_SET_DOOR_CLOSED) {
|
if (dwFlags & MCI_SET_DOOR_CLOSED) {
|
||||||
dprintf_cdaudio(stddeb,
|
dprintf_cdaudio(stddeb,
|
||||||
"CDAUDIO_mciSet // MCI_SET_DOOR_CLOSED !\n");
|
"CDAUDIO_mciSet // MCI_SET_DOOR_CLOSED !\n");
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
if (ioctl(CDADev[index].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
|
||||||
if (ioctl(CDADev[index].unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE;
|
||||||
if (ioctl(CDADev[index].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
|
||||||
#elif linux
|
#elif linux
|
||||||
if (ioctl(CDADev[index].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
|
if (ioctl(CDADev[wDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
|
||||||
/* XXX should it be ",1" ??? */
|
/* XXX should it be ",1" ??? */
|
||||||
#endif
|
#endif
|
||||||
CDADev[index].nTracks = 0;
|
CDADev[wDevID].nTracks = 0;
|
||||||
}
|
}
|
||||||
if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION;
|
if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION;
|
||||||
if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
|
if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
|
||||||
|
@ -1024,7 +1008,7 @@ static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParm
|
||||||
"CDAUDIO_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
"CDAUDIO_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
||||||
lpParms->dwCallback);
|
lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
CDADev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -311,6 +311,7 @@ MCISTR_Open(_MCISTR_PROTO_) {
|
||||||
if (s!=NULL) {
|
if (s!=NULL) {
|
||||||
*s++='\0';
|
*s++='\0';
|
||||||
pU->openParams.lpstrElementName=SEGPTR_GET(SEGPTR_STRDUP(s));
|
pU->openParams.lpstrElementName=SEGPTR_GET(SEGPTR_STRDUP(s));
|
||||||
|
dwFlags |= MCI_OPEN_ELEMENT;
|
||||||
}
|
}
|
||||||
if (!STRCMP(dev,"cdaudio")) {
|
if (!STRCMP(dev,"cdaudio")) {
|
||||||
uDevTyp=MCI_DEVTYPE_CD_AUDIO;
|
uDevTyp=MCI_DEVTYPE_CD_AUDIO;
|
||||||
|
@ -338,7 +339,7 @@ MCISTR_Open(_MCISTR_PROTO_) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GetDrv(wDevID)->wType = uDevTyp;
|
GetDrv(wDevID)->wType = uDevTyp;
|
||||||
GetDrv(wDevID)->wDeviceID = wDevID;
|
GetDrv(wDevID)->wDeviceID = 0; /* FIXME? for multiple devices */
|
||||||
pU->openParams.dwCallback = 0;
|
pU->openParams.dwCallback = 0;
|
||||||
pU->openParams.wDeviceID = wDevID;
|
pU->openParams.wDeviceID = wDevID;
|
||||||
pU->ovlyopenParams.dwStyle = 0;
|
pU->ovlyopenParams.dwStyle = 0;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "ldt.h"
|
#include "ldt.h"
|
||||||
|
#include "user.h"
|
||||||
#include "driver.h"
|
#include "driver.h"
|
||||||
#include "mmsystem.h"
|
#include "mmsystem.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
|
@ -24,8 +25,6 @@
|
||||||
#include <machine/soundcard.h>
|
#include <machine/soundcard.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int MMSYSTEM_DevIDToIndex(UINT16);
|
|
||||||
|
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
#define MIDI_DEV "/dev/sequencer"
|
#define MIDI_DEV "/dev/sequencer"
|
||||||
|
|
||||||
|
@ -35,9 +34,9 @@ int MMSYSTEM_DevIDToIndex(UINT16);
|
||||||
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
|
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_MIDIINDRV 2
|
#define MAX_MIDIINDRV (1)
|
||||||
#define MAX_MIDIOUTDRV 2
|
#define MAX_MIDIOUTDRV (1)
|
||||||
#define MAX_MCIMIDIDRV 2
|
#define MAX_MCIMIDIDRV (1)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int unixdev;
|
int unixdev;
|
||||||
|
@ -71,7 +70,8 @@ typedef struct {
|
||||||
WORD nTracks;
|
WORD nTracks;
|
||||||
WORD nTempo;
|
WORD nTempo;
|
||||||
MCI_OPEN_PARMS openParms;
|
MCI_OPEN_PARMS openParms;
|
||||||
MIDIHDR MidiHdr;
|
/* MIDIHDR MidiHdr; */
|
||||||
|
HLOCAL16 hMidiHdr;
|
||||||
WORD dwStatus;
|
WORD dwStatus;
|
||||||
} LINUX_MCIMIDI;
|
} LINUX_MCIMIDI;
|
||||||
|
|
||||||
|
@ -88,11 +88,10 @@ static DWORD MIDI_NotifyClient(UINT16 wDevID, WORD wMsg,
|
||||||
DWORD dwParam1, DWORD dwParam2)
|
DWORD dwParam1, DWORD dwParam2)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
if (MidiInDev[wDevID].wFlags != DCB_NULL && !DriverCallback(
|
||||||
if (MidiInDev[index].wFlags != DCB_NULL && !DriverCallback(
|
MidiInDev[wDevID].midiDesc.dwCallback, MidiInDev[wDevID].wFlags,
|
||||||
MidiInDev[index].midiDesc.dwCallback, MidiInDev[index].wFlags,
|
MidiInDev[wDevID].midiDesc.hMidi, wMsg,
|
||||||
MidiInDev[index].midiDesc.hMidi, wMsg,
|
MidiInDev[wDevID].midiDesc.dwInstance, dwParam1, dwParam2)) {
|
||||||
MidiInDev[index].midiDesc.dwInstance, dwParam1, dwParam2)) {
|
|
||||||
dprintf_midi(stddeb, "MIDI_NotifyClient // can't notify client !\n");
|
dprintf_midi(stddeb, "MIDI_NotifyClient // can't notify client !\n");
|
||||||
return MMSYSERR_NOERROR;
|
return MMSYSERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
@ -108,10 +107,9 @@ static DWORD MIDI_NotifyClient(UINT16 wDevID, WORD wMsg,
|
||||||
*/
|
*/
|
||||||
static DWORD MIDI_ReadByte(UINT16 wDevID, BYTE *lpbyt)
|
static DWORD MIDI_ReadByte(UINT16 wDevID, BYTE *lpbyt)
|
||||||
{
|
{
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
if (lpbyt != NULL) {
|
if (lpbyt != NULL) {
|
||||||
if (mmioRead(MCIMidiDev[index].hFile, (HPSTR)lpbyt,
|
if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)lpbyt,
|
||||||
(long) sizeof(BYTE)) == (long) sizeof(BYTE)) {
|
(long) sizeof(BYTE)) == (long) sizeof(BYTE)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -197,34 +195,33 @@ static DWORD MIDI_ReadVaryLen(UINT16 wDevID, LPDWORD lpdw)
|
||||||
static DWORD MIDI_ReadMThd(UINT16 wDevID, DWORD dwOffset)
|
static DWORD MIDI_ReadMThd(UINT16 wDevID, DWORD dwOffset)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
DWORD toberead;
|
DWORD toberead;
|
||||||
FOURCC fourcc;
|
FOURCC fourcc;
|
||||||
dprintf_midi(stddeb, "MIDI_ReadMThd(%04X, %08lX);\n", wDevID, dwOffset);
|
dprintf_midi(stddeb, "MIDI_ReadMThd(%04X, %08lX);\n", wDevID, dwOffset);
|
||||||
if (mmioSeek(MCIMidiDev[index].hFile, dwOffset, SEEK_SET) != dwOffset) {
|
if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) {
|
||||||
dprintf_midi(stddeb, "MIDI_ReadMThd // can't seek at %08lX begin of 'MThd' \n", dwOffset);
|
dprintf_midi(stddeb, "MIDI_ReadMThd // can't seek at %08lX begin of 'MThd' \n", dwOffset);
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
if (mmioRead(MCIMidiDev[index].hFile, (HPSTR)&fourcc,
|
if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc,
|
||||||
(long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) {
|
(long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
if (MIDI_ReadLong(wDevID, &toberead) != 0) {
|
if (MIDI_ReadLong(wDevID, &toberead) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
if (MIDI_ReadWord(wDevID, &MCIMidiDev[index].wFormat) != 0) {
|
if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].wFormat) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
if (MIDI_ReadWord(wDevID, &MCIMidiDev[index].nTracks) != 0) {
|
if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].nTracks) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
if (MIDI_ReadWord(wDevID, &MCIMidiDev[index].nTempo) != 0) {
|
if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].nTempo) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
dprintf_midi(stddeb, "MIDI_ReadMThd // toberead=%08lX, wFormat=%04X nTracks=%04X nTempo=%04X\n",
|
dprintf_midi(stddeb, "MIDI_ReadMThd // toberead=%08lX, wFormat=%04X nTracks=%04X nTempo=%04X\n",
|
||||||
toberead, MCIMidiDev[index].wFormat,
|
toberead, MCIMidiDev[wDevID].wFormat,
|
||||||
MCIMidiDev[index].nTracks,
|
MCIMidiDev[wDevID].nTracks,
|
||||||
MCIMidiDev[index].nTempo);
|
MCIMidiDev[wDevID].nTempo);
|
||||||
toberead -= 3 * sizeof(WORD);
|
toberead -= 3 * sizeof(WORD);
|
||||||
/*
|
/*
|
||||||
ntrks = read16bit ();
|
ntrks = read16bit ();
|
||||||
|
@ -241,13 +238,12 @@ static DWORD MIDI_ReadMThd(UINT16 wDevID, DWORD dwOffset)
|
||||||
static DWORD MIDI_ReadMTrk(UINT16 wDevID, DWORD dwOffset)
|
static DWORD MIDI_ReadMTrk(UINT16 wDevID, DWORD dwOffset)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
DWORD toberead;
|
DWORD toberead;
|
||||||
FOURCC fourcc;
|
FOURCC fourcc;
|
||||||
if (mmioSeek(MCIMidiDev[index].hFile, dwOffset, SEEK_SET) != dwOffset) {
|
if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) {
|
||||||
dprintf_midi(stddeb, "MIDI_ReadMTrk // can't seek at %08lX begin of 'MThd' \n", dwOffset);
|
dprintf_midi(stddeb, "MIDI_ReadMTrk // can't seek at %08lX begin of 'MThd' \n", dwOffset);
|
||||||
}
|
}
|
||||||
if (mmioRead(MCIMidiDev[index].hFile, (HPSTR)&fourcc,
|
if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc,
|
||||||
(long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) {
|
(long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
|
@ -256,7 +252,7 @@ static DWORD MIDI_ReadMTrk(UINT16 wDevID, DWORD dwOffset)
|
||||||
}
|
}
|
||||||
dprintf_midi(stddeb, "MIDI_ReadMTrk // toberead=%08lX\n", toberead);
|
dprintf_midi(stddeb, "MIDI_ReadMTrk // toberead=%08lX\n", toberead);
|
||||||
toberead -= 3 * sizeof(WORD);
|
toberead -= 3 * sizeof(WORD);
|
||||||
MCIMidiDev[index].dwTotalLen = toberead;
|
MCIMidiDev[wDevID].dwTotalLen = toberead;
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
|
@ -270,7 +266,6 @@ static DWORD MIDI_ReadMTrk(UINT16 wDevID, DWORD dwOffset)
|
||||||
static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
|
static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index;
|
|
||||||
MIDIOPENDESC MidiDesc;
|
MIDIOPENDESC MidiDesc;
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
DWORD dwOffset;
|
DWORD dwOffset;
|
||||||
|
@ -280,24 +275,22 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen(%08lX, %p)\n", dwFlags, lpParms);
|
dprintf_midi(stddeb, "MIDI_mciOpen(%08lX, %p)\n", dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
|
|
||||||
wDevID = lpParms->wDeviceID;
|
if (MCIMidiDev[wDevID].nUseCount > 0) {
|
||||||
index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
|
|
||||||
if (MCIMidiDev[index].nUseCount > 0) {
|
|
||||||
/* The driver already open on this channel */
|
/* The driver already open on this channel */
|
||||||
/* If the driver was opened shareable before and this open specifies */
|
/* If the driver was opened shareable before and this open specifies */
|
||||||
/* shareable then increment the use count */
|
/* shareable then increment the use count */
|
||||||
if (MCIMidiDev[index].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
if (MCIMidiDev[wDevID].fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
||||||
++MCIMidiDev[index].nUseCount;
|
++MCIMidiDev[wDevID].nUseCount;
|
||||||
else
|
else
|
||||||
return MCIERR_MUST_USE_SHAREABLE;
|
return MCIERR_MUST_USE_SHAREABLE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MCIMidiDev[index].nUseCount = 1;
|
MCIMidiDev[wDevID].nUseCount = 1;
|
||||||
MCIMidiDev[index].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
MCIMidiDev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
||||||
|
MCIMidiDev[wDevID].hMidiHdr = USER_HEAP_ALLOC(sizeof(MIDIHDR));
|
||||||
}
|
}
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // wDevID=%04X\n", wDevID);
|
dprintf_midi(stddeb, "MIDI_mciOpen // wDevID=%04X\n", wDevID);
|
||||||
lpParms->wDeviceID = wDevID;
|
/* lpParms->wDeviceID = wDevID;*/
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID);
|
dprintf_midi(stddeb, "MIDI_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID);
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // before OPEN_ELEMENT\n");
|
dprintf_midi(stddeb, "MIDI_mciOpen // before OPEN_ELEMENT\n");
|
||||||
if (dwFlags & MCI_OPEN_ELEMENT) {
|
if (dwFlags & MCI_OPEN_ELEMENT) {
|
||||||
|
@ -306,26 +299,26 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms
|
||||||
if (strlen(lpstrElementName) > 0) {
|
if (strlen(lpstrElementName) > 0) {
|
||||||
strcpy(str, lpstrElementName);
|
strcpy(str, lpstrElementName);
|
||||||
CharUpper32A(str);
|
CharUpper32A(str);
|
||||||
MCIMidiDev[index].hFile = mmioOpen(str, NULL,
|
MCIMidiDev[wDevID].hFile = mmioOpen(str, NULL,
|
||||||
MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
|
MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
|
||||||
if (MCIMidiDev[index].hFile == 0) {
|
if (MCIMidiDev[wDevID].hFile == 0) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // can't find file='%s' !\n", str);
|
dprintf_midi(stddeb, "MIDI_mciOpen // can't find file='%s' !\n", str);
|
||||||
return MCIERR_FILE_NOT_FOUND;
|
return MCIERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
MCIMidiDev[index].hFile = 0;
|
MCIMidiDev[wDevID].hFile = 0;
|
||||||
}
|
}
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // hFile=%u\n", MCIMidiDev[index].hFile);
|
dprintf_midi(stddeb, "MIDI_mciOpen // hFile=%u\n", MCIMidiDev[wDevID].hFile);
|
||||||
memcpy(&MCIMidiDev[index].openParms, lpParms, sizeof(MCI_OPEN_PARMS));
|
memcpy(&MCIMidiDev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS));
|
||||||
MCIMidiDev[index].wNotifyDeviceID = lpParms->wDeviceID;
|
MCIMidiDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
|
||||||
MCIMidiDev[index].dwStatus = MCI_MODE_STOP;
|
MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
|
||||||
MCIMidiDev[index].dwBeginData = 0;
|
MCIMidiDev[wDevID].dwBeginData = 0;
|
||||||
MCIMidiDev[index].dwTotalLen = 0;
|
MCIMidiDev[wDevID].dwTotalLen = 0;
|
||||||
MidiDesc.hMidi = 0;
|
MidiDesc.hMidi = 0;
|
||||||
if (MCIMidiDev[index].hFile != 0) {
|
if (MCIMidiDev[wDevID].hFile != 0) {
|
||||||
MMCKINFO ckMainRIFF;
|
MMCKINFO ckMainRIFF;
|
||||||
if (mmioDescend(MCIMidiDev[index].hFile, &ckMainRIFF, NULL, 0) != 0) {
|
if (mmioDescend(MCIMidiDev[wDevID].hFile, &ckMainRIFF, NULL, 0) != 0) {
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
dprintf_midi(stddeb,"MIDI_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
|
dprintf_midi(stddeb,"MIDI_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
|
||||||
|
@ -344,19 +337,19 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // can't read 'MThd' header \n");
|
dprintf_midi(stddeb, "MIDI_mciOpen // can't read 'MThd' header \n");
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
dwOffset = mmioSeek(MCIMidiDev[index].hFile, 0, SEEK_CUR);
|
dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR);
|
||||||
if (MIDI_ReadMTrk(wDevID, dwOffset) != 0) {
|
if (MIDI_ReadMTrk(wDevID, dwOffset) != 0) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // can't read 'MTrk' header \n");
|
dprintf_midi(stddeb, "MIDI_mciOpen // can't read 'MTrk' header \n");
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
}
|
}
|
||||||
dwOffset = mmioSeek(MCIMidiDev[index].hFile, 0, SEEK_CUR);
|
dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR);
|
||||||
MCIMidiDev[index].dwBeginData = dwOffset;
|
MCIMidiDev[wDevID].dwBeginData = dwOffset;
|
||||||
dprintf_midi(stddeb, "MIDI_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
|
dprintf_midi(stddeb, "MIDI_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
|
||||||
(LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
|
(LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
|
||||||
ckMainRIFF.cksize);
|
ckMainRIFF.cksize);
|
||||||
}
|
}
|
||||||
dwRet = modMessage(wDevID, MODM_OPEN, 0, (DWORD)&MidiDesc, CALLBACK_NULL);
|
dwRet = modMessage(wDevID, MODM_OPEN, 0, (DWORD)&MidiDesc, CALLBACK_NULL);
|
||||||
dwRet = midMessage(wDevID, MIDM_OPEN, 0, (DWORD)&MidiDesc, CALLBACK_NULL);
|
/* dwRet = midMessage(wDevID, MIDM_OPEN, 0, (DWORD)&MidiDesc, CALLBACK_NULL); */
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
|
@ -370,12 +363,11 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms
|
||||||
static DWORD MIDI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD MIDI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_midi(stddeb, "MIDI_mciStop(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
dprintf_midi(stddeb, "MIDI_mciStop(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
MCIMidiDev[index].dwStatus = MCI_MODE_STOP;
|
MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
|
||||||
dprintf_midi(stddeb, "MIDI_mciStop // MCIMidiDev[index].dwStatus=%p %d\n",
|
dprintf_midi(stddeb, "MIDI_mciStop // MCIMidiDev[wDevID].dwStatus=%p %d\n",
|
||||||
&MCIMidiDev[index].dwStatus, MCIMidiDev[index].dwStatus);
|
&MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus);
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return MCIERR_INTERNAL;
|
return MCIERR_INTERNAL;
|
||||||
|
@ -389,24 +381,27 @@ static DWORD MIDI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa
|
||||||
static DWORD MIDI_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
static DWORD MIDI_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
|
|
||||||
dprintf_midi(stddeb, "MIDI_mciClose(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms);
|
dprintf_midi(stddeb, "MIDI_mciClose(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms);
|
||||||
if (MCIMidiDev[index].dwStatus != MCI_MODE_STOP) {
|
if (MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) {
|
||||||
MIDI_mciStop(wDevID, MCI_WAIT, lpParms);
|
MIDI_mciStop(wDevID, MCI_WAIT, lpParms);
|
||||||
}
|
}
|
||||||
MCIMidiDev[index].dwStatus = MCI_MODE_STOP;
|
MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
|
||||||
MCIMidiDev[index].nUseCount--;
|
MCIMidiDev[wDevID].nUseCount--;
|
||||||
if (MCIMidiDev[index].nUseCount == 0) {
|
if (MCIMidiDev[wDevID].nUseCount == 0) {
|
||||||
if (MCIMidiDev[index].hFile != 0) {
|
if (MCIMidiDev[wDevID].hFile != 0) {
|
||||||
mmioClose(MCIMidiDev[index].hFile, 0);
|
mmioClose(MCIMidiDev[wDevID].hFile, 0);
|
||||||
MCIMidiDev[index].hFile = 0;
|
MCIMidiDev[wDevID].hFile = 0;
|
||||||
dprintf_midi(stddeb, "MIDI_mciClose // hFile closed !\n");
|
dprintf_midi(stddeb, "MIDI_mciClose // hFile closed !\n");
|
||||||
}
|
}
|
||||||
|
USER_HEAP_FREE(MCIMidiDev[wDevID].hMidiHdr);
|
||||||
dwRet = modMessage(wDevID, MODM_CLOSE, 0, 0L, 0L);
|
dwRet = modMessage(wDevID, MODM_CLOSE, 0, 0L, 0L);
|
||||||
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
||||||
|
/*
|
||||||
dwRet = midMessage(wDevID, MIDM_CLOSE, 0, 0L, 0L);
|
dwRet = midMessage(wDevID, MIDM_CLOSE, 0, 0L, 0L);
|
||||||
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -421,17 +416,18 @@ static DWORD MIDI_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpP
|
||||||
static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int count;
|
int count;
|
||||||
int start, end;
|
int start, end;
|
||||||
LPMIDIHDR lpMidiHdr;
|
LPMIDIHDR lpMidiHdr;
|
||||||
|
DWORD lp16MidiHdr;
|
||||||
DWORD dwData;
|
DWORD dwData;
|
||||||
LPWORD ptr;
|
LPWORD ptr;
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
|
|
||||||
dprintf_midi(stddeb, "MIDI_mciPlay(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
dprintf_midi(stddeb, "MIDI_mciPlay(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (MCIMidiDev[index].hFile == 0) {
|
if (MCIMidiDev[wDevID].hFile == 0) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciPlay // can't find file='%08lx' !\n",
|
dprintf_midi(stddeb, "MIDI_mciPlay // can't find file='%08lx' !\n",
|
||||||
MCIMidiDev[index].openParms.lpstrElementName);
|
MCIMidiDev[wDevID].openParms.lpstrElementName);
|
||||||
return MCIERR_FILE_NOT_FOUND;
|
return MCIERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
start = 1; end = 99999;
|
start = 1; end = 99999;
|
||||||
|
@ -459,51 +455,80 @@ static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lpMidiHdr = &MCIMidiDev[index].MidiHdr;
|
|
||||||
|
lpMidiHdr = USER_HEAP_LIN_ADDR(MCIMidiDev[wDevID].hMidiHdr);
|
||||||
|
lp16MidiHdr = USER_HEAP_SEG_ADDR(MCIMidiDev[wDevID].hMidiHdr);
|
||||||
|
|
||||||
lpMidiHdr->lpData = (LPSTR) malloc(1200);
|
lpMidiHdr->lpData = (LPSTR) malloc(1200);
|
||||||
if (lpMidiHdr->lpData == NULL) return MCIERR_INTERNAL;
|
if (lpMidiHdr->lpData == NULL) return MCIERR_INTERNAL;
|
||||||
lpMidiHdr->dwBufferLength = 1024;
|
lpMidiHdr->dwBufferLength = 1024;
|
||||||
lpMidiHdr->dwUser = 0L;
|
lpMidiHdr->dwUser = 0L;
|
||||||
lpMidiHdr->dwFlags = 0L;
|
lpMidiHdr->dwFlags = 0L;
|
||||||
dwRet = modMessage(wDevID, MODM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
|
dwRet = modMessage(wDevID, MODM_PREPARE, 0, (DWORD)lp16MidiHdr, sizeof(MIDIHDR));
|
||||||
|
|
||||||
/* dprintf_midi(stddeb, "MIDI_mciPlay // after MODM_PREPARE \n"); */
|
/* dprintf_midi(stddeb, "MIDI_mciPlay // after MODM_PREPARE \n"); */
|
||||||
MCIMidiDev[index].dwStatus = MCI_MODE_PLAY;
|
|
||||||
while(MCIMidiDev[index].dwStatus != MCI_MODE_STOP) {
|
MCIMidiDev[wDevID].dwStatus = MCI_MODE_PLAY;
|
||||||
dprintf_midi(stddeb, "MIDI_mciPlay // MCIMidiDev[index].dwStatus=%p %d\n",
|
while(MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) {
|
||||||
&MCIMidiDev[index].dwStatus, MCIMidiDev[index].dwStatus);
|
dprintf_midi(stddeb, "MIDI_mciPlay // MCIMidiDev[wDevID].dwStatus=%p %d\n",
|
||||||
|
&MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus);
|
||||||
|
|
||||||
ptr = (LPWORD)lpMidiHdr->lpData;
|
ptr = (LPWORD)lpMidiHdr->lpData;
|
||||||
for (count = 0; count < lpMidiHdr->dwBufferLength; count++) {
|
for (count = 0; count < lpMidiHdr->dwBufferLength; count++) {
|
||||||
if (MIDI_ReadVaryLen(wDevID, &dwData) != 0) break;
|
if (MIDI_ReadVaryLen(wDevID, &dwData) != 0) break;
|
||||||
*ptr = LOWORD(dwData);
|
*ptr = LOWORD(dwData);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
count = mmioRead(MCIMidiDev[index].hFile, lpMidiHdr->lpData, lpMidiHdr->dwBufferLength);
|
count = mmioRead(MCIMidiDev[wDevID].hFile, lpMidiHdr->lpData, lpMidiHdr->dwBufferLength);
|
||||||
*/
|
*/
|
||||||
|
dprintf_midi(stddeb, "MIDI_mciPlay // after read count = %d\n",count);
|
||||||
|
|
||||||
if (count < 1) break;
|
if (count < 1) break;
|
||||||
lpMidiHdr->dwBytesRecorded = count;
|
lpMidiHdr->dwBytesRecorded = count;
|
||||||
dprintf_midi(stddeb, "MIDI_mciPlay // before MODM_LONGDATA lpMidiHdr=%p dwBytesRecorded=%lu\n",
|
dprintf_midi(stddeb, "MIDI_mciPlay // before MODM_LONGDATA lpMidiHdr=%p dwBytesRecorded=%lu\n",
|
||||||
lpMidiHdr, lpMidiHdr->dwBytesRecorded);
|
lpMidiHdr, lpMidiHdr->dwBytesRecorded);
|
||||||
dwRet = modMessage(wDevID, MODM_LONGDATA, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
|
dwRet = modMessage(wDevID, MODM_LONGDATA, 0, (DWORD)lp16MidiHdr, sizeof(MIDIHDR));
|
||||||
|
if (dwRet != MMSYSERR_NOERROR) {
|
||||||
|
switch (dwRet) {
|
||||||
|
case MMSYSERR_NOTENABLED:
|
||||||
|
return MCIERR_DEVICE_NOT_READY;
|
||||||
|
|
||||||
|
case MIDIERR_NODEVICE:
|
||||||
|
return MCIERR_INVALID_DEVICE_ID;
|
||||||
|
|
||||||
|
case MIDIERR_UNPREPARED:
|
||||||
|
return MCIERR_DRIVER_INTERNAL;
|
||||||
|
|
||||||
|
case MIDIERR_STILLPLAYING:
|
||||||
|
return MCIERR_SEQ_PORT_INUSE;
|
||||||
|
|
||||||
|
case MMSYSERR_INVALPARAM:
|
||||||
|
return MCIERR_CANNOT_LOAD_DRIVER;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return MCIERR_DRIVER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dwRet = modMessage(wDevID, MODM_UNPREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
|
}
|
||||||
|
dwRet = modMessage(wDevID, MODM_UNPREPARE, 0, (DWORD)lp16MidiHdr, sizeof(MIDIHDR));
|
||||||
if (lpMidiHdr->lpData != NULL) {
|
if (lpMidiHdr->lpData != NULL) {
|
||||||
free(lpMidiHdr->lpData);
|
free(lpMidiHdr->lpData);
|
||||||
lpMidiHdr->lpData = NULL;
|
lpMidiHdr->lpData = NULL;
|
||||||
}
|
}
|
||||||
MCIMidiDev[index].dwStatus = MCI_MODE_STOP;
|
MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
dprintf_midi(stddeb, "MIDI_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
MCIMidiDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
#if 0
|
#if 0
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -512,15 +537,14 @@ static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
||||||
static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
|
static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int start, end;
|
int start, end;
|
||||||
LPMIDIHDR lpMidiHdr;
|
LPMIDIHDR lpMidiHdr;
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
|
|
||||||
dprintf_midi(stddeb, "MIDI_mciRecord(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
dprintf_midi(stddeb, "MIDI_mciRecord(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (MCIMidiDev[index].hFile == 0) {
|
if (MCIMidiDev[wDevID].hFile == 0) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciRecord // can't find file='%08lx' !\n",
|
dprintf_midi(stddeb, "MIDI_mciRecord // can't find file='%08lx' !\n",
|
||||||
MCIMidiDev[index].openParms.lpstrElementName);
|
MCIMidiDev[wDevID].openParms.lpstrElementName);
|
||||||
return MCIERR_FILE_NOT_FOUND;
|
return MCIERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
start = 1; end = 99999;
|
start = 1; end = 99999;
|
||||||
|
@ -532,17 +556,17 @@ static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP
|
||||||
end = lpParms->dwTo;
|
end = lpParms->dwTo;
|
||||||
dprintf_midi(stddeb, "MIDI_mciRecord // MCI_TO=%d \n", end);
|
dprintf_midi(stddeb, "MIDI_mciRecord // MCI_TO=%d \n", end);
|
||||||
}
|
}
|
||||||
lpMidiHdr = &MCIMidiDev[index].MidiHdr;
|
lpMidiHdr = USER_HEAP_LIN_ADDR(MCIMidiDev[wDevID].hMidiHdr);
|
||||||
lpMidiHdr->lpData = (LPSTR) xmalloc(1200);
|
lpMidiHdr->lpData = (LPSTR) xmalloc(1200);
|
||||||
lpMidiHdr->dwBufferLength = 1024;
|
lpMidiHdr->dwBufferLength = 1024;
|
||||||
lpMidiHdr->dwUser = 0L;
|
lpMidiHdr->dwUser = 0L;
|
||||||
lpMidiHdr->dwFlags = 0L;
|
lpMidiHdr->dwFlags = 0L;
|
||||||
dwRet = midMessage(wDevID, MIDM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
|
dwRet = midMessage(wDevID, MIDM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
|
||||||
dprintf_midi(stddeb, "MIDI_mciRecord // after MIDM_PREPARE \n");
|
dprintf_midi(stddeb, "MIDI_mciRecord // after MIDM_PREPARE \n");
|
||||||
MCIMidiDev[index].dwStatus = MCI_MODE_RECORD;
|
MCIMidiDev[wDevID].dwStatus = MCI_MODE_RECORD;
|
||||||
while(MCIMidiDev[index].dwStatus != MCI_MODE_STOP) {
|
while(MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciRecord // MCIMidiDev[index].dwStatus=%p %d\n",
|
dprintf_midi(stddeb, "MIDI_mciRecord // MCIMidiDev[wDevID].dwStatus=%p %d\n",
|
||||||
&MCIMidiDev[index].dwStatus, MCIMidiDev[index].dwStatus);
|
&MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus);
|
||||||
lpMidiHdr->dwBytesRecorded = 0;
|
lpMidiHdr->dwBytesRecorded = 0;
|
||||||
dwRet = midMessage(wDevID, MIDM_START, 0, 0L, 0L);
|
dwRet = midMessage(wDevID, MIDM_START, 0, 0L, 0L);
|
||||||
dprintf_midi(stddeb, "MIDI_mciRecord // after MIDM_START lpMidiHdr=%p dwBytesRecorded=%lu\n",
|
dprintf_midi(stddeb, "MIDI_mciRecord // after MIDM_START lpMidiHdr=%p dwBytesRecorded=%lu\n",
|
||||||
|
@ -556,11 +580,11 @@ static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP
|
||||||
free(lpMidiHdr->lpData);
|
free(lpMidiHdr->lpData);
|
||||||
lpMidiHdr->lpData = NULL;
|
lpMidiHdr->lpData = NULL;
|
||||||
}
|
}
|
||||||
MCIMidiDev[index].dwStatus = MCI_MODE_STOP;
|
MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
dprintf_midi(stddeb, "MIDI_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
MCIMidiDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -671,7 +695,6 @@ static DWORD MIDI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
||||||
static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_midi(stddeb, "MIDI_mciStatus(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
dprintf_midi(stddeb, "MIDI_mciStatus(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||||
if (lpParms == NULL) return MCIERR_INTERNAL;
|
if (lpParms == NULL) return MCIERR_INTERNAL;
|
||||||
if (dwFlags & MCI_STATUS_ITEM) {
|
if (dwFlags & MCI_STATUS_ITEM) {
|
||||||
|
@ -746,7 +769,7 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
|
||||||
if (dwFlags & MCI_NOTIFY) {
|
if (dwFlags & MCI_NOTIFY) {
|
||||||
dprintf_midi(stddeb, "MIDI_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
dprintf_midi(stddeb, "MIDI_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||||
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback),
|
||||||
MCIMidiDev[index].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -850,7 +873,6 @@ static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPS lpCaps, DWORD dwSize)
|
||||||
static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int midi;
|
int midi;
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"midOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
|
"midOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
|
||||||
|
@ -858,18 +880,18 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
||||||
dprintf_midi(stddeb,"Linux 'midOpen' // Invalid Parameter !\n");
|
dprintf_midi(stddeb,"Linux 'midOpen' // Invalid Parameter !\n");
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
}
|
}
|
||||||
if (index >= MAX_MIDIINDRV) {
|
if (wDevID >= MAX_MIDIINDRV) {
|
||||||
dprintf_midi(stddeb,"Linux 'midOpen' // MAX_MIDIINDRV reached !\n");
|
dprintf_midi(stddeb,"Linux 'midOpen' // MAX_MIDIINDRV reached !\n");
|
||||||
return MMSYSERR_ALLOCATED;
|
return MMSYSERR_ALLOCATED;
|
||||||
}
|
}
|
||||||
MidiInDev[index].unixdev = 0;
|
MidiInDev[wDevID].unixdev = 0;
|
||||||
midi = open (MIDI_DEV, O_RDONLY, 0);
|
midi = open (MIDI_DEV, O_RDONLY, 0);
|
||||||
if (midi == -1) {
|
if (midi == -1) {
|
||||||
dprintf_midi(stddeb,"Linux 'midOpen' // can't open !\n");
|
dprintf_midi(stddeb,"Linux 'midOpen' // can't open !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
MidiInDev[index].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
|
MidiInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
|
||||||
switch(MidiInDev[index].wFlags) {
|
switch(MidiInDev[wDevID].wFlags) {
|
||||||
case DCB_NULL:
|
case DCB_NULL:
|
||||||
dprintf_midi(stddeb,"Linux 'midOpen' // CALLBACK_NULL !\n");
|
dprintf_midi(stddeb,"Linux 'midOpen' // CALLBACK_NULL !\n");
|
||||||
break;
|
break;
|
||||||
|
@ -886,10 +908,10 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
||||||
"Linux 'midOpen' // CALLBACK_FUNCTION !\n");
|
"Linux 'midOpen' // CALLBACK_FUNCTION !\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
MidiInDev[index].lpQueueHdr = NULL;
|
MidiInDev[wDevID].lpQueueHdr = NULL;
|
||||||
MidiInDev[index].unixdev = midi;
|
MidiInDev[wDevID].unixdev = midi;
|
||||||
MidiInDev[index].dwTotalPlayed = 0;
|
MidiInDev[wDevID].dwTotalPlayed = 0;
|
||||||
MidiInDev[index].bufsize = 0x3FFF;
|
MidiInDev[wDevID].bufsize = 0x3FFF;
|
||||||
if (MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
|
if (MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
|
||||||
dprintf_midi(stddeb,"Linux 'midOpen' // can't notify client !\n");
|
dprintf_midi(stddeb,"Linux 'midOpen' // can't notify client !\n");
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
|
@ -906,15 +928,14 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
||||||
static DWORD midClose(WORD wDevID)
|
static DWORD midClose(WORD wDevID)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_midi(stddeb, "midClose(%04X);\n", wDevID);
|
dprintf_midi(stddeb, "midClose(%04X);\n", wDevID);
|
||||||
if (MidiInDev[index].unixdev == 0) {
|
if (MidiInDev[wDevID].unixdev == 0) {
|
||||||
dprintf_midi(stddeb,"Linux 'midClose' // can't close !\n");
|
dprintf_midi(stddeb,"Linux 'midClose' // can't close !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
close(MidiInDev[index].unixdev);
|
close(MidiInDev[wDevID].unixdev);
|
||||||
MidiInDev[index].unixdev = 0;
|
MidiInDev[wDevID].unixdev = 0;
|
||||||
MidiInDev[index].bufsize = 0;
|
MidiInDev[wDevID].bufsize = 0;
|
||||||
if (MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
|
if (MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
|
||||||
dprintf_midi(stddeb,"Linux 'midClose' // can't notify client !\n");
|
dprintf_midi(stddeb,"Linux 'midClose' // can't notify client !\n");
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
|
@ -1036,26 +1057,26 @@ static DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPS lpCaps, DWORD dwSize)
|
||||||
static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int midi;
|
int midi;
|
||||||
|
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
|
"modOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
|
||||||
if (lpDesc == NULL) {
|
if (lpDesc == NULL) {
|
||||||
dprintf_midi(stddeb,"Linux 'modOpen' // Invalid Parameter !\n");
|
dprintf_midi(stddeb,"Linux 'modOpen' // Invalid Parameter !\n");
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
}
|
}
|
||||||
if (index >= MAX_MIDIOUTDRV) {
|
if (wDevID>= MAX_MIDIOUTDRV) {
|
||||||
dprintf_midi(stddeb,"Linux 'modOpen' // MAX_MIDIOUTDRV reached !\n");
|
dprintf_midi(stddeb,"Linux 'modOpen' // MAX_MIDIOUTDRV reached !\n");
|
||||||
return MMSYSERR_ALLOCATED;
|
return MMSYSERR_ALLOCATED;
|
||||||
}
|
}
|
||||||
MidiOutDev[index].unixdev = 0;
|
MidiOutDev[wDevID].unixdev = 0;
|
||||||
midi = open (MIDI_DEV, O_WRONLY, 0);
|
midi = open (MIDI_DEV, O_WRONLY, 0);
|
||||||
if (midi == -1) {
|
if (midi == -1) {
|
||||||
dprintf_midi(stddeb,"Linux 'modOpen' // can't open !\n");
|
dprintf_midi(stddeb,"Linux 'modOpen' // can't open !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
MidiOutDev[index].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
|
MidiOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
|
||||||
switch(MidiOutDev[index].wFlags) {
|
switch(MidiOutDev[wDevID].wFlags) {
|
||||||
case DCB_NULL:
|
case DCB_NULL:
|
||||||
dprintf_midi(stddeb,"Linux 'modOpen' // CALLBACK_NULL !\n");
|
dprintf_midi(stddeb,"Linux 'modOpen' // CALLBACK_NULL !\n");
|
||||||
break;
|
break;
|
||||||
|
@ -1072,10 +1093,10 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
||||||
"Linux 'modOpen' // CALLBACK_FUNCTION !\n");
|
"Linux 'modOpen' // CALLBACK_FUNCTION !\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
MidiOutDev[index].lpQueueHdr = NULL;
|
MidiOutDev[wDevID].lpQueueHdr = NULL;
|
||||||
MidiOutDev[index].unixdev = midi;
|
MidiOutDev[wDevID].unixdev = midi;
|
||||||
MidiOutDev[index].dwTotalPlayed = 0;
|
MidiOutDev[wDevID].dwTotalPlayed = 0;
|
||||||
MidiOutDev[index].bufsize = 0x3FFF;
|
MidiOutDev[wDevID].bufsize = 0x3FFF;
|
||||||
if (MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
|
if (MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
|
||||||
dprintf_midi(stddeb,"Linux 'modOpen' // can't notify client !\n");
|
dprintf_midi(stddeb,"Linux 'modOpen' // can't notify client !\n");
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
|
@ -1095,15 +1116,14 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
|
||||||
static DWORD modClose(WORD wDevID)
|
static DWORD modClose(WORD wDevID)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_midi(stddeb, "modClose(%04X);\n", wDevID);
|
dprintf_midi(stddeb, "modClose(%04X);\n", wDevID);
|
||||||
if (MidiOutDev[index].unixdev == 0) {
|
if (MidiOutDev[wDevID].unixdev == 0) {
|
||||||
dprintf_midi(stddeb,"Linux 'modClose' // can't close !\n");
|
dprintf_midi(stddeb,"Linux 'modClose' // can't close !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
close(MidiOutDev[index].unixdev);
|
close(MidiOutDev[wDevID].unixdev);
|
||||||
MidiOutDev[index].unixdev = 0;
|
MidiOutDev[wDevID].unixdev = 0;
|
||||||
MidiOutDev[index].bufsize = 0;
|
MidiOutDev[wDevID].bufsize = 0;
|
||||||
if (MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
|
if (MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
|
||||||
dprintf_midi(stddeb,"Linux 'modClose' // can't notify client !\n");
|
dprintf_midi(stddeb,"Linux 'modClose' // can't notify client !\n");
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
|
@ -1120,16 +1140,16 @@ static DWORD modClose(WORD wDevID)
|
||||||
static DWORD modData(WORD wDevID, DWORD dwParam)
|
static DWORD modData(WORD wDevID, DWORD dwParam)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
WORD event;
|
WORD event;
|
||||||
|
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modData(%04X, %08lX);\n", wDevID, dwParam);
|
"modData(%04X, %08lX);\n", wDevID, dwParam);
|
||||||
if (MidiOutDev[index].unixdev == 0) {
|
if (MidiOutDev[wDevID].unixdev == 0) {
|
||||||
dprintf_midi(stddeb,"Linux 'modData' // can't play !\n");
|
dprintf_midi(stddeb,"Linux 'modData' // can't play !\n");
|
||||||
return MIDIERR_NODEVICE;
|
return MIDIERR_NODEVICE;
|
||||||
}
|
}
|
||||||
event = LOWORD(dwParam);
|
event = LOWORD(dwParam);
|
||||||
if (write (MidiOutDev[index].unixdev,
|
if (write (MidiOutDev[wDevID].unixdev,
|
||||||
&event, sizeof(WORD)) != sizeof(WORD)) {
|
&event, sizeof(WORD)) != sizeof(WORD)) {
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modData() // error writting unixdev !\n");
|
"modData() // error writting unixdev !\n");
|
||||||
|
@ -1146,12 +1166,13 @@ static DWORD modData(WORD wDevID, DWORD dwParam)
|
||||||
static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
int count;
|
int count;
|
||||||
LPWORD ptr;
|
LPWORD ptr;
|
||||||
|
int en;
|
||||||
|
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modLongData(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
|
"modLongData(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
|
||||||
if (MidiOutDev[index].unixdev == 0) {
|
if (MidiOutDev[wDevID].unixdev == 0) {
|
||||||
dprintf_midi(stddeb,"Linux 'modLongData' // can't play !\n");
|
dprintf_midi(stddeb,"Linux 'modLongData' // can't play !\n");
|
||||||
return MIDIERR_NODEVICE;
|
return MIDIERR_NODEVICE;
|
||||||
}
|
}
|
||||||
|
@ -1162,20 +1183,30 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
||||||
lpMidiHdr->dwFlags |= MHDR_INQUEUE;
|
lpMidiHdr->dwFlags |= MHDR_INQUEUE;
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modLongData() // dwBytesRecorded %lu !\n", lpMidiHdr->dwBytesRecorded);
|
"modLongData() // dwBytesRecorded %lu !\n", lpMidiHdr->dwBytesRecorded);
|
||||||
|
dprintf_midi(stddeb,
|
||||||
|
" %02X %02X %02X %02X\n",lpMidiHdr->lpData[0],
|
||||||
|
lpMidiHdr->lpData[1],
|
||||||
|
lpMidiHdr->lpData[2],
|
||||||
|
lpMidiHdr->lpData[3]);
|
||||||
/*
|
/*
|
||||||
count = write (MidiOutDev[index].unixdev,
|
count = write (MidiOutDev[wDevID].unixdev,
|
||||||
lpMidiHdr->lpData, lpMidiHdr->dwBytesRecorded);
|
lpMidiHdr->lpData, lpMidiHdr->dwBytesRecorded);
|
||||||
*/
|
*/
|
||||||
ptr = (LPWORD)lpMidiHdr->lpData;
|
ptr = (LPWORD)lpMidiHdr->lpData;
|
||||||
for (count = 0; count < lpMidiHdr->dwBytesRecorded; count++) {
|
for (count = 0; count < lpMidiHdr->dwBytesRecorded; count++) {
|
||||||
if (write (MidiOutDev[index].unixdev, ptr,
|
if (write (MidiOutDev[wDevID].unixdev, ptr,
|
||||||
sizeof(WORD)) != sizeof(WORD)) break;
|
sizeof(WORD)) != sizeof(WORD)) break;
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
en = errno;
|
||||||
|
dprintf_midi(stddeb, "Linux 'modLongData' // after write count = %d\n",count);
|
||||||
if (count != lpMidiHdr->dwBytesRecorded) {
|
if (count != lpMidiHdr->dwBytesRecorded) {
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modLongData() // error writting unixdev #%d ! (%d != %ld)\n",
|
"modLongData() // error writting unixdev #%d ! (%d != %ld)\n",
|
||||||
MidiOutDev[index].unixdev, count, lpMidiHdr->dwBytesRecorded);
|
MidiOutDev[wDevID].unixdev, count, lpMidiHdr->dwBytesRecorded);
|
||||||
|
dprintf_midi(stddeb,
|
||||||
|
" errno = %d error = %s\n",en,strerror(en));
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
|
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
|
||||||
|
@ -1196,19 +1227,18 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
||||||
static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modPrepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
|
"modPrepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
|
||||||
if (MidiOutDev[index].unixdev == 0) {
|
if (MidiOutDev[wDevID].unixdev == 0) {
|
||||||
dprintf_midi(stddeb,"Linux 'modPrepare' // can't prepare !\n");
|
dprintf_midi(stddeb,"Linux 'modPrepare' // can't prepare !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
if (MidiOutDev[index].lpQueueHdr != NULL) {
|
if (MidiOutDev[wDevID].lpQueueHdr != NULL) {
|
||||||
dprintf_midi(stddeb,"Linux 'modPrepare' // already prepare !\n");
|
dprintf_midi(stddeb,"Linux 'modPrepare' // already prepare !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
MidiOutDev[index].dwTotalPlayed = 0;
|
MidiOutDev[wDevID].dwTotalPlayed = 0;
|
||||||
MidiOutDev[index].lpQueueHdr = lpMidiHdr;
|
MidiOutDev[wDevID].lpQueueHdr = PTR_SEG_TO_LIN(lpMidiHdr);
|
||||||
if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING;
|
if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING;
|
||||||
lpMidiHdr->dwFlags |= MHDR_PREPARED;
|
lpMidiHdr->dwFlags |= MHDR_PREPARED;
|
||||||
lpMidiHdr->dwFlags &= ~MHDR_DONE;
|
lpMidiHdr->dwFlags &= ~MHDR_DONE;
|
||||||
|
@ -1224,10 +1254,9 @@ static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
||||||
static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
||||||
{
|
{
|
||||||
#if defined(linux) || defined(__FreeBSD__)
|
#if defined(linux) || defined(__FreeBSD__)
|
||||||
int index = MMSYSTEM_DevIDToIndex(wDevID);
|
|
||||||
dprintf_midi(stddeb,
|
dprintf_midi(stddeb,
|
||||||
"modUnprepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
|
"modUnprepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
|
||||||
if (MidiOutDev[index].unixdev == 0) {
|
if (MidiOutDev[wDevID].unixdev == 0) {
|
||||||
dprintf_midi(stddeb,"Linux 'modUnprepare' // can't unprepare !\n");
|
dprintf_midi(stddeb,"Linux 'modUnprepare' // can't unprepare !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,12 @@
|
||||||
|
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
#include <linux/soundcard.h>
|
#include <linux/soundcard.h>
|
||||||
|
#elif __FreeBSD__
|
||||||
|
#include <machine/soundcard.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int MMSYSTEM_DevIDToIndex(UINT16);
|
#include "stddebug.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
#define SOUND_DEV "/dev/dsp"
|
#define SOUND_DEV "/dev/dsp"
|
||||||
#define MIXER_DEV "/dev/mixer"
|
#define MIXER_DEV "/dev/mixer"
|
||||||
|
@ -45,15 +48,15 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
int mixer;
|
int mixer;
|
||||||
int volume;
|
int volume;
|
||||||
printf("AUX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
dprintf_mmaux(stddeb,"AUX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
||||||
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
|
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
|
||||||
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
||||||
printf("AUX_GetDevCaps // mixer device not available !\n");
|
dprintf_mmaux(stddeb,"AUX_GetDevCaps // mixer device not available !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
if (ioctl(mixer, SOUND_MIXER_READ_LINE, &volume) == -1) {
|
if (ioctl(mixer, SOUND_MIXER_READ_LINE, &volume) == -1) {
|
||||||
close(mixer);
|
close(mixer);
|
||||||
printf("AUX_GetDevCaps // unable read mixer !\n");
|
dprintf_mmaux(stddeb,"AUX_GetDevCaps // unable read mixer !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
close(mixer);
|
close(mixer);
|
||||||
|
@ -61,7 +64,7 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
|
||||||
lpCaps->wMid = 0x0002;
|
lpCaps->wMid = 0x0002;
|
||||||
lpCaps->vDriverVersion = 0x0200;
|
lpCaps->vDriverVersion = 0x0200;
|
||||||
lpCaps->dwSupport = AUXCAPS_VOLUME | AUXCAPS_LRVOLUME;
|
lpCaps->dwSupport = AUXCAPS_VOLUME | AUXCAPS_LRVOLUME;
|
||||||
switch (MMSYSTEM_DevIDToIndex(wDevID)) {
|
switch (wDevID) {
|
||||||
case 0:
|
case 0:
|
||||||
lpCaps->wPid = 0x0196;
|
lpCaps->wPid = 0x0196;
|
||||||
strcpy(lpCaps->szPname, "SB16 Aux: Wave");
|
strcpy(lpCaps->szPname, "SB16 Aux: Wave");
|
||||||
|
@ -117,49 +120,50 @@ static DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol)
|
||||||
int mixer;
|
int mixer;
|
||||||
int volume, left, right;
|
int volume, left, right;
|
||||||
int cmd;
|
int cmd;
|
||||||
printf("AUX_GetVolume(%04X, %p);\n", wDevID, lpdwVol);
|
|
||||||
|
dprintf_mmaux(stddeb,"AUX_GetVolume(%04X, %p);\n", wDevID, lpdwVol);
|
||||||
if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
|
if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
|
||||||
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
||||||
printf("Linux 'AUX_GetVolume' // mixer device not available !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // mixer device not available !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
switch(MMSYSTEM_DevIDToIndex(wDevID)) {
|
switch(wDevID) {
|
||||||
case 0:
|
case 0:
|
||||||
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_PCM !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_PCM !\n");
|
||||||
cmd = SOUND_MIXER_READ_PCM;
|
cmd = SOUND_MIXER_READ_PCM;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_SYNTH !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_SYNTH !\n");
|
||||||
cmd = SOUND_MIXER_READ_SYNTH;
|
cmd = SOUND_MIXER_READ_SYNTH;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_CD !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_CD !\n");
|
||||||
cmd = SOUND_MIXER_READ_CD;
|
cmd = SOUND_MIXER_READ_CD;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_LINE !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_LINE !\n");
|
||||||
cmd = SOUND_MIXER_READ_LINE;
|
cmd = SOUND_MIXER_READ_LINE;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_MIC !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_MIC !\n");
|
||||||
cmd = SOUND_MIXER_READ_MIC;
|
cmd = SOUND_MIXER_READ_MIC;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_VOLUME !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_VOLUME !\n");
|
||||||
cmd = SOUND_MIXER_READ_VOLUME;
|
cmd = SOUND_MIXER_READ_VOLUME;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Linux 'AUX_GetVolume' // invalid device id=%04X !\n", wDevID);
|
dprintf_mmaux(stddeb, "Linux 'AUX_GetVolume' // invalid device id=%04X !\n", wDevID);
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
if (ioctl(mixer, cmd, &volume) == -1) {
|
if (ioctl(mixer, cmd, &volume) == -1) {
|
||||||
printf("Linux 'AUX_GetVolume' // unable read mixer !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // unable read mixer !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
close(mixer);
|
close(mixer);
|
||||||
left = volume & 0x7F;
|
left = volume & 0x7F;
|
||||||
right = (volume >> 8) & 0x7F;
|
right = (volume >> 8) & 0x7F;
|
||||||
printf("Linux 'AUX_GetVolume' // left=%d right=%d !\n", left, right);
|
dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // left=%d right=%d !\n", left, right);
|
||||||
*lpdwVol = MAKELONG(left << 9, right << 9);
|
*lpdwVol = MAKELONG(left << 9, right << 9);
|
||||||
return MMSYSERR_NOERROR;
|
return MMSYSERR_NOERROR;
|
||||||
#else
|
#else
|
||||||
|
@ -176,44 +180,44 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
|
||||||
int mixer;
|
int mixer;
|
||||||
int volume;
|
int volume;
|
||||||
int cmd;
|
int cmd;
|
||||||
printf("AUX_SetVolume(%04X, %08lX);\n", wDevID, dwParam);
|
dprintf_mmaux(stddeb,"AUX_SetVolume(%04X, %08lX);\n", wDevID, dwParam);
|
||||||
volume = (LOWORD(dwParam) >> 9 & 0x7F) +
|
volume = (LOWORD(dwParam) >> 9 & 0x7F) +
|
||||||
((HIWORD(dwParam) >> 9 & 0x7F) << 8);
|
((HIWORD(dwParam) >> 9 & 0x7F) << 8);
|
||||||
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
||||||
printf("Linux 'AUX_SetVolume' // mixer device not available !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // mixer device not available !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
switch(MMSYSTEM_DevIDToIndex(wDevID)) {
|
switch(wDevID) {
|
||||||
case 0:
|
case 0:
|
||||||
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_PCM !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_PCM !\n");
|
||||||
cmd = SOUND_MIXER_WRITE_PCM;
|
cmd = SOUND_MIXER_WRITE_PCM;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_SYNTH !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_SYNTH !\n");
|
||||||
cmd = SOUND_MIXER_WRITE_SYNTH;
|
cmd = SOUND_MIXER_WRITE_SYNTH;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_CD !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_CD !\n");
|
||||||
cmd = SOUND_MIXER_WRITE_CD;
|
cmd = SOUND_MIXER_WRITE_CD;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_LINE !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_LINE !\n");
|
||||||
cmd = SOUND_MIXER_WRITE_LINE;
|
cmd = SOUND_MIXER_WRITE_LINE;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_MIC !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_MIC !\n");
|
||||||
cmd = SOUND_MIXER_WRITE_MIC;
|
cmd = SOUND_MIXER_WRITE_MIC;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_VOLUME !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_VOLUME !\n");
|
||||||
cmd = SOUND_MIXER_WRITE_VOLUME;
|
cmd = SOUND_MIXER_WRITE_VOLUME;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Linux 'AUX_SetVolume' // invalid device id=%04X !\n", wDevID);
|
dprintf_mmaux(stddeb, "Linux 'AUX_SetVolume' // invalid device id=%04X !\n", wDevID);
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
if (ioctl(mixer, cmd, &volume) == -1) {
|
if (ioctl(mixer, cmd, &volume) == -1) {
|
||||||
printf("Linux 'AUX_SetVolume' // unable set mixer !\n");
|
dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // unable set mixer !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
}
|
}
|
||||||
close(mixer);
|
close(mixer);
|
||||||
|
@ -230,21 +234,21 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
|
||||||
DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
|
DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
|
||||||
DWORD dwParam1, DWORD dwParam2)
|
DWORD dwParam1, DWORD dwParam2)
|
||||||
{
|
{
|
||||||
printf("auxMessage(%04X, %04X, %08lX, %08lX, %08lX);\n",
|
dprintf_mmaux(stddeb,"auxMessage(%04X, %04X, %08lX, %08lX, %08lX);\n",
|
||||||
wDevID, wMsg, dwUser, dwParam1, dwParam2);
|
wDevID, wMsg, dwUser, dwParam1, dwParam2);
|
||||||
switch(wMsg) {
|
switch(wMsg) {
|
||||||
case AUXDM_GETDEVCAPS:
|
case AUXDM_GETDEVCAPS:
|
||||||
return AUX_GetDevCaps(wDevID,
|
return AUX_GetDevCaps(wDevID,
|
||||||
(LPAUXCAPS)PTR_SEG_TO_LIN(dwParam1), dwParam2);
|
(LPAUXCAPS)PTR_SEG_TO_LIN(dwParam1), dwParam2);
|
||||||
case AUXDM_GETNUMDEVS:
|
case AUXDM_GETNUMDEVS:
|
||||||
printf("AUX_GetNumDevs() return %d;\n", NumDev);
|
dprintf_mmaux(stddeb,"AUX_GetNumDevs() return %d;\n", NumDev);
|
||||||
return NumDev;
|
return NumDev;
|
||||||
case AUXDM_GETVOLUME:
|
case AUXDM_GETVOLUME:
|
||||||
return AUX_GetVolume(wDevID, (LPDWORD)PTR_SEG_TO_LIN(dwParam1));
|
return AUX_GetVolume(wDevID, (LPDWORD)PTR_SEG_TO_LIN(dwParam1));
|
||||||
case AUXDM_SETVOLUME:
|
case AUXDM_SETVOLUME:
|
||||||
return AUX_SetVolume(wDevID, dwParam1);
|
return AUX_SetVolume(wDevID, dwParam1);
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,"auxMessage // unknown message !\n");
|
dprintf_mmaux(stddeb,"auxMessage // unknown message !\n");
|
||||||
}
|
}
|
||||||
return MMSYSERR_NOTSUPPORTED;
|
return MMSYSERR_NOTSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ BOOL16 sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags)
|
||||||
lpWaveDesc->hWave = 0;
|
lpWaveDesc->hWave = 0;
|
||||||
lpWaveDesc->lpFormat = (LPWAVEFORMAT) SEGPTR_GET(lpFormat);
|
lpWaveDesc->lpFormat = (LPWAVEFORMAT) SEGPTR_GET(lpFormat);
|
||||||
|
|
||||||
dwRet = wodMessage( MMSYSTEM_FirstDevID(),
|
dwRet = wodMessage( 0,
|
||||||
WODM_OPEN, 0, (DWORD)SEGPTR_GET(lpWaveDesc), CALLBACK_NULL);
|
WODM_OPEN, 0, (DWORD)SEGPTR_GET(lpWaveDesc), CALLBACK_NULL);
|
||||||
SEGPTR_FREE(lpFormat);
|
SEGPTR_FREE(lpFormat);
|
||||||
SEGPTR_FREE(lpWaveDesc);
|
SEGPTR_FREE(lpWaveDesc);
|
||||||
|
@ -208,7 +208,7 @@ BOOL16 sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags)
|
||||||
lpWaveHdr->dwFlags = 0L;
|
lpWaveHdr->dwFlags = 0L;
|
||||||
lpWaveHdr->dwLoops = 0L;
|
lpWaveHdr->dwLoops = 0L;
|
||||||
|
|
||||||
dwRet = wodMessage( MMSYSTEM_FirstDevID(),
|
dwRet = wodMessage( 0,
|
||||||
WODM_PREPARE, 0, (DWORD)spWaveHdr, sizeof(WAVEHDR));
|
WODM_PREPARE, 0, (DWORD)spWaveHdr, sizeof(WAVEHDR));
|
||||||
if (dwRet == MMSYSERR_NOERROR)
|
if (dwRet == MMSYSERR_NOERROR)
|
||||||
{
|
{
|
||||||
|
@ -218,12 +218,12 @@ BOOL16 sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags)
|
||||||
if (count < 1) break;
|
if (count < 1) break;
|
||||||
lpWaveHdr->dwBufferLength = count;
|
lpWaveHdr->dwBufferLength = count;
|
||||||
/* lpWaveHdr->dwBytesRecorded = count; */
|
/* lpWaveHdr->dwBytesRecorded = count; */
|
||||||
wodMessage( MMSYSTEM_FirstDevID(), WODM_WRITE,
|
wodMessage( 0, WODM_WRITE,
|
||||||
0, (DWORD)spWaveHdr, sizeof(WAVEHDR));
|
0, (DWORD)spWaveHdr, sizeof(WAVEHDR));
|
||||||
}
|
}
|
||||||
wodMessage( MMSYSTEM_FirstDevID(),
|
wodMessage( 0,
|
||||||
WODM_UNPREPARE, 0, (DWORD)spWaveHdr, sizeof(WAVEHDR));
|
WODM_UNPREPARE, 0, (DWORD)spWaveHdr, sizeof(WAVEHDR));
|
||||||
wodMessage( MMSYSTEM_FirstDevID(),
|
wodMessage( 0,
|
||||||
WODM_CLOSE, 0, 0L, 0L);
|
WODM_CLOSE, 0, 0L, 0L);
|
||||||
|
|
||||||
bRet = TRUE;
|
bRet = TRUE;
|
||||||
|
@ -547,17 +547,32 @@ BOOL16 mciGetErrorString (DWORD wError, LPSTR lpstrBuffer, UINT16 uLength)
|
||||||
case MCIERR_FILE_WRITE:
|
case MCIERR_FILE_WRITE:
|
||||||
msgptr = "Cannot write to the specified file. Make sure you have enough disk space or are still connected to the network.";
|
msgptr = "Cannot write to the specified file. Make sure you have enough disk space or are still connected to the network.";
|
||||||
break;
|
break;
|
||||||
|
case MCIERR_SEQ_DIV_INCOMPATIBLE:
|
||||||
|
msgptr = "The time formats of the \"song pointer\" and SMPTE are mutually exclusive. You can't use them together.";
|
||||||
|
break;
|
||||||
|
case MCIERR_SEQ_NOMIDIPRESENT:
|
||||||
|
msgptr = "The system has no installed MIDI devices. Use the Drivers option from the Control Panel to install a MIDI driver.";
|
||||||
|
break;
|
||||||
|
case MCIERR_SEQ_PORT_INUSE:
|
||||||
|
msgptr = "The specified MIDI port is already in use. Wait until it is free; the try again.";
|
||||||
|
break;
|
||||||
|
case MCIERR_SEQ_PORT_MAPNODEVICE:
|
||||||
|
msgptr = "The current MIDI Mapper setup refers to a MIDI device that is not installed on the system. Use the MIDI Mapper option from the Control Panel to edit the setup.";
|
||||||
|
break;
|
||||||
|
case MCIERR_SEQ_PORT_MISCERROR:
|
||||||
|
msgptr = "An error occurred with the specified port.";
|
||||||
|
break;
|
||||||
|
case MCIERR_SEQ_PORT_NONEXISTENT:
|
||||||
|
msgptr = "The specified MIDI device is not installed on the system. Use the Drivers option from the Control Panel to install a MIDI device.";
|
||||||
|
break;
|
||||||
|
case MCIERR_SEQ_PORTUNSPECIFIED:
|
||||||
|
msgptr = "The system doesnot have a current MIDI port specified.";
|
||||||
|
break;
|
||||||
|
case MCIERR_SEQ_TIMER:
|
||||||
|
msgptr = "All multimedia timers are being used by other applications. Quit one of these applications; then, try again.";
|
||||||
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define MCIERR_SEQ_DIV_INCOMPATIBLE (MCIERR_BASE + 80)
|
|
||||||
#define MCIERR_SEQ_PORT_INUSE (MCIERR_BASE + 81)
|
|
||||||
#define MCIERR_SEQ_PORT_NONEXISTENT (MCIERR_BASE + 82)
|
|
||||||
#define MCIERR_SEQ_PORT_MAPNODEVICE (MCIERR_BASE + 83)
|
|
||||||
#define MCIERR_SEQ_PORT_MISCERROR (MCIERR_BASE + 84)
|
|
||||||
#define MCIERR_SEQ_TIMER (MCIERR_BASE + 85)
|
|
||||||
#define MCIERR_SEQ_PORTUNSPECIFIED (MCIERR_BASE + 86)
|
|
||||||
#define MCIERR_SEQ_NOMIDIPRESENT (MCIERR_BASE + 87)
|
|
||||||
|
|
||||||
msg# 513 : vcr
|
msg# 513 : vcr
|
||||||
msg# 514 : videodisc
|
msg# 514 : videodisc
|
||||||
msg# 515 : overlay
|
msg# 515 : overlay
|
||||||
|
@ -595,6 +610,7 @@ msg# 543 : tmsf
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lstrcpyn32A(lpstrBuffer, msgptr, uLength);
|
lstrcpyn32A(lpstrBuffer, msgptr, uLength);
|
||||||
|
dprintf_mmsys(stddeb, "mciGetErrorString // msg = %s;\n", msgptr);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,7 +624,7 @@ BOOL16 mciDriverNotify(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStatus)
|
||||||
if (!IsWindow32(hWndCallBack)) return FALSE;
|
if (!IsWindow32(hWndCallBack)) return FALSE;
|
||||||
dprintf_mmsys(stddeb, "mciDriverNotify // before PostMessage\n");
|
dprintf_mmsys(stddeb, "mciDriverNotify // before PostMessage\n");
|
||||||
PostMessage16( hWndCallBack, MM_MCINOTIFY, wStatus,
|
PostMessage16( hWndCallBack, MM_MCINOTIFY, wStatus,
|
||||||
MAKELONG(GetDrv(wDevID)->wDeviceID, 0));
|
MAKELONG(wDevID, 0));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,10 +638,12 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lp16Parms)
|
||||||
LPMCI_OPEN_PARMS lpParms;
|
LPMCI_OPEN_PARMS lpParms;
|
||||||
UINT16 uDevTyp = 0;
|
UINT16 uDevTyp = 0;
|
||||||
UINT16 wDevID = MMSYSTEM_FirstDevID();
|
UINT16 wDevID = MMSYSTEM_FirstDevID();
|
||||||
|
DWORD dwret;
|
||||||
|
|
||||||
lpParms = PTR_SEG_TO_LIN(lp16Parms);
|
lpParms = PTR_SEG_TO_LIN(lp16Parms);
|
||||||
dprintf_mmsys(stddeb, "mciOpen(%08lX, %p (%p))\n", dwParam, lp16Parms, lpParms);
|
dprintf_mmsys(stddeb, "mciOpen(%08lX, %p (%p))\n", dwParam, lp16Parms, lpParms);
|
||||||
if (lp16Parms == NULL) return MCIERR_INTERNAL;
|
if (lp16Parms == NULL) return MCIERR_INTERNAL;
|
||||||
|
|
||||||
while(GetDrv(wDevID)->wType != 0) {
|
while(GetDrv(wDevID)->wType != 0) {
|
||||||
wDevID = MMSYSTEM_NextDevID(wDevID);
|
wDevID = MMSYSTEM_NextDevID(wDevID);
|
||||||
if (!MMSYSTEM_DevIDValid(wDevID)) {
|
if (!MMSYSTEM_DevIDValid(wDevID)) {
|
||||||
|
@ -647,6 +665,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lp16Parms)
|
||||||
if (t) {
|
if (t) {
|
||||||
GetProfileString32A("mci extensions",t+1,"*",str,sizeof(str));
|
GetProfileString32A("mci extensions",t+1,"*",str,sizeof(str));
|
||||||
CharUpper32A(str);
|
CharUpper32A(str);
|
||||||
|
dprintf_mmsys(stddeb, "mciOpen // str = %s \n", str);
|
||||||
if (strcmp(str, "CDAUDIO") == 0) {
|
if (strcmp(str, "CDAUDIO") == 0) {
|
||||||
uDevTyp = MCI_DEVTYPE_CD_AUDIO;
|
uDevTyp = MCI_DEVTYPE_CD_AUDIO;
|
||||||
} else
|
} else
|
||||||
|
@ -710,32 +729,41 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lp16Parms)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GetDrv(wDevID)->wType = uDevTyp;
|
GetDrv(wDevID)->wType = uDevTyp;
|
||||||
GetDrv(wDevID)->wDeviceID = wDevID;
|
GetDrv(wDevID)->wDeviceID = 0; /* FIXME? for multiple devices */
|
||||||
lpParms->wDeviceID = wDevID;
|
lpParms->wDeviceID = wDevID;
|
||||||
dprintf_mmsys(stddeb, "MCI_OPEN // mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n",
|
dprintf_mmsys(stddeb, "MCI_OPEN // mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n",
|
||||||
wDevID, uDevTyp, lpParms->wDeviceID);
|
wDevID, uDevTyp, lpParms->wDeviceID);
|
||||||
switch(uDevTyp)
|
switch(uDevTyp)
|
||||||
{
|
{
|
||||||
case MCI_DEVTYPE_CD_AUDIO:
|
case MCI_DEVTYPE_CD_AUDIO:
|
||||||
return CDAUDIO_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
dwret = CDAUDIO_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
||||||
dwParam, (DWORD)lp16Parms);
|
dwParam, (DWORD)lp16Parms);
|
||||||
|
break;
|
||||||
case MCI_DEVTYPE_WAVEFORM_AUDIO:
|
case MCI_DEVTYPE_WAVEFORM_AUDIO:
|
||||||
return WAVE_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
dwret = WAVE_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
||||||
dwParam, (DWORD)lp16Parms);
|
dwParam, (DWORD)lp16Parms);
|
||||||
|
break;
|
||||||
case MCI_DEVTYPE_SEQUENCER:
|
case MCI_DEVTYPE_SEQUENCER:
|
||||||
return MIDI_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
dwret = MIDI_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
||||||
dwParam, (DWORD)lp16Parms);
|
dwParam, (DWORD)lp16Parms);
|
||||||
|
break;
|
||||||
case MCI_DEVTYPE_ANIMATION:
|
case MCI_DEVTYPE_ANIMATION:
|
||||||
return ANIM_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
dwret = ANIM_DriverProc( 0, 0, MCI_OPEN_DRIVER,
|
||||||
dwParam, (DWORD)lp16Parms);
|
dwParam, (DWORD)lp16Parms);
|
||||||
|
break;
|
||||||
case MCI_DEVTYPE_DIGITAL_VIDEO:
|
case MCI_DEVTYPE_DIGITAL_VIDEO:
|
||||||
dprintf_mmsys(stddeb, "MCI_OPEN // No DIGITAL_VIDEO yet !\n");
|
dprintf_mmsys(stddeb, "MCI_OPEN // No DIGITAL_VIDEO yet !\n");
|
||||||
return MCIERR_DEVICE_NOT_INSTALLED;
|
return MCIERR_DEVICE_NOT_INSTALLED;
|
||||||
default:
|
default:
|
||||||
dprintf_mmsys(stddeb, "MCI_OPEN // Invalid Device Name '%08lx' !\n", lpParms->lpstrDeviceType);
|
dprintf_mmsys(stddeb, "MCI_OPEN // Invalid Device Name '%08lx' !\n", lpParms->lpstrDeviceType);
|
||||||
return MCIERR_INVALID_DEVICE_NAME;
|
return MCIERR_INVALID_DEVICE_NAME;
|
||||||
}
|
}
|
||||||
return MCIERR_INTERNAL;
|
|
||||||
|
/* only handled devices fall through */
|
||||||
|
dprintf_mmsys(stddeb, "MCI_OPEN // wDevID = %04X wDeviceID = %d dwret = %ld\n",wDevID, lpParms->wDeviceID, dwret);
|
||||||
|
return dwret;
|
||||||
|
|
||||||
|
/* return MCIERR_INTERNAL; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -745,7 +773,8 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lp16Parms)
|
||||||
DWORD mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
DWORD mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
||||||
{
|
{
|
||||||
DWORD dwRet = MCIERR_INTERNAL;
|
DWORD dwRet = MCIERR_INTERNAL;
|
||||||
dprintf_mmsys(stddeb, "mciClose(%u, %08lX, %p)\n", wDevID, dwParam, lpParms);
|
|
||||||
|
dprintf_mmsys(stddeb, "mciClose(%04x, %08lX, %p)\n", wDevID, dwParam, lpParms);
|
||||||
switch(GetDrv(wDevID)->wType) {
|
switch(GetDrv(wDevID)->wType) {
|
||||||
case MCI_DEVTYPE_CD_AUDIO:
|
case MCI_DEVTYPE_CD_AUDIO:
|
||||||
dwRet = CDAUDIO_DriverProc(GetDrv(wDevID)->wDeviceID,0,
|
dwRet = CDAUDIO_DriverProc(GetDrv(wDevID)->wDeviceID,0,
|
||||||
|
@ -768,14 +797,16 @@ DWORD mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dprintf_mmsys(stddeb, "mciClose() // unknown device type=%04X !\n", GetDrv(wDevID)->wType);
|
dprintf_mmsys(stddeb, "mciClose() // unknown device type=%04X !\n", GetDrv(wDevID)->wType);
|
||||||
|
dwRet = MCIERR_DEVICE_NOT_INSTALLED;
|
||||||
}
|
}
|
||||||
GetDrv(wDevID)->wType = 0;
|
GetDrv(wDevID)->wType = 0;
|
||||||
|
dprintf_mmsys(stddeb, "mciClose() // returns %ld\n",dwRet);
|
||||||
return dwRet;
|
return dwRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* mciSound [internal]
|
* mciSysinfo [internal]
|
||||||
*/
|
*/
|
||||||
DWORD mciSysInfo(DWORD dwFlags, LPMCI_SYSINFO_PARMS lpParms)
|
DWORD mciSysInfo(DWORD dwFlags, LPMCI_SYSINFO_PARMS lpParms)
|
||||||
{
|
{
|
||||||
|
@ -936,7 +967,7 @@ UINT16 mciGetDeviceID (LPCSTR lpstrName)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
wDevID = MMSYSTEM_FirstDevID();
|
wDevID = MMSYSTEM_FirstDevID();
|
||||||
while(GetDrv(wDevID)->wType) {
|
while(MMSYSTEM_DevIDValid(wDevID) && GetDrv(wDevID)->wType) {
|
||||||
if (GetOpenDrv(wDevID)->lpstrDeviceType &&
|
if (GetOpenDrv(wDevID)->lpstrDeviceType &&
|
||||||
strcmp(PTR_SEG_TO_LIN(GetOpenDrv(wDevID)->lpstrDeviceType), lpstrName) == 0)
|
strcmp(PTR_SEG_TO_LIN(GetOpenDrv(wDevID)->lpstrDeviceType), lpstrName) == 0)
|
||||||
return wDevID;
|
return wDevID;
|
||||||
|
@ -1524,6 +1555,7 @@ UINT16 waveOutOpen(HWAVEOUT16 * lphWaveOut, UINT16 uDeviceID,
|
||||||
LPWAVEOPENDESC lp16Desc;
|
LPWAVEOPENDESC lp16Desc;
|
||||||
DWORD dwRet = 0;
|
DWORD dwRet = 0;
|
||||||
BOOL32 bMapperFlg = FALSE;
|
BOOL32 bMapperFlg = FALSE;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveOutOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n",
|
dprintf_mmsys(stddeb, "waveOutOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n",
|
||||||
lphWaveOut, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
|
lphWaveOut, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
|
||||||
if (dwFlags & WAVE_FORMAT_QUERY) {
|
if (dwFlags & WAVE_FORMAT_QUERY) {
|
||||||
|
@ -1535,13 +1567,14 @@ UINT16 waveOutOpen(HWAVEOUT16 * lphWaveOut, UINT16 uDeviceID,
|
||||||
uDeviceID = 0;
|
uDeviceID = 0;
|
||||||
}
|
}
|
||||||
if (lpFormat == NULL) return WAVERR_BADFORMAT;
|
if (lpFormat == NULL) return WAVERR_BADFORMAT;
|
||||||
|
|
||||||
hWaveOut = USER_HEAP_ALLOC(sizeof(WAVEOPENDESC));
|
hWaveOut = USER_HEAP_ALLOC(sizeof(WAVEOPENDESC));
|
||||||
if (lphWaveOut != NULL) *lphWaveOut = hWaveOut;
|
if (lphWaveOut != NULL) *lphWaveOut = hWaveOut;
|
||||||
lp16Desc = (LPWAVEOPENDESC) USER_HEAP_SEG_ADDR(hWaveOut);
|
lp16Desc = (LPWAVEOPENDESC) USER_HEAP_SEG_ADDR(hWaveOut);
|
||||||
lpDesc = (LPWAVEOPENDESC) PTR_SEG_TO_LIN(lp16Desc);
|
lpDesc = (LPWAVEOPENDESC) PTR_SEG_TO_LIN(lp16Desc);
|
||||||
if (lpDesc == NULL) return MMSYSERR_NOMEM;
|
if (lpDesc == NULL) return MMSYSERR_NOMEM;
|
||||||
lpDesc->hWave = hWaveOut;
|
lpDesc->hWave = hWaveOut;
|
||||||
lpDesc->lpFormat = lpFormat;
|
lpDesc->lpFormat = lpFormat; /* should the struct be copied iso pointer? */
|
||||||
lpDesc->dwCallBack = dwCallback;
|
lpDesc->dwCallBack = dwCallback;
|
||||||
lpDesc->dwInstance = dwInstance;
|
lpDesc->dwInstance = dwInstance;
|
||||||
while(uDeviceID < MAXWAVEDRIVERS) {
|
while(uDeviceID < MAXWAVEDRIVERS) {
|
||||||
|
@ -1556,6 +1589,7 @@ UINT16 waveOutOpen(HWAVEOUT16 * lphWaveOut, UINT16 uDeviceID,
|
||||||
dprintf_mmsys(stddeb, "waveOutOpen // End of WAVE_FORMAT_QUERY !\n");
|
dprintf_mmsys(stddeb, "waveOutOpen // End of WAVE_FORMAT_QUERY !\n");
|
||||||
waveOutClose(hWaveOut);
|
waveOutClose(hWaveOut);
|
||||||
}
|
}
|
||||||
|
lpDesc->uDeviceID = uDeviceID; /* save physical Device ID */
|
||||||
return dwRet;
|
return dwRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1565,10 +1599,11 @@ UINT16 waveOutOpen(HWAVEOUT16 * lphWaveOut, UINT16 uDeviceID,
|
||||||
UINT16 waveOutClose(HWAVEOUT16 hWaveOut)
|
UINT16 waveOutClose(HWAVEOUT16 hWaveOut)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveOutClose(%04X)\n", hWaveOut);
|
dprintf_mmsys(stddeb, "waveOutClose(%04X)\n", hWaveOut);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
|
return wodMessage( lpDesc->uDeviceID, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1578,11 +1613,12 @@ UINT16 waveOutPrepareHeader(HWAVEOUT16 hWaveOut,
|
||||||
WAVEHDR * lpWaveOutHdr, UINT16 uSize)
|
WAVEHDR * lpWaveOutHdr, UINT16 uSize)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveOutPrepareHeader(%04X, %p, %u);\n",
|
dprintf_mmsys(stddeb, "waveOutPrepareHeader(%04X, %p, %u);\n",
|
||||||
hWaveOut, lpWaveOutHdr, uSize);
|
hWaveOut, lpWaveOutHdr, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_PREPARE, lpDesc->dwInstance,
|
return wodMessage( lpDesc->uDeviceID, WODM_PREPARE, lpDesc->dwInstance,
|
||||||
(DWORD)lpWaveOutHdr, uSize);
|
(DWORD)lpWaveOutHdr, uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1593,11 +1629,12 @@ UINT16 waveOutUnprepareHeader(HWAVEOUT16 hWaveOut,
|
||||||
WAVEHDR * lpWaveOutHdr, UINT16 uSize)
|
WAVEHDR * lpWaveOutHdr, UINT16 uSize)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveOutUnprepareHeader(%04X, %p, %u);\n",
|
dprintf_mmsys(stddeb, "waveOutUnprepareHeader(%04X, %p, %u);\n",
|
||||||
hWaveOut, lpWaveOutHdr, uSize);
|
hWaveOut, lpWaveOutHdr, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_UNPREPARE, lpDesc->dwInstance,
|
return wodMessage( lpDesc->uDeviceID, WODM_UNPREPARE, lpDesc->dwInstance,
|
||||||
(DWORD)lpWaveOutHdr, uSize);
|
(DWORD)lpWaveOutHdr, uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1607,10 +1644,11 @@ UINT16 waveOutUnprepareHeader(HWAVEOUT16 hWaveOut,
|
||||||
UINT16 waveOutWrite(HWAVEOUT16 hWaveOut, WAVEHDR * lpWaveOutHdr, UINT16 uSize)
|
UINT16 waveOutWrite(HWAVEOUT16 hWaveOut, WAVEHDR * lpWaveOutHdr, UINT16 uSize)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
|
dprintf_mmsys(stddeb, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_WRITE, lpDesc->dwInstance,
|
return wodMessage( lpDesc->uDeviceID, WODM_WRITE, lpDesc->dwInstance,
|
||||||
(DWORD)lpWaveOutHdr, uSize);
|
(DWORD)lpWaveOutHdr, uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1620,10 +1658,11 @@ UINT16 waveOutWrite(HWAVEOUT16 hWaveOut, WAVEHDR * lpWaveOutHdr, UINT16 uSize)
|
||||||
UINT16 waveOutPause(HWAVEOUT16 hWaveOut)
|
UINT16 waveOutPause(HWAVEOUT16 hWaveOut)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveOutPause(%04X)\n", hWaveOut);
|
dprintf_mmsys(stddeb, "waveOutPause(%04X)\n", hWaveOut);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_PAUSE, lpDesc->dwInstance, 0L, 0L);
|
return wodMessage( lpDesc->uDeviceID, WODM_PAUSE, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1632,10 +1671,11 @@ UINT16 waveOutPause(HWAVEOUT16 hWaveOut)
|
||||||
UINT16 waveOutRestart(HWAVEOUT16 hWaveOut)
|
UINT16 waveOutRestart(HWAVEOUT16 hWaveOut)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveOutRestart(%04X)\n", hWaveOut);
|
dprintf_mmsys(stddeb, "waveOutRestart(%04X)\n", hWaveOut);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_RESTART, lpDesc->dwInstance, 0L, 0L);
|
return wodMessage( lpDesc->uDeviceID, WODM_RESTART, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1647,7 +1687,7 @@ UINT16 waveOutReset(HWAVEOUT16 hWaveOut)
|
||||||
dprintf_mmsys(stddeb, "waveOutReset(%04X)\n", hWaveOut);
|
dprintf_mmsys(stddeb, "waveOutReset(%04X)\n", hWaveOut);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_RESET, lpDesc->dwInstance, 0L, 0L);
|
return wodMessage( lpDesc->uDeviceID, WODM_RESET, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1659,7 +1699,7 @@ UINT16 waveOutGetPosition(HWAVEOUT16 hWaveOut, MMTIME * lpTime, UINT16 uSize)
|
||||||
dprintf_mmsys(stddeb, "waveOutGetPosition(%04X, %p, %u);\n", hWaveOut, lpTime, uSize);
|
dprintf_mmsys(stddeb, "waveOutGetPosition(%04X, %p, %u);\n", hWaveOut, lpTime, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_GETPOS, lpDesc->dwInstance,
|
return wodMessage( lpDesc->uDeviceID, WODM_GETPOS, lpDesc->dwInstance,
|
||||||
(DWORD)lpTime, (DWORD)uSize);
|
(DWORD)lpTime, (DWORD)uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1672,7 +1712,7 @@ UINT16 waveOutGetPitch(HWAVEOUT16 hWaveOut, DWORD * lpdwPitch)
|
||||||
dprintf_mmsys(stddeb, "waveOutGetPitch(%04X, %p);\n", hWaveOut, lpdwPitch);
|
dprintf_mmsys(stddeb, "waveOutGetPitch(%04X, %p);\n", hWaveOut, lpdwPitch);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_GETPITCH, lpDesc->dwInstance,
|
return wodMessage( lpDesc->uDeviceID, WODM_GETPITCH, lpDesc->dwInstance,
|
||||||
(DWORD)lpdwPitch, 0L);
|
(DWORD)lpdwPitch, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1685,7 +1725,7 @@ UINT16 waveOutSetPitch(HWAVEOUT16 hWaveOut, DWORD dwPitch)
|
||||||
dprintf_mmsys(stddeb, "waveOutSetPitch(%04X, %08lX);\n", hWaveOut, dwPitch);
|
dprintf_mmsys(stddeb, "waveOutSetPitch(%04X, %08lX);\n", hWaveOut, dwPitch);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_SETPITCH, lpDesc->dwInstance, (DWORD)dwPitch, 0L);
|
return wodMessage( lpDesc->uDeviceID, WODM_SETPITCH, lpDesc->dwInstance, (DWORD)dwPitch, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1715,7 +1755,7 @@ UINT16 waveOutGetPlaybackRate(HWAVEOUT16 hWaveOut, DWORD * lpdwRate)
|
||||||
dprintf_mmsys(stddeb, "waveOutGetPlaybackRate(%04X, %p);\n", hWaveOut, lpdwRate);
|
dprintf_mmsys(stddeb, "waveOutGetPlaybackRate(%04X, %p);\n", hWaveOut, lpdwRate);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_GETPLAYBACKRATE, lpDesc->dwInstance,
|
return wodMessage( lpDesc->uDeviceID, WODM_GETPLAYBACKRATE, lpDesc->dwInstance,
|
||||||
(DWORD)lpdwRate, 0L);
|
(DWORD)lpdwRate, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1728,7 +1768,7 @@ UINT16 waveOutSetPlaybackRate(HWAVEOUT16 hWaveOut, DWORD dwRate)
|
||||||
dprintf_mmsys(stddeb, "waveOutSetPlaybackRate(%04X, %08lX);\n", hWaveOut, dwRate);
|
dprintf_mmsys(stddeb, "waveOutSetPlaybackRate(%04X, %08lX);\n", hWaveOut, dwRate);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), WODM_SETPLAYBACKRATE,
|
return wodMessage( lpDesc->uDeviceID, WODM_SETPLAYBACKRATE,
|
||||||
lpDesc->dwInstance, (DWORD)dwRate, 0L);
|
lpDesc->dwInstance, (DWORD)dwRate, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1754,7 +1794,8 @@ UINT16 waveOutGetID(HWAVEOUT16 hWaveOut, UINT16 * lpuDeviceID)
|
||||||
/*
|
/*
|
||||||
*lpuDeviceID = lpParms->wDeviceID;
|
*lpuDeviceID = lpParms->wDeviceID;
|
||||||
*/
|
*/
|
||||||
return 0;
|
*lpuDeviceID = lpDesc->uDeviceID;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1768,7 +1809,7 @@ DWORD waveOutMessage(HWAVEOUT16 hWaveOut, UINT16 uMessage,
|
||||||
hWaveOut, uMessage, dwParam1, dwParam2);
|
hWaveOut, uMessage, dwParam1, dwParam2);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return wodMessage( MMSYSTEM_FirstDevID(), uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
|
return wodMessage( lpDesc->uDeviceID, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1857,10 +1898,11 @@ UINT16 waveInOpen(HWAVEIN16 * lphWaveIn, UINT16 uDeviceID,
|
||||||
UINT16 waveInClose(HWAVEIN16 hWaveIn)
|
UINT16 waveInClose(HWAVEIN16 hWaveIn)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInClose(%04X)\n", hWaveIn);
|
dprintf_mmsys(stddeb, "waveInClose(%04X)\n", hWaveIn);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return widMessage(0, WIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
|
return widMessage(lpDesc->uDeviceID, WIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1872,6 +1914,7 @@ UINT16 waveInPrepareHeader(HWAVEIN16 hWaveIn,
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
LPWAVEHDR lp32WaveInHdr;
|
LPWAVEHDR lp32WaveInHdr;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInPrepareHeader(%04X, %p, %u);\n",
|
dprintf_mmsys(stddeb, "waveInPrepareHeader(%04X, %p, %u);\n",
|
||||||
hWaveIn, lpWaveInHdr, uSize);
|
hWaveIn, lpWaveInHdr, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
|
@ -1882,7 +1925,7 @@ UINT16 waveInPrepareHeader(HWAVEIN16 hWaveIn,
|
||||||
lp32WaveInHdr->dwBytesRecorded = 0;
|
lp32WaveInHdr->dwBytesRecorded = 0;
|
||||||
dprintf_mmsys(stddeb, "waveInPrepareHeader // lpData=%p size=%lu \n",
|
dprintf_mmsys(stddeb, "waveInPrepareHeader // lpData=%p size=%lu \n",
|
||||||
lp32WaveInHdr->lpData, lp32WaveInHdr->dwBufferLength);
|
lp32WaveInHdr->lpData, lp32WaveInHdr->dwBufferLength);
|
||||||
return widMessage(0, WIDM_PREPARE, lpDesc->dwInstance,
|
return widMessage(lpDesc->uDeviceID, WIDM_PREPARE, lpDesc->dwInstance,
|
||||||
(DWORD)lpWaveInHdr, uSize);
|
(DWORD)lpWaveInHdr, uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1895,6 +1938,7 @@ UINT16 waveInUnprepareHeader(HWAVEIN16 hWaveIn,
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
LPWAVEHDR lp32WaveInHdr;
|
LPWAVEHDR lp32WaveInHdr;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInUnprepareHeader(%04X, %p, %u);\n",
|
dprintf_mmsys(stddeb, "waveInUnprepareHeader(%04X, %p, %u);\n",
|
||||||
hWaveIn, lpWaveInHdr, uSize);
|
hWaveIn, lpWaveInHdr, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
|
@ -1904,7 +1948,7 @@ UINT16 waveInUnprepareHeader(HWAVEIN16 hWaveIn,
|
||||||
USER_HEAP_FREE(HIWORD((DWORD)lp32WaveInHdr->lpData));
|
USER_HEAP_FREE(HIWORD((DWORD)lp32WaveInHdr->lpData));
|
||||||
lp32WaveInHdr->lpData = NULL;
|
lp32WaveInHdr->lpData = NULL;
|
||||||
lp32WaveInHdr->lpNext = NULL;
|
lp32WaveInHdr->lpNext = NULL;
|
||||||
return widMessage(0, WIDM_UNPREPARE, lpDesc->dwInstance,
|
return widMessage(lpDesc->uDeviceID, WIDM_UNPREPARE, lpDesc->dwInstance,
|
||||||
(DWORD)lpWaveInHdr, uSize);
|
(DWORD)lpWaveInHdr, uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1917,6 +1961,7 @@ UINT16 waveInAddBuffer(HWAVEIN16 hWaveIn,
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
LPWAVEHDR lp32WaveInHdr;
|
LPWAVEHDR lp32WaveInHdr;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
|
dprintf_mmsys(stddeb, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
|
@ -1926,7 +1971,7 @@ UINT16 waveInAddBuffer(HWAVEIN16 hWaveIn,
|
||||||
lp32WaveInHdr->dwBytesRecorded = 0;
|
lp32WaveInHdr->dwBytesRecorded = 0;
|
||||||
dprintf_mmsys(stddeb, "waveInAddBuffer // lpData=%p size=%lu \n",
|
dprintf_mmsys(stddeb, "waveInAddBuffer // lpData=%p size=%lu \n",
|
||||||
lp32WaveInHdr->lpData, lp32WaveInHdr->dwBufferLength);
|
lp32WaveInHdr->lpData, lp32WaveInHdr->dwBufferLength);
|
||||||
return widMessage(0, WIDM_ADDBUFFER, lpDesc->dwInstance,
|
return widMessage(lpDesc->uDeviceID, WIDM_ADDBUFFER, lpDesc->dwInstance,
|
||||||
(DWORD)lpWaveInHdr, uSize);
|
(DWORD)lpWaveInHdr, uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1937,10 +1982,11 @@ UINT16 waveInAddBuffer(HWAVEIN16 hWaveIn,
|
||||||
UINT16 waveInStart(HWAVEIN16 hWaveIn)
|
UINT16 waveInStart(HWAVEIN16 hWaveIn)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInStart(%04X)\n", hWaveIn);
|
dprintf_mmsys(stddeb, "waveInStart(%04X)\n", hWaveIn);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return widMessage(0, WIDM_START, lpDesc->dwInstance, 0L, 0L);
|
return widMessage(lpDesc->uDeviceID, WIDM_START, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1950,10 +1996,11 @@ UINT16 waveInStart(HWAVEIN16 hWaveIn)
|
||||||
UINT16 waveInStop(HWAVEIN16 hWaveIn)
|
UINT16 waveInStop(HWAVEIN16 hWaveIn)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInStop(%04X)\n", hWaveIn);
|
dprintf_mmsys(stddeb, "waveInStop(%04X)\n", hWaveIn);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return widMessage(0, WIDM_STOP, lpDesc->dwInstance, 0L, 0L);
|
return widMessage(lpDesc->uDeviceID, WIDM_STOP, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1963,10 +2010,11 @@ UINT16 waveInStop(HWAVEIN16 hWaveIn)
|
||||||
UINT16 waveInReset(HWAVEIN16 hWaveIn)
|
UINT16 waveInReset(HWAVEIN16 hWaveIn)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInReset(%04X)\n", hWaveIn);
|
dprintf_mmsys(stddeb, "waveInReset(%04X)\n", hWaveIn);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return widMessage(0, WIDM_RESET, lpDesc->dwInstance, 0L, 0L);
|
return widMessage(lpDesc->uDeviceID, WIDM_RESET, lpDesc->dwInstance, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1976,10 +2024,11 @@ UINT16 waveInReset(HWAVEIN16 hWaveIn)
|
||||||
UINT16 waveInGetPosition(HWAVEIN16 hWaveIn, MMTIME * lpTime, UINT16 uSize)
|
UINT16 waveInGetPosition(HWAVEIN16 hWaveIn, MMTIME * lpTime, UINT16 uSize)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInGetPosition(%04X, %p, %u);\n", hWaveIn, lpTime, uSize);
|
dprintf_mmsys(stddeb, "waveInGetPosition(%04X, %p, %u);\n", hWaveIn, lpTime, uSize);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return widMessage(0, WIDM_GETPOS, lpDesc->dwInstance,
|
return widMessage(lpDesc->uDeviceID, WIDM_GETPOS, lpDesc->dwInstance,
|
||||||
(DWORD)lpTime, (DWORD)uSize);
|
(DWORD)lpTime, (DWORD)uSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1989,8 +2038,13 @@ UINT16 waveInGetPosition(HWAVEIN16 hWaveIn, MMTIME * lpTime, UINT16 uSize)
|
||||||
*/
|
*/
|
||||||
UINT16 waveInGetID(HWAVEIN16 hWaveIn, UINT16 * lpuDeviceID)
|
UINT16 waveInGetID(HWAVEIN16 hWaveIn, UINT16 * lpuDeviceID)
|
||||||
{
|
{
|
||||||
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInGetID\n");
|
dprintf_mmsys(stddeb, "waveInGetID\n");
|
||||||
if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
|
if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
|
*lpuDeviceID = lpDesc->uDeviceID;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2002,11 +2056,12 @@ DWORD waveInMessage(HWAVEIN16 hWaveIn, UINT16 uMessage,
|
||||||
DWORD dwParam1, DWORD dwParam2)
|
DWORD dwParam1, DWORD dwParam2)
|
||||||
{
|
{
|
||||||
LPWAVEOPENDESC lpDesc;
|
LPWAVEOPENDESC lpDesc;
|
||||||
|
|
||||||
dprintf_mmsys(stddeb, "waveInMessage(%04X, %04X, %08lX, %08lX)\n",
|
dprintf_mmsys(stddeb, "waveInMessage(%04X, %04X, %08lX, %08lX)\n",
|
||||||
hWaveIn, uMessage, dwParam1, dwParam2);
|
hWaveIn, uMessage, dwParam1, dwParam2);
|
||||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
|
||||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||||
return widMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
|
return widMessage(lpDesc->uDeviceID, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ static VOID TIME_MMSysTimeCallback( HWND32 hwnd, UINT32 msg,
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* StartMMTime [internal]
|
* StartMMTime [internal]
|
||||||
*/
|
*/
|
||||||
void StartMMTime()
|
static void StartMMTime()
|
||||||
{
|
{
|
||||||
if (!mmTimeStarted) {
|
if (!mmTimeStarted) {
|
||||||
mmTimeStarted = TRUE;
|
mmTimeStarted = TRUE;
|
||||||
|
|
|
@ -201,7 +201,7 @@ LONG GetBitmapBits32( HBITMAP32 hbitmap, LONG count, LPVOID buffer )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
widthbytes = DIB_GetImageWidthBytesX11(bmp->bitmap.bmWidth,bmp->bitmap.bmBitsPixel);
|
widthbytes = DIB_GetXImageWidthBytes(bmp->bitmap.bmWidth,bmp->bitmap.bmBitsPixel);
|
||||||
tmpbuffer = (LPBYTE)xmalloc(widthbytes*height);
|
tmpbuffer = (LPBYTE)xmalloc(widthbytes*height);
|
||||||
image = XCreateImage( display, DefaultVisualOfScreen(screen),
|
image = XCreateImage( display, DefaultVisualOfScreen(screen),
|
||||||
bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,
|
bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,
|
||||||
|
@ -223,8 +223,10 @@ LONG GetBitmapBits32( HBITMAP32 hbitmap, LONG count, LPVOID buffer )
|
||||||
*tbuf = 0;
|
*tbuf = 0;
|
||||||
for (w=0;w<bmp->bitmap.bmWidth;w++)
|
for (w=0;w<bmp->bitmap.bmWidth;w++)
|
||||||
{
|
{
|
||||||
|
if ((w%8) == 0)
|
||||||
|
*tbuf = 0;
|
||||||
*tbuf |= XGetPixel(image,w,h)<<(7-(w&7));
|
*tbuf |= XGetPixel(image,w,h)<<(7-(w&7));
|
||||||
if ((w&7) == 7) *(++tbuf) = 0;
|
if ((w&7) == 7) ++tbuf;
|
||||||
}
|
}
|
||||||
tbuf += pad;
|
tbuf += pad;
|
||||||
}
|
}
|
||||||
|
@ -348,7 +350,7 @@ LONG SetBitmapBits32( HBITMAP32 hbitmap, LONG count, LPCVOID buffer )
|
||||||
}
|
}
|
||||||
sbuf = (LPBYTE)buffer;
|
sbuf = (LPBYTE)buffer;
|
||||||
|
|
||||||
widthbytes = DIB_GetImageWidthBytesX11(bmp->bitmap.bmWidth,bmp->bitmap.bmBitsPixel);
|
widthbytes = DIB_GetXImageWidthBytes(bmp->bitmap.bmWidth,bmp->bitmap.bmBitsPixel);
|
||||||
tmpbuffer = (LPBYTE)xmalloc(widthbytes*height);
|
tmpbuffer = (LPBYTE)xmalloc(widthbytes*height);
|
||||||
image = XCreateImage( display, DefaultVisualOfScreen(screen),
|
image = XCreateImage( display, DefaultVisualOfScreen(screen),
|
||||||
bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,
|
bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,
|
||||||
|
|
|
@ -40,6 +40,8 @@ typedef struct
|
||||||
Colormap colorMap;
|
Colormap colorMap;
|
||||||
UINT16 size;
|
UINT16 size;
|
||||||
UINT16 flags;
|
UINT16 flags;
|
||||||
|
INT32 monoPlane; /* bit plane different for white and black pixels */
|
||||||
|
BOOL32 bWhiteOn; /* monoPlane bit is 1 for the white pixel */
|
||||||
} CSPACE;
|
} CSPACE;
|
||||||
|
|
||||||
static CSPACE cSpace = {0, 0, 0};
|
static CSPACE cSpace = {0, 0, 0};
|
||||||
|
@ -125,6 +127,12 @@ Colormap COLOR_GetColormap(void)
|
||||||
return cSpace.colorMap;
|
return cSpace.colorMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL32 COLOR_GetMonoPlane(INT32* plane)
|
||||||
|
{
|
||||||
|
*plane = cSpace.monoPlane;
|
||||||
|
return (cSpace.flags & COLOR_WHITESET) ? TRUE : FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
UINT16 COLOR_GetSystemPaletteSize(void)
|
UINT16 COLOR_GetSystemPaletteSize(void)
|
||||||
{
|
{
|
||||||
return (cSpace.flags & COLOR_PRIVATE) ? cSpace.size : 256;
|
return (cSpace.flags & COLOR_PRIVATE) ? cSpace.size : 256;
|
||||||
|
@ -537,10 +545,6 @@ static HPALETTE16 COLOR_InitPalette(void)
|
||||||
|
|
||||||
memset(COLOR_freeList, 0, 256*sizeof(unsigned char));
|
memset(COLOR_freeList, 0, 256*sizeof(unsigned char));
|
||||||
|
|
||||||
/* calculate max palette size */
|
|
||||||
|
|
||||||
cSpace.size = visual->map_entries;
|
|
||||||
|
|
||||||
if (cSpace.flags & COLOR_PRIVATE)
|
if (cSpace.flags & COLOR_PRIVATE)
|
||||||
COLOR_BuildPrivateMap( &cSpace );
|
COLOR_BuildPrivateMap( &cSpace );
|
||||||
else
|
else
|
||||||
|
@ -610,10 +614,20 @@ static void COLOR_Computeshifts(unsigned long maskbits, int *shift, int *max)
|
||||||
*/
|
*/
|
||||||
HPALETTE16 COLOR_Init(void)
|
HPALETTE16 COLOR_Init(void)
|
||||||
{
|
{
|
||||||
|
int mask, white, black;
|
||||||
|
|
||||||
visual = DefaultVisual( display, DefaultScreen(display) );
|
visual = DefaultVisual( display, DefaultScreen(display) );
|
||||||
|
|
||||||
dprintf_palette(stddeb,"COLOR_Init: initializing palette manager...");
|
dprintf_palette(stddeb,"COLOR_Init: initializing palette manager...");
|
||||||
|
|
||||||
|
white = WhitePixelOfScreen( screen );
|
||||||
|
black = BlackPixelOfScreen( screen );
|
||||||
|
cSpace.monoPlane = 1;
|
||||||
|
for( mask = 1; !((white & mask)^(black & mask)); mask <<= 1 )
|
||||||
|
cSpace.monoPlane++;
|
||||||
|
cSpace.flags = (white & mask) ? COLOR_WHITESET : 0;
|
||||||
|
cSpace.size = visual->map_entries;
|
||||||
|
|
||||||
switch(visual->class)
|
switch(visual->class)
|
||||||
{
|
{
|
||||||
case DirectColor:
|
case DirectColor:
|
||||||
|
@ -624,18 +638,23 @@ HPALETTE16 COLOR_Init(void)
|
||||||
{
|
{
|
||||||
XSetWindowAttributes win_attr;
|
XSetWindowAttributes win_attr;
|
||||||
|
|
||||||
cSpace.flags |= COLOR_PRIVATE;
|
|
||||||
cSpace.colorMap = XCreateColormap( display, rootWindow,
|
cSpace.colorMap = XCreateColormap( display, rootWindow,
|
||||||
visual, AllocAll );
|
visual, AllocAll );
|
||||||
if (cSpace.colorMap)
|
if (cSpace.colorMap)
|
||||||
{
|
{
|
||||||
if( rootWindow != DefaultRootWindow(display) )
|
cSpace.flags |= (COLOR_PRIVATE | COLOR_WHITESET);
|
||||||
{
|
|
||||||
|
cSpace.monoPlane = 1;
|
||||||
|
for( white = cSpace.size - 1; !(white & 1); white >>= 1 )
|
||||||
|
cSpace.monoPlane++;
|
||||||
|
|
||||||
|
if( rootWindow != DefaultRootWindow(display) )
|
||||||
|
{
|
||||||
win_attr.colormap = cSpace.colorMap;
|
win_attr.colormap = cSpace.colorMap;
|
||||||
XChangeWindowAttributes( display, rootWindow,
|
XChangeWindowAttributes( display, rootWindow,
|
||||||
CWColormap, &win_attr );
|
CWColormap, &win_attr );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cSpace.colorMap = DefaultColormapOfScreen( screen );
|
cSpace.colorMap = DefaultColormapOfScreen( screen );
|
||||||
|
@ -658,7 +677,8 @@ HPALETTE16 COLOR_Init(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf_palette(stddeb," visual class %i\n", visual->class);
|
dprintf_palette(stddeb," visual class %i (%i)\n",
|
||||||
|
visual->class, cSpace.monoPlane);
|
||||||
|
|
||||||
return COLOR_InitPalette();
|
return COLOR_InitPalette();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
/*
|
/*
|
||||||
* Theory:
|
* Theory:
|
||||||
*
|
*
|
||||||
|
* http://www.microsoft.com/win32dev/ui/icons.htm
|
||||||
|
*
|
||||||
* Cursors and icons are stored in a global heap block, with the
|
* Cursors and icons are stored in a global heap block, with the
|
||||||
* following layout:
|
* following layout:
|
||||||
*
|
*
|
||||||
|
@ -33,7 +35,6 @@
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "xmalloc.h"
|
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
extern UINT16 COLOR_GetSystemPaletteSize();
|
extern UINT16 COLOR_GetSystemPaletteSize();
|
||||||
|
@ -237,14 +238,15 @@ static BOOL32 CURSORICON_LoadDirEntry( HINSTANCE32 hInstance, SEGPTR name,
|
||||||
HGLOBAL16 CURSORICON_LoadHandler( HGLOBAL16 handle, HINSTANCE16 hInstance,
|
HGLOBAL16 CURSORICON_LoadHandler( HGLOBAL16 handle, HINSTANCE16 hInstance,
|
||||||
BOOL32 fCursor )
|
BOOL32 fCursor )
|
||||||
{
|
{
|
||||||
HBITMAP32 hAndBits, hXorBits;
|
static char* __loadhandlerStr = "CURSORICON_LoadHandler";
|
||||||
HDC32 hdc;
|
|
||||||
int size, sizeAnd, sizeXor;
|
int sizeAnd, sizeXor;
|
||||||
POINT16 hotspot = { 0 ,0 };
|
HBITMAP32 hAndBits = 0, hXorBits = 0; /* error condition for later */
|
||||||
BITMAPOBJ *bmpXor, *bmpAnd;
|
BITMAPOBJ *bmpXor, *bmpAnd;
|
||||||
BITMAPINFO *bmi, *pInfo;
|
POINT16 hotspot = { 0 ,0 };
|
||||||
CURSORICONINFO *info;
|
CURSORICONINFO *info;
|
||||||
char *bits;
|
BITMAPINFO *bmi;
|
||||||
|
HDC32 hdc;
|
||||||
|
|
||||||
if (fCursor) /* If cursor, get the hotspot */
|
if (fCursor) /* If cursor, get the hotspot */
|
||||||
{
|
{
|
||||||
|
@ -254,87 +256,81 @@ HGLOBAL16 CURSORICON_LoadHandler( HGLOBAL16 handle, HINSTANCE16 hInstance,
|
||||||
}
|
}
|
||||||
else bmi = (BITMAPINFO *)LockResource16( handle );
|
else bmi = (BITMAPINFO *)LockResource16( handle );
|
||||||
|
|
||||||
/* Create a copy of the bitmap header */
|
/* Check bitmap header */
|
||||||
|
|
||||||
size = DIB_BitmapInfoSize( bmi, DIB_RGB_COLORS );
|
if ( (bmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) &&
|
||||||
/* Make sure we have room for the monochrome bitmap later on */
|
(bmi->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) ||
|
||||||
size = MAX( size, sizeof(BITMAPINFOHEADER) + 2*sizeof(RGBQUAD) );
|
bmi->bmiHeader.biCompression != BI_RGB) )
|
||||||
pInfo = (BITMAPINFO *)xmalloc( size );
|
|
||||||
memcpy( pInfo, bmi, size );
|
|
||||||
|
|
||||||
if (pInfo->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
|
|
||||||
{
|
{
|
||||||
if (pInfo->bmiHeader.biCompression != BI_RGB)
|
fprintf(stderr,"%s: invalid bitmap header.\n", __loadhandlerStr);
|
||||||
{
|
return 0;
|
||||||
fprintf(stderr,"Unknown size for compressed icon bitmap.\n");
|
|
||||||
free( pInfo );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
pInfo->bmiHeader.biHeight /= 2;
|
|
||||||
}
|
}
|
||||||
else if (pInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
|
||||||
|
if( (hdc = GetDC32( 0 )) )
|
||||||
{
|
{
|
||||||
BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)pInfo;
|
BITMAPINFO* pInfo;
|
||||||
core->bcHeight /= 2;
|
INT32 size = DIB_BitmapInfoSize( bmi, DIB_RGB_COLORS );
|
||||||
|
|
||||||
|
/* Make sure we have room for the monochrome bitmap later on.
|
||||||
|
* Note that BITMAPINFOINFO and BITMAPCOREHEADER are the same
|
||||||
|
* up to and including the biBitCount. In-memory icon resource
|
||||||
|
* format is as follows:
|
||||||
|
*
|
||||||
|
* BITMAPINFOHEADER icHeader // DIB header
|
||||||
|
* RGBQUAD icColors[] // Color table
|
||||||
|
* BYTE icXOR[] // DIB bits for XOR mask
|
||||||
|
* BYTE icAND[] // DIB bits for AND mask
|
||||||
|
*/
|
||||||
|
|
||||||
|
if( (pInfo = (BITMAPINFO *)HeapAlloc( GetProcessHeap(), 0,
|
||||||
|
MAX(size, sizeof(BITMAPINFOHEADER) + 2*sizeof(RGBQUAD)))) )
|
||||||
|
{
|
||||||
|
memcpy( pInfo, bmi, size );
|
||||||
|
pInfo->bmiHeader.biHeight /= 2;
|
||||||
|
|
||||||
|
/* Create the XOR bitmap */
|
||||||
|
|
||||||
|
hXorBits = CreateDIBitmap32( hdc, &pInfo->bmiHeader, CBM_INIT,
|
||||||
|
(char*)bmi + size, pInfo, DIB_RGB_COLORS );
|
||||||
|
if( hXorBits )
|
||||||
|
{
|
||||||
|
char* bits = (char *)bmi + size + bmi->bmiHeader.biHeight *
|
||||||
|
DIB_GetDIBWidthBytes(bmi->bmiHeader.biWidth,
|
||||||
|
bmi->bmiHeader.biBitCount) / 2;
|
||||||
|
|
||||||
|
pInfo->bmiHeader.biBitCount = 1;
|
||||||
|
if (pInfo->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
|
||||||
|
{
|
||||||
|
RGBQUAD *rgb = pInfo->bmiColors;
|
||||||
|
|
||||||
|
pInfo->bmiHeader.biClrUsed = pInfo->bmiHeader.biClrImportant = 2;
|
||||||
|
rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00;
|
||||||
|
rgb[1].rgbBlue = rgb[1].rgbGreen = rgb[1].rgbRed = 0xff;
|
||||||
|
rgb[0].rgbReserved = rgb[1].rgbReserved = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RGBTRIPLE *rgb = (RGBTRIPLE *)(((BITMAPCOREHEADER *)pInfo) + 1);
|
||||||
|
|
||||||
|
rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00;
|
||||||
|
rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the AND bitmap */
|
||||||
|
|
||||||
|
hAndBits = CreateDIBitmap32( hdc, &pInfo->bmiHeader, CBM_INIT,
|
||||||
|
bits, pInfo, DIB_RGB_COLORS );
|
||||||
|
if( !hAndBits ) DeleteObject32( hXorBits );
|
||||||
|
}
|
||||||
|
HeapFree( GetProcessHeap(), 0, pInfo );
|
||||||
|
}
|
||||||
|
ReleaseDC32( 0, hdc );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if( !hXorBits || !hAndBits )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "CURSORICON_Load: Unknown bitmap length %ld!\n",
|
fprintf(stderr,"%s: unable to create a bitmap.\n", __loadhandlerStr );
|
||||||
pInfo->bmiHeader.biSize );
|
return 0;
|
||||||
free( pInfo );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create the XOR bitmap */
|
|
||||||
|
|
||||||
if (!(hdc = GetDC32( 0 )))
|
|
||||||
{
|
|
||||||
free( pInfo );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
hXorBits = CreateDIBitmap32( hdc, &pInfo->bmiHeader, CBM_INIT,
|
|
||||||
(char*)bmi + size, pInfo, DIB_RGB_COLORS );
|
|
||||||
if (!hXorBits) {
|
|
||||||
free( pInfo );
|
|
||||||
ReleaseDC32( 0, hdc );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fix the bitmap header to load the monochrome mask */
|
|
||||||
|
|
||||||
if (pInfo->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
|
|
||||||
{
|
|
||||||
BITMAPINFOHEADER *bih = &pInfo->bmiHeader;
|
|
||||||
RGBQUAD *rgb = pInfo->bmiColors;
|
|
||||||
bits = (char *)bmi + size +
|
|
||||||
DIB_GetImageWidthBytes(bih->biWidth,bih->biBitCount)*bih->biHeight;
|
|
||||||
bih->biBitCount = 1;
|
|
||||||
bih->biClrUsed = bih->biClrImportant = 2;
|
|
||||||
rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00;
|
|
||||||
rgb[1].rgbBlue = rgb[1].rgbGreen = rgb[1].rgbRed = 0xff;
|
|
||||||
rgb[0].rgbReserved = rgb[1].rgbReserved = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BITMAPCOREHEADER *bch = (BITMAPCOREHEADER *)pInfo;
|
|
||||||
RGBTRIPLE *rgb = (RGBTRIPLE *)(bch + 1);
|
|
||||||
bits = (char *)bmi + size +
|
|
||||||
DIB_GetImageWidthBytes(bch->bcWidth,bch->bcBitCount)*bch->bcHeight;
|
|
||||||
bch->bcBitCount = 1;
|
|
||||||
rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00;
|
|
||||||
rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create the AND bitmap */
|
|
||||||
|
|
||||||
hAndBits = CreateDIBitmap32( hdc, &pInfo->bmiHeader, CBM_INIT,
|
|
||||||
bits, pInfo, DIB_RGB_COLORS );
|
|
||||||
ReleaseDC32( 0, hdc );
|
|
||||||
if (!hAndBits) {
|
|
||||||
DeleteObject32( hXorBits );
|
|
||||||
free( pInfo );
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now create the CURSORICONINFO structure */
|
/* Now create the CURSORICONINFO structure */
|
||||||
|
@ -451,12 +447,12 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL32 bSemiTransparent)
|
||||||
HTASK16 hTask = GetCurrentTask();
|
HTASK16 hTask = GetCurrentTask();
|
||||||
TDB* pTask = (TDB *)GlobalLock16(hTask);
|
TDB* pTask = (TDB *)GlobalLock16(hTask);
|
||||||
|
|
||||||
if(hIcon)
|
if(hIcon && pTask)
|
||||||
if (!(ptr = (CURSORICONINFO*)GlobalLock16( hIcon ))) return FALSE;
|
if (!(ptr = (CURSORICONINFO*)GlobalLock16( hIcon ))) return FALSE;
|
||||||
if (ptr->bPlanes * ptr->bBitsPerPixel == 1)
|
if (ptr->bPlanes * ptr->bBitsPerPixel == 1)
|
||||||
hRet = CURSORICON_Copy( pTask->hInstance, hIcon );
|
hRet = CURSORICON_Copy( pTask->hInstance, hIcon );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BYTE pAndBits[128];
|
BYTE pAndBits[128];
|
||||||
BYTE pXorBits[128];
|
BYTE pXorBits[128];
|
||||||
int x, y, ix, iy, shift;
|
int x, y, ix, iy, shift;
|
||||||
|
@ -471,8 +467,6 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL32 bSemiTransparent)
|
||||||
COLORREF col;
|
COLORREF col;
|
||||||
CURSORICONINFO cI;
|
CURSORICONINFO cI;
|
||||||
|
|
||||||
if(!pTask) return 0;
|
|
||||||
|
|
||||||
memset(pXorBits, 0, 128);
|
memset(pXorBits, 0, 128);
|
||||||
cI.bBitsPerPixel = 1; cI.bPlanes = 1;
|
cI.bBitsPerPixel = 1; cI.bPlanes = 1;
|
||||||
cI.ptHotSpot.x = cI.ptHotSpot.y = 15;
|
cI.ptHotSpot.x = cI.ptHotSpot.y = 15;
|
||||||
|
@ -519,7 +513,7 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL32 bSemiTransparent)
|
||||||
hRet = CURSORICON_Copy( pTask->hInstance ,
|
hRet = CURSORICON_Copy( pTask->hInstance ,
|
||||||
CURSORICON_Load(0,MAKEINTRESOURCE(OCR_DRAGOBJECT),
|
CURSORICON_Load(0,MAKEINTRESOURCE(OCR_DRAGOBJECT),
|
||||||
SYSMETRICS_CXCURSOR, SYSMETRICS_CYCURSOR, 1, TRUE) );
|
SYSMETRICS_CXCURSOR, SYSMETRICS_CYCURSOR, 1, TRUE) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return hRet;
|
return hRet;
|
||||||
}
|
}
|
||||||
|
@ -1149,3 +1143,8 @@ HICON16 LoadIconHandler( HGLOBAL16 hResource, BOOL16 bNew )
|
||||||
}
|
}
|
||||||
return CURSORICON_LoadHandler( hResource, 0, FALSE);
|
return CURSORICON_LoadHandler( hResource, 0, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* GetIconInfo (USER32.241)
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -18,53 +18,51 @@
|
||||||
|
|
||||||
extern void CLIPPING_UpdateGCRegion(DC* );
|
extern void CLIPPING_UpdateGCRegion(DC* );
|
||||||
|
|
||||||
|
static int bitmapDepthTable[] = { 8, 1, 32, 16, 24, 15, 4, 0 };
|
||||||
|
static int ximageDepthTable[] = { 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DIB_GetImageWidthBytesX11
|
* DIB_Init
|
||||||
*
|
|
||||||
* Return the width of an X image in bytes
|
|
||||||
*/
|
*/
|
||||||
int DIB_GetImageWidthBytesX11( int width, int depth )
|
BOOL32 DIB_Init()
|
||||||
{
|
{
|
||||||
int wbits;
|
int i;
|
||||||
XImage *testimage;
|
XImage* testimage;
|
||||||
|
|
||||||
#define DEPTHCASE(depth) \
|
for( i = 0; bitmapDepthTable[i]; i++ )
|
||||||
case depth: { \
|
|
||||||
static int w##depth = 0; \
|
|
||||||
if (! w##depth ) { \
|
|
||||||
testimage=XCreateImage(display,DefaultVisualOfScreen(screen),\
|
|
||||||
depth,ZPixmap,0,NULL,1,1,32,20); \
|
|
||||||
w##depth = testimage->bits_per_pixel; \
|
|
||||||
XDestroyImage(testimage); \
|
|
||||||
} \
|
|
||||||
wbits = width*w##depth; \
|
|
||||||
break; \
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(depth)
|
|
||||||
{
|
{
|
||||||
DEPTHCASE(1);
|
testimage = XCreateImage(display, DefaultVisualOfScreen(screen),
|
||||||
DEPTHCASE(4);
|
bitmapDepthTable[i], ZPixmap, 0, NULL, 1, 1, 32, 20 );
|
||||||
DEPTHCASE(8);
|
if( testimage ) ximageDepthTable[i] = testimage->bits_per_pixel;
|
||||||
DEPTHCASE(15);
|
else return FALSE;
|
||||||
DEPTHCASE(16);
|
XDestroyImage(testimage);
|
||||||
DEPTHCASE(24);
|
|
||||||
DEPTHCASE(32);
|
|
||||||
default:
|
|
||||||
fprintf(stderr, "DIB: unsupported depth %d.\n", depth );
|
|
||||||
/* assume 32 bits/pixel */
|
|
||||||
wbits = width*32;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return 4 * ((wbits+31)/32);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DIB_GetImageWidthBytes
|
* DIB_GetXImageWidthBytes
|
||||||
*
|
*
|
||||||
* Return the width of an X image in bytes
|
* Return the width of an X image in bytes
|
||||||
*/
|
*/
|
||||||
int DIB_GetImageWidthBytes( int width, int depth )
|
int DIB_GetXImageWidthBytes( int width, int depth )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for( i = 0; bitmapDepthTable[i] ; i++ )
|
||||||
|
if( bitmapDepthTable[i] == depth )
|
||||||
|
return (4 * ((width * ximageDepthTable[i] + 31)/32));
|
||||||
|
fprintf(stderr, "DIB: unsupported depth %d.\n", depth );
|
||||||
|
return (4 * width);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* DIB_GetDIBWidthBytes
|
||||||
|
*
|
||||||
|
* Return the width of a DIB bitmap in bytes. DIB bitmap data is 32-bit aligned.
|
||||||
|
* http://www.microsoft.com/msdn/sdk/platforms/doc/sdk/win32/struc/src/str01.htm
|
||||||
|
*/
|
||||||
|
int DIB_GetDIBWidthBytes( int width, int depth )
|
||||||
{
|
{
|
||||||
int words;
|
int words;
|
||||||
|
|
||||||
|
@ -90,7 +88,7 @@ int DIB_GetImageWidthBytes( int width, int depth )
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DIB_BitmapInfoSize
|
* DIB_BitmapInfoSize
|
||||||
*
|
*
|
||||||
* Return the size of the bitmap info structure.
|
* Return the size of the bitmap info structure including color table.
|
||||||
*/
|
*/
|
||||||
int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse )
|
int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse )
|
||||||
{
|
{
|
||||||
|
@ -791,6 +789,8 @@ INT16 GetDIBits16( HDC16 hdc, HBITMAP16 hbitmap, UINT16 startscan,
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetDIBits32 (GDI32.170)
|
* GetDIBits32 (GDI32.170)
|
||||||
|
*
|
||||||
|
* http://www.microsoft.com/msdn/sdk/platforms/doc/sdk/win32/func/src/f30_14.htm
|
||||||
*/
|
*/
|
||||||
INT32 GetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
INT32 GetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
||||||
UINT32 lines, LPSTR bits, BITMAPINFO * info,
|
UINT32 lines, LPSTR bits, BITMAPINFO * info,
|
||||||
|
@ -864,7 +864,7 @@ INT32 GetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
||||||
switch( info->bmiHeader.biBitCount )
|
switch( info->bmiHeader.biBitCount )
|
||||||
{
|
{
|
||||||
case 8:
|
case 8:
|
||||||
/* pad up to 32 bit (FIXME: not 16? ) */
|
/* pad up to 32 bit */
|
||||||
pad += (4 - (info->bmiHeader.biWidth & 3)) & 3;
|
pad += (4 - (info->bmiHeader.biWidth & 3)) & 3;
|
||||||
for( y = yend - 1; (int)y >= (int)startscan; y-- )
|
for( y = yend - 1; (int)y >= (int)startscan; y-- )
|
||||||
{
|
{
|
||||||
|
@ -953,8 +953,8 @@ INT32 GetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
||||||
info->bmiHeader.biPlanes = 1;
|
info->bmiHeader.biPlanes = 1;
|
||||||
info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel;
|
info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel;
|
||||||
info->bmiHeader.biSizeImage = bmp->bitmap.bmHeight *
|
info->bmiHeader.biSizeImage = bmp->bitmap.bmHeight *
|
||||||
DIB_GetImageWidthBytes( bmp->bitmap.bmWidth,
|
DIB_GetDIBWidthBytes( bmp->bitmap.bmWidth,
|
||||||
bmp->bitmap.bmBitsPixel );
|
bmp->bitmap.bmBitsPixel );
|
||||||
info->bmiHeader.biCompression = 0;
|
info->bmiHeader.biCompression = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,10 +156,12 @@ BOOL32 GDI_Init(void)
|
||||||
{
|
{
|
||||||
HPALETTE16 hpalette;
|
HPALETTE16 hpalette;
|
||||||
extern BOOL32 X11DRV_Init(void);
|
extern BOOL32 X11DRV_Init(void);
|
||||||
|
extern BOOL32 DIB_Init(void);
|
||||||
|
|
||||||
/* Initialize drivers */
|
/* Initialize drivers */
|
||||||
|
|
||||||
if (!X11DRV_Init()) return FALSE;
|
if (!X11DRV_Init()) return FALSE;
|
||||||
|
if (!DIB_Init()) return FALSE;
|
||||||
|
|
||||||
/* Create default palette */
|
/* Create default palette */
|
||||||
|
|
||||||
|
|
|
@ -607,30 +607,38 @@ void PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
|
||||||
case META_EXTTEXTOUT:
|
case META_EXTTEXTOUT:
|
||||||
{
|
{
|
||||||
LPINT16 dxx;
|
LPINT16 dxx;
|
||||||
|
LPSTR sot;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
|
||||||
s1 = mr->rdParam[2]; /* String length */
|
s1 = mr->rdParam[2]; /* String length */
|
||||||
len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short)
|
len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short)
|
||||||
+ sizeof(UINT16) + sizeof(RECT16);
|
+ sizeof(UINT16) + (mr->rdParam[3] ? sizeof(RECT16) : 0); /* rec len without dx array */
|
||||||
if (mr->rdSize == len / 2)
|
|
||||||
dxx = NULL; /* No array present */
|
sot= (LPSTR)&mr->rdParam[4]; /* start_of_text */
|
||||||
else if (mr->rdSize == (len + s1 * sizeof(INT16)) / 2)
|
if (mr->rdParam[3])
|
||||||
dxx = &mr->rdParam[8+(s1+1)/2]; /* start of array */
|
sot+=sizeof(RECT16); /* there is a rectangle, so add offset */
|
||||||
else {
|
|
||||||
fprintf(stderr,
|
if (mr->rdSize == len / 2)
|
||||||
"PlayMetaFileRecord ExtTextOut mr->rdSize = %08lx, count = %x\n",
|
dxx = NULL; /* determine if array present */
|
||||||
mr->rdSize, s1);
|
else
|
||||||
dxx = NULL;
|
if (mr->rdSize == (len + s1 * sizeof(INT16)) / 2)
|
||||||
}
|
dxx = (LPINT16)(sot+(((s1+1)>>1)*2));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Please report: PlayMetaFile/ExtTextOut len=%ld slen=%d rdSize=%ld opt=%04x\n",
|
||||||
|
len,s1,mr->rdSize,mr->rdParam[3]);
|
||||||
|
dxx = NULL; /* should't happen -- but if, we continue with NULL [for workaround] */
|
||||||
|
}
|
||||||
ExtTextOut16( hdc, mr->rdParam[1], /* X position */
|
ExtTextOut16( hdc, mr->rdParam[1], /* X position */
|
||||||
mr->rdParam[0], /* Y position */
|
mr->rdParam[0], /* Y position */
|
||||||
mr->rdParam[3], /* options */
|
mr->rdParam[3], /* options */
|
||||||
(LPRECT16) &mr->rdParam[4], /* rectangle */
|
mr->rdParam[3] ? (LPRECT16) &mr->rdParam[4]:NULL, /* rectangle */
|
||||||
(char *)(mr->rdParam + 8), /* string */
|
sot, /* string */
|
||||||
s1, dxx); /* length, dx array */
|
s1, dxx); /* length, dx array */
|
||||||
if (dxx)
|
if (dxx)
|
||||||
dprintf_metafile(stddeb,"EXTTEXTOUT len: %ld (%hd %hd) [%s].\n",
|
dprintf_metafile(stddeb,"EXTTEXTOUT: %s len: %ld dx0: %d\n",
|
||||||
mr->rdSize,dxx[0],dxx[1],(char*) &(mr->rdParam[8]) );
|
sot,mr->rdSize,dxx[0]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -740,16 +748,29 @@ void PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
|
||||||
GlobalFree16(hndl);
|
GlobalFree16(hndl);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case META_DIBBITBLT:
|
||||||
|
{
|
||||||
|
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[8]);
|
||||||
|
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParam[0] );
|
||||||
|
StretchDIBits16(hdc,mr->rdParam[7],mr->rdParam[6],mr->rdParam[5],
|
||||||
|
mr->rdParam[4],mr->rdParam[3],mr->rdParam[2],
|
||||||
|
mr->rdParam[5],mr->rdParam[4],bits,info,
|
||||||
|
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1]));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case META_SETTEXTJUSTIFICATION:
|
||||||
|
SetTextJustification32(hdc, *(mr->rdParam + 1), *(mr->rdParam));
|
||||||
|
break;
|
||||||
|
|
||||||
#define META_UNIMP(x) case x: fprintf(stderr,"PlayMetaFileRecord:record type "#x" not implemented.\n");break;
|
#define META_UNIMP(x) case x: fprintf(stderr,"PlayMetaFileRecord:record type "#x" not implemented.\n");break;
|
||||||
META_UNIMP(META_SETTEXTCHAREXTRA)
|
META_UNIMP(META_SETTEXTCHAREXTRA)
|
||||||
META_UNIMP(META_SETTEXTJUSTIFICATION)
|
|
||||||
META_UNIMP(META_FRAMEREGION)
|
META_UNIMP(META_FRAMEREGION)
|
||||||
META_UNIMP(META_DRAWTEXT)
|
META_UNIMP(META_DRAWTEXT)
|
||||||
META_UNIMP(META_SETDIBTODEV)
|
META_UNIMP(META_SETDIBTODEV)
|
||||||
META_UNIMP(META_ANIMATEPALETTE)
|
META_UNIMP(META_ANIMATEPALETTE)
|
||||||
META_UNIMP(META_SETPALENTRIES)
|
META_UNIMP(META_SETPALENTRIES)
|
||||||
META_UNIMP(META_RESIZEPALETTE)
|
META_UNIMP(META_RESIZEPALETTE)
|
||||||
META_UNIMP(META_DIBBITBLT)
|
|
||||||
META_UNIMP(META_EXTFLOODFILL)
|
META_UNIMP(META_EXTFLOODFILL)
|
||||||
META_UNIMP(META_RESETDC)
|
META_UNIMP(META_RESETDC)
|
||||||
META_UNIMP(META_STARTDOC)
|
META_UNIMP(META_STARTDOC)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
|
SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
|
||||||
{
|
{
|
||||||
MENUITEM "&Restaurer", 61728
|
MENUITEM "&Restaurar", 61728
|
||||||
MENUITEM "&Mover", 61456
|
MENUITEM "&Mover", 61456
|
||||||
MENUITEM "&Tamaño", 61440
|
MENUITEM "&Tamaño", 61440
|
||||||
MENUITEM "Mi&nimizar", 61472
|
MENUITEM "Mi&nimizar", 61472
|
||||||
|
@ -20,12 +20,12 @@ EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Undo", EM_UNDO32
|
MENUITEM "&Undo", EM_UNDO32
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Cu&t", WM_CUT
|
MENUITEM "Co&rtar", WM_CUT
|
||||||
MENUITEM "&Copy", WM_COPY
|
MENUITEM "&Copiar", WM_COPY
|
||||||
MENUITEM "&Paste", WM_PASTE
|
MENUITEM "&Pegar", WM_PASTE
|
||||||
MENUITEM "&Delete", WM_CLEAR
|
MENUITEM "&Borrar", WM_CLEAR
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Select &All", EM_SETSEL32
|
MENUITEM "Seleccionar &todo", EM_SETSEL32
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,36 +148,66 @@ FONT 8, "Helv"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CHOOSE_FONT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134
|
CHOOSE_FONT DIALOG DISCARDABLE 13, 54, 264, 147
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Fuente"
|
CAPTION "Fuente"
|
||||||
FONT 8, "Helv"
|
FONT 8, "Helv"
|
||||||
{
|
{
|
||||||
LTEXT "Fuente:", 1088, 6, 6, 40, 9
|
LTEXT "&Fuente:",1088 ,6,3,40,9
|
||||||
LTEXT "", 1089, 60, 6, 150, 9
|
COMBOBOX 1136 ,6,13,94,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL |
|
||||||
DEFPUSHBUTTON "Aceptar", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE
|
||||||
PUSHBUTTON "Cancelar", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
|
LTEXT "Est&ilo de fuente:",1089 ,108,3,44,9
|
||||||
|
COMBOBOX 1137,108,13,64,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL |
|
||||||
|
WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE
|
||||||
|
LTEXT "&Tamaño:",1090,179,3,30,9
|
||||||
|
COMBOBOX 1138,179,13,32,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL |
|
||||||
|
WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE | CBS_SORT
|
||||||
|
DEFPUSHBUTTON "Aceptar",IDOK,218,6,40,14,WS_GROUP
|
||||||
|
PUSHBUTTON "Cancelar",IDCANCEL,218,23,40,14,WS_GROUP
|
||||||
|
PUSHBUTTON "A&plicar", 1026,218,40,40,14,WS_GROUP
|
||||||
|
PUSHBUTTON "A&yuda" , 1038,218,57,40,14,WS_GROUP
|
||||||
|
GROUPBOX "&Efectos",1072,6,72,84,34,WS_GROUP
|
||||||
|
CHECKBOX "&Rayado", 1040, 10,82,50,10, BS_AUTOCHECKBOX | WS_TABSTOP
|
||||||
|
CHECKBOX "&Subrayado", 1041, 10,94,50,10, BS_AUTOCHECKBOX
|
||||||
|
LTEXT "&Color:", 1091 ,6,110,30,9
|
||||||
|
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
|
||||||
|
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
|
||||||
|
GROUPBOX "Ejemplo",1073,98,72,160,49,WS_GROUP
|
||||||
|
CTEXT "AaBbYyZzÑñ",1093,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 200
|
CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Color"
|
CAPTION "Color"
|
||||||
FONT 8, "Helv"
|
FONT 8, "Helv"
|
||||||
{
|
{
|
||||||
LTEXT "Colores &basicos:", 1088, 6, 6, 40, 9
|
LTEXT "Colores &básicos:", 1088, 4, 4, 140, 10
|
||||||
LTEXT "Colores person&alizados:", 1089, 6, 126, 40, 9
|
LTEXT "Colores person&alizados:", 1089, 4, 106, 140, 10
|
||||||
LTEXT "Color|Sól&ido", 1090, 100, 146, 40, 9
|
LTEXT "Color|Só3l&ido", 1090, 150, 151, 48, 10
|
||||||
LTEXT "&Hue:", 1091, 150, 126, 40, 9
|
LTEXT "&Rojo:", 726 /*1094*/,249,126,24,10
|
||||||
LTEXT "&Sat:", 1092, 150, 146, 40, 9
|
EDITTEXT 706, 275,124,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||||
LTEXT "&Lum:", 1093, 150, 166, 40, 9
|
LTEXT "&Verde:",727/*1095*/,249,140,24,10
|
||||||
LTEXT "&Rojo:", 1094, 150, 126, 40, 9
|
EDITTEXT 707, 275,138,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||||
LTEXT "&Verde:", 1095, 150, 146, 40, 9
|
LTEXT "A&zul:",728 /*1096*/,249,154,24,10
|
||||||
LTEXT "A&zul:", 1096, 150, 166, 40, 9
|
EDITTEXT 708, 275,152,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||||
DEFPUSHBUTTON "Aceptar", 1, 6, 182, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
LTEXT "&Tinte:" ,723 /*1091*/,202,126,22,10
|
||||||
PUSHBUTTON "Agregar a los &colores personalizados", 1024, 120, 182, 100, 14, WS_GROUP | WS_TABSTOP
|
EDITTEXT 703, 226,124,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||||
PUSHBUTTON "Borrar colores personalizados", 1025, 6, 164, 56, 14, WS_GROUP | WS_TABSTOP
|
LTEXT "&Sat.:" ,724 /*1092*/,202,140,22,10
|
||||||
PUSHBUTTON "Cancelar", 2, 76, 182, 56, 14, WS_GROUP | WS_TABSTOP
|
EDITTEXT 704, 226,138,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||||
|
LTEXT "&Lum.:" ,725 /*1093*/,202,154,22,10
|
||||||
|
EDITTEXT 705, 226,152,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||||
|
CONTROL "" ,720,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,14,140,86
|
||||||
|
CONTROL "" ,721,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,116,140,28
|
||||||
|
CONTROL "" ,710,"STATIC",WS_BORDER|SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,4,118,116 CONTROL "" ,702,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 278,4,8,116
|
||||||
|
CONTROL "" ,702,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 278,4,8,116
|
||||||
|
CONTROL "" ,709,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,124,40,26
|
||||||
|
DEFPUSHBUTTON "Aceptar", 1, 4, 166, 44, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||||
|
PUSHBUTTON "Cancelar", 2, 52, 166, 44, 14, WS_GROUP | WS_TABSTOP
|
||||||
|
PUSHBUTTON "A&yuda", 1038,100,166, 44, 14
|
||||||
|
PUSHBUTTON "Agregar a los &colores personalizados", 712/*1024*/, 152, 166, 142, 14, WS_GROUP | WS_TABSTOP
|
||||||
|
PUSHBUTTON "&Definir colores personalizados >>", 719/*1025*/, 4, 150, 142, 14, WS_GROUP | WS_TABSTOP
|
||||||
|
PUSHBUTTON "&i",713,300,200,4,14 /* just a dummy: 'i' is like &i in "sol&id" */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ static HGLOBAL32 CURSORICON32_LoadHandler( HANDLE32 handle,
|
||||||
BITMAPINFOHEADER *bih = &pInfo->bmiHeader;
|
BITMAPINFOHEADER *bih = &pInfo->bmiHeader;
|
||||||
RGBQUAD *rgb = pInfo->bmiColors;
|
RGBQUAD *rgb = pInfo->bmiColors;
|
||||||
bits = (char *)bmi + size +
|
bits = (char *)bmi + size +
|
||||||
DIB_GetImageWidthBytes(bih->biWidth,bih->biBitCount)*bih->biHeight;
|
DIB_GetDIBWidthBytes(bih->biWidth,bih->biBitCount)*bih->biHeight;
|
||||||
bih->biBitCount = 1;
|
bih->biBitCount = 1;
|
||||||
bih->biClrUsed = bih->biClrImportant = 2;
|
bih->biClrUsed = bih->biClrImportant = 2;
|
||||||
rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00;
|
rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00;
|
||||||
|
@ -351,7 +351,7 @@ static HGLOBAL32 CURSORICON32_LoadHandler( HANDLE32 handle,
|
||||||
BITMAPCOREHEADER *bch = (BITMAPCOREHEADER *)pInfo;
|
BITMAPCOREHEADER *bch = (BITMAPCOREHEADER *)pInfo;
|
||||||
RGBTRIPLE *rgb = (RGBTRIPLE *)(bch + 1);
|
RGBTRIPLE *rgb = (RGBTRIPLE *)(bch + 1);
|
||||||
bits = (char *)bmi + size +
|
bits = (char *)bmi + size +
|
||||||
DIB_GetImageWidthBytes(bch->bcWidth,bch->bcBitCount)*bch->bcHeight;
|
DIB_GetDIBWidthBytes(bch->bcWidth,bch->bcBitCount)*bch->bcHeight;
|
||||||
bch->bcBitCount = 1;
|
bch->bcBitCount = 1;
|
||||||
rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00;
|
rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00;
|
||||||
rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff;
|
rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff;
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#define DEBUG_WIN32
|
#define DEBUG_WIN32
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
DWORD ErrnoToLastError(int errno_num);
|
||||||
|
|
||||||
static int TranslateCreationFlags(DWORD create_flags);
|
static int TranslateCreationFlags(DWORD create_flags);
|
||||||
static int TranslateAccessFlags(DWORD access_flags);
|
static int TranslateAccessFlags(DWORD access_flags);
|
||||||
|
|
|
@ -325,7 +325,7 @@ DWORD WaitForSingleObject(HANDLE32 h, DWORD timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* WaitForSingleObject (USER32.399)
|
* WaitForMultipleObjects (USER32.399)
|
||||||
*/
|
*/
|
||||||
DWORD MsgWaitForMultipleObjects(
|
DWORD MsgWaitForMultipleObjects(
|
||||||
DWORD nCount,HANDLE32 *pHandles,BOOL32 fWaitAll,DWORD dwMilliseconds,
|
DWORD nCount,HANDLE32 *pHandles,BOOL32 fWaitAll,DWORD dwMilliseconds,
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
static short iF10Key = 0;
|
static short iF10Key = 0;
|
||||||
static short iMenuSysKey = 0;
|
static short iMenuSysKey = 0;
|
||||||
|
|
||||||
|
extern void EndMenu(void);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DEFWND_HandleWindowPosChanged
|
* DEFWND_HandleWindowPosChanged
|
||||||
*
|
*
|
||||||
|
@ -328,8 +330,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT32 msg, WPARAM32 wParam,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_CANCELMODE:
|
case WM_CANCELMODE:
|
||||||
/* EndMenu() should be called if in menu state but currently it's
|
if (wndPtr->parent == WIN_GetDesktop()) EndMenu();
|
||||||
impossible to detect - menu code should be updated*/
|
|
||||||
if (GetCapture32() == wndPtr->hwndSelf) ReleaseCapture();
|
if (GetCapture32() == wndPtr->hwndSelf) ReleaseCapture();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ LRESULT SendDriverMessage(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = CallDriverProc( lpdrv->lpDrvProc, 0L /* FIXME */, hDriver, msg,
|
retval = CallDriverProc( (FARPROC16)lpdrv->lpDrvProc, 0L /* FIXME */,
|
||||||
lParam1, lParam2 );
|
hDriver, msg, lParam1, lParam2 );
|
||||||
|
|
||||||
dprintf_driver( stddeb, "SendDriverMessage // retval = %ld\n", retval );
|
dprintf_driver( stddeb, "SendDriverMessage // retval = %ld\n", retval );
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/Intrinsic.h>
|
#include <X11/Intrinsic.h>
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
|
#include "color.h"
|
||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "gdi.h"
|
#include "gdi.h"
|
||||||
#include "dc.h"
|
#include "dc.h"
|
||||||
|
@ -65,7 +66,7 @@ BOOL32 GRAPH_DrawLines( HDC32 hdc, LPPOINT32 pXY, INT32 N, HPEN32 hPen )
|
||||||
*/
|
*/
|
||||||
BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
|
BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
|
||||||
INT32 xdest, INT32 ydest, INT32 xsrc, INT32 ysrc,
|
INT32 xdest, INT32 ydest, INT32 xsrc, INT32 ysrc,
|
||||||
INT32 width, INT32 height )
|
INT32 width, INT32 height, BOOL32 bMono )
|
||||||
{
|
{
|
||||||
BITMAPOBJ *bmp;
|
BITMAPOBJ *bmp;
|
||||||
DC *dc;
|
DC *dc;
|
||||||
|
@ -73,24 +74,43 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
|
||||||
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
|
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
|
||||||
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
|
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
xdest += dc->w.DCOrgX; ydest += dc->w.DCOrgY;
|
||||||
|
|
||||||
XSetFunction( display, dc->u.x.gc, GXcopy );
|
XSetFunction( display, dc->u.x.gc, GXcopy );
|
||||||
if (bmp->bitmap.bmBitsPixel == 1)
|
if (bmp->bitmap.bmBitsPixel == 1)
|
||||||
{
|
{
|
||||||
XSetForeground( display, dc->u.x.gc, dc->w.backgroundPixel );
|
XSetForeground( display, dc->u.x.gc, dc->w.backgroundPixel );
|
||||||
XSetBackground( display, dc->u.x.gc, dc->w.textPixel );
|
XSetBackground( display, dc->u.x.gc, dc->w.textPixel );
|
||||||
XCopyPlane( display, bmp->pixmap, dc->u.x.drawable, dc->u.x.gc,
|
XCopyPlane( display, bmp->pixmap, dc->u.x.drawable, dc->u.x.gc,
|
||||||
xsrc, ysrc, width, height,
|
xsrc, ysrc, width, height, xdest, ydest, 1 );
|
||||||
dc->w.DCOrgX + xdest, dc->w.DCOrgY + ydest, 1 );
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
else if (bmp->bitmap.bmBitsPixel == dc->w.bitsPerPixel)
|
else if (bmp->bitmap.bmBitsPixel == dc->w.bitsPerPixel)
|
||||||
{
|
{
|
||||||
XCopyArea( display, bmp->pixmap, dc->u.x.drawable, dc->u.x.gc,
|
if( bMono )
|
||||||
xsrc, ysrc, width, height,
|
{
|
||||||
dc->w.DCOrgX + xdest, dc->w.DCOrgY + ydest );
|
INT32 plane;
|
||||||
return TRUE;
|
|
||||||
|
if( COLOR_GetMonoPlane(&plane) )
|
||||||
|
{
|
||||||
|
XSetForeground( display, dc->u.x.gc, dc->w.backgroundPixel );
|
||||||
|
XSetBackground( display, dc->u.x.gc, dc->w.textPixel );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XSetForeground( display, dc->u.x.gc, dc->w.textPixel );
|
||||||
|
XSetBackground( display, dc->u.x.gc, dc->w.backgroundPixel );
|
||||||
|
}
|
||||||
|
XCopyPlane( display, bmp->pixmap, dc->u.x.drawable, dc->u.x.gc,
|
||||||
|
xsrc, ysrc, width, height, xdest, ydest, plane );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
XCopyArea( display, bmp->pixmap, dc->u.x.drawable,
|
||||||
|
dc->u.x.gc, xsrc, ysrc, width, height, xdest, ydest );
|
||||||
}
|
}
|
||||||
else return FALSE;
|
else return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -639,7 +639,7 @@ msg->hwnd=%04x, msg->message=%04x\n", hAccel,hWnd,msg->hwnd,msg->message);
|
||||||
if (sendmsg) /* found an accelerator, but send a message... ? */
|
if (sendmsg) /* found an accelerator, but send a message... ? */
|
||||||
{
|
{
|
||||||
INT16 iSysStat,iStat,mesg=0;
|
INT16 iSysStat,iStat,mesg=0;
|
||||||
HMENU16 hSysMenu,hMenu;
|
HMENU16 hMenu;
|
||||||
|
|
||||||
if (msg->message == WM_KEYUP || msg->message == WM_SYSKEYUP)
|
if (msg->message == WM_KEYUP || msg->message == WM_SYSKEYUP)
|
||||||
mesg=1;
|
mesg=1;
|
||||||
|
@ -651,16 +651,14 @@ msg->hwnd=%04x, msg->message=%04x\n", hAccel,hWnd,msg->hwnd,msg->message);
|
||||||
mesg=3;
|
mesg=3;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hMenu=GetMenu32(hWnd);
|
WND* wndPtr = WIN_FindWndPtr(hWnd);
|
||||||
hSysMenu=GetSystemMenu32(hWnd,FALSE);
|
|
||||||
if (hSysMenu)
|
hMenu = (wndPtr->dwStyle & WS_CHILD) ? 0 : (HMENU32)wndPtr->wIDmenu;
|
||||||
iSysStat=GetMenuState32(hSysMenu,lpAccelTbl->tbl[i].wIDval,MF_BYCOMMAND);
|
iSysStat = (wndPtr->hSysMenu) ? GetMenuState32(GetSubMenu16(wndPtr->hSysMenu, 0),
|
||||||
else
|
lpAccelTbl->tbl[i].wIDval, MF_BYCOMMAND) : -1 ;
|
||||||
iSysStat=-1;
|
iStat = (hMenu) ? GetMenuState32(hMenu,
|
||||||
if (hMenu)
|
lpAccelTbl->tbl[i].wIDval, MF_BYCOMMAND) : -1 ;
|
||||||
iStat=GetMenuState32(hMenu,lpAccelTbl->tbl[i].wIDval,MF_BYCOMMAND);
|
|
||||||
else
|
|
||||||
iStat=-1;
|
|
||||||
if (iSysStat!=-1)
|
if (iSysStat!=-1)
|
||||||
{
|
{
|
||||||
if (iSysStat & (MF_DISABLED|MF_GRAYED))
|
if (iSysStat & (MF_DISABLED|MF_GRAYED))
|
||||||
|
|
163
windows/mdi.c
163
windows/mdi.c
|
@ -30,6 +30,8 @@
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
#define MDIF_NEEDUPDATE 0x0001
|
||||||
|
|
||||||
|
|
||||||
static HBITMAP16 hBmpClose = 0;
|
static HBITMAP16 hBmpClose = 0;
|
||||||
static HBITMAP16 hBmpRestore = 0;
|
static HBITMAP16 hBmpRestore = 0;
|
||||||
|
@ -57,9 +59,9 @@ static HWND16 MDI_GetChildByID(WND* wndPtr,int id)
|
||||||
|
|
||||||
static void MDI_PostUpdate(HWND16 hwnd, MDICLIENTINFO* ci, WORD recalc)
|
static void MDI_PostUpdate(HWND16 hwnd, MDICLIENTINFO* ci, WORD recalc)
|
||||||
{
|
{
|
||||||
if( !ci->sbNeedUpdate )
|
if( !(ci->mdiFlags & MDIF_NEEDUPDATE) )
|
||||||
{
|
{
|
||||||
ci->sbNeedUpdate = TRUE;
|
ci->mdiFlags |= MDIF_NEEDUPDATE;
|
||||||
PostMessage16( hwnd, WM_MDICALCCHILDSCROLL, 0, 0);
|
PostMessage16( hwnd, WM_MDICALCCHILDSCROLL, 0, 0);
|
||||||
}
|
}
|
||||||
ci->sbRecalc = recalc;
|
ci->sbRecalc = recalc;
|
||||||
|
@ -980,7 +982,6 @@ static void MDI_UpdateFrameText( WND *frameWnd, HWND16 hClient,
|
||||||
LRESULT MDIClientWndProc(HWND16 hwnd, UINT16 message, WPARAM16 wParam, LPARAM lParam)
|
LRESULT MDIClientWndProc(HWND16 hwnd, UINT16 message, WPARAM16 wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
LPCREATESTRUCT16 cs;
|
LPCREATESTRUCT16 cs;
|
||||||
LPCLIENTCREATESTRUCT16 ccs;
|
|
||||||
MDICLIENTINFO *ci;
|
MDICLIENTINFO *ci;
|
||||||
RECT16 rect;
|
RECT16 rect;
|
||||||
WND *w = WIN_FindWndPtr(hwnd);
|
WND *w = WIN_FindWndPtr(hwnd);
|
||||||
|
@ -999,17 +1000,25 @@ LRESULT MDIClientWndProc(HWND16 hwnd, UINT16 message, WPARAM16 wParam, LPARAM lP
|
||||||
* so we have to keep track of what environment we're in. */
|
* so we have to keep track of what environment we're in. */
|
||||||
|
|
||||||
if( w->flags & WIN_ISWIN32 )
|
if( w->flags & WIN_ISWIN32 )
|
||||||
ccs = (LPCLIENTCREATESTRUCT16) cs->lpCreateParams;
|
{
|
||||||
|
#define ccs ((LPCLIENTCREATESTRUCT32)cs->lpCreateParams)
|
||||||
|
ci->hWindowMenu = ccs->hWindowMenu;
|
||||||
|
ci->idFirstChild = ccs->idFirstChild;
|
||||||
|
#undef ccs
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ccs = (LPCLIENTCREATESTRUCT16) PTR_SEG_TO_LIN(cs->lpCreateParams);
|
{
|
||||||
|
LPCLIENTCREATESTRUCT16 ccs = (LPCLIENTCREATESTRUCT16)
|
||||||
|
PTR_SEG_TO_LIN(cs->lpCreateParams);
|
||||||
|
ci->hWindowMenu = ccs->hWindowMenu;
|
||||||
|
ci->idFirstChild = ccs->idFirstChild;
|
||||||
|
}
|
||||||
|
|
||||||
ci->hWindowMenu = ccs->hWindowMenu;
|
|
||||||
ci->idFirstChild = ccs->idFirstChild;
|
|
||||||
ci->hwndChildMaximized = 0;
|
ci->hwndChildMaximized = 0;
|
||||||
ci->nActiveChildren = 0;
|
ci->nActiveChildren = 0;
|
||||||
ci->nTotalCreated = 0;
|
ci->nTotalCreated = 0;
|
||||||
ci->frameTitle = NULL;
|
ci->frameTitle = NULL;
|
||||||
ci->sbNeedUpdate = 0;
|
ci->mdiFlags = 0;
|
||||||
ci->self = hwnd;
|
ci->self = hwnd;
|
||||||
w->dwStyle |= WS_CLIPCHILDREN;
|
w->dwStyle |= WS_CLIPCHILDREN;
|
||||||
|
|
||||||
|
@ -1020,7 +1029,7 @@ LRESULT MDIClientWndProc(HWND16 hwnd, UINT16 message, WPARAM16 wParam, LPARAM lP
|
||||||
}
|
}
|
||||||
MDI_UpdateFrameText(frameWnd, hwnd, MDI_NOFRAMEREPAINT,frameWnd->text);
|
MDI_UpdateFrameText(frameWnd, hwnd, MDI_NOFRAMEREPAINT,frameWnd->text);
|
||||||
|
|
||||||
AppendMenu32A( ccs->hWindowMenu, MF_SEPARATOR, 0, NULL );
|
AppendMenu32A( ci->hWindowMenu, MF_SEPARATOR, 0, NULL );
|
||||||
|
|
||||||
GetClientRect16(frameWnd->hwndSelf, &rect);
|
GetClientRect16(frameWnd->hwndSelf, &rect);
|
||||||
NC_HandleNCCalcSize( w, &rect );
|
NC_HandleNCCalcSize( w, &rect );
|
||||||
|
@ -1064,7 +1073,7 @@ LRESULT MDIClientWndProc(HWND16 hwnd, UINT16 message, WPARAM16 wParam, LPARAM lP
|
||||||
((LONG) (ci->hwndChildMaximized>0) << 16));
|
((LONG) (ci->hwndChildMaximized>0) << 16));
|
||||||
|
|
||||||
case WM_MDIICONARRANGE:
|
case WM_MDIICONARRANGE:
|
||||||
ci->sbNeedUpdate = TRUE;
|
ci->mdiFlags |= MDIF_NEEDUPDATE;
|
||||||
MDIIconArrange(hwnd);
|
MDIIconArrange(hwnd);
|
||||||
ci->sbRecalc = SB_BOTH+1;
|
ci->sbRecalc = SB_BOTH+1;
|
||||||
SendMessage16(hwnd,WM_MDICALCCHILDSCROLL,0,0L);
|
SendMessage16(hwnd,WM_MDICALCCHILDSCROLL,0,0L);
|
||||||
|
@ -1090,17 +1099,17 @@ LRESULT MDIClientWndProc(HWND16 hwnd, UINT16 message, WPARAM16 wParam, LPARAM lP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case WM_MDITILE:
|
case WM_MDITILE:
|
||||||
ci->sbNeedUpdate = TRUE;
|
ci->mdiFlags |= MDIF_NEEDUPDATE;
|
||||||
ShowScrollBar32(hwnd,SB_BOTH,FALSE);
|
ShowScrollBar32(hwnd,SB_BOTH,FALSE);
|
||||||
MDITile(w, ci,wParam);
|
MDITile(w, ci,wParam);
|
||||||
ci->sbNeedUpdate = FALSE;
|
ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_VSCROLL:
|
case WM_VSCROLL:
|
||||||
case WM_HSCROLL:
|
case WM_HSCROLL:
|
||||||
ci->sbNeedUpdate = TRUE;
|
ci->mdiFlags |= MDIF_NEEDUPDATE;
|
||||||
ScrollChildren32(hwnd,message,wParam,lParam);
|
ScrollChildren32(hwnd,message,wParam,lParam);
|
||||||
ci->sbNeedUpdate = FALSE;
|
ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
|
@ -1132,27 +1141,27 @@ LRESULT MDIClientWndProc(HWND16 hwnd, UINT16 message, WPARAM16 wParam, LPARAM lP
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
if( ci->hwndChildMaximized )
|
if( ci->hwndChildMaximized )
|
||||||
{
|
{
|
||||||
WND* child = WIN_FindWndPtr(ci->hwndChildMaximized);
|
WND* child = WIN_FindWndPtr(ci->hwndChildMaximized);
|
||||||
RECT16 rect = { 0, 0, LOWORD(lParam), HIWORD(lParam) };
|
RECT16 rect = { 0, 0, LOWORD(lParam), HIWORD(lParam) };
|
||||||
|
|
||||||
AdjustWindowRectEx16(&rect, child->dwStyle, 0, child->dwExStyle);
|
AdjustWindowRectEx16(&rect, child->dwStyle, 0, child->dwExStyle);
|
||||||
MoveWindow16(ci->hwndChildMaximized, rect.left, rect.top,
|
MoveWindow16(ci->hwndChildMaximized, rect.left, rect.top,
|
||||||
rect.right - rect.left, rect.bottom - rect.top, 1);
|
rect.right - rect.left, rect.bottom - rect.top, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
MDI_PostUpdate(hwnd, ci, SB_BOTH+1);
|
MDI_PostUpdate(hwnd, ci, SB_BOTH+1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_MDICALCCHILDSCROLL:
|
case WM_MDICALCCHILDSCROLL:
|
||||||
if( ci->sbNeedUpdate )
|
if( (ci->mdiFlags & MDIF_NEEDUPDATE) && ci->sbRecalc )
|
||||||
if( ci->sbRecalc )
|
{
|
||||||
{
|
CalcChildScroll(hwnd, ci->sbRecalc-1);
|
||||||
CalcChildScroll(hwnd, ci->sbRecalc-1);
|
ci->sbRecalc = 0;
|
||||||
ci->sbRecalc = ci->sbNeedUpdate = 0;
|
ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1236,20 +1245,20 @@ LRESULT DefFrameProc16( HWND16 hwnd, HWND16 hwndMDIClient, UINT16 message,
|
||||||
|
|
||||||
if( !(wndPtr->parent->dwStyle & WS_MINIMIZE)
|
if( !(wndPtr->parent->dwStyle & WS_MINIMIZE)
|
||||||
&& ci->hwndActiveChild && !ci->hwndChildMaximized )
|
&& ci->hwndActiveChild && !ci->hwndChildMaximized )
|
||||||
{
|
{
|
||||||
/* control menu is between the frame system menu and
|
/* control menu is between the frame system menu and
|
||||||
* the first entry of menu bar */
|
* the first entry of menu bar */
|
||||||
|
|
||||||
if( wParam == VK_LEFT )
|
if( (wParam == VK_LEFT &&
|
||||||
{ if( wndPtr->parent->wIDmenu != LOWORD(lParam) ) break; }
|
wndPtr->parent->wIDmenu == LOWORD(lParam)) ||
|
||||||
else if( wParam == VK_RIGHT )
|
(wParam == VK_RIGHT &&
|
||||||
{ if( GetSystemMenu16( wndPtr->parent->hwndSelf, 0)
|
GetSubMenu16(wndPtr->parent->hSysMenu, 0) == LOWORD(lParam)) )
|
||||||
!= LOWORD(lParam) ) break; }
|
{
|
||||||
else break;
|
wndPtr = WIN_FindWndPtr(ci->hwndActiveChild);
|
||||||
|
return MAKELONG( GetSubMenu16(wndPtr->hSysMenu, 0),
|
||||||
return MAKELONG( GetSystemMenu16(ci->hwndActiveChild, 0),
|
ci->hwndActiveChild);
|
||||||
ci->hwndActiveChild );
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1405,8 +1414,7 @@ LRESULT DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_SETVISIBLE:
|
case WM_SETVISIBLE:
|
||||||
if( ci->hwndChildMaximized)
|
if( ci->hwndChildMaximized) ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||||
ci->sbNeedUpdate = 0;
|
|
||||||
else
|
else
|
||||||
MDI_PostUpdate(clientWnd->hwndSelf, ci, SB_BOTH+1);
|
MDI_PostUpdate(clientWnd->hwndSelf, ci, SB_BOTH+1);
|
||||||
break;
|
break;
|
||||||
|
@ -1469,7 +1477,7 @@ LRESULT DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
||||||
case WM_NEXTMENU:
|
case WM_NEXTMENU:
|
||||||
|
|
||||||
if( wParam == VK_LEFT ) /* switch to frame system menu */
|
if( wParam == VK_LEFT ) /* switch to frame system menu */
|
||||||
return MAKELONG( GetSystemMenu16(clientWnd->parent->hwndSelf, 0),
|
return MAKELONG( GetSubMenu16(clientWnd->parent->hSysMenu, 0),
|
||||||
clientWnd->parent->hwndSelf );
|
clientWnd->parent->hwndSelf );
|
||||||
if( wParam == VK_RIGHT ) /* to frame menu bar */
|
if( wParam == VK_RIGHT ) /* to frame menu bar */
|
||||||
return MAKELONG( clientWnd->parent->wIDmenu,
|
return MAKELONG( clientWnd->parent->wIDmenu,
|
||||||
|
@ -1598,42 +1606,49 @@ BOOL32 TranslateMDISysAccel32( HWND32 hwndClient, LPMSG32 msg )
|
||||||
*/
|
*/
|
||||||
BOOL16 TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
|
BOOL16 TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
|
||||||
{
|
{
|
||||||
WND* clientWnd = WIN_FindWndPtr( hwndClient);
|
WND* clientWnd = WIN_FindWndPtr( hwndClient);
|
||||||
WND* wnd;
|
WND* wnd;
|
||||||
MDICLIENTINFO *ci = NULL;
|
MDICLIENTINFO *ci = NULL;
|
||||||
WPARAM16 wParam = 0;
|
WPARAM16 wParam = 0;
|
||||||
|
|
||||||
if( (msg->message != WM_KEYDOWN && msg->message != WM_SYSKEYDOWN) || !clientWnd )
|
if( clientWnd && (msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN))
|
||||||
return 0;
|
{
|
||||||
|
MDICLIENTINFO *ci = NULL;
|
||||||
|
WND* wnd;
|
||||||
|
|
||||||
ci = (MDICLIENTINFO*) clientWnd->wExtra;
|
ci = (MDICLIENTINFO*) clientWnd->wExtra;
|
||||||
wnd = WIN_FindWndPtr(ci->hwndActiveChild);
|
wnd = WIN_FindWndPtr(ci->hwndActiveChild);
|
||||||
|
if( wnd && !(wnd->dwStyle & WS_DISABLED) )
|
||||||
|
{
|
||||||
|
WPARAM16 wParam = 0;
|
||||||
|
|
||||||
if( !wnd ) return 0;
|
/* translate if the Ctrl key is down and Alt not. */
|
||||||
|
|
||||||
if( wnd->dwStyle & WS_DISABLED ) return 0;
|
if( (GetKeyState32(VK_CONTROL) & 0x8000) &&
|
||||||
|
!(GetKeyState32(VK_MENU) & 0x8000))
|
||||||
if ((GetKeyState32(VK_CONTROL) & 0x8000) && !(GetKeyState32(VK_MENU) & 0x8000))
|
{
|
||||||
switch( msg->wParam )
|
switch( msg->wParam )
|
||||||
{
|
{
|
||||||
case VK_F6:
|
case VK_F6:
|
||||||
case VK_SEPARATOR:
|
case VK_SEPARATOR:
|
||||||
wParam = ( GetKeyState32(VK_SHIFT) & 0x8000 )? SC_NEXTWINDOW: SC_PREVWINDOW;
|
wParam = ( GetKeyState32(VK_SHIFT) & 0x8000 )
|
||||||
break;
|
? SC_NEXTWINDOW : SC_PREVWINDOW;
|
||||||
case VK_F4:
|
break;
|
||||||
case VK_RBUTTON:
|
case VK_F4:
|
||||||
wParam = SC_CLOSE;
|
case VK_RBUTTON:
|
||||||
break;
|
wParam = SC_CLOSE;
|
||||||
default:
|
break;
|
||||||
return 0;
|
default:
|
||||||
}
|
return 0;
|
||||||
else
|
}
|
||||||
return 0;
|
dprintf_mdi(stddeb,"TranslateMDISysAccel: wParam = %04x\n", wParam);
|
||||||
|
SendMessage16( ci->hwndActiveChild, WM_SYSCOMMAND,
|
||||||
dprintf_mdi(stddeb,"TranslateMDISysAccel: wParam = %04x\n", wParam);
|
wParam, (LPARAM)msg->wParam);
|
||||||
|
return 1;
|
||||||
SendMessage16(ci->hwndActiveChild,WM_SYSCOMMAND, wParam, (LPARAM)msg->wParam);
|
}
|
||||||
return 1;
|
}
|
||||||
|
}
|
||||||
|
return 0; /* failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1055,7 +1055,7 @@ LRESULT SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam)
|
||||||
fprintf( stderr, "SendMessage16: invalid hwnd %04x\n", hwnd );
|
fprintf( stderr, "SendMessage16: invalid hwnd %04x\n", hwnd );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (QUEUE_IsDoomedQueue(wndPtr->hmemTaskQ))
|
if (QUEUE_IsExitingQueue(wndPtr->hmemTaskQ))
|
||||||
return 0; /* Don't send anything if the task is dying */
|
return 0; /* Don't send anything if the task is dying */
|
||||||
if (wndPtr->hmemTaskQ != GetTaskQueue(0))
|
if (wndPtr->hmemTaskQ != GetTaskQueue(0))
|
||||||
return MSG_SendMessage( wndPtr->hmemTaskQ, hwnd, msg, wParam, lParam );
|
return MSG_SendMessage( wndPtr->hmemTaskQ, hwnd, msg, wParam, lParam );
|
||||||
|
@ -1120,7 +1120,7 @@ LRESULT SendMessage32A(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QUEUE_IsDoomedQueue(wndPtr->hmemTaskQ))
|
if (QUEUE_IsExitingQueue(wndPtr->hmemTaskQ))
|
||||||
return 0; /* Don't send anything if the task is dying */
|
return 0; /* Don't send anything if the task is dying */
|
||||||
|
|
||||||
if (wndPtr->hmemTaskQ != GetTaskQueue(0))
|
if (wndPtr->hmemTaskQ != GetTaskQueue(0))
|
||||||
|
@ -1168,7 +1168,7 @@ LRESULT SendMessage32W(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
||||||
fprintf( stderr, "SendMessage32W: invalid hwnd %08x\n", hwnd );
|
fprintf( stderr, "SendMessage32W: invalid hwnd %08x\n", hwnd );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (QUEUE_IsDoomedQueue(wndPtr->hmemTaskQ))
|
if (QUEUE_IsExitingQueue(wndPtr->hmemTaskQ))
|
||||||
return 0; /* Don't send anything if the task is dying */
|
return 0; /* Don't send anything if the task is dying */
|
||||||
if (wndPtr->hmemTaskQ != GetTaskQueue(0))
|
if (wndPtr->hmemTaskQ != GetTaskQueue(0))
|
||||||
{
|
{
|
||||||
|
|
|
@ -465,11 +465,11 @@ static void NC_DrawMaxButton( HWND32 hwnd, HDC16 hdc, BOOL32 down )
|
||||||
if( !(wndPtr->flags & WIN_MANAGED) )
|
if( !(wndPtr->flags & WIN_MANAGED) )
|
||||||
{
|
{
|
||||||
NC_GetInsideRect( hwnd, &rect );
|
NC_GetInsideRect( hwnd, &rect );
|
||||||
GRAPH_DrawBitmap( hdc, (IsZoomed32(hwnd) ?
|
GRAPH_DrawBitmap( hdc, (IsZoomed32(hwnd)
|
||||||
(down ? hbitmapRestoreD : hbitmapRestore) :
|
? (down ? hbitmapRestoreD : hbitmapRestore)
|
||||||
(down ? hbitmapMaximizeD : hbitmapMaximize)),
|
: (down ? hbitmapMaximizeD : hbitmapMaximize)),
|
||||||
rect.right - SYSMETRICS_CXSIZE - 1, rect.top,
|
rect.right - SYSMETRICS_CXSIZE - 1, rect.top,
|
||||||
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE );
|
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE, FALSE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ static void NC_DrawMinButton( HWND32 hwnd, HDC16 hdc, BOOL32 down )
|
||||||
if (wndPtr->dwStyle & WS_MAXIMIZEBOX) rect.right -= SYSMETRICS_CXSIZE+1;
|
if (wndPtr->dwStyle & WS_MAXIMIZEBOX) rect.right -= SYSMETRICS_CXSIZE+1;
|
||||||
GRAPH_DrawBitmap( hdc, (down ? hbitmapMinimizeD : hbitmapMinimize),
|
GRAPH_DrawBitmap( hdc, (down ? hbitmapMinimizeD : hbitmapMinimize),
|
||||||
rect.right - SYSMETRICS_CXSIZE - 1, rect.top,
|
rect.right - SYSMETRICS_CXSIZE - 1, rect.top,
|
||||||
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE );
|
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE, FALSE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,19 +927,18 @@ static void NC_TrackSysMenu( HWND32 hwnd, POINT16 pt )
|
||||||
* Initialisation of a move or resize, when initiatied from a menu choice.
|
* Initialisation of a move or resize, when initiatied from a menu choice.
|
||||||
* Return hit test code for caption or sizing border.
|
* Return hit test code for caption or sizing border.
|
||||||
*/
|
*/
|
||||||
static LONG NC_StartSizeMove( HWND32 hwnd, WPARAM16 wParam,
|
static LONG NC_StartSizeMove( WND* wndPtr, WPARAM16 wParam,
|
||||||
POINT16 *capturePoint )
|
POINT16 *capturePoint )
|
||||||
{
|
{
|
||||||
LONG hittest = 0;
|
LONG hittest = 0;
|
||||||
POINT16 pt;
|
POINT16 pt;
|
||||||
MSG16 msg;
|
MSG16 msg;
|
||||||
WND * wndPtr = WIN_FindWndPtr( hwnd );
|
|
||||||
|
|
||||||
if ((wParam & 0xfff0) == SC_MOVE)
|
if ((wParam & 0xfff0) == SC_MOVE)
|
||||||
{
|
{
|
||||||
/* Move pointer at the center of the caption */
|
/* Move pointer at the center of the caption */
|
||||||
RECT32 rect;
|
RECT32 rect;
|
||||||
NC_GetInsideRect( hwnd, &rect );
|
NC_GetInsideRect( wndPtr->hwndSelf, &rect );
|
||||||
if (wndPtr->dwStyle & WS_SYSMENU)
|
if (wndPtr->dwStyle & WS_SYSMENU)
|
||||||
rect.left += SYSMETRICS_CXSIZE + 1;
|
rect.left += SYSMETRICS_CXSIZE + 1;
|
||||||
if (wndPtr->dwStyle & WS_MINIMIZEBOX)
|
if (wndPtr->dwStyle & WS_MINIMIZEBOX)
|
||||||
|
@ -948,20 +947,21 @@ static LONG NC_StartSizeMove( HWND32 hwnd, WPARAM16 wParam,
|
||||||
rect.right -= SYSMETRICS_CXSIZE + 1;
|
rect.right -= SYSMETRICS_CXSIZE + 1;
|
||||||
pt.x = wndPtr->rectWindow.left + (rect.right - rect.left) / 2;
|
pt.x = wndPtr->rectWindow.left + (rect.right - rect.left) / 2;
|
||||||
pt.y = wndPtr->rectWindow.top + rect.top + SYSMETRICS_CYSIZE/2;
|
pt.y = wndPtr->rectWindow.top + rect.top + SYSMETRICS_CYSIZE/2;
|
||||||
|
hittest = HTCAPTION;
|
||||||
|
*capturePoint = pt;
|
||||||
|
|
||||||
if (wndPtr->dwStyle & WS_CHILD)
|
if (wndPtr->dwStyle & WS_CHILD)
|
||||||
ClientToScreen16( wndPtr->parent->hwndSelf, &pt );
|
ClientToScreen16( wndPtr->parent->hwndSelf, &pt );
|
||||||
hittest = HTCAPTION;
|
|
||||||
}
|
}
|
||||||
else /* SC_SIZE */
|
else /* SC_SIZE */
|
||||||
{
|
{
|
||||||
SetCapture32(hwnd);
|
|
||||||
while(!hittest)
|
while(!hittest)
|
||||||
{
|
{
|
||||||
MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE );
|
MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE );
|
||||||
switch(msg.message)
|
switch(msg.message)
|
||||||
{
|
{
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
hittest = NC_HandleNCHitTest( hwnd, msg.pt );
|
hittest = NC_HandleNCHitTest( wndPtr->hwndSelf, msg.pt );
|
||||||
pt = msg.pt;
|
pt = msg.pt;
|
||||||
if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT))
|
if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT))
|
||||||
hittest = 0;
|
hittest = 0;
|
||||||
|
@ -998,10 +998,11 @@ static LONG NC_StartSizeMove( HWND32 hwnd, WPARAM16 wParam,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*capturePoint = pt;
|
||||||
}
|
}
|
||||||
*capturePoint = pt;
|
SetCursorPos32( pt.x, pt.y );
|
||||||
SetCursorPos32( capturePoint->x, capturePoint->y );
|
NC_HandleSetCursor( wndPtr->hwndSelf,
|
||||||
NC_HandleSetCursor( hwnd, (WPARAM16)hwnd, MAKELONG( hittest, WM_MOUSEMOVE ));
|
wndPtr->hwndSelf, MAKELONG( hittest, WM_MOUSEMOVE ));
|
||||||
return hittest;
|
return hittest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1030,17 +1031,18 @@ static void NC_DoSizeMove( HWND32 hwnd, WORD wParam, POINT16 pt )
|
||||||
if ((wParam & 0xfff0) == SC_MOVE)
|
if ((wParam & 0xfff0) == SC_MOVE)
|
||||||
{
|
{
|
||||||
if (!(wndPtr->dwStyle & WS_CAPTION)) return;
|
if (!(wndPtr->dwStyle & WS_CAPTION)) return;
|
||||||
if (!hittest) hittest = NC_StartSizeMove( hwnd, wParam, &capturePoint );
|
if (!hittest)
|
||||||
|
hittest = NC_StartSizeMove( wndPtr, wParam, &capturePoint );
|
||||||
if (!hittest) return;
|
if (!hittest) return;
|
||||||
}
|
}
|
||||||
else /* SC_SIZE */
|
else /* SC_SIZE */
|
||||||
{
|
{
|
||||||
if (!thickframe) return;
|
if (!thickframe) return;
|
||||||
if (hittest) hittest += HTLEFT-1;
|
if ( hittest && hittest != HTSYSMENU ) hittest += 2;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetCapture32(hwnd);
|
SetCapture32(hwnd);
|
||||||
hittest = NC_StartSizeMove( hwnd, wParam, &capturePoint );
|
hittest = NC_StartSizeMove( wndPtr, wParam, &capturePoint );
|
||||||
if (!hittest)
|
if (!hittest)
|
||||||
{
|
{
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
|
@ -1055,7 +1057,8 @@ static void NC_DoSizeMove( HWND32 hwnd, WORD wParam, POINT16 pt )
|
||||||
sizingRect = wndPtr->rectWindow;
|
sizingRect = wndPtr->rectWindow;
|
||||||
if (wndPtr->dwStyle & WS_CHILD)
|
if (wndPtr->dwStyle & WS_CHILD)
|
||||||
GetClientRect16( wndPtr->parent->hwndSelf, &mouseRect );
|
GetClientRect16( wndPtr->parent->hwndSelf, &mouseRect );
|
||||||
else SetRect16(&mouseRect, 0, 0, SYSMETRICS_CXSCREEN, SYSMETRICS_CYSCREEN);
|
else
|
||||||
|
SetRect16(&mouseRect, 0, 0, SYSMETRICS_CXSCREEN, SYSMETRICS_CYSCREEN);
|
||||||
if (ON_LEFT_BORDER(hittest))
|
if (ON_LEFT_BORDER(hittest))
|
||||||
{
|
{
|
||||||
mouseRect.left = MAX( mouseRect.left, sizingRect.right-maxTrack.x );
|
mouseRect.left = MAX( mouseRect.left, sizingRect.right-maxTrack.x );
|
||||||
|
@ -1361,7 +1364,8 @@ LONG NC_HandleNCLButtonDown( HWND32 hwnd, WPARAM16 wParam, LPARAM lParam )
|
||||||
case HTBOTTOM:
|
case HTBOTTOM:
|
||||||
case HTBOTTOMLEFT:
|
case HTBOTTOMLEFT:
|
||||||
case HTBOTTOMRIGHT:
|
case HTBOTTOMRIGHT:
|
||||||
SendMessage16( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - HTLEFT+1, lParam);
|
/* make sure hittest fits into 0xf and doesn't overlap with HTSYSMENU */
|
||||||
|
SendMessage16( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - 2, lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HTBORDER:
|
case HTBORDER:
|
||||||
|
@ -1416,14 +1420,15 @@ LONG NC_HandleSysCommand( HWND32 hwnd, WPARAM16 wParam, POINT16 pt )
|
||||||
{
|
{
|
||||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||||
POINT32 pt32;
|
POINT32 pt32;
|
||||||
|
UINT16 uCommand = wParam & 0xFFF0;
|
||||||
|
|
||||||
dprintf_nonclient(stddeb, "Handling WM_SYSCOMMAND %x %d,%d\n",
|
dprintf_nonclient(stddeb, "Handling WM_SYSCOMMAND %x %d,%d\n",
|
||||||
wParam, pt.x, pt.y );
|
wParam, pt.x, pt.y );
|
||||||
|
|
||||||
if (wndPtr->dwStyle & WS_CHILD && wParam != SC_KEYMENU )
|
if (wndPtr->dwStyle & WS_CHILD && uCommand != SC_KEYMENU )
|
||||||
ScreenToClient16( wndPtr->parent->hwndSelf, &pt );
|
ScreenToClient16( wndPtr->parent->hwndSelf, &pt );
|
||||||
|
|
||||||
switch (wParam & 0xfff0)
|
switch (uCommand)
|
||||||
{
|
{
|
||||||
case SC_SIZE:
|
case SC_SIZE:
|
||||||
case SC_MOVE:
|
case SC_MOVE:
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#define MAX_QUEUE_SIZE 120 /* Max. size of a message queue */
|
#define MAX_QUEUE_SIZE 120 /* Max. size of a message queue */
|
||||||
|
|
||||||
static HQUEUE16 hFirstQueue = 0;
|
static HQUEUE16 hFirstQueue = 0;
|
||||||
static HQUEUE16 hDoomedQueue = 0;
|
static HQUEUE16 hExitingQueue = 0;
|
||||||
static HQUEUE16 hmemSysMsgQueue = 0;
|
static HQUEUE16 hmemSysMsgQueue = 0;
|
||||||
static MESSAGEQUEUE *sysMsgQueue = NULL;
|
static MESSAGEQUEUE *sysMsgQueue = NULL;
|
||||||
|
|
||||||
|
@ -94,20 +94,20 @@ void QUEUE_WalkQueues(void)
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* QUEUE_IsDoomedQueue
|
* QUEUE_IsExitingQueue
|
||||||
*/
|
*/
|
||||||
BOOL32 QUEUE_IsDoomedQueue( HQUEUE16 hQueue )
|
BOOL32 QUEUE_IsExitingQueue( HQUEUE16 hQueue )
|
||||||
{
|
{
|
||||||
return (hDoomedQueue && (hQueue == hDoomedQueue));
|
return (hExitingQueue && (hQueue == hExitingQueue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* QUEUE_SetDoomedQueue
|
* QUEUE_SetExitingQueue
|
||||||
*/
|
*/
|
||||||
void QUEUE_SetDoomedQueue( HQUEUE16 hQueue )
|
void QUEUE_SetExitingQueue( HQUEUE16 hQueue )
|
||||||
{
|
{
|
||||||
hDoomedQueue = hQueue;
|
hExitingQueue = hQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
WORD USER_HeapSel = 0;
|
WORD USER_HeapSel = 0;
|
||||||
|
|
||||||
extern BOOL32 MENU_SwitchTPWndTo(HTASK16);
|
extern BOOL32 MENU_PatchResidentPopup( HQUEUE16, WND* );
|
||||||
extern void QUEUE_FlushMessages(HQUEUE16);
|
extern void QUEUE_FlushMessages(HQUEUE16);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -108,7 +108,7 @@ INT16 InitApp( HINSTANCE16 hInstance )
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* USER_AppExit
|
* USER_AppExit
|
||||||
*/
|
*/
|
||||||
void USER_AppExit( HTASK16 hTask, HINSTANCE16 hInstance, HQUEUE16 hQueue )
|
void USER_AppExit( HTASK16 hTask, HINSTANCE16 hInstance, HQUEUE16 hQueue )
|
||||||
{
|
{
|
||||||
|
@ -123,16 +123,16 @@ void USER_AppExit( HTASK16 hTask, HINSTANCE16 hInstance, HQUEUE16 hQueue )
|
||||||
desktop->hmemTaskQ = GetTaskQueue(TASK_GetNextTask(hTask));
|
desktop->hmemTaskQ = GetTaskQueue(TASK_GetNextTask(hTask));
|
||||||
|
|
||||||
/* Patch resident popup menu window */
|
/* Patch resident popup menu window */
|
||||||
MENU_SwitchTPWndTo(0);
|
MENU_PatchResidentPopup( hQueue, NULL );
|
||||||
|
|
||||||
TIMER_RemoveQueueTimers( hQueue );
|
TIMER_RemoveQueueTimers( hQueue );
|
||||||
|
|
||||||
QUEUE_FlushMessages( hQueue );
|
QUEUE_FlushMessages( hQueue );
|
||||||
HOOK_FreeQueueHooks( hQueue );
|
HOOK_FreeQueueHooks( hQueue );
|
||||||
|
|
||||||
QUEUE_SetDoomedQueue( hQueue );
|
QUEUE_SetExitingQueue( hQueue );
|
||||||
WIN_ResetQueueWindows( desktop->child, hQueue, (HQUEUE16)0);
|
WIN_ResetQueueWindows( desktop->child, hQueue, (HQUEUE16)0);
|
||||||
QUEUE_SetDoomedQueue( 0 );
|
QUEUE_SetExitingQueue( 0 );
|
||||||
|
|
||||||
/* Free the message queue */
|
/* Free the message queue */
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ static HWND32 hwndSysModal = 0;
|
||||||
static WORD wDragWidth = 4;
|
static WORD wDragWidth = 4;
|
||||||
static WORD wDragHeight= 3;
|
static WORD wDragHeight= 3;
|
||||||
|
|
||||||
|
extern BOOL32 MENU_PatchResidentPopup( HQUEUE16, WND* );
|
||||||
extern HCURSOR16 CURSORICON_IconToCursor(HICON16, BOOL32);
|
extern HCURSOR16 CURSORICON_IconToCursor(HICON16, BOOL32);
|
||||||
extern HWND32 CARET_GetHwnd(void);
|
extern HWND32 CARET_GetHwnd(void);
|
||||||
extern BOOL32 WINPOS_ActivateOtherWindow(WND* pWnd);
|
extern BOOL32 WINPOS_ActivateOtherWindow(WND* pWnd);
|
||||||
|
@ -569,8 +570,9 @@ static HWND32 WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
|
||||||
wndPtr->pVScroll = NULL;
|
wndPtr->pVScroll = NULL;
|
||||||
wndPtr->pHScroll = NULL;
|
wndPtr->pHScroll = NULL;
|
||||||
wndPtr->pProp = NULL;
|
wndPtr->pProp = NULL;
|
||||||
wndPtr->hSysMenu = MENU_GetDefSysMenu();
|
|
||||||
wndPtr->userdata = 0;
|
wndPtr->userdata = 0;
|
||||||
|
wndPtr->hSysMenu = (wndPtr->dwStyle & WS_SYSMENU)
|
||||||
|
? MENU_GetSysMenu( hwnd, 0 ) : 0;
|
||||||
|
|
||||||
if (classPtr->cbWndExtra) memset( wndPtr->wExtra, 0, classPtr->cbWndExtra);
|
if (classPtr->cbWndExtra) memset( wndPtr->wExtra, 0, classPtr->cbWndExtra);
|
||||||
|
|
||||||
|
@ -1000,7 +1002,7 @@ BOOL32 DestroyWindow32( HWND32 hwnd )
|
||||||
/* FIXME: clean up palette - see "Internals" p.352 */
|
/* FIXME: clean up palette - see "Internals" p.352 */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !QUEUE_IsDoomedQueue(wndPtr->hmemTaskQ) )
|
if( !QUEUE_IsExitingQueue(wndPtr->hmemTaskQ) )
|
||||||
WIN_SendParentNotify( hwnd, WM_DESTROY, wndPtr->wIDmenu, (LPARAM)hwnd );
|
WIN_SendParentNotify( hwnd, WM_DESTROY, wndPtr->wIDmenu, (LPARAM)hwnd );
|
||||||
if (!IsWindow32(hwnd)) return TRUE;
|
if (!IsWindow32(hwnd)) return TRUE;
|
||||||
|
|
||||||
|
@ -1012,7 +1014,7 @@ BOOL32 DestroyWindow32( HWND32 hwnd )
|
||||||
{
|
{
|
||||||
SetWindowPos32( hwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW |
|
SetWindowPos32( hwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW |
|
||||||
SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|
|
SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|
|
||||||
((QUEUE_IsDoomedQueue(wndPtr->hmemTaskQ))?SWP_DEFERERASE:0) );
|
((QUEUE_IsExitingQueue(wndPtr->hmemTaskQ))?SWP_DEFERERASE:0) );
|
||||||
if (!IsWindow32(hwnd)) return TRUE;
|
if (!IsWindow32(hwnd)) return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1020,6 +1022,9 @@ BOOL32 DestroyWindow32( HWND32 hwnd )
|
||||||
|
|
||||||
if( !(wndPtr->dwStyle & WS_CHILD) )
|
if( !(wndPtr->dwStyle & WS_CHILD) )
|
||||||
{
|
{
|
||||||
|
/* make sure top menu popup doesn't get destroyed */
|
||||||
|
MENU_PatchResidentPopup( TRUE, wndPtr );
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
WND *siblingPtr = wndPtr->parent->child; /* First sibling */
|
WND *siblingPtr = wndPtr->parent->child; /* First sibling */
|
||||||
|
|
|
@ -1181,7 +1181,7 @@ BOOL32 WINPOS_ActivateOtherWindow(WND* pWnd)
|
||||||
hwndPrevActive = 0;
|
hwndPrevActive = 0;
|
||||||
|
|
||||||
if( hwndActive != pWnd->hwndSelf &&
|
if( hwndActive != pWnd->hwndSelf &&
|
||||||
( hwndActive || QUEUE_IsDoomedQueue(pWnd->hmemTaskQ)) )
|
( hwndActive || QUEUE_IsExitingQueue(pWnd->hmemTaskQ)) )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if( pWnd->dwStyle & WS_POPUP &&
|
if( pWnd->dwStyle & WS_POPUP &&
|
||||||
|
|
Loading…
Reference in New Issue