Commit ecc7669d authored by Todd Vierling's avatar Todd Vierling Committed by Alexandre Julliard

- add -lossaudio if needed, and a check for <soundcard.h>, to configure.in

(run autoconf after this). Note that the check has been altered to break out of the AC_CHECK_HEADERS after the first match - this is so <sys/soundcard.h>, if found on NetBSD (a `real' OSS), will not conflict with the emulated ossaudio. - check for <soundcard.h> along with the other two in a mutually-exclusive manner in the various *.c files that need it; change include of "mmsystem.h" to "multimedia.h" so this logic is all in one place - change mcicda.c to allow for CD audio manipulation on NetBSD. This includes: * changing ioctl() calls to be NON-SPLIT with exactly 3 args; on NetBSD ossaudio, ioctl() is #defined to be _oss_ioctl by <soundcard.h>, and neither splitting with #-directives nor a two-arg ioctl work; * changing the #if logic to allow both FreeBSD and NetBSD to share the appropriate code blocks - block out MIDI code for NetBSD (init.c) and/or missing SNDCTL_MIDI_INFO (midi.c, mcimidi.c). NetBSD's OSS emulation does not (yet) support MIDI. Thanks go to mycroft@netbsd.org for the 99% bulk of this work.
parent 9824ec40
......@@ -83,6 +83,8 @@ dnl **** Check for some libraries ****
dnl Check for -li386 for NetBSD and OpenBSD
AC_CHECK_LIB(i386,i386_set_ldt)
dnl Check for -lossaudio for NetBSD
AC_CHECK_LIB(ossaudio,_oss_ioctl)
dnl Check for -lw for Solaris
AC_CHECK_LIB(w,iswalnum)
dnl Check for -lnsl for Solaris
......@@ -115,16 +117,17 @@ else
fi
dnl **** Check for Open Sound System ****
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
AC_CACHE_CHECK("for Open Sound System",
ac_cv_c_opensoundsystem,
AC_TRY_COMPILE([
#ifdef HAVE_SYS_SOUNDCARD_H
#if defined(HAVE_SYS_SOUNDCARD_H)
#include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
#include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
#include <soundcard.h>
#endif
],[
......
......@@ -141,6 +141,9 @@
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
......@@ -195,6 +198,9 @@
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the ossaudio library (-lossaudio). */
#undef HAVE_LIBOSSAUDIO
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
......
......@@ -20,11 +20,12 @@
#define MAX_MIDIOUTDRV (16)
#define MAX_MCIMIDIDRV (1)
#ifdef HAVE_SYS_SOUNDCARD_H
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#include <sys/errno.h>
......
......@@ -22,20 +22,13 @@
#include "windows.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#include "multimedia.h"
#include "heap.h"
#include "ldt.h"
#include "debug.h"
#ifdef HAVE_OSS
#ifdef HAVE_MACHINE_SOUNDCARD_H
# include <machine/soundcard.h>
#endif
#ifdef HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
#endif
#define SOUND_DEV "/dev/dsp"
#define MIXER_DEV "/dev/mixer"
......
......@@ -42,20 +42,15 @@
#include "windows.h"
#include "winerror.h"
#include "interfaces.h"
#include "mmsystem.h"
#include "multimedia.h"
#include "dsound.h"
#include "thread.h"
#include "debug.h"
#include "xmalloc.h"
#ifdef HAVE_OSS
# include <sys/ioctl.h>
# ifdef HAVE_MACHINE_SOUNDCARD_H
# include <machine/soundcard.h>
# endif
# ifdef HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
# endif
#include <sys/ioctl.h>
/* #define USE_DSOUND3D 1 */
......
......@@ -36,6 +36,7 @@ extern LPMIDIINCAPS16 midiInDevices [MAX_MIDIINDRV];
#ifdef HAVE_OSS
int unixToWindowsDeviceType(int type)
{
#ifndef __NetBSD__
/* MOD_MIDIPORT output port
* MOD_SYNTH generic internal synth
* MOD_SQSYNTH square wave internal synth
......@@ -55,6 +56,9 @@ int unixToWindowsDeviceType(int type)
"Assuming FM Synth\n");
return MOD_FMSYNTH;
}
#else
return MOD_FMSYNTH;
#endif
}
#endif
......@@ -66,7 +70,7 @@ int unixToWindowsDeviceType(int type)
*/
BOOL32 MULTIMEDIA_MidiInit(void)
{
#ifdef HAVE_OSS
#if defined(HAVE_OSS) && !defined(__NetBSD__)
int i, status, numsynthdevs = 255, nummididevs = 255;
struct synth_info sinfo;
struct midi_info minfo;
......
......@@ -26,7 +26,6 @@
#include "multimedia.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#include "xmalloc.h"
#include "debug.h"
#include "callback.h"
......@@ -72,6 +71,7 @@ static WINE_MCIMIDI MCIMidiDev[MAX_MCIMIDIDRV];
* MCI MIDI implemantation *
*======================================================================*/
#ifdef SNDCTL_MIDI_INFO
/**************************************************************************
* MIDI_mciGetOpenDev [internal]
*/
......@@ -1461,6 +1461,7 @@ static DWORD MIDI_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
}
return ret;
}
#endif
/*======================================================================*
* MIDI entry points *
......@@ -1483,6 +1484,7 @@ LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
case DRV_CONFIGURE: MessageBox16(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
#ifdef SNDCTL_MIDI_INFO
case MCI_OPEN_DRIVER: return MIDI_mciOpen (dwDevID, dwParam1, (LPMCI_OPEN_PARMS32A) dwParam2);
case MCI_CLOSE_DRIVER: return MIDI_mciClose (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
case MCI_PLAY: return MIDI_mciPlay (dwDevID, dwParam1, (LPMCI_PLAY_PARMS) dwParam2);
......@@ -1495,6 +1497,20 @@ LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
case MCI_GETDEVCAPS: return MIDI_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2);
case MCI_INFO: return MIDI_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMS32A) dwParam2);
case MCI_SEEK: return MIDI_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2);
#else
case MCI_OPEN_DRIVER:
case MCI_CLOSE_DRIVER:
case MCI_PLAY:
case MCI_RECORD:
case MCI_STOP:
case MCI_SET:
case MCI_PAUSE:
case MCI_RESUME:
case MCI_STATUS:
case MCI_GETDEVCAPS:
case MCI_INFO:
case MCI_SEEK:
#endif
case MCI_LOAD:
case MCI_SAVE:
case MCI_FREEZE:
......
......@@ -26,7 +26,6 @@
#include "multimedia.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#include "xmalloc.h"
#include "debug.h"
#include "callback.h"
......@@ -108,7 +107,7 @@ LPMIDIINCAPS16 midiInDevices [MAX_MIDIINDRV];
/*======================================================================*
* Low level MIDI implemantation *
*======================================================================*/
#ifdef SNDCTL_MIDI_INFO
/**************************************************************************
* MIDI_NotifyClient [internal]
*/
......@@ -1482,6 +1481,7 @@ static DWORD modReset(WORD wDevID)
*/
return MMSYSERR_NOTENABLED;
}
#endif
/*======================================================================*
* MIDI entry points *
......@@ -1497,6 +1497,7 @@ DWORD WINAPI modMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) {
#ifdef SNDCTL_MIDI_INFO
case MODM_OPEN:
return modOpen(wDevID, (LPMIDIOPENDESC)dwParam1, dwParam2);
case MODM_CLOSE:
......@@ -1519,6 +1520,7 @@ DWORD WINAPI modMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
return 0;
case MODM_RESET:
return modReset(wDevID);
#endif
default:
TRACE(midi, "Unsupported message\n");
}
......
......@@ -11,25 +11,11 @@
#include "windows.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#include "multimedia.h"
#include "debug.h"
#ifdef HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
# include <machine/soundcard.h>
#endif
#define MIXER_DEV "/dev/mixer"
#ifdef SOUND_VERSION
#define IOCTL(a,b,c) ioctl(a,b,&c)
#else
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
#endif
/**************************************************************************
* MIX_GetDevCaps [internal]
*/
......
......@@ -13,25 +13,11 @@
#include "windows.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#include "multimedia.h"
#include "debug.h"
#ifdef HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
# include <machine/soundcard.h>
#endif
#define MIXER_DEV "/dev/mixer"
#ifdef SOUND_VERSION
#define IOCTL(a,b,c) ioctl(a,b,&c)
#else
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
#endif
static int NumDev = 6;
/*-----------------------------------------------------------------------*/
......
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