xaudio2: Rewrite to use FAudio.

Signed-off-by: Ethan Lee <elee@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ethan Lee 2019-02-20 11:05:25 -05:00 committed by Alexandre Julliard
parent 71004a825f
commit 3e390b1aaf
35 changed files with 2224 additions and 2996 deletions

149
configure vendored
View File

@ -659,6 +659,8 @@ CUPS_LIBS
CUPS_CFLAGS
CAPI20_LIBS
CAPI20_CFLAGS
FAUDIO_LIBS
FAUDIO_CFLAGS
SDL2_LIBS
SDL2_CFLAGS
UDEV_LIBS
@ -836,6 +838,7 @@ with_coreaudio
with_cups
with_curses
with_dbus
with_faudio
with_float_abi
with_fontconfig
with_freetype
@ -1828,6 +1831,8 @@ UDEV_CFLAGS
UDEV_LIBS
SDL2_CFLAGS
SDL2_LIBS
FAUDIO_CFLAGS
FAUDIO_LIBS
CAPI20_CFLAGS
CAPI20_LIBS
CUPS_CFLAGS
@ -2498,6 +2503,7 @@ Optional Packages:
--without-cups do not use CUPS
--without-curses do not use (n)curses
--without-dbus do not use DBus (dynamic device support)
--without-faudio do not use FAudio (XAudio2 support)
--with-float-abi=abi specify the ABI (soft|softfp|hard) for ARM platforms
--without-fontconfig do not use fontconfig
--without-freetype do not use the FreeType library
@ -2605,6 +2611,9 @@ Some influential environment variables:
UDEV_LIBS Linker flags for libudev, overriding pkg-config
SDL2_CFLAGS C compiler flags for sdl2, overriding pkg-config
SDL2_LIBS Linker flags for sdl2, overriding pkg-config
FAUDIO_CFLAGS
C compiler flags for faudio, overriding pkg-config
FAUDIO_LIBS Linker flags for faudio, overriding pkg-config
CAPI20_CFLAGS
C compiler flags for capi20, overriding pkg-config
CAPI20_LIBS Linker flags for capi20, overriding pkg-config
@ -3837,6 +3846,12 @@ if test "${with_dbus+set}" = set; then :
fi
# Check whether --with-faudio was given.
if test "${with_faudio+set}" = set; then :
withval=$with_faudio;
fi
# Check whether --with-float-abi was given.
if test "${with_float_abi+set}" = set; then :
withval=$with_float_abi;
@ -14003,6 +14018,104 @@ esac
fi
if test "x$with_faudio" != "xno"
then
if ${FAUDIO_CFLAGS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
FAUDIO_CFLAGS=`$PKG_CONFIG --cflags faudio 2>/dev/null`
fi
fi
if ${FAUDIO_LIBS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
FAUDIO_LIBS=`$PKG_CONFIG --libs faudio 2>/dev/null`
fi
fi
FAUDIO_LIBS=${FAUDIO_LIBS:-"-lFAudio"}
$as_echo "$as_me:${as_lineno-$LINENO}: faudio cflags: $FAUDIO_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: faudio libs: $FAUDIO_LIBS" >&5
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $FAUDIO_CFLAGS"
for ac_header in FAudio.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "FAudio.h" "ac_cv_header_FAudio_h" "$ac_includes_default"
if test "x$ac_cv_header_FAudio_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_FAUDIO_H 1
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lFAudio" >&5
$as_echo_n "checking for -lFAudio... " >&6; }
if ${ac_cv_lib_soname_FAudio+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-lFAudio $FAUDIO_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char FAudioCreate ();
int
main ()
{
return FAudioCreate ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
case "$LIBEXT" in
dll) ac_cv_lib_soname_FAudio=`$ac_cv_path_LDD conftest.exe | grep "FAudio" | sed -e "s/dll.*/dll/"';2,$d'` ;;
dylib) ac_cv_lib_soname_FAudio=`$OTOOL -L conftest$ac_exeext | grep "libFAudio*\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libFAudio*\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_FAudio=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libFAudio*\\.$LIBEXT" | sed -e "s/^.*\\[\\(libFAudio*\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'`
if ${ac_cv_lib_soname_FAudio:+false} :; then :
ac_cv_lib_soname_FAudio=`$LDD conftest$ac_exeext | grep "libFAudio*\\.$LIBEXT" | sed -e "s/^.*\(libFAudio*\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'`
fi ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_soname_save_LIBS
fi
if ${ac_cv_lib_soname_FAudio:+false} :; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_FAudio" >&5
$as_echo "$ac_cv_lib_soname_FAudio" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBFAUDIO "$ac_cv_lib_soname_FAudio"
_ACEOF
fi
fi
done
CPPFLAGS=$ac_save_CPPFLAGS
test -z "$FAUDIO_CFLAGS" || FAUDIO_CFLAGS=`echo " $FAUDIO_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'`
test -z "$FAUDIO_LIBS" || FAUDIO_LIBS=`echo " $FAUDIO_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
fi
if test "x$ac_cv_lib_soname_FAudio" = "x"; then :
case "x$with_faudio" in
x) as_fn_append wine_notices "|libFAudio ${notice_platform}development files not found, XAudio2 won't be supported." ;;
xno) ;;
*) as_fn_error $? "libFAudio ${notice_platform}development files not found, XAudio2 won't be supported.
This is an error since --with-faudio was requested." "$LINENO" 5 ;;
esac
fi
if test "x$with_capi" != "xno"
then
if ${CAPI20_CFLAGS:+false} :; then :
@ -15072,40 +15185,8 @@ esac
enable_openal32=${enable_openal32:-no}
fi
if test "x$ac_cv_lib_openal" = xyes
if test "x$ac_cv_lib_soname_FAudio" = "x"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openal-soft" >&5
$as_echo_n "checking for openal-soft... " >&6; }
if ${ac_cv_have_openalsoft+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alext.h>
LPALCRENDERSAMPLESSOFT x;
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_have_openalsoft=yes
else
ac_cv_have_openalsoft=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_openalsoft" >&5
$as_echo "$ac_cv_have_openalsoft" >&6; }
fi
if test "x$ac_cv_have_openalsoft" != xyes
then
as_fn_append wine_notices "|openal-soft ${notice_platform}development files not found (or too old), XAudio2 won't be supported."
enable_x3daudio1_0=${enable_x3daudio1_0:-no}
enable_x3daudio1_1=${enable_x3daudio1_1:-no}
enable_x3daudio1_2=${enable_x3daudio1_2:-no}
@ -19064,6 +19145,8 @@ UDEV_CFLAGS = $UDEV_CFLAGS
UDEV_LIBS = $UDEV_LIBS
SDL2_CFLAGS = $SDL2_CFLAGS
SDL2_LIBS = $SDL2_LIBS
FAUDIO_CFLAGS = $FAUDIO_CFLAGS
FAUDIO_LIBS = $FAUDIO_LIBS
CAPI20_CFLAGS = $CAPI20_CFLAGS
CAPI20_LIBS = $CAPI20_LIBS
CUPS_CFLAGS = $CUPS_CFLAGS

View File

@ -43,6 +43,7 @@ AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS]))
AC_ARG_WITH(curses, AS_HELP_STRING([--without-curses],[do not use (n)curses]),
[if test "x$withval" = "xno"; then ac_cv_header_ncurses_h=no; ac_cv_header_curses_h=no; fi])
AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic device support)]))
AC_ARG_WITH(faudio, AS_HELP_STRING([--without-faudio],[do not use FAudio (XAudio2 support)]))
AC_ARG_WITH(float-abi, AS_HELP_STRING([--with-float-abi=abi],[specify the ABI (soft|softfp|hard) for ARM platforms]))
AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]))
AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library]))
@ -1634,6 +1635,16 @@ fi
WINE_NOTICE_WITH(sdl,[test "x$ac_cv_lib_soname_SDL2" = "x"],
[libSDL2 ${notice_platform}development files not found, SDL2 won't be supported.])
dnl **** Check for FAudio ****
if test "x$with_faudio" != "xno"
then
WINE_PACKAGE_FLAGS(FAUDIO,[faudio],[-lFAudio],,,
[AC_CHECK_HEADERS([FAudio.h],
[WINE_CHECK_SONAME(FAudio,FAudioCreate,,,[$FAUDIO_LIBS],[[libFAudio*]])])])
fi
WINE_NOTICE_WITH(faudio,[test "x$ac_cv_lib_soname_FAudio" = "x"],
[libFAudio ${notice_platform}development files not found, XAudio2 won't be supported.])
dnl **** Check for capi4linux ****
if test "x$with_capi" != "xno"
then
@ -1798,19 +1809,8 @@ WINE_NOTICE_WITH(openal,[test "x$ac_cv_lib_openal" != xyes],
[libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported.],
[enable_openal32])
dnl **** Check for openal-soft ****
if test "x$ac_cv_lib_openal" = xyes
if test "x$ac_cv_lib_soname_FAudio" = "x"
then
AC_CACHE_CHECK([for openal-soft], ac_cv_have_openalsoft,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alext.h>
LPALCRENDERSAMPLESSOFT x;]])],[ac_cv_have_openalsoft=yes],[ac_cv_have_openalsoft=no]))
fi
if test "x$ac_cv_have_openalsoft" != xyes
then
WINE_NOTICE([openal-soft ${notice_platform}development files not found (or too old), XAudio2 won't be supported.])
enable_x3daudio1_0=${enable_x3daudio1_0:-no}
enable_x3daudio1_1=${enable_x3daudio1_1:-no}
enable_x3daudio1_2=${enable_x3daudio1_2:-no}

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=0 -DXAUDIO2_VER=0
MODULE = x3daudio1_0.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=1 -DXAUDIO2_VER=1
MODULE = x3daudio1_1.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=2 -DXAUDIO2_VER=2
MODULE = x3daudio1_2.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=3 -DXAUDIO2_VER=3
MODULE = x3daudio1_3.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=4 -DXAUDIO2_VER=4
MODULE = x3daudio1_4.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=5 -DXAUDIO2_VER=5
MODULE = x3daudio1_5.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=6 -DXAUDIO2_VER=6
MODULE = x3daudio1_6.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -1,6 +1,8 @@
EXTRADEFS = -DX3DAUDIO1_VER=7 -DXAUDIO2_VER=7
MODULE = x3daudio1_7.dll
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
x3daudio.c

View File

@ -2,8 +2,12 @@ EXTRADEFS = -DXAPOFX1_VER=1 -DXAUDIO2_VER=2
MODULE = xapofx1_1.dll
IMPORTS = ole32
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
xapofx.c
xapo.c \
xapofx.c \
xaudio_allocator.c
RC_SRCS = version.rc

View File

@ -2,6 +2,10 @@ EXTRADEFS = -DXAPOFX1_VER=2 -DXAUDIO2_VER=3
MODULE = xapofx1_2.dll
IMPORTS = ole32
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
xapofx.c
xapo.c \
xapofx.c \
xaudio_allocator.c

View File

@ -2,8 +2,12 @@ EXTRADEFS = -DXAPOFX1_VER=3 -DXAUDIO2_VER=4
MODULE = xapofx1_3.dll
IMPORTS = ole32
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
xapofx.c
xapo.c \
xapofx.c \
xaudio_allocator.c
RC_SRCS = version.rc

View File

@ -2,6 +2,10 @@ EXTRADEFS = -DXAPOFX1_VER=4 -DXAUDIO2_VER=6
MODULE = xapofx1_4.dll
IMPORTS = ole32
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
xapofx.c
xapo.c \
xapofx.c \
xaudio_allocator.c

View File

@ -2,6 +2,10 @@ EXTRADEFS = -DXAPOFX1_VER=5 -DXAUDIO2_VER=7
MODULE = xapofx1_5.dll
IMPORTS = ole32
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
xapofx.c
xapo.c \
xapofx.c \
xaudio_allocator.c

View File

@ -1,12 +1,14 @@
EXTRADEFS = -DXAUDIO2_VER=0
MODULE = xaudio2_0.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
xapofx.c \
xapo.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,12 +1,14 @@
EXTRADEFS = -DXAUDIO2_VER=1
MODULE = xaudio2_1.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
xapofx.c \
xapo.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,12 +1,14 @@
EXTRADEFS = -DXAUDIO2_VER=2
MODULE = xaudio2_2.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
xapofx.c \
xapo.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,12 +1,14 @@
EXTRADEFS = -DXAUDIO2_VER=3
MODULE = xaudio2_3.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
xapofx.c \
xapo.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,12 +1,14 @@
EXTRADEFS = -DXAUDIO2_VER=4
MODULE = xaudio2_4.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
xapofx.c \
xapo.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,12 +1,14 @@
EXTRADEFS = -DXAUDIO2_VER=5
MODULE = xaudio2_5.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
xapofx.c \
xapo.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,12 +1,14 @@
EXTRADEFS = -DXAUDIO2_VER=6
MODULE = xaudio2_6.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
xapofx.c \
xapo.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,12 +1,15 @@
EXTRADEFS = -DXAUDIO2_VER=7
MODULE = xaudio2_7.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
x3daudio.c \
xapo.c \
xapofx.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

File diff suppressed because it is too large Load Diff

View File

@ -524,7 +524,7 @@ static void test_buffer_callbacks(IXAudio2 *xa)
if(xaudio27){
hr = IXAudio27SourceVoice_SetSourceSampleRate((IXAudio27SourceVoice*)src, 48000);
todo_wine ok(hr == S_OK, "SetSourceSampleRate failed: %08x\n", hr);
ok(hr == S_OK, "SetSourceSampleRate failed: %08x\n", hr);
}else{
hr = IXAudio2SourceVoice_SetSourceSampleRate(src, 48000);
ok(hr == XAUDIO2_E_INVALID_CALL, "SetSourceSampleRate should have failed: %08x\n", hr);
@ -952,19 +952,16 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
HRESULT (CDECL *pCreateFX)(REFCLSID,IUnknown**) = NULL;
/* CLSIDs are the same across all versions */
static struct {
const GUID *clsid;
BOOL todo;
} const_clsids[] = {
{ &CLSID_FXEQ27, FALSE },
{ &CLSID_FXMasteringLimiter27, TRUE },
{ &CLSID_FXReverb27, FALSE },
{ &CLSID_FXEcho27, TRUE},
static const GUID *const_clsids[] = {
&CLSID_FXEQ27,
&CLSID_FXMasteringLimiter27,
&CLSID_FXReverb27,
&CLSID_FXEcho27,
/* older versions of xapofx actually have support for new clsids */
{ &CLSID_FXEQ, FALSE },
{ &CLSID_FXMasteringLimiter, TRUE },
{ &CLSID_FXReverb, FALSE },
{ &CLSID_FXEcho, TRUE}
&CLSID_FXEQ,
&CLSID_FXMasteringLimiter,
&CLSID_FXReverb,
&CLSID_FXEcho
};
/* different CLSID for each version */
@ -1005,9 +1002,8 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
if(pCreateFX){
for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
hr = pCreateFX(const_clsids[i].clsid, &fx_unk);
todo_wine_if(const_clsids[i].todo)
ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i].clsid), hr);
hr = pCreateFX(const_clsids[i], &fx_unk);
ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
if(SUCCEEDED(hr)){
IXAPO *xapo;
hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
@ -1017,7 +1013,7 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
IUnknown_Release(fx_unk);
}
hr = CoCreateInstance(const_clsids[i].clsid, NULL, CLSCTX_INPROC_SERVER,
hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&fx_unk);
ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
if(SUCCEEDED(hr))
@ -1062,20 +1058,18 @@ static void test_xapo_creation_modern(const char *module)
HRESULT (WINAPI *pCAR)(IUnknown**) = NULL;
/* CLSIDs are the same across all versions */
static struct {
const GUID *clsid;
BOOL todo;
} const_clsids[] = {
{ &CLSID_FXEQ27, FALSE },
{ &CLSID_FXMasteringLimiter27, TRUE },
{ &CLSID_FXReverb27, FALSE },
{ &CLSID_FXEcho27, TRUE},
{ &CLSID_FXEQ, FALSE },
{ &CLSID_FXMasteringLimiter, TRUE },
{ &CLSID_FXReverb, FALSE },
{ &CLSID_FXEcho, TRUE}
static const GUID *const_clsids[] = {
&CLSID_FXEQ27,
&CLSID_FXMasteringLimiter27,
&CLSID_FXReverb27,
&CLSID_FXEcho27,
&CLSID_FXEQ,
&CLSID_FXMasteringLimiter,
&CLSID_FXReverb,
&CLSID_FXEcho
};
xaudio2dll = LoadLibraryA(module);
if(xaudio2dll){
pCreateFX = (void*)GetProcAddress(xaudio2dll, "CreateFX");
@ -1091,9 +1085,8 @@ static void test_xapo_creation_modern(const char *module)
if(pCreateFX){
for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
hr = pCreateFX(const_clsids[i].clsid, &fx_unk, NULL, 0);
todo_wine_if(const_clsids[i].todo)
ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i].clsid), hr);
hr = pCreateFX(const_clsids[i], &fx_unk, NULL, 0);
ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
if(SUCCEEDED(hr)){
IXAPO *xapo;
hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo);
@ -1103,7 +1096,7 @@ static void test_xapo_creation_modern(const char *module)
IUnknown_Release(fx_unk);
}
hr = CoCreateInstance(const_clsids[i].clsid, NULL, CLSCTX_INPROC_SERVER,
hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&fx_unk);
ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
if(SUCCEEDED(hr))

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2016 Andrew Eikum for CodeWeavers
* Copyright (c) 2018 Ethan Lee for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,11 +19,14 @@
#include <stdarg.h>
#include "xaudio_private.h"
#include "windef.h"
#include "winbase.h"
#include "x3daudio.h"
#include "wine/debug.h"
#include <F3DAudio.h>
#if XAUDIO2_VER >= 8 || defined X3DAUDIO1_VER
WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
#endif
@ -34,8 +38,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
switch (reason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hinstDLL );
break;
@ -48,7 +50,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound,
X3DAUDIO_HANDLE handle)
{
FIXME("0x%x, %f, %p: Stub!\n", chanmask, speedofsound, handle);
TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle);
F3DAudioInitialize(chanmask, speedofsound, handle);
return S_OK;
}
#endif /* XAUDIO2_VER >= 8 */
@ -57,7 +60,8 @@ HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound,
void CDECL LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound,
X3DAUDIO_HANDLE handle)
{
FIXME("0x%x, %f, %p: Stub!\n", chanmask, speedofsound, handle);
TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle);
F3DAudioInitialize(chanmask, speedofsound, handle);
}
#endif /* X3DAUDIO1_VER */
@ -66,19 +70,13 @@ void CDECL X3DAudioCalculate(const X3DAUDIO_HANDLE handle,
const X3DAUDIO_LISTENER *listener, const X3DAUDIO_EMITTER *emitter,
UINT32 flags, X3DAUDIO_DSP_SETTINGS *out)
{
static int once = 0;
if(!once){
FIXME("%p %p %p 0x%x %p: Stub!\n", handle, listener, emitter, flags, out);
++once;
}
out->LPFDirectCoefficient = 0;
out->LPFReverbCoefficient = 0;
out->ReverbLevel = 0;
out->DopplerFactor = 1;
out->EmitterToListenerAngle = 0;
out->EmitterToListenerDistance = 0;
out->EmitterVelocityComponent = 0;
out->ListenerVelocityComponent = 0;
TRACE("%p, %p, %p, 0x%x, %p\n", handle, listener, emitter, flags, out);
F3DAudioCalculate(
handle,
(const F3DAUDIO_LISTENER*) listener,
(const F3DAUDIO_EMITTER*) emitter,
flags,
(F3DAUDIO_DSP_SETTINGS*) out
);
}
#endif /* XAUDIO2_VER >= 8 || defined X3DAUDIO1_VER */

405
dlls/xaudio2_7/xapo.c Normal file
View File

@ -0,0 +1,405 @@
/*
* Copyright (c) 2015 Mark Harmstone
* Copyright (c) 2015 Andrew Eikum for CodeWeavers
* Copyright (c) 2018 Ethan Lee for CodeWeavers
*
* 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>
#define NONAMELESSUNION
#define COBJMACROS
#include "xaudio_private.h"
#include "xaudio2fx.h"
#include "xapofx.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include <FAPO.h>
#include <FAPOFX.h>
#include <FAudioFX.h>
WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
static XA2XAPOFXImpl *impl_from_IXAPO(IXAPO *iface)
{
return CONTAINING_RECORD(iface, XA2XAPOFXImpl, IXAPO_iface);
}
static XA2XAPOFXImpl *impl_from_IXAPOParameters(IXAPOParameters *iface)
{
return CONTAINING_RECORD(iface, XA2XAPOFXImpl, IXAPOParameters_iface);
}
static HRESULT WINAPI XAPOFX_QueryInterface(IXAPO *iface, REFIID riid, void **ppvObject)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject);
if(IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IXAPO) ||
IsEqualGUID(riid, &IID_IXAPO27))
*ppvObject = &This->IXAPO_iface;
else if(IsEqualGUID(riid, &IID_IXAPOParameters) ||
IsEqualGUID(riid, &IID_IXAPO27Parameters))
*ppvObject = &This->IXAPOParameters_iface;
else
*ppvObject = NULL;
if(*ppvObject){
IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI XAPOFX_AddRef(IXAPO *iface)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
ULONG ref = This->fapo->AddRef(This->fapo);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI XAPOFX_Release(IXAPO *iface)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
ULONG ref = This->fapo->Release(This->fapo);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
if(!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI XAPOFX_GetRegistrationProperties(IXAPO *iface,
XAPO_REGISTRATION_PROPERTIES **props)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
HRESULT hr;
FAPORegistrationProperties *fprops;
TRACE("%p, %p\n", This, props);
hr = This->fapo->GetRegistrationProperties(This->fapo, &fprops);
if(FAILED(hr))
return hr;
/* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */
*props = (XAPO_REGISTRATION_PROPERTIES*) fprops;
return hr;
}
static HRESULT WINAPI XAPOFX_IsInputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt,
WAVEFORMATEX **supported_fmt)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt);
return This->fapo->IsInputFormatSupported(This->fapo,
(const FAudioWaveFormatEx *)output_fmt,
(const FAudioWaveFormatEx *)input_fmt,
(FAudioWaveFormatEx **)supported_fmt);
}
static HRESULT WINAPI XAPOFX_IsOutputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt,
WAVEFORMATEX **supported_fmt)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt);
return This->fapo->IsOutputFormatSupported(This->fapo,
(const FAudioWaveFormatEx *)input_fmt,
(const FAudioWaveFormatEx *)output_fmt,
(FAudioWaveFormatEx **)supported_fmt);
}
static HRESULT WINAPI XAPOFX_Initialize(IXAPO *iface, const void *data,
UINT32 data_len)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %p, %u\n", This, data, data_len);
return This->fapo->Initialize(This->fapo, data, data_len);
}
static void WINAPI XAPOFX_Reset(IXAPO *iface)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p\n", This);
This->fapo->Reset(This->fapo);
}
static HRESULT WINAPI XAPOFX_LockForProcess(IXAPO *iface, UINT32 in_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params,
out_params_count, out_params);
return This->fapo->LockForProcess(This->fapo,
in_params_count,
(const FAPOLockForProcessBufferParameters *)in_params,
out_params_count,
(const FAPOLockForProcessBufferParameters *)out_params);
}
static void WINAPI XAPOFX_UnlockForProcess(IXAPO *iface)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p\n", This);
This->fapo->UnlockForProcess(This->fapo);
}
static void WINAPI XAPOFX_Process(IXAPO *iface, UINT32 in_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params,
out_params_count, out_params, enabled);
This->fapo->Process(This->fapo, in_params_count,
(const FAPOProcessBufferParameters *)in_params, out_params_count,
(FAPOProcessBufferParameters *)out_params, enabled);
}
static UINT32 WINAPI XAPOFX_CalcInputFrames(IXAPO *iface, UINT32 output_frames)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %u\n", This, output_frames);
return 0;
}
static UINT32 WINAPI XAPOFX_CalcOutputFrames(IXAPO *iface, UINT32 input_frames)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %u\n", This, input_frames);
return 0;
}
static const IXAPOVtbl XAPOFX_Vtbl = {
XAPOFX_QueryInterface,
XAPOFX_AddRef,
XAPOFX_Release,
XAPOFX_GetRegistrationProperties,
XAPOFX_IsInputFormatSupported,
XAPOFX_IsOutputFormatSupported,
XAPOFX_Initialize,
XAPOFX_Reset,
XAPOFX_LockForProcess,
XAPOFX_UnlockForProcess,
XAPOFX_Process,
XAPOFX_CalcInputFrames,
XAPOFX_CalcOutputFrames
};
static HRESULT WINAPI XAPOFXParams_QueryInterface(IXAPOParameters *iface,
REFIID riid, void **ppvObject)
{
XA2XAPOFXImpl *This = impl_from_IXAPOParameters(iface);
return XAPOFX_QueryInterface(&This->IXAPO_iface, riid, ppvObject);
}
static ULONG WINAPI XAPOFXParams_AddRef(IXAPOParameters *iface)
{
XA2XAPOFXImpl *This = impl_from_IXAPOParameters(iface);
return XAPOFX_AddRef(&This->IXAPO_iface);
}
static ULONG WINAPI XAPOFXParams_Release(IXAPOParameters *iface)
{
XA2XAPOFXImpl *This = impl_from_IXAPOParameters(iface);
return XAPOFX_Release(&This->IXAPO_iface);
}
static void WINAPI XAPOFXParams_SetParameters(IXAPOParameters *iface,
const void *params, UINT32 params_len)
{
XA2XAPOFXImpl *This = impl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
This->fapo->SetParameters(This->fapo, params, params_len);
}
static void WINAPI XAPOFXParams_GetParameters(IXAPOParameters *iface, void *params,
UINT32 params_len)
{
XA2XAPOFXImpl *This = impl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
This->fapo->GetParameters(This->fapo, params, params_len);
}
static const IXAPOParametersVtbl XAPOFXParameters_Vtbl = {
XAPOFXParams_QueryInterface,
XAPOFXParams_AddRef,
XAPOFXParams_Release,
XAPOFXParams_SetParameters,
XAPOFXParams_GetParameters
};
struct xapo_cf {
IClassFactory IClassFactory_iface;
LONG ref;
const CLSID *class;
};
static struct xapo_cf *xapo_impl_from_IClassFactory(IClassFactory *iface)
{
return CONTAINING_RECORD(iface, struct xapo_cf, IClassFactory_iface);
}
static HRESULT WINAPI xapocf_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
{
if(IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IClassFactory))
{
IClassFactory_AddRef(iface);
*ppobj = iface;
return S_OK;
}
*ppobj = NULL;
WARN("(%p)->(%s, %p): interface not found\n", iface, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI xapocf_AddRef(IClassFactory *iface)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI xapocf_Release(IClassFactory *iface)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
if (!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo)
{
#ifndef XAPOFX1_VER
if(IsEqualGUID(clsid, &CLSID_AudioVolumeMeter27))
return FAudioCreateVolumeMeterWithCustomAllocatorEXT(
fapo,
0,
XAudio_Internal_Malloc,
XAudio_Internal_Free,
XAudio_Internal_Realloc
);
if(IsEqualGUID(clsid, &CLSID_AudioReverb27))
return FAudioCreateReverbWithCustomAllocatorEXT(
fapo,
0,
XAudio_Internal_Malloc,
XAudio_Internal_Free,
XAudio_Internal_Realloc
);
#endif
#if XAUDIO2_VER >= 8 || defined XAPOFX1_VER
if(IsEqualGUID(clsid, &CLSID_FXReverb) ||
IsEqualGUID(clsid, &CLSID_FXEQ) ||
IsEqualGUID(clsid, &CLSID_FXEcho) ||
IsEqualGUID(clsid, &CLSID_FXMasteringLimiter))
return FAPOFX_CreateFXWithCustomAllocatorEXT(
(const FAudioGUID*) clsid,
fapo,
NULL,
0,
XAudio_Internal_Malloc,
XAudio_Internal_Free,
XAudio_Internal_Realloc
);
#endif
ERR("Invalid XAPO CLSID!");
return E_INVALIDARG;
}
static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOuter,
REFIID riid, void **ppobj)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
HRESULT hr;
XA2XAPOFXImpl *object;
TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
*ppobj = NULL;
if(pOuter)
return CLASS_E_NOAGGREGATION;
object = heap_alloc(sizeof(*object));
object->IXAPO_iface.lpVtbl = &XAPOFX_Vtbl;
object->IXAPOParameters_iface.lpVtbl = &XAPOFXParameters_Vtbl;
hr = get_fapo_from_clsid(This->class, &object->fapo);
if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
return S_OK;
}
static HRESULT WINAPI xapocf_LockServer(IClassFactory *iface, BOOL dolock)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
FIXME("(%p)->(%d): stub!\n", This, dolock);
return S_OK;
}
static const IClassFactoryVtbl xapo_Vtbl =
{
xapocf_QueryInterface,
xapocf_AddRef,
xapocf_Release,
xapocf_CreateInstance,
xapocf_LockServer
};
HRESULT make_xapo_factory(REFCLSID clsid, REFIID riid, void **ppv)
{
HRESULT hr;
struct xapo_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xapo_cf));
ret->IClassFactory_iface.lpVtbl = &xapo_Vtbl;
ret->class = clsid;
ret->ref = 0;
hr = IClassFactory_QueryInterface(&ret->IClassFactory_iface, riid, ppv);
if(FAILED(hr))
HeapFree(GetProcessHeap(), 0, ret);
return hr;
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015 Andrew Eikum for CodeWeavers
* Copyright (c) 2018 Ethan Lee for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -23,13 +24,17 @@
#define NONAMELESSUNION
#define COBJMACROS
#ifdef XAPOFX1_VER
#include "initguid.h"
#endif /* XAPOFX1_VER */
#include "xaudio_private.h"
#include "xapofx.h"
#include "wine/debug.h"
#if XAUDIO2_VER >= 8 || defined XAPOFX1_VER
WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
#endif
#ifdef XAPOFX1_VER
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
@ -38,8 +43,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
switch (reason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hinstDLL );
break;
@ -48,779 +51,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
}
#endif /* XAPOFX1_VER */
typedef struct _VUMeterImpl {
IXAPO IXAPO_iface;
IXAPOParameters IXAPOParameters_iface;
LONG ref;
} VUMeterImpl;
static VUMeterImpl *VUMeterImpl_from_IXAPO(IXAPO *iface)
{
return CONTAINING_RECORD(iface, VUMeterImpl, IXAPO_iface);
}
static VUMeterImpl *VUMeterImpl_from_IXAPOParameters(IXAPOParameters *iface)
{
return CONTAINING_RECORD(iface, VUMeterImpl, IXAPOParameters_iface);
}
static HRESULT WINAPI VUMXAPO_QueryInterface(IXAPO *iface, REFIID riid,
void **ppvObject)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject);
if(IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IXAPO) ||
IsEqualGUID(riid, &IID_IXAPO27))
*ppvObject = &This->IXAPO_iface;
else if(IsEqualGUID(riid, &IID_IXAPOParameters))
*ppvObject = &This->IXAPOParameters_iface;
else
*ppvObject = NULL;
if(*ppvObject){
IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI VUMXAPO_AddRef(IXAPO *iface)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI VUMXAPO_Release(IXAPO *iface)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
if(!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI VUMXAPO_GetRegistrationProperties(IXAPO *iface,
XAPO_REGISTRATION_PROPERTIES **props)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %p\n", This, props);
/* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */
return E_NOTIMPL;
}
static HRESULT WINAPI VUMXAPO_IsInputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt,
WAVEFORMATEX **supported_fmt)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt);
return E_NOTIMPL;
}
static HRESULT WINAPI VUMXAPO_IsOutputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt,
WAVEFORMATEX **supported_fmt)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt);
return E_NOTIMPL;
}
static HRESULT WINAPI VUMXAPO_Initialize(IXAPO *iface, const void *data,
UINT32 data_len)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %p, %u\n", This, data, data_len);
return E_NOTIMPL;
}
static void WINAPI VUMXAPO_Reset(IXAPO *iface)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p\n", This);
}
static HRESULT WINAPI VUMXAPO_LockForProcess(IXAPO *iface,
UINT32 in_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params,
out_params_count, out_params);
return E_NOTIMPL;
}
static void WINAPI VUMXAPO_UnlockForProcess(IXAPO *iface)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p\n", This);
}
static void WINAPI VUMXAPO_Process(IXAPO *iface, UINT32 in_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params,
out_params_count, out_params, enabled);
}
static UINT32 WINAPI VUMXAPO_CalcInputFrames(IXAPO *iface, UINT32 output_frames)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %u\n", This, output_frames);
return 0;
}
static UINT32 WINAPI VUMXAPO_CalcOutputFrames(IXAPO *iface, UINT32 input_frames)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface);
TRACE("%p, %u\n", This, input_frames);
return 0;
}
static const IXAPOVtbl VUMXAPO_Vtbl = {
VUMXAPO_QueryInterface,
VUMXAPO_AddRef,
VUMXAPO_Release,
VUMXAPO_GetRegistrationProperties,
VUMXAPO_IsInputFormatSupported,
VUMXAPO_IsOutputFormatSupported,
VUMXAPO_Initialize,
VUMXAPO_Reset,
VUMXAPO_LockForProcess,
VUMXAPO_UnlockForProcess,
VUMXAPO_Process,
VUMXAPO_CalcInputFrames,
VUMXAPO_CalcOutputFrames
};
static HRESULT WINAPI VUMXAPOParams_QueryInterface(IXAPOParameters *iface,
REFIID riid, void **ppvObject)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface);
return VUMXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject);
}
static ULONG WINAPI VUMXAPOParams_AddRef(IXAPOParameters *iface)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface);
return VUMXAPO_AddRef(&This->IXAPO_iface);
}
static ULONG WINAPI VUMXAPOParams_Release(IXAPOParameters *iface)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface);
return VUMXAPO_Release(&This->IXAPO_iface);
}
static void WINAPI VUMXAPOParams_SetParameters(IXAPOParameters *iface,
const void *params, UINT32 params_len)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
}
static void WINAPI VUMXAPOParams_GetParameters(IXAPOParameters *iface,
void *params, UINT32 params_len)
{
VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
}
static const IXAPOParametersVtbl VUMXAPOParameters_Vtbl = {
VUMXAPOParams_QueryInterface,
VUMXAPOParams_AddRef,
VUMXAPOParams_Release,
VUMXAPOParams_SetParameters,
VUMXAPOParams_GetParameters
};
typedef struct _ReverbImpl {
IXAPO IXAPO_iface;
IXAPOParameters IXAPOParameters_iface;
LONG ref;
} ReverbImpl;
static ReverbImpl *ReverbImpl_from_IXAPO(IXAPO *iface)
{
return CONTAINING_RECORD(iface, ReverbImpl, IXAPO_iface);
}
static ReverbImpl *ReverbImpl_from_IXAPOParameters(IXAPOParameters *iface)
{
return CONTAINING_RECORD(iface, ReverbImpl, IXAPOParameters_iface);
}
static HRESULT WINAPI RVBXAPO_QueryInterface(IXAPO *iface, REFIID riid, void **ppvObject)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject);
if(IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IXAPO) ||
IsEqualGUID(riid, &IID_IXAPO27))
*ppvObject = &This->IXAPO_iface;
else if(IsEqualGUID(riid, &IID_IXAPOParameters))
*ppvObject = &This->IXAPOParameters_iface;
else
*ppvObject = NULL;
if(*ppvObject){
IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI RVBXAPO_AddRef(IXAPO *iface)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI RVBXAPO_Release(IXAPO *iface)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
if(!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI RVBXAPO_GetRegistrationProperties(IXAPO *iface,
XAPO_REGISTRATION_PROPERTIES **props)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %p\n", This, props);
/* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */
return E_NOTIMPL;
}
static HRESULT WINAPI RVBXAPO_IsInputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt,
WAVEFORMATEX **supported_fmt)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt);
return E_NOTIMPL;
}
static HRESULT WINAPI RVBXAPO_IsOutputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt,
WAVEFORMATEX **supported_fmt)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt);
return E_NOTIMPL;
}
static HRESULT WINAPI RVBXAPO_Initialize(IXAPO *iface, const void *data,
UINT32 data_len)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %p, %u\n", This, data, data_len);
return E_NOTIMPL;
}
static void WINAPI RVBXAPO_Reset(IXAPO *iface)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p\n", This);
}
static HRESULT WINAPI RVBXAPO_LockForProcess(IXAPO *iface, UINT32 in_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params,
out_params_count, out_params);
return E_NOTIMPL;
}
static void WINAPI RVBXAPO_UnlockForProcess(IXAPO *iface)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p\n", This);
}
static void WINAPI RVBXAPO_Process(IXAPO *iface, UINT32 in_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params,
out_params_count, out_params, enabled);
}
static UINT32 WINAPI RVBXAPO_CalcInputFrames(IXAPO *iface, UINT32 output_frames)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %u\n", This, output_frames);
return 0;
}
static UINT32 WINAPI RVBXAPO_CalcOutputFrames(IXAPO *iface, UINT32 input_frames)
{
ReverbImpl *This = ReverbImpl_from_IXAPO(iface);
TRACE("%p, %u\n", This, input_frames);
return 0;
}
static const IXAPOVtbl RVBXAPO_Vtbl = {
RVBXAPO_QueryInterface,
RVBXAPO_AddRef,
RVBXAPO_Release,
RVBXAPO_GetRegistrationProperties,
RVBXAPO_IsInputFormatSupported,
RVBXAPO_IsOutputFormatSupported,
RVBXAPO_Initialize,
RVBXAPO_Reset,
RVBXAPO_LockForProcess,
RVBXAPO_UnlockForProcess,
RVBXAPO_Process,
RVBXAPO_CalcInputFrames,
RVBXAPO_CalcOutputFrames
};
static HRESULT WINAPI RVBXAPOParams_QueryInterface(IXAPOParameters *iface,
REFIID riid, void **ppvObject)
{
ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface);
return RVBXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject);
}
static ULONG WINAPI RVBXAPOParams_AddRef(IXAPOParameters *iface)
{
ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface);
return RVBXAPO_AddRef(&This->IXAPO_iface);
}
static ULONG WINAPI RVBXAPOParams_Release(IXAPOParameters *iface)
{
ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface);
return RVBXAPO_Release(&This->IXAPO_iface);
}
static void WINAPI RVBXAPOParams_SetParameters(IXAPOParameters *iface,
const void *params, UINT32 params_len)
{
ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
}
static void WINAPI RVBXAPOParams_GetParameters(IXAPOParameters *iface, void *params,
UINT32 params_len)
{
ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
}
static const IXAPOParametersVtbl RVBXAPOParameters_Vtbl = {
RVBXAPOParams_QueryInterface,
RVBXAPOParams_AddRef,
RVBXAPOParams_Release,
RVBXAPOParams_SetParameters,
RVBXAPOParams_GetParameters
};
typedef struct _EQImpl {
IXAPO IXAPO_iface;
IXAPOParameters IXAPOParameters_iface;
LONG ref;
} EQImpl;
static EQImpl *EQImpl_from_IXAPO(IXAPO *iface)
{
return CONTAINING_RECORD(iface, EQImpl, IXAPO_iface);
}
static EQImpl *EQImpl_from_IXAPOParameters(IXAPOParameters *iface)
{
return CONTAINING_RECORD(iface, EQImpl, IXAPOParameters_iface);
}
static HRESULT WINAPI EQXAPO_QueryInterface(IXAPO *iface, REFIID riid, void **ppvObject)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject);
if(IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IXAPO) ||
IsEqualGUID(riid, &IID_IXAPO27))
*ppvObject = &This->IXAPO_iface;
else if(IsEqualGUID(riid, &IID_IXAPOParameters))
*ppvObject = &This->IXAPOParameters_iface;
else
*ppvObject = NULL;
if(*ppvObject){
IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI EQXAPO_AddRef(IXAPO *iface)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI EQXAPO_Release(IXAPO *iface)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
if(!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI EQXAPO_GetRegistrationProperties(IXAPO *iface,
XAPO_REGISTRATION_PROPERTIES **props)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %p\n", This, props);
/* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */
return E_NOTIMPL;
}
static HRESULT WINAPI EQXAPO_IsInputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt,
WAVEFORMATEX **supported_fmt)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt);
return E_NOTIMPL;
}
static HRESULT WINAPI EQXAPO_IsOutputFormatSupported(IXAPO *iface,
const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt,
WAVEFORMATEX **supported_fmt)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt);
return E_NOTIMPL;
}
static HRESULT WINAPI EQXAPO_Initialize(IXAPO *iface, const void *data,
UINT32 data_len)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %p, %u\n", This, data, data_len);
return E_NOTIMPL;
}
static void WINAPI EQXAPO_Reset(IXAPO *iface)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p\n", This);
}
static HRESULT WINAPI EQXAPO_LockForProcess(IXAPO *iface, UINT32 in_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params,
out_params_count, out_params);
return E_NOTIMPL;
}
static void WINAPI EQXAPO_UnlockForProcess(IXAPO *iface)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p\n", This);
}
static void WINAPI EQXAPO_Process(IXAPO *iface, UINT32 in_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params,
out_params_count, out_params, enabled);
}
static UINT32 WINAPI EQXAPO_CalcInputFrames(IXAPO *iface, UINT32 output_frames)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %u\n", This, output_frames);
return 0;
}
static UINT32 WINAPI EQXAPO_CalcOutputFrames(IXAPO *iface, UINT32 input_frames)
{
EQImpl *This = EQImpl_from_IXAPO(iface);
TRACE("%p, %u\n", This, input_frames);
return 0;
}
static const IXAPOVtbl EQXAPO_Vtbl = {
EQXAPO_QueryInterface,
EQXAPO_AddRef,
EQXAPO_Release,
EQXAPO_GetRegistrationProperties,
EQXAPO_IsInputFormatSupported,
EQXAPO_IsOutputFormatSupported,
EQXAPO_Initialize,
EQXAPO_Reset,
EQXAPO_LockForProcess,
EQXAPO_UnlockForProcess,
EQXAPO_Process,
EQXAPO_CalcInputFrames,
EQXAPO_CalcOutputFrames
};
static HRESULT WINAPI EQXAPOParams_QueryInterface(IXAPOParameters *iface,
REFIID riid, void **ppvObject)
{
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
return EQXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject);
}
static ULONG WINAPI EQXAPOParams_AddRef(IXAPOParameters *iface)
{
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
return EQXAPO_AddRef(&This->IXAPO_iface);
}
static ULONG WINAPI EQXAPOParams_Release(IXAPOParameters *iface)
{
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
return EQXAPO_Release(&This->IXAPO_iface);
}
static void WINAPI EQXAPOParams_SetParameters(IXAPOParameters *iface,
const void *params, UINT32 params_len)
{
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
}
static void WINAPI EQXAPOParams_GetParameters(IXAPOParameters *iface, void *params,
UINT32 params_len)
{
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
TRACE("%p, %p, %u\n", This, params, params_len);
}
static const IXAPOParametersVtbl EQXAPOParameters_Vtbl = {
EQXAPOParams_QueryInterface,
EQXAPOParams_AddRef,
EQXAPOParams_Release,
EQXAPOParams_SetParameters,
EQXAPOParams_GetParameters
};
struct xapo_cf {
IClassFactory IClassFactory_iface;
LONG ref;
const CLSID *class;
};
static struct xapo_cf *xapo_impl_from_IClassFactory(IClassFactory *iface)
{
return CONTAINING_RECORD(iface, struct xapo_cf, IClassFactory_iface);
}
static HRESULT WINAPI xapocf_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
{
if(IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IClassFactory))
{
IClassFactory_AddRef(iface);
*ppobj = iface;
return S_OK;
}
*ppobj = NULL;
WARN("(%p)->(%s, %p): interface not found\n", iface, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI xapocf_AddRef(IClassFactory *iface)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI xapocf_Release(IClassFactory *iface)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
if (!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOuter,
REFIID riid, void **ppobj)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
HRESULT hr;
TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
*ppobj = NULL;
if(pOuter)
return CLASS_E_NOAGGREGATION;
if(IsEqualGUID(This->class, &CLSID_AudioVolumeMeter27)){
VUMeterImpl *object;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if(!object)
return E_OUTOFMEMORY;
object->IXAPO_iface.lpVtbl = &VUMXAPO_Vtbl;
object->IXAPOParameters_iface.lpVtbl = &VUMXAPOParameters_Vtbl;
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
}else if(IsEqualGUID(This->class, &CLSID_FXReverb)){
ReverbImpl *object;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if(!object)
return E_OUTOFMEMORY;
object->IXAPO_iface.lpVtbl = &RVBXAPO_Vtbl;
object->IXAPOParameters_iface.lpVtbl = &RVBXAPOParameters_Vtbl;
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
}else if(IsEqualGUID(This->class, &CLSID_FXEQ)){
EQImpl *object;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if(!object)
return E_OUTOFMEMORY;
object->IXAPO_iface.lpVtbl = &EQXAPO_Vtbl;
object->IXAPOParameters_iface.lpVtbl = &EQXAPOParameters_Vtbl;
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
}else
/* TODO FXECHO, FXMasteringLimiter, */
return E_INVALIDARG;
return S_OK;
}
static HRESULT WINAPI xapocf_LockServer(IClassFactory *iface, BOOL dolock)
{
struct xapo_cf *This = xapo_impl_from_IClassFactory(iface);
FIXME("(%p)->(%d): stub!\n", This, dolock);
return S_OK;
}
static const IClassFactoryVtbl xapo_Vtbl =
{
xapocf_QueryInterface,
xapocf_AddRef,
xapocf_Release,
xapocf_CreateInstance,
xapocf_LockServer
};
HRESULT make_xapo_factory(REFCLSID clsid, REFIID riid, void **ppv)
{
HRESULT hr;
struct xapo_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xapo_cf));
ret->IClassFactory_iface.lpVtbl = &xapo_Vtbl;
ret->class = clsid;
ret->ref = 0;
hr = IClassFactory_QueryInterface(&ret->IClassFactory_iface, riid, ppv);
if(FAILED(hr))
HeapFree(GetProcessHeap(), 0, ret);
return hr;
}
#if XAUDIO2_VER >= 8
HRESULT WINAPI CreateAudioVolumeMeter(IUnknown **out)
{
IClassFactory *cf;
HRESULT hr;
hr = make_xapo_factory(&CLSID_AudioVolumeMeter27, &IID_IClassFactory, (void**)&cf);
if(FAILED(hr))
return hr;
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)out);
IClassFactory_Release(cf);
return hr;
}
HRESULT WINAPI CreateAudioReverb(IUnknown **out)
{
IClassFactory *cf;
HRESULT hr;
hr = make_xapo_factory(&CLSID_FXReverb, &IID_IClassFactory, (void**)&cf);
if(FAILED(hr))
return hr;
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)out);
IClassFactory_Release(cf);
return hr;
}
HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out, void *initdata, UINT32 initdata_bytes)
{
HRESULT hr;
@ -836,6 +67,12 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out, void *initdata, UINT32 in
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
IsEqualGUID(clsid, &CLSID_FXEQ))
class = &CLSID_FXEQ;
else if(IsEqualGUID(clsid, &CLSID_FXEcho27) ||
IsEqualGUID(clsid, &CLSID_FXEcho))
class = &CLSID_FXEcho;
else if(IsEqualGUID(clsid, &CLSID_FXMasteringLimiter27) ||
IsEqualGUID(clsid, &CLSID_FXMasteringLimiter))
class = &CLSID_FXMasteringLimiter;
if(class){
hr = make_xapo_factory(class, &IID_IClassFactory, (void**)&cf);
@ -895,7 +132,12 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
IsEqualGUID(clsid, &CLSID_FXEQ))
class = &CLSID_FXEQ;
/* TODO FXECHO, FXMasteringLimiter, */
else if(IsEqualGUID(clsid, &CLSID_FXEcho27) ||
IsEqualGUID(clsid, &CLSID_FXEcho))
class = &CLSID_FXEcho;
else if(IsEqualGUID(clsid, &CLSID_FXMasteringLimiter27) ||
IsEqualGUID(clsid, &CLSID_FXMasteringLimiter))
class = &CLSID_FXMasteringLimiter;
if(class){
hr = make_xapo_factory(class, &IID_IClassFactory, (void**)&cf);

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2018 Ethan Lee for CodeWeavers
*
* 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>
#define NONAMELESSUNION
#define COBJMACROS
#include "ole2.h"
void* XAudio_Internal_Malloc(size_t size)
{
return CoTaskMemAlloc(size);
}
void XAudio_Internal_Free(void* ptr)
{
return CoTaskMemFree(ptr);
}
void* XAudio_Internal_Realloc(void* ptr, size_t size)
{
return CoTaskMemRealloc(ptr, size);
}

View File

@ -41,13 +41,6 @@ coclass AudioVolumeMeter { interface IUnknown; }
uuid(6a93130e-1d53-41d1-a9cf-e758800bb179)
]
coclass AudioReverb { interface IUnknown; }
[
helpstring("XACT 31 Class"),
threading(both),
uuid(962f5027-99be-4692-a468-85802cf8de61)
]
coclass XACT31 { interface IUnknown; }
#endif /* XAUDIO2_VER == 7 */
#if XAUDIO2_VER == 6

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015 Andrew Eikum for CodeWeavers
* Copyright (c) 2018 Ethan Lee for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -17,33 +18,42 @@
*/
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wine/list.h"
#include "mmsystem.h"
#include "xaudio2.h"
#include "xaudio2fx.h"
#include "xapo.h"
#include "devpkey.h"
#include "mmdeviceapi.h"
#include "audioclient.h"
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alext.h>
#include <FAudio.h>
#include <FAPO.h>
typedef struct _XA2Buffer {
XAUDIO2_BUFFER xa2buffer;
DWORD offs_bytes;
UINT32 latest_al_buf, looped, loop_end_bytes, play_end_bytes, cur_end_bytes;
} XA2Buffer;
#include <pthread.h>
typedef struct _IXAudio2Impl IXAudio2Impl;
#if XAUDIO2_VER == 0
#define COMPAT_E_INVALID_CALL E_INVALIDARG
#define COMPAT_E_DEVICE_INVALIDATED XAUDIO20_E_DEVICE_INVALIDATED
#else
#define COMPAT_E_INVALID_CALL XAUDIO2_E_INVALID_CALL
#define COMPAT_E_DEVICE_INVALIDATED XAUDIO2_E_DEVICE_INVALIDATED
#endif
typedef struct _XA2SourceImpl {
typedef struct _XA2XAPOImpl {
IXAPO *xapo;
IXAPOParameters *xapo_params;
LONG ref;
FAPO FAPO_vtbl;
} XA2XAPOImpl;
typedef struct _XA2XAPOFXImpl {
IXAPO IXAPO_iface;
IXAPOParameters IXAPOParameters_iface;
FAPO *fapo;
} XA2XAPOFXImpl;
typedef struct _XA2VoiceImpl {
IXAudio2SourceVoice IXAudio2SourceVoice_iface;
#if XAUDIO2_VER == 0
IXAudio20SourceVoice IXAudio20SourceVoice_iface;
#elif XAUDIO2_VER <= 3
@ -52,43 +62,7 @@ typedef struct _XA2SourceImpl {
IXAudio27SourceVoice IXAudio27SourceVoice_iface;
#endif
IXAudio2Impl *xa2;
BOOL in_use;
CRITICAL_SECTION lock;
WAVEFORMATEX *fmt;
ALenum al_fmt;
UINT32 submit_blocksize;
IXAudio2VoiceCallback *cb;
DWORD nsends;
XAUDIO2_SEND_DESCRIPTOR *sends;
BOOL running;
UINT64 played_frames;
XA2Buffer buffers[XAUDIO2_MAX_QUEUED_BUFFERS];
UINT32 first_buf, cur_buf, nbufs, in_al_bytes;
UINT32 scratch_bytes, convert_bytes;
BYTE *scratch_buf, *convert_buf;
ALuint al_src;
/* most cases will only need about 4 AL buffers, but some corner cases
* could require up to MAX_QUEUED_BUFFERS */
ALuint al_bufs[XAUDIO2_MAX_QUEUED_BUFFERS];
DWORD first_al_buf, al_bufs_used, abandoned_albufs;
struct list entry;
} XA2SourceImpl;
typedef struct _XA2SubmixImpl {
IXAudio2SubmixVoice IXAudio2SubmixVoice_iface;
#if XAUDIO2_VER == 0
IXAudio20SubmixVoice IXAudio20SubmixVoice_iface;
#elif XAUDIO2_VER <= 3
@ -97,18 +71,41 @@ typedef struct _XA2SubmixImpl {
IXAudio27SubmixVoice IXAudio27SubmixVoice_iface;
#endif
BOOL in_use;
IXAudio2MasteringVoice IXAudio2MasteringVoice_iface;
#if XAUDIO2_VER == 0
IXAudio20MasteringVoice IXAudio20MasteringVoice_iface;
#elif XAUDIO2_VER <= 3
IXAudio23MasteringVoice IXAudio23MasteringVoice_iface;
#elif XAUDIO2_VER <= 7
IXAudio27MasteringVoice IXAudio27MasteringVoice_iface;
#endif
XAUDIO2_VOICE_DETAILS details;
FAudioVoiceCallback FAudioVoiceCallback_vtbl;
FAudioEffectChain *effect_chain;
BOOL in_use;
CRITICAL_SECTION lock;
struct list entry;
} XA2SubmixImpl;
IXAudio2VoiceCallback *cb;
struct _IXAudio2Impl {
FAudioVoice *faudio_voice;
struct {
FAudioEngineCallEXT proc;
FAudio *faudio;
float *stream;
} engine_params;
HANDLE engine_thread;
pthread_cond_t engine_done, engine_ready;
pthread_mutex_t engine_lock;
struct list entry;
} XA2VoiceImpl;
typedef struct _IXAudio2Impl {
IXAudio2 IXAudio2_iface;
IXAudio2MasteringVoice IXAudio2MasteringVoice_iface;
#if XAUDIO2_VER == 0
IXAudio20 IXAudio20_iface;
@ -118,59 +115,43 @@ struct _IXAudio2Impl {
IXAudio27 IXAudio27_iface;
#endif
#if XAUDIO2_VER == 0
IXAudio20MasteringVoice IXAudio20MasteringVoice_iface;
#elif XAUDIO2_VER <= 3
IXAudio23MasteringVoice IXAudio23MasteringVoice_iface;
#elif XAUDIO2_VER <= 7
IXAudio27MasteringVoice IXAudio27MasteringVoice_iface;
#endif
LONG ref;
CRITICAL_SECTION lock;
HANDLE engine, mmevt;
BOOL stop_engine;
struct list voices;
struct list source_voices;
struct list submix_voices;
FAudio *faudio;
IMMDeviceEnumerator *devenum;
FAudioEngineCallback FAudioEngineCallback_vtbl;
WCHAR **devids;
UINT32 ndevs;
XA2VoiceImpl mst;
UINT32 last_query_glitches;
IAudioClient *aclient;
IAudioRenderClient *render;
UINT32 period_frames;
WAVEFORMATEXTENSIBLE fmt;
ALCdevice *al_device;
ALCcontext *al_ctx;
DWORD last_query_glitches;
UINT32 ncbs;
IXAudio2EngineCallback **cbs;
BOOL running;
};
} IXAudio2Impl;
#if XAUDIO2_VER == 0
extern const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio20SourceVoice(IXAudio20SourceVoice *iface) DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio20SubmixVoice(IXAudio20SubmixVoice *iface) DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio20MasteringVoice(IXAudio20MasteringVoice *iface) DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 3
extern const IXAudio23SourceVoiceVtbl XAudio23SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio23SubmixVoiceVtbl XAudio23SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio23MasteringVoiceVtbl XAudio23MasteringVoice_Vtbl DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio23SourceVoice(IXAudio23SourceVoice *iface) DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio23SubmixVoice(IXAudio23SubmixVoice *iface) DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio23MasteringVoice(IXAudio23MasteringVoice *iface) DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 7
extern const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio27SubmixVoiceVtbl XAudio27SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio27MasteringVoiceVtbl XAudio27MasteringVoice_Vtbl DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio27SourceVoice(IXAudio27SourceVoice *iface) DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio27SubmixVoice(IXAudio27SubmixVoice *iface) DECLSPEC_HIDDEN;
extern XA2VoiceImpl *impl_from_IXAudio27MasteringVoice(IXAudio27MasteringVoice *iface) DECLSPEC_HIDDEN;
#endif
#if XAUDIO2_VER == 0
@ -181,5 +162,16 @@ extern const IXAudio22Vtbl XAudio22_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio27Vtbl XAudio27_Vtbl DECLSPEC_HIDDEN;
#endif
extern HRESULT make_xapo_factory(REFCLSID clsid, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
/* xaudio_dll.c */
extern HRESULT xaudio2_initialize(IXAudio2Impl *This, UINT32 flags, XAUDIO2_PROCESSOR proc) DECLSPEC_HIDDEN;
extern FAudioEffectChain *wrap_effect_chain(const XAUDIO2_EFFECT_CHAIN *pEffectChain) DECLSPEC_HIDDEN;
extern void engine_cb(FAudioEngineCallEXT proc, FAudio *faudio, float *stream, void *user) DECLSPEC_HIDDEN;
extern DWORD WINAPI engine_thread(void *user) DECLSPEC_HIDDEN;
/* xapo.c */
extern HRESULT make_xapo_factory(REFCLSID clsid, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
/* xaudio_allocator.c */
extern void* XAudio_Internal_Malloc(size_t size) DECLSPEC_HIDDEN;
extern void XAudio_Internal_Free(void* ptr) DECLSPEC_HIDDEN;
extern void* XAudio_Internal_Realloc(void* ptr, size_t size) DECLSPEC_HIDDEN;

View File

@ -1,13 +1,16 @@
EXTRADEFS = -DXAUDIO2_VER=8
MODULE = xaudio2_8.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
x3daudio.c \
xapo.c \
xapofx.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -1,13 +1,16 @@
EXTRADEFS = -DXAUDIO2_VER=9
MODULE = xaudio2_9.dll
IMPORTS = advapi32 ole32 user32 uuid
EXTRALIBS = $(OPENAL_LIBS)
PARENTSRC = ../xaudio2_7
EXTRALIBS = $(FAUDIO_LIBS)
EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \
compat.c \
x3daudio.c \
xapo.c \
xapofx.c \
xaudio_allocator.c \
xaudio_dll.c
IDL_SRCS = xaudio_classes.idl

View File

@ -165,6 +165,9 @@
/* Define to 1 if you have the `fallocate' function. */
#undef HAVE_FALLOCATE
/* Define to 1 if you have the <FAudio.h> header file. */
#undef HAVE_FAUDIO_H
/* Define to 1 if you have the `ffs' function. */
#undef HAVE_FFS
@ -1482,6 +1485,9 @@
/* Define to the soname of the libEGL library. */
#undef SONAME_LIBEGL
/* Define to the soname of the libFAudio library. */
#undef SONAME_LIBFAUDIO
/* Define to the soname of the libfontconfig library. */
#undef SONAME_LIBFONTCONFIG