wineoss.drv: Remove unnecessary ifdefs.

This commit is contained in:
Alexandre Julliard 2011-03-28 22:11:45 +02:00
parent 255cc210b6
commit 1644b25847
10 changed files with 82 additions and 161 deletions

View File

@ -8,7 +8,6 @@ C_SRCS = \
midi.c \ midi.c \
midipatch.c \ midipatch.c \
mixer.c \ mixer.c \
mmaux.c \ mmaux.c
oss.c
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@

View File

@ -55,6 +55,16 @@
#ifdef HAVE_SYS_POLL_H #ifdef HAVE_SYS_POLL_H
# include <sys/poll.h> # include <sys/poll.h>
#endif #endif
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -70,7 +80,6 @@
#include "ksmedia.h" #include "ksmedia.h"
#include "initguid.h" #include "initguid.h"
#include "dsdriver.h" #include "dsdriver.h"
#include "oss.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "audio.h" #include "audio.h"
@ -80,8 +89,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wave);
/* Allow 1% deviation for sample rates (some ES137x cards) */ /* Allow 1% deviation for sample rates (some ES137x cards) */
#define NEAR_MATCH(rate1,rate2) (((100*((int)(rate1)-(int)(rate2)))/(rate1))==0) #define NEAR_MATCH(rate1,rate2) (((100*((int)(rate1)-(int)(rate2)))/(rate1))==0)
#ifdef HAVE_OSS
WINE_WAVEOUT WOutDev[MAX_WAVEDRV]; WINE_WAVEOUT WOutDev[MAX_WAVEDRV];
WINE_WAVEIN WInDev[MAX_WAVEDRV]; WINE_WAVEIN WInDev[MAX_WAVEDRV];
unsigned numOutDev; unsigned numOutDev;
@ -3166,26 +3173,29 @@ DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser,
return MMSYSERR_NOTSUPPORTED; return MMSYSERR_NOTSUPPORTED;
} }
#else /* !HAVE_OSS */
/************************************************************************** /**************************************************************************
* wodMessage (WINEOSS.7) * DriverProc (WINEOSS.1)
*/ */
DWORD WINAPI OSS_wodMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, LRESULT CALLBACK OSS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
DWORD_PTR dwParam1, DWORD_PTR dwParam2) LPARAM dwParam1, LPARAM dwParam2)
{ {
FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
return MMSYSERR_NOTENABLED; dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
/************************************************************************** switch(wMsg) {
* widMessage (WINEOSS.6) case DRV_LOAD:
*/ case DRV_FREE:
DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, case DRV_OPEN:
DWORD_PTR dwParam1, DWORD_PTR dwParam2) case DRV_CLOSE:
{ case DRV_ENABLE:
FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); case DRV_DISABLE:
return MMSYSERR_NOTENABLED; case DRV_QUERYCONFIGURE:
return 1;
case DRV_CONFIGURE: MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
case DRV_INSTALL:
case DRV_REMOVE:
return DRV_SUCCESS;
default:
return 0;
}
} }
#endif /* HAVE_OSS */

View File

@ -25,8 +25,6 @@
# error You must include config.h to use this header # error You must include config.h to use this header
#endif #endif
#ifdef HAVE_OSS
/* unless someone makes a wineserver kernel module, Unix pipes are faster than win32 events */ /* unless someone makes a wineserver kernel module, Unix pipes are faster than win32 events */
#define USE_PIPE_SYNC #define USE_PIPE_SYNC
@ -183,5 +181,3 @@ extern DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc);
/* dsrender.c */ /* dsrender.c */
extern DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); extern DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv);
extern DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); extern DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc);
#endif /* HAVE_OSS */

View File

@ -42,6 +42,16 @@
#ifdef HAVE_SYS_POLL_H #ifdef HAVE_SYS_POLL_H
# include <sys/poll.h> # include <sys/poll.h>
#endif #endif
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -52,15 +62,12 @@
#include "mmreg.h" #include "mmreg.h"
#include "dsound.h" #include "dsound.h"
#include "dsdriver.h" #include "dsdriver.h"
#include "oss.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "audio.h" #include "audio.h"
WINE_DEFAULT_DEBUG_CHANNEL(dscapture); WINE_DEFAULT_DEBUG_CHANNEL(dscapture);
#ifdef HAVE_OSS
/*======================================================================* /*======================================================================*
* Low level DSOUND capture definitions * * Low level DSOUND capture definitions *
*======================================================================*/ *======================================================================*/
@ -1327,5 +1334,3 @@ DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc)
memcpy(desc, &(WInDev[wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC)); memcpy(desc, &(WInDev[wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
#endif /* HAVE_OSS */

View File

@ -45,6 +45,16 @@
#ifdef HAVE_SYS_POLL_H #ifdef HAVE_SYS_POLL_H
# include <sys/poll.h> # include <sys/poll.h>
#endif #endif
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -55,15 +65,12 @@
#include "mmreg.h" #include "mmreg.h"
#include "dsound.h" #include "dsound.h"
#include "dsdriver.h" #include "dsdriver.h"
#include "oss.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "audio.h" #include "audio.h"
WINE_DEFAULT_DEBUG_CHANNEL(wave); WINE_DEFAULT_DEBUG_CHANNEL(wave);
#ifdef HAVE_OSS
/*======================================================================* /*======================================================================*
* Low level DSOUND definitions * * Low level DSOUND definitions *
*======================================================================*/ *======================================================================*/
@ -963,5 +970,3 @@ DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc)
*desc = WOutDev[wDevID].ossdev.ds_desc; *desc = WOutDev[wDevID].ossdev.ds_desc;
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
#endif /* HAVE_OSS */

View File

@ -60,6 +60,16 @@
#ifdef HAVE_SYS_POLL_H #ifdef HAVE_SYS_POLL_H
#include <sys/poll.h> #include <sys/poll.h>
#endif #endif
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -67,7 +77,6 @@
#include "winuser.h" #include "winuser.h"
#include "winnls.h" #include "winnls.h"
#include "mmddk.h" #include "mmddk.h"
#include "oss.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"

View File

@ -41,6 +41,16 @@
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h> # include <sys/ioctl.h>
#endif #endif
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#define NONAMELESSUNION #define NONAMELESSUNION
#define NONAMELESSSTRUCT #define NONAMELESSSTRUCT
@ -48,14 +58,11 @@
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "mmddk.h" #include "mmddk.h"
#include "oss.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mixer); WINE_DEFAULT_DEBUG_CHANNEL(mixer);
#ifdef HAVE_OSS
#define MAX_MIXERDRV (6) #define MAX_MIXERDRV (6)
#define WINE_MIXER_MANUF_ID 0xAA #define WINE_MIXER_MANUF_ID 0xAA
@ -1509,15 +1516,12 @@ static DWORD MIX_GetNumDevs(void)
return MIX_NumMixers; return MIX_NumMixers;
} }
#endif /* HAVE_OSS */
/************************************************************************** /**************************************************************************
* mxdMessage (WINEOSS.3) * mxdMessage (WINEOSS.3)
*/ */
DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
DWORD_PTR dwParam1, DWORD_PTR dwParam2) DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{ {
#ifdef HAVE_OSS
TRACE("(%04X, %s, %08lX, %08lX, %08lX);\n", wDevID, getMessage(wMsg), TRACE("(%04X, %s, %08lX, %08lX, %08lX);\n", wDevID, getMessage(wMsg),
dwUser, dwParam1, dwParam2); dwUser, dwParam1, dwParam2);
@ -1552,10 +1556,4 @@ DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
WARN("unknown message %d!\n", wMsg); WARN("unknown message %d!\n", wMsg);
return MMSYSERR_NOTSUPPORTED; return MMSYSERR_NOTSUPPORTED;
} }
#else
TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg,
dwUser, dwParam1, dwParam2);
return MMSYSERR_NOTENABLED;
#endif
} }

View File

@ -31,18 +31,25 @@
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h> # include <sys/ioctl.h>
#endif #endif
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "mmddk.h" #include "mmddk.h"
#include "oss.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mmaux); WINE_DEFAULT_DEBUG_CHANNEL(mmaux);
#ifdef HAVE_OSS
#define MIXER_DEV "/dev/mixer" #define MIXER_DEV "/dev/mixer"
static int NumDev = 6; static int NumDev = 6;
@ -220,8 +227,6 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
#endif
/************************************************************************** /**************************************************************************
* auxMessage (WINEOSS.2) * auxMessage (WINEOSS.2)
*/ */
@ -231,7 +236,6 @@ DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2); wDevID, wMsg, dwUser, dwParam1, dwParam2);
#ifdef HAVE_OSS
switch (wMsg) { switch (wMsg) {
case DRVM_INIT: case DRVM_INIT:
return OSS_AuxInit(); return OSS_AuxInit();
@ -254,7 +258,4 @@ DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
WARN("unknown message !\n"); WARN("unknown message !\n");
} }
return MMSYSERR_NOTSUPPORTED; return MMSYSERR_NOTSUPPORTED;
#else
return MMSYSERR_NOTENABLED;
#endif
} }

View File

@ -1,63 +0,0 @@
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
/*
* Wine Driver for Open Sound System
*
* Copyright 1999 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "mmddk.h"
#include "oss.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wave);
/**************************************************************************
* DriverProc (WINEOSS.1)
*/
LRESULT CALLBACK OSS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
LPARAM dwParam1, LPARAM dwParam2)
{
TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
dwDevID, hDriv, wMsg, dwParam1, dwParam2);
switch(wMsg) {
#ifdef HAVE_OSS
case DRV_LOAD:
case DRV_FREE:
case DRV_OPEN:
case DRV_CLOSE:
case DRV_ENABLE:
case DRV_DISABLE:
case DRV_QUERYCONFIGURE:
return 1;
case DRV_CONFIGURE: MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
case DRV_INSTALL:
case DRV_REMOVE:
return DRV_SUCCESS;
#endif
default:
return 0;
}
}

View File

@ -1,39 +0,0 @@
/* Definition for OSS drivers : wine multimedia system
*
* Copyright 1999 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
#elif defined(HAVE_MACHINE_SOUNDCARD_H)
# include <machine/soundcard.h>
#elif defined(HAVE_SOUNDCARD_H)
# include <soundcard.h>
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
/* check for one of the Open Sound System specific SNDCTL_ defines */
#ifdef SNDCTL_DSP_STEREO
# define HAVE_OSS
#endif