Commit abe72277 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Added built-in msacm.drv and midimap.drv drivers.

parent 659fcd81
......@@ -71,6 +71,8 @@ LIBSUBDIRS = \
dlls/winmm/mcicda \
dlls/winmm/mciseq \
dlls/winmm/mciwave \
dlls/winmm/midimap \
dlls/winmm/wavemap \
dlls/winmm/wineoss \
dlls/winspool \
dlls/wnaspi32 \
......@@ -170,13 +172,15 @@ LIBOBJS = \
dlls/winaspi/winaspi.o \
dlls/windebug/windebug.o \
dlls/wing/wing.o \
dlls/winmm/winmm.o \
dlls/winmm/mcianim/mcianim.drv.o \
dlls/winmm/mciavi/mciavi.drv.o \
dlls/winmm/mcicda/mcicda.drv.o \
dlls/winmm/mciseq/mciseq.drv.o \
dlls/winmm/mciwave/mciwave.drv.o \
dlls/winmm/midimap/midimap.drv.o \
dlls/winmm/wavemap/msacm.drv.o \
dlls/winmm/wineoss/wineoss.o \
dlls/winmm/winmm.o \
dlls/winspool/winspool.o \
dlls/wnaspi32/wnaspi32.o \
files/files.o \
......
......@@ -5673,6 +5673,8 @@ dlls/winmm/mciavi/Makefile
dlls/winmm/mcicda/Makefile
dlls/winmm/mciseq/Makefile
dlls/winmm/mciwave/Makefile
dlls/winmm/midimap/Makefile
dlls/winmm/wavemap/Makefile
dlls/winmm/wineoss/Makefile
dlls/winspool/Makefile
dlls/wnaspi32/Makefile
......@@ -5874,6 +5876,8 @@ dlls/winmm/mciavi/Makefile
dlls/winmm/mcicda/Makefile
dlls/winmm/mciseq/Makefile
dlls/winmm/mciwave/Makefile
dlls/winmm/midimap/Makefile
dlls/winmm/wavemap/Makefile
dlls/winmm/wineoss/Makefile
dlls/winspool/Makefile
dlls/wnaspi32/Makefile
......
......@@ -880,6 +880,8 @@ dlls/winmm/mciavi/Makefile
dlls/winmm/mcicda/Makefile
dlls/winmm/mciseq/Makefile
dlls/winmm/mciwave/Makefile
dlls/winmm/midimap/Makefile
dlls/winmm/wavemap/Makefile
dlls/winmm/wineoss/Makefile
dlls/winspool/Makefile
dlls/wnaspi32/Makefile
......
......@@ -6,6 +6,7 @@ SUBDIRS = \
crtdll \
dciman32 \
dplayx \
dsound \
imagehlp \
imm32 \
lzexpand \
......@@ -32,6 +33,7 @@ SUBDIRS = \
winaspi \
windebug \
wing \
winmm \
winspool \
wnaspi32
......
Makefile
midimap.spec.c
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = midimap.drv
SPEC_SRCS = \
midimap.spec
C_SRCS = \
midimap.c
all: $(MODULE).o
@MAKE_RULES@
call32.s: $(BUILD)
$(BUILD) @BUILDFLAGS@ -o $@ -call32
### Dependencies:
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
/*
* Wine Midi mapper driver
*
* Copyright 1999 Eric Pouech
*/
#include "winuser.h"
#include "driver.h"
#include "mmddk.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(msacm)
typedef struct tagMIDIMAPDATA {
HMIDI hMidi;
} MIDIMAPDATA;
/*======================================================================*
* MIDI OUT part *
*======================================================================*/
static DWORD modOpen(LPDWORD lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
{
UINT nd = midiOutGetNumDevs();
UINT i;
MIDIMAPDATA* mom = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIMAPDATA));
TRACE("(%p %p %08lx\n", lpdwUser, lpDesc, dwFlags);
for (i = 0; i < nd; i++) {
if (midiOutOpen(&mom->hMidi, i, lpDesc->dwCallback,
lpDesc->dwInstance, dwFlags) == MMSYSERR_NOERROR) {
lpDesc->hMidi = mom->hMidi;
*lpdwUser = (DWORD)mom;
return MMSYSERR_NOERROR;
}
}
HeapFree(GetProcessHeap(), 0, mom);
return MMSYSERR_ALLOCATED;
}
static DWORD modClose(MIDIMAPDATA* mom)
{
DWORD ret = midiOutClose(mom->hMidi);
if (ret == MMSYSERR_NOERROR)
HeapFree(GetProcessHeap(), 0, mom);
return ret;
}
static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
{
return midiOutLongMsg(mom->hMidi, lpMidiHdr, dwParam2);
}
static DWORD modData(MIDIMAPDATA* mom, DWORD dwParam)
{
return midiOutShortMsg(mom->hMidi, dwParam);
}
static DWORD modPrepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
{
return midiOutPrepareHeader(mom->hMidi, lpMidiHdr, dwParam2);
}
static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
{
return midiOutUnprepareHeader(mom->hMidi, lpMidiHdr, dwParam2);
}
static DWORD modGetDevCaps(MIDIMAPDATA* mom, LPMIDIOUTCAPSA lpMidiCaps, DWORD dwParam2)
{
return midiOutGetDevCapsA(mom->hMidi, lpMidiCaps, dwParam2);
}
static DWORD modGetVolume(MIDIMAPDATA* mom, LPDWORD lpVol)
{
return midiOutGetVolume(mom->hMidi, lpVol);
}
static DWORD modSetVolume(MIDIMAPDATA* mom, DWORD vol)
{
return midiOutSetVolume(mom->hMidi, vol);
}
static DWORD modReset(MIDIMAPDATA* mom)
{
return midiOutReset(mom->hMidi);
}
/**************************************************************************
* MIDIMAP_modMessage [sample driver]
*/
DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) {
case DRVM_INIT:
case DRVM_EXIT:
case DRVM_ENABLE:
case DRVM_DISABLE:
/* FIXME: Pretend this is supported */
return 0;
case MODM_OPEN: return modOpen ((LPDWORD)dwUser, (LPMIDIOPENDESC)dwParam1,dwParam2);
case MODM_CLOSE: return modClose ((MIDIMAPDATA*)dwUser);
case MODM_DATA: return modData ((MIDIMAPDATA*)dwUser, dwParam1);
case MODM_LONGDATA: return modLongData ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
case MODM_PREPARE: return modPrepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
case MODM_UNPREPARE: return modUnprepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
case MODM_GETDEVCAPS: return modGetDevCaps ((MIDIMAPDATA*)dwUser, (LPMIDIOUTCAPSA)dwParam1,dwParam2);
case MODM_GETNUMDEVS: return 1;
case MODM_GETVOLUME: return modGetVolume ((MIDIMAPDATA*)dwUser, (LPDWORD)dwParam1);
case MODM_SETVOLUME: return modSetVolume ((MIDIMAPDATA*)dwUser, dwParam1);
case MODM_RESET: return modReset ((MIDIMAPDATA*)dwUser);
default:
FIXME("unknown message %d!\n", wMsg);
}
return MMSYSERR_NOTSUPPORTED;
}
/*======================================================================*
* MIDI IN part *
*======================================================================*/
static DWORD midOpen(LPDWORD lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
{
UINT nd = midiInGetNumDevs();
UINT i;
MIDIMAPDATA* wim = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIMAPDATA));
TRACE("(%p %p %08lx\n", lpdwUser, lpDesc, dwFlags);
for (i = 0; i < nd; i++) {
if (midiInOpen(&wim->hMidi, i, lpDesc->dwCallback,
lpDesc->dwInstance, dwFlags) == MMSYSERR_NOERROR) {
lpDesc->hMidi = wim->hMidi;
*lpdwUser = (DWORD)wim;
return MMSYSERR_NOERROR;
}
}
HeapFree(GetProcessHeap(), 0, wim);
return MMSYSERR_ALLOCATED;
}
static DWORD midClose(MIDIMAPDATA* wim)
{
DWORD ret = midiInClose(wim->hMidi);
if (ret == MMSYSERR_NOERROR)
HeapFree(GetProcessHeap(), 0, wim);
return ret;
}
static DWORD midAddBuffer(MIDIMAPDATA* wim, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
{
return midiInAddBuffer(wim->hMidi, lpMidiHdr, dwParam2);
}
static DWORD midPrepare(MIDIMAPDATA* wim, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
{
return midiInPrepareHeader(wim->hMidi, lpMidiHdr, dwParam2);
}
static DWORD midUnprepare(MIDIMAPDATA* wim, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
{
return midiInUnprepareHeader(wim->hMidi, lpMidiHdr, dwParam2);
}
static DWORD midGetDevCaps(MIDIMAPDATA* wim, LPMIDIINCAPSA lpMidiCaps, DWORD dwParam2)
{
return midiInGetDevCapsA(wim->hMidi, lpMidiCaps, dwParam2);
}
static DWORD midStop(MIDIMAPDATA* wim)
{
return midiInStop(wim->hMidi);
}
static DWORD midStart(MIDIMAPDATA* wim)
{
return midiInStart(wim->hMidi);
}
static DWORD midReset(MIDIMAPDATA* wim)
{
return midiInReset(wim->hMidi);
}
/**************************************************************************
* MIDIMAP_midMessage [sample driver]
*/
DWORD WINAPI MIDIMAP_midMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) {
case DRVM_INIT:
case DRVM_EXIT:
case DRVM_ENABLE:
case DRVM_DISABLE:
/* FIXME: Pretend this is supported */
return 0;
case MIDM_OPEN: return midOpen ((LPDWORD)dwUser, (LPMIDIOPENDESC)dwParam1, dwParam2);
case MIDM_CLOSE: return midClose ((MIDIMAPDATA*)dwUser);
case MIDM_ADDBUFFER: return midAddBuffer ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
case MIDM_PREPARE: return midPrepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
case MIDM_UNPREPARE: return midUnprepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
case MIDM_GETDEVCAPS: return midGetDevCaps ((MIDIMAPDATA*)dwUser, (LPMIDIINCAPSA)dwParam1, dwParam2);
case MIDM_GETNUMDEVS: return 1;
case MIDM_RESET: return midReset ((MIDIMAPDATA*)dwUser);
case MIDM_START: return midStart ((MIDIMAPDATA*)dwUser);
case MIDM_STOP: return midStop ((MIDIMAPDATA*)dwUser);
default:
FIXME("unknown message %u!\n", wMsg);
}
return MMSYSERR_NOTSUPPORTED;
}
/*======================================================================*
* Driver part *
*======================================================================*/
static struct WINE_MIDIMAP* oss = NULL;
/**************************************************************************
* MIDIMAP_drvOpen [internal]
*/
static DWORD MIDIMAP_drvOpen(LPSTR str)
{
if (oss)
return 0;
/* I know, this is ugly, but who cares... */
oss = (struct WINE_MIDIMAP*)1;
return 1;
}
/**************************************************************************
* MIDIMAP_drvClose [internal]
*/
static DWORD MIDIMAP_drvClose(DWORD dwDevID)
{
if (oss) {
oss = NULL;
return 1;
}
return 0;
}
/**************************************************************************
* MIDIMAP_DriverProc [internal]
*/
LONG CALLBACK MIDIMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
/* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
/* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
switch(wMsg) {
case DRV_LOAD: return 1;
case DRV_FREE: return 1;
case DRV_OPEN: return MIDIMAP_drvOpen((LPSTR)dwParam1);
case DRV_CLOSE: return MIDIMAP_drvClose(dwDevID);
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBoxA(0, "MIDIMAP MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
}
name midimap
file midimap.drv
type win32
1 stdcall DriverProc(long long long long long) MIDIMAP_DriverProc
2 stdcall midMessage(long long long long long) MIDIMAP_midMessage
3 stdcall modMessage(long long long long long) MIDIMAP_modMessage
Makefile
msacm.spec.c
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msacm.drv
SPEC_SRCS = \
msacm.spec
C_SRCS = \
wavemap.c
all: $(MODULE).o
@MAKE_RULES@
call32.s: $(BUILD)
$(BUILD) @BUILDFLAGS@ -o $@ -call32
### Dependencies:
name msacmmap
file msacm.drv
type win32
1 stdcall DriverProc(long long long long long) WAVEMAP_DriverProc
2 stdcall widMessage(long long long long long) WAVEMAP_widMessage
3 stdcall wodMessage(long long long long long) WAVEMAP_wodMessage
......@@ -51,6 +51,7 @@ static struct tagDllOverride {
{"mcicda.drv, mciseq.drv", "builtin, native"},
{"mciwave.drv", "builtin, native"},
{"mciavi.drv, mcianim.drv", "native, builtin"},
{"msacm.drv, midimap.drv", "builtin, native"},
{"w32skrnl", "builtin"},
{"wnaspi32,wow32", "builtin"},
{"system,display,wprocs ", "builtin"},
......
......@@ -70,7 +70,9 @@ extern const BUILTIN32_DESCRIPTOR MCIAVI_Descriptor;
extern const BUILTIN32_DESCRIPTOR MCICDA_Descriptor;
extern const BUILTIN32_DESCRIPTOR MCISEQ_Descriptor;
extern const BUILTIN32_DESCRIPTOR MCIWAVE_Descriptor;
extern const BUILTIN32_DESCRIPTOR MIDIMAP_Descriptor;
extern const BUILTIN32_DESCRIPTOR MSACM32_Descriptor;
extern const BUILTIN32_DESCRIPTOR MSACMMAP_Descriptor;
extern const BUILTIN32_DESCRIPTOR MSNET32_Descriptor;
extern const BUILTIN32_DESCRIPTOR MSVFW32_Descriptor;
extern const BUILTIN32_DESCRIPTOR NTDLL_Descriptor;
......@@ -123,8 +125,10 @@ static BUILTIN32_DLL BuiltinDLLs[] =
{ &MCICDA_Descriptor, 0, 0, NULL },
{ &MCISEQ_Descriptor, 0, 0, NULL },
{ &MCIWAVE_Descriptor, 0, 0, NULL },
{ &MIDIMAP_Descriptor, 0, 0, NULL },
{ &MPR_Descriptor, 0, 0, NULL },
{ &MSACM32_Descriptor, BI32_DANGER, 0, NULL },
{ &MSACMMAP_Descriptor, 0, 0, NULL },
{ &MSNET32_Descriptor, 0, 0, NULL },
{ &MSVFW32_Descriptor, 0, 0, NULL },
{ &NTDLL_Descriptor, 0, 0, NULL },
......
......@@ -91,6 +91,7 @@ msvideo, msvfw32 = builtin, native
mcicda.drv, mciseq.drv = builtin, native
mciwave.drv = builtin, native
mciavi.drv, mcianim.drv = native, builtin
msacm.drv, midimap.drv = builtin, native
w32skrnl = builtin
wnaspi32, wow32 = builtin
system, display, wprocs = builtin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment