Implemented an Esound driver.

This commit is contained in:
Peter Åstrand 2005-08-03 15:53:26 +00:00 committed by Alexandre Julliard
parent 4fa411fa07
commit 7a15eb9318
12 changed files with 2471 additions and 6 deletions

141
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -725,6 +725,27 @@ then
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
fi fi
dnl **** Check for EsounD ****
AC_PATH_PROG(ESDCONFIG, esd-config)
if test x$ESDCONFIG != x -a x$ESDCONFIG != x'"$ESDCONFIG"';
then
ESD_CFLAGS=""
for i in `$ESDCONFIG --cflags`
do
case "$i" in
-I*) ESD_CFLAGS="$ESD_CFLAGS $i";;
esac
done
ESD_LIBS=`$ESDCONFIG --libs`
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ESD_CFLAGS"
AC_CHECK_LIB(esd,esd_open_sound,
[AC_SUBST(ESDLIBS, $ESD_LIBS)
AC_SUBST(ESDINCL, $ESD_CFLAGS)
AC_DEFINE(HAVE_ESD, 1, [Define if you have EsounD sound server])])
CFLAGS="$save_CFLAGS"
fi
dnl **** Check for ALSA 1.x **** dnl **** Check for ALSA 1.x ****
AC_SUBST(ALSALIBS,"") AC_SUBST(ALSALIBS,"")
AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break) AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break)
@ -1753,6 +1774,7 @@ dlls/winmm/wavemap/Makefile
dlls/winmm/winealsa/Makefile dlls/winmm/winealsa/Makefile
dlls/winmm/winearts/Makefile dlls/winmm/winearts/Makefile
dlls/winmm/wineaudioio/Makefile dlls/winmm/wineaudioio/Makefile
dlls/winmm/wineesd/Makefile
dlls/winmm/winejack/Makefile dlls/winmm/winejack/Makefile
dlls/winmm/winenas/Makefile dlls/winmm/winenas/Makefile
dlls/winmm/wineoss/Makefile dlls/winmm/wineoss/Makefile
@ -1848,11 +1870,11 @@ fi
if test -z "$ALSALIBS" -a -z "$ARTSC_LIBS" -a -z "$AUDIOIOLIBS" -a \ if test -z "$ALSALIBS" -a -z "$ARTSC_LIBS" -a -z "$AUDIOIOLIBS" -a \
-z "$ac_cv_lib_soname_jack" -a -z "$NASLIBS" -a \ -z "$ac_cv_lib_soname_jack" -a -z "$NASLIBS" -a \
"$ac_cv_c_opensoundsystem" = "no" "$ac_cv_c_opensoundsystem" = "no" -a -z "$ESD_LIBS"
then then
echo "*** No sound system was found. Windows applications will be silent." echo "*** No sound system was found. Windows applications will be silent."
echo "*** The currently supported sound systems are:" echo "*** The currently supported sound systems are:"
echo "*** ALSA, ARTS, AudioIO, Jack, NAS and OSS" echo "*** ALSA, ARTS, EsounD, AudioIO, Jack, NAS and OSS"
fi fi
echo echo

View File

@ -164,6 +164,7 @@ BASEDIRS = \
winmm/winealsa \ winmm/winealsa \
winmm/winearts \ winmm/winearts \
winmm/wineaudioio \ winmm/wineaudioio \
winmm/wineesd \
winmm/winejack \ winmm/winejack \
winmm/winenas \ winmm/winenas \
winmm/wineoss \ winmm/wineoss \
@ -403,6 +404,7 @@ SYMLINKS_SO = \
winearts.drv.so \ winearts.drv.so \
wineaudioio.drv.so \ wineaudioio.drv.so \
winedos.dll.so \ winedos.dll.so \
wineesd.drv.so \
winejack.drv.so \ winejack.drv.so \
winemp3.acm.so \ winemp3.acm.so \
winenas.drv.so \ winenas.drv.so \
@ -956,6 +958,9 @@ winedos.dll.so: winedos/winedos.dll.so
wprocs.dll.so : winedos.dll.so wprocs.dll.so : winedos.dll.so
$(RM) $@ && $(LN_S) winedos.dll.so $@ $(RM) $@ && $(LN_S) winedos.dll.so $@
wineesd.drv.so: winmm/wineesd/wineesd.drv.so
$(RM) $@ && $(LN_S) winmm/wineesd/wineesd.drv.so $@
winejack.drv.so: winmm/winejack/winejack.drv.so winejack.drv.so: winmm/winejack/winejack.drv.so
$(RM) $@ && $(LN_S) winmm/winejack/winejack.drv.so $@ $(RM) $@ && $(LN_S) winmm/winejack/winejack.drv.so $@
@ -1758,6 +1763,7 @@ winmm/winearts/winearts.drv.so: winmm/winearts
winmm/wineaudioio/wineaudioio.drv.so: winmm/wineaudioio winmm/wineaudioio/wineaudioio.drv.so: winmm/wineaudioio
wined3d/wined3d.dll.so: wined3d wined3d/wined3d.dll.so: wined3d
winedos/winedos.dll.so: winedos winedos/winedos.dll.so: winedos
winmm/wineesd/wineesd.drv.so: winmm/wineesd
winmm/winejack/winejack.drv.so: winmm/winejack winmm/winejack/winejack.drv.so: winmm/winejack
msacm/winemp3/winemp3.acm.so: msacm/winemp3 msacm/winemp3/winemp3.acm.so: msacm/winemp3
winmm/winenas/winenas.drv.so: winmm/winenas winmm/winenas/winenas.drv.so: winmm/winenas

View File

@ -0,0 +1,2 @@
Makefile
wineesd.drv.dbg.c

View File

@ -0,0 +1,16 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wineesd.drv
IMPORTS = winmm user32 kernel32
EXTRAINCL = @ESDINCL@
EXTRALIBS = @ESDLIBS@ -ldxguid -luuid
C_SRCS = \
esound.c \
audio.c
@MAKE_DLL_RULES@
### Dependencies:

2144
dlls/winmm/wineesd/audio.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
/*
* Wine Driver for EsounD Sound Server
* http://www.tux.org/~ricdude/EsounD.html
*
* Copyright 2004 Zhangrong Huang <hzhr@users.sourceforge.net>
*
* Code massively copied from Eric Pouech's OSS driver
* and Chris Morgan aRts driver
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "mmddk.h"
#include "esound.h"
#ifdef HAVE_ESD
static int esd = 0;
/**************************************************************************
* ESD_drvOpen [internal]
*/
static DWORD ESD_drvOpen(LPSTR str)
{
if (esd)
return 0;
/* I know, this is ugly, but who cares... */
esd = 1;
return 1;
}
/**************************************************************************
* ESD_drvClose [internal]
*/
static DWORD ESD_drvClose(DWORD dwDevID)
{
if (esd) {
esd = 0;
return 1;
}
return 0;
}
#endif /* #ifdef HAVE_ESD */
/**************************************************************************
* DriverProc (WINEESD.@)
*/
LONG CALLBACK ESD_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) {
#ifdef HAVE_ESD
case DRV_LOAD: if (ESD_WaveInit()<0) return 0;
return 1;
case DRV_FREE: return ESD_WaveClose();
case DRV_OPEN: return ESD_drvOpen((LPSTR)dwParam1);
case DRV_CLOSE: return ESD_drvClose(dwDevID);
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBoxA(0, "EsounD MultiMedia Driver!", "EsounD Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
#endif
default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
}

View File

@ -0,0 +1,34 @@
/* Definition for EsounD drivers : wine multimedia system
*
* Copyright 2004 Zhangrong Huang <hzhr@users.sourceforge.net>
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_ESD_H
#define __WINE_ESD_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
extern LONG ESD_WaveInit(void);
extern LONG ESD_WaveClose(void);
#endif /* __WINE_ESD_H */

View File

@ -0,0 +1,3 @@
@ stdcall DriverProc(long long long long long) ESD_DriverProc
@ stdcall wodMessage(long long long long long) ESD_wodMessage
@ stdcall widMessage(long long long long long) ESD_widMessage

View File

@ -86,6 +86,9 @@
/* Define to 1 if you have the `epoll_create' function. */ /* Define to 1 if you have the `epoll_create' function. */
#undef HAVE_EPOLL_CREATE #undef HAVE_EPOLL_CREATE
/* Define if you have EsounD sound server */
#undef HAVE_ESD
/* Define to 1 if you have the `ffs' function. */ /* Define to 1 if you have the `ffs' function. */
#undef HAVE_FFS #undef HAVE_FFS

View File

@ -210,6 +210,15 @@ static const char *audioAutoDetect(void)
numFound++; numFound++;
} }
/* try to detect EsounD */
argv_new[2] = "ps awx|grep esd|grep -v grep|grep esd > /dev/null";
if(!spawnvp(_P_WAIT, "/bin/sh", argv_new))
{
driversFound[numFound] = "esd";
name[numFound] = "EsounD";
numFound++;
}
/* try to detect nas */ /* try to detect nas */
/* TODO */ /* TODO */

View File

@ -60,6 +60,7 @@ static const DLL_DESC sDLLType[] = {
static const AUDIO_DRIVER sAudioDrivers[] = { static const AUDIO_DRIVER sAudioDrivers[] = {
{"ALSA", "alsa"}, {"ALSA", "alsa"},
{"aRts", "arts"}, {"aRts", "arts"},
{"EsounD", "esd"},
{"OSS", "oss"}, {"OSS", "oss"},
{"JACK", "jack"}, {"JACK", "jack"},
{"NAS", "nas"}, {"NAS", "nas"},