提交 625c524d authored 作者: Anthony Minessale's avatar Anthony Minessale

merge in newer portaudio

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8835 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 50e9411c
...@@ -16,7 +16,7 @@ bindir = @bindir@ ...@@ -16,7 +16,7 @@ bindir = @bindir@
libdir = @libdir@ libdir = @libdir@
includedir = @includedir@ includedir = @includedir@
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix @DEFS@ CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix @CFLAGS@ @DEFS@
LIBS = @LIBS@ LIBS = @LIBS@
AR = @AR@ AR = @AR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
...@@ -56,62 +56,62 @@ COMMON_OBJS = \ ...@@ -56,62 +56,62 @@ COMMON_OBJS = \
src/common/pa_trace.o src/common/pa_trace.o
TESTS = \ TESTS = \
test/paqa_devs \ bin/paqa_devs \
test/paqa_errs \ bin/paqa_errs \
test/patest1 \ bin/patest1 \
test/patest_buffer \ bin/patest_buffer \
test/patest_callbackstop \ bin/patest_callbackstop \
test/patest_clip \ bin/patest_clip \
test/patest_dither \ bin/patest_dither \
test/patest_hang \ bin/patest_hang \
test/patest_in_overflow \ bin/patest_in_overflow \
test/patest_latency \ bin/patest_latency \
test/patest_leftright \ bin/patest_leftright \
test/patest_longsine \ bin/patest_longsine \
test/patest_many \ bin/patest_many \
test/patest_maxsines \ bin/patest_maxsines \
test/patest_multi_sine \ bin/patest_multi_sine \
test/patest_out_underflow \ bin/patest_out_underflow \
test/patest_pink \ bin/patest_pink \
test/patest_prime \ bin/patest_prime \
test/patest_read_record \ bin/patest_read_record \
test/patest_read_write_wire \ bin/patest_read_write_wire \
test/patest_record \ bin/patest_record \
test/patest_ringmix \ bin/patest_ringmix \
test/patest_saw \ bin/patest_saw \
test/patest_sine8 \ bin/patest_sine8 \
test/patest_sine \ bin/patest_sine \
test/patest_sine_channelmaps \ bin/patest_sine_channelmaps \
test/patest_sine_formats \ bin/patest_sine_formats \
test/patest_sine_time \ bin/patest_sine_time \
test/patest_start_stop \ bin/patest_start_stop \
test/patest_stop \ bin/patest_stop \
test/patest_stop_playout \ bin/patest_stop_playout \
test/patest_toomanysines \ bin/patest_toomanysines \
test/patest_underflow \ bin/patest_underflow \
test/patest_wire \ bin/patest_wire \
test/patest_write_sine \ bin/patest_write_sine \
test/pa_devs \ bin/pa_devs \
test/pa_fuzz \ bin/pa_fuzz \
test/pa_minlat bin/pa_minlat
# Most of these don't compile yet. Put them in TESTS, above, if # Most of these don't compile yet. Put them in TESTS, above, if
# you want to try to compile them... # you want to try to compile them...
ALL_TESTS = \ ALL_TESTS = \
$(TESTS) \ $(TESTS) \
test/patest_sync \ bin/patest_sync \
test/debug_convert \ bin/debug_convert \
test/debug_dither_calc \ bin/debug_dither_calc \
test/debug_dual \ bin/debug_dual \
test/debug_multi_in \ bin/debug_multi_in \
test/debug_multi_out \ bin/debug_multi_out \
test/debug_record \ bin/debug_record \
test/debug_record_reuse \ bin/debug_record_reuse \
test/debug_sine_amp \ bin/debug_sine_amp \
test/debug_sine \ bin/debug_sine \
test/debug_sine_formats \ bin/debug_sine_formats \
test/debug_srate \ bin/debug_srate \
test/debug_test1 bin/debug_test1
OBJS = $(COMMON_OBJS) $(OTHER_OBJS) OBJS = $(COMMON_OBJS) $(OTHER_OBJS)
...@@ -120,7 +120,7 @@ LTOBJS:= $(OBJS:.o=.lo) ...@@ -120,7 +120,7 @@ LTOBJS:= $(OBJS:.o=.lo)
SUBDIRS = SUBDIRS =
@ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp @ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp
all: lib/$(PALIB) all-recursive all: lib/$(PALIB) all-recursive tests
tests: bin-stamp $(TESTS) tests: bin-stamp $(TESTS)
...@@ -128,8 +128,9 @@ tests: bin-stamp $(TESTS) ...@@ -128,8 +128,9 @@ tests: bin-stamp $(TESTS)
lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC) lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC)
$(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS) $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS)
$(ALL_TESTS): lib/$(PALIB) $(MAKEFILE) $(PAINC) $(ALL_TESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) test/%.c
$(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/$@.c lib/$(PALIB) $(LIBS) $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
install: lib/$(PALIB) portaudio-2.0.pc install: lib/$(PALIB) portaudio-2.0.pc
$(INSTALL) -d $(DESTDIR)$(libdir) $(INSTALL) -d $(DESTDIR)$(libdir)
...@@ -163,19 +164,16 @@ clean: ...@@ -163,19 +164,16 @@ clean:
distclean: clean distclean: clean
rm -f config.log config.status Makefile libtool portaudio-2.0.pc rm -f config.log config.status Makefile libtool portaudio-2.0.pc
.SUFFIXES: %.o: %.c $(MAKEFILE) $(PAINC)
.SUFFIXES: .c .lo .o .cpp
.c.o: $(MAKEFILE) $(PAINC)
$(CC) -c $(CFLAGS) $< -o $@ $(CC) -c $(CFLAGS) $< -o $@
.c.lo: $(MAKEFILE) $(PAINC) %.lo: %.c $(MAKEFILE) $(PAINC)
$(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@ $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@
.cpp.o: $(MAKEFILE) $(PAINC) %.o: %.cpp $(MAKEFILE) $(PAINC)
$(CXX) -c $(CXXFLAGS) $< -o $@ $(CXX) -c $(CXXFLAGS) $< -o $@
.asm.o: %.o: %.asm
$(NASM) $(NASMOPT) -o $@ $< $(NASM) $(NASMOPT) -o $@ $<
bin-stamp: bin-stamp:
...@@ -184,9 +182,21 @@ bin-stamp: ...@@ -184,9 +182,21 @@ bin-stamp:
lib-stamp: lib-stamp:
-mkdir lib -mkdir lib
-mkdir -p src/os/win src/os/unix src/os/mac_osx src/common \ -mkdir -p \
src/hostapi/oss src/hostapi/alsa src/hostapi/jack src/hostapi/asihpi \ src/common \
src/hostapi/wmme src/hostapi/wdmks src/hostapi/dsound src/hostapi/wasapi src/hostapi/alsa \
src/hostapi/asihpi \
src/hostapi/asio \
src/hostapi/coreaudio \
src/hostapi/dsound \
src/hostapi/jack \
src/hostapi/oss \
src/hostapi/wasapi \
src/hostapi/wdmks \
src/hostapi/wmme \
src/os/mac_osx \
src/os/unix \
src/os/win
touch $@ touch $@
Makefile: Makefile.in config.status Makefile: Makefile.in config.status
......
...@@ -64,7 +64,7 @@ env.Append(CPPPATH=[os.path.join("#", "include"), "common"]) ...@@ -64,7 +64,7 @@ env.Append(CPPPATH=[os.path.join("#", "include"), "common"])
env.SConsignFile(os.path.join(sconsDir, ".sconsign")) env.SConsignFile(os.path.join(sconsDir, ".sconsign"))
env.SConscriptChdir(False) env.SConscriptChdir(False)
sources, sharedLib, staticLib, tests, portEnv = env.SConscript(os.path.join("src", "SConscript"), sources, sharedLib, staticLib, tests, portEnv, hostApis = env.SConscript(os.path.join("src", "SConscript"),
build_dir=buildDir, duplicate=False, exports=["env"]) build_dir=buildDir, duplicate=False, exports=["env"])
if Platform in Posix: if Platform in Posix:
...@@ -133,6 +133,7 @@ if env["enableStatic"]: ...@@ -133,6 +133,7 @@ if env["enableStatic"]:
env.Install(includeDir, os.path.join("include", "portaudio.h")) env.Install(includeDir, os.path.join("include", "portaudio.h"))
if env["enableCxx"]: if env["enableCxx"]:
env.SConscriptChdir(True) env.SConscriptChdir(True)
cxxEnv = env.Copy() cxxEnv = env.Copy()
...@@ -145,3 +146,49 @@ if env["enableCxx"]: ...@@ -145,3 +146,49 @@ if env["enableCxx"]:
env.Default(sharedLibs) env.Default(sharedLibs)
env.Install(libDir, sharedLibs) env.Install(libDir, sharedLibs)
env.Install(os.path.join(includeDir, "portaudiocpp"), headers) env.Install(os.path.join(includeDir, "portaudiocpp"), headers)
# Generate portaudio_config.h header with compile-time definitions of which PA
# back-ends are available, and which includes back-end extension headers
# Host-specific headers
hostApiHeaders = {"ALSA": "pa_linux_alsa.h",
"ASIO": "pa_asio.h",
"COREAUDIO": "pa_mac_core.h",
"JACK": "pa_jack.h",
"WMME": "pa_winwmme.h",
}
def buildConfigH(target, source, env):
"""builder for portaudio_config.h"""
global hostApiHeaders, hostApis
out = ""
for hostApi in hostApis:
out += "#define PA_HAVE_%s\n" % hostApi
hostApiSpecificHeader = hostApiHeaders.get(hostApi, None)
if hostApiSpecificHeader:
out += "#include \"%s\"\n" % hostApiSpecificHeader
out += "\n"
# Strip the last newline
if out[-1] == "\n":
out = out[:-1]
f = file(str(target[0]), 'w')
try: f.write(out)
finally: f.close()
return 0
# Define the builder for the config header
env.Append(BUILDERS={"portaudioConfig": env.Builder(action=Action(buildConfigH,
"generating '$TARGET'"), target_factory=env.fs.File,)})
confH = env.portaudioConfig(File("portaudio_config.h", "include"),
File("portaudio.h", "include"))
env.Default(confH)
env.Install(os.path.join(includeDir, "portaudio"), confH)
for api in hostApis:
if api in hostApiHeaders:
env.Install(os.path.join(includeDir, "portaudio"),
File(hostApiHeaders[api], "include"))
差异被折叠。
差异被折叠。
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
dnl also defines GSTUFF_PKG_ERRORS on error
AC_DEFUN(PKG_CHECK_MODULES, [
succeeded=no
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" = "no" ; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
else
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
AC_MSG_CHECKING(for $2)
if $PKG_CONFIG --exists "$2" ; then
AC_MSG_RESULT(yes)
succeeded=yes
AC_MSG_CHECKING($1_CFLAGS)
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
AC_MSG_RESULT($$1_CFLAGS)
AC_MSG_CHECKING($1_LIBS)
$1_LIBS=`$PKG_CONFIG --libs "$2"`
AC_MSG_RESULT($$1_LIBS)
else
$1_CFLAGS=""
$1_LIBS=""
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
ifelse([$4], ,echo $$1_PKG_ERRORS,)
fi
AC_SUBST($1_CFLAGS)
AC_SUBST($1_LIBS)
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
if test $succeeded = yes; then
ifelse([$3], , :, [$3])
else
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
fi
])
...@@ -35,9 +35,9 @@ Pa_GetStreamReadAvailable @31 ...@@ -35,9 +35,9 @@ Pa_GetStreamReadAvailable @31
Pa_GetStreamWriteAvailable @32 Pa_GetStreamWriteAvailable @32
Pa_GetSampleSize @33 Pa_GetSampleSize @33
Pa_Sleep @34 Pa_Sleep @34
;PaAsio_GetAvailableLatencyValues @50 PaAsio_GetAvailableLatencyValues @50
;PaAsio_ShowControlPanel @51 PaAsio_ShowControlPanel @51
PaUtil_InitializeX86PlainConverters @52 PaUtil_InitializeX86PlainConverters @52
;PaAsio_GetInputChannelName @53 PaAsio_GetInputChannelName @53
;PaAsio_GetOutputChannelName @54 PaAsio_GetOutputChannelName @54
PaUtil_SetDebugPrintFunction @55 PaUtil_SetDebugPrintFunction @55
\ No newline at end of file
...@@ -43,7 +43,7 @@ RSC=rc.exe ...@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\src\common" /I "..\..\include" /I ".\\" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /D "PA_ENABLE_DEBUG_OUTPUT" /D "_CRT_SECURE_NO_DEPRECATE" /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\src\common" /I "..\..\include" /I ".\\" /I "..\..\src\os\win" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /D "PA_ENABLE_DEBUG_OUTPUT" /D "_CRT_SECURE_NO_DEPRECATE" /D "PAWIN_USE_WDMKS_DEVICE_INFO" /FD /c
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
...@@ -54,7 +54,7 @@ BSC32=bscmake.exe ...@@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"./Release_x86/portaudio_x86.dll" # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setupapi.lib /nologo /dll /machine:I386 /out:"./Release_x86/portaudio_x86.dll"
!ELSEIF "$(CFG)" == "portaudio - Win32 Debug" !ELSEIF "$(CFG)" == "portaudio - Win32 Debug"
...@@ -70,7 +70,7 @@ LINK32=link.exe ...@@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /GZ /c # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\src\common" /I "..\..\include" /I ".\\" /D "WIN32" /D "_DEBUG" /D "_USRDLL" /D "PA_ENABLE_DEBUG_OUTPUT" /D "_CRT_SECURE_NO_DEPRECATE" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\src\common" /I "..\..\include" /I ".\\" /I "..\..\src\os\win" /D "WIN32" /D "_DEBUG" /D "_USRDLL" /D "PA_ENABLE_DEBUG_OUTPUT" /D "_CRT_SECURE_NO_DEPRECATE" /D "PAWIN_USE_WDMKS_DEVICE_INFO" /FD /GZ /c
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
...@@ -81,7 +81,7 @@ BSC32=bscmake.exe ...@@ -81,7 +81,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"./Debug_x86/portaudio_x86.dll" /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setupapi.lib /nologo /dll /debug /machine:I386 /out:"./Debug_x86/portaudio_x86.dll" /pdbtype:sept
!ENDIF !ENDIF
...@@ -211,6 +211,14 @@ SOURCE=..\..\src\hostapi\wmme\pa_win_wmme.c ...@@ -211,6 +211,14 @@ SOURCE=..\..\src\hostapi\wmme\pa_win_wmme.c
SOURCE=..\..\src\hostapi\wasapi\pa_win_wasapi.cpp SOURCE=..\..\src\hostapi\wasapi\pa_win_wasapi.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "wdm-ks"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\src\hostapi\wdmks\pa_win_wdmks.c
# End Source File
# End Group
# End Group # End Group
# Begin Group "os" # Begin Group "os"
...@@ -228,6 +236,14 @@ SOURCE=..\..\src\os\win\pa_win_util.c ...@@ -228,6 +236,14 @@ SOURCE=..\..\src\os\win\pa_win_util.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\os\win\pa_win_waveformat.c
# End Source File
# Begin Source File
SOURCE=..\..\src\os\win\pa_win_wdmks_utils.c
# End Source File
# Begin Source File
SOURCE=..\..\src\os\win\pa_x86_plain_converters.c SOURCE=..\..\src\os\win\pa_x86_plain_converters.c
# End Source File # End Source File
# End Group # End Group
......
...@@ -5,28 +5,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "portaudio.vcpr ...@@ -5,28 +5,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "portaudio.vcpr
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug DirectSound|Win32 = Debug DirectSound|Win32
Debug DirectSound|x64 = Debug DirectSound|x64
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Release DirectSound|Win32 = Release DirectSound|Win32
Release DirectSound|x64 = Release DirectSound|x64
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|Win32.ActiveCfg = Debug DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|Win32.Build.0 = Debug DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|x64.ActiveCfg = Debug DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|x64.Build.0 = Debug DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|x64 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug|x64 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|Win32.ActiveCfg = Release DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|Win32.Build.0 = Release DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|x64.ActiveCfg = Release DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|x64.Build.0 = Release DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64
......
...@@ -15,11 +15,41 @@ This DLL contains all 3 current win32 PA APIS (MM/DS/ASIO) ...@@ -15,11 +15,41 @@ This DLL contains all 3 current win32 PA APIS (MM/DS/ASIO)
You dont need "driver" You dont need "driver"
2)
*If you have Visual Studio 6.0*, please make sure you have it updated with the latest (and final)
microsoft libraries for it, namely:
2)If you have Visual Studio 6.0, 7.0(VC.NET/2001) or 7.1(VC.2003) Service pack 5:
Latest known URL:
http://msdn2.microsoft.com/en-us/vstudio/aa718363.aspx
Yes there EXISTS a service pack 6 , but the processor pack (below) isnt compatible with it.
Processor Pack(only works with above SP5)
Latest known URL:
http://msdn2.microsoft.com/en-us/vstudio/Aa718349.aspx
This isnt absolutely required for portaudio, but if you plan on using SSE intrinsics and similar things.
Up to you to decide upon Service pack 5 or 6 depending on your need for intrinsics.
Platform SDK (Feb 2003) :
Latest known URL:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
(This will allow your code base to be x64 friendly, with correct defines
for LONG_PTR and such)
NOTE A) Yes you have to use IE activex scripts to install that - wont work in Firefox, you
may have to temporarily change tyour default browser(aint life unfair)
NOTE B) Dont forget to hit "Register PSDK Directories with Visual Studio".
you can make sure its right in VC6 if you open tools/options/directories/include files and you see SDK 2003 as the FIRST entry
(it must be the same for libs)
DirectX 9.0 SDK Update - (Summer 2003)
Latest known URL:
http://www.microsoft.com/downloads/details.aspx?familyid=9216652f-51e0-402e-b7b5-feb68d00f298&displaylang=en
Again register the links in VC6, and check inside vc6 if headers are in second place right after SDk 2003
*If you have 7.0(VC.NET/2001) or 7.1(VC.2003) *
then I suggest you open portaudio.dsp (and convert if needed) then I suggest you open portaudio.dsp (and convert if needed)
If you have Visual Studio 2005, I suggest you open the portaudio.sln file *If you have Visual Studio 2005*, I suggest you open the portaudio.sln file
which contains 4 configurations. Win32/x64 in both Release and Debug variants which contains 4 configurations. Win32/x64 in both Release and Debug variants
hit compile and hope for the best. hit compile and hope for the best.
......
差异被折叠。
差异被折叠。
...@@ -139,11 +139,16 @@ case "${host_os}" in ...@@ -139,11 +139,16 @@ case "${host_os}" in
dnl Mac OS X configuration dnl Mac OS X configuration
AC_DEFINE(PA_USE_COREAUDIO) AC_DEFINE(PA_USE_COREAUDIO)
CFLAGS="$CFLAGS -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3"; if [[ -d /Developer/SDKs/MacOSX10.5.sdk ]] ; then
OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o"; SHARED_FLAGS="-Werror -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib -arch x86_64 -arch ppc64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3";
CFLAGS="-Werror $CFLAGS -arch x86_64 -arch ppc64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3";
else
SHARED_FLAGS="-Werror -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3";
CFLAGS="-Werror $CFLAGS -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3";
fi
OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o";
LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"; LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon";
PADLL="libportaudio.dylib"; PADLL="libportaudio.dylib";
SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3";
if [[ $with_macapi = "asio" ]] ; then if [[ $with_macapi = "asio" ]] ; then
if [[ $with_asiodir ]] ; then if [[ $with_asiodir ]] ; then
ASIODIR="$with_asiodir"; ASIODIR="$with_asiodir";
...@@ -312,7 +317,4 @@ fi ...@@ -312,7 +317,4 @@ fi
AC_SUBST(ENABLE_CXX_TRUE) AC_SUBST(ENABLE_CXX_TRUE)
AC_SUBST(ENABLE_CXX_FALSE) AC_SUBST(ENABLE_CXX_FALSE)
#check for some headers
AC_CHECK_HEADERS([libkern/OSAtomic.h])
AC_OUTPUT([Makefile portaudio-2.0.pc]) AC_OUTPUT([Makefile portaudio-2.0.pc])
#ifndef PA_JACK_H
#define PA_JACK_H
/*
* $Id:
* PortAudio Portable Real-Time Audio Library
* JACK-specific extensions
*
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
/** @file
* JACK-specific PortAudio API extension header file.
*/
#include "portaudio.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Set the JACK client name.
*
* During Pa_Initialize, When PA JACK connects as a client of the JACK server, it requests a certain
* name, which is for instance prepended to port names. By default this name is "PortAudio". The
* JACK server may append a suffix to the client name, in order to avoid clashes among clients that
* try to connect with the same name (e.g., different PA JACK clients).
*
* This function must be called before Pa_Initialize, otherwise it won't have any effect. Note that
* the string is not copied, but instead referenced directly, so it must not be freed for as long as
* PA might need it.
* @sa PaJack_GetClientName
*/
PaError PaJack_SetClientName( const char* name );
/** Get the JACK client name used by PA JACK.
*
* The caller is responsible for freeing the returned pointer.
*/
PaError PaJack_GetClientName(const char** clientName);
#ifdef __cplusplus
}
#endif
#endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define PA_LINUX_ALSA_H #define PA_LINUX_ALSA_H
/* /*
* $Id: pa_linux_alsa.h 1145 2006-11-22 22:40:04Z aknudsen $ * $Id: pa_linux_alsa.h 1236 2007-06-24 20:39:26Z aknudsen $
* PortAudio Portable Real-Time Audio Library * PortAudio Portable Real-Time Audio Library
* ALSA-specific extensions * ALSA-specific extensions
* *
...@@ -58,17 +58,33 @@ typedef struct PaAlsaStreamInfo ...@@ -58,17 +58,33 @@ typedef struct PaAlsaStreamInfo
} }
PaAlsaStreamInfo; PaAlsaStreamInfo;
/** Initialize host API specific structure, call this before setting relevant attributes. */
void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info ); void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info );
/** Instruct whether to enable real-time priority when starting the audio thread.
*
* If this is turned on by the stream is started, the audio callback thread will be created
* with the FIFO scheduling policy, which is suitable for realtime operation.
**/
void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable ); void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable );
#if 0 #if 0
void PaAlsa_EnableWatchdog( PaStream *s, int enable ); void PaAlsa_EnableWatchdog( PaStream *s, int enable );
#endif #endif
int PaAlsa_GetStreamInputCard( PaStream *s, int *card ); /** Get the ALSA-lib card index of this stream's input device. */
PaError PaAlsa_GetStreamInputCard( PaStream *s, int *card );
/** Get the ALSA-lib card index of this stream's output device. */
PaError PaAlsa_GetStreamOutputCard( PaStream *s, int *card );
int PaAlsa_GetStreamOutputCard( PaStream *s, int *card ); /** Set the number of periods (buffer fragments) to configure devices with.
*
* By default the number of periods is 4, this is the lowest number of periods that works well on
* the author's soundcard.
* @param numPeriods The number of periods.
*/
PaError PaAlsa_SetNumPeriods( int numPeriods );
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -50,8 +50,8 @@ extern "C" { ...@@ -50,8 +50,8 @@ extern "C" {
* A pointer to a paMacCoreStreamInfo may be passed as * A pointer to a paMacCoreStreamInfo may be passed as
* the hostApiSpecificStreamInfo in the PaStreamParameters struct * the hostApiSpecificStreamInfo in the PaStreamParameters struct
* when opening a stream or querying the format. Use NULL, for the * when opening a stream or querying the format. Use NULL, for the
* defaults. Note that for duplex streams, both infos should be the * defaults. Note that for duplex streams, flags for input and output
* same or behaviour is undefined. * should be the same or behaviour is undefined.
*/ */
typedef struct typedef struct
{ {
...@@ -59,7 +59,7 @@ typedef struct ...@@ -59,7 +59,7 @@ typedef struct
PaHostApiTypeId hostApiType; /**host API for which this data is intended */ PaHostApiTypeId hostApiType; /**host API for which this data is intended */
unsigned long version; /**structure version */ unsigned long version; /**structure version */
unsigned long flags; /* flags to modify behaviour */ unsigned long flags; /* flags to modify behaviour */
long const * channelMap; /* Channel map for HAL channel mapping , if not needed, use NULL;*/ SInt32 const * channelMap; /* Channel map for HAL channel mapping , if not needed, use NULL;*/
unsigned long channelMapSize; /* Channel map size for HAL channel mapping , if not needed, use 0;*/ unsigned long channelMapSize; /* Channel map size for HAL channel mapping , if not needed, use 0;*/
} PaMacCoreStreamInfo; } PaMacCoreStreamInfo;
...@@ -81,7 +81,7 @@ void PaMacCore_SetupStreamInfo( PaMacCoreStreamInfo *data, unsigned long flags ) ...@@ -81,7 +81,7 @@ void PaMacCore_SetupStreamInfo( PaMacCoreStreamInfo *data, unsigned long flags )
* @param channelMap The channel map array, as described in notes.txt. This array pointer will be used directly (ie the underlying data will not be copied), so the caller should not free the array until after the stream has been opened. * @param channelMap The channel map array, as described in notes.txt. This array pointer will be used directly (ie the underlying data will not be copied), so the caller should not free the array until after the stream has been opened.
* @param channelMapSize The size of the channel map array. * @param channelMapSize The size of the channel map array.
*/ */
void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const long * const channelMap, unsigned long channelMapSize ); void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const SInt32 * const channelMap, unsigned long channelMapSize );
/* /*
* Retrieve the AudioDeviceID of the input device assigned to an open stream * Retrieve the AudioDeviceID of the input device assigned to an open stream
......
#ifndef PA_WIN_DS_H
#define PA_WIN_DS_H
/*
* $Id: $
* PortAudio Portable Real-Time Audio Library
* DirectSound specific extensions
*
* Copyright (c) 1999-2007 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
/** @file
@brief DirectSound-specific PortAudio API extension header file.
*/
#include "portaudio.h"
#include "pa_win_waveformat.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#define paWinDirectSoundUseLowLevelLatencyParameters (0x01)
#define paWinDirectSoundUseChannelMask (0x04)
typedef struct PaWinDirectSoundStreamInfo{
unsigned long size; /**< sizeof(PaWinDirectSoundStreamInfo) */
PaHostApiTypeId hostApiType; /**< paDirectSound */
unsigned long version; /**< 1 */
unsigned long flags;
/* low-level latency setting support
TODO ** NOT IMPLEMENTED **
These settings control the number and size of host buffers in order
to set latency. They will be used instead of the generic parameters
to Pa_OpenStream() if flags contains the paWinDirectSoundUseLowLevelLatencyParameters
flag.
If PaWinDirectSoundStreamInfo structures with paWinDirectSoundUseLowLevelLatencyParameters
are supplied for both input and output in a full duplex stream, then the
input and output framesPerBuffer must be the same, or the larger of the
two must be a multiple of the smaller, otherwise a
paIncompatibleHostApiSpecificStreamInfo error will be returned from
Pa_OpenStream().
unsigned long framesPerBuffer;
*/
/*
support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
paWinDirectSoundUseChannelMask this allows you to specify which speakers
to address in a multichannel stream. Constants for channelMask
are specified in pa_win_waveformat.h
*/
PaWinWaveFormatChannelMask channelMask;
}PaWinDirectSoundStreamInfo;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* PA_WIN_DS_H */
差异被折叠。
#ifndef PA_WIN_WMME_H #ifndef PA_WIN_WMME_H
#define PA_WIN_WMME_H #define PA_WIN_WMME_H
/* /*
* $Id: pa_win_wmme.h 1115 2006-09-06 15:39:48Z rossb $ * $Id: pa_win_wmme.h 1247 2007-08-11 16:29:09Z rossb $
* PortAudio Portable Real-Time Audio Library * PortAudio Portable Real-Time Audio Library
* MME specific extensions * MME specific extensions
* *
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "portaudio.h" #include "portaudio.h"
#include "pa_win_waveformat.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
...@@ -53,7 +54,7 @@ extern "C" ...@@ -53,7 +54,7 @@ extern "C"
#define paWinMmeUseLowLevelLatencyParameters (0x01) #define paWinMmeUseLowLevelLatencyParameters (0x01)
#define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */
#define paWinMmeUseChannelMask (0x04)
/* By default, the mme implementation drops the processing thread's priority /* By default, the mme implementation drops the processing thread's priority
to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100% to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100%
...@@ -106,6 +107,15 @@ typedef struct PaWinMmeStreamInfo{ ...@@ -106,6 +107,15 @@ typedef struct PaWinMmeStreamInfo{
PaWinMmeDeviceAndChannelCount *devices; PaWinMmeDeviceAndChannelCount *devices;
unsigned long deviceCount; unsigned long deviceCount;
/*
support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
paWinMmeUseChannelMask this allows you to specify which speakers
to address in a multichannel stream. Constants for channelMask
are specified in pa_win_waveformat.h
*/
PaWinWaveFormatChannelMask channelMask;
}PaWinMmeStreamInfo; }PaWinMmeStreamInfo;
......
#ifndef PORTAUDIO_H #ifndef PORTAUDIO_H
#define PORTAUDIO_H #define PORTAUDIO_H
/* /*
* $Id: portaudio.h 1149 2006-11-27 01:42:26Z leland_lucius $ * $Id: portaudio.h 1247 2007-08-11 16:29:09Z rossb $
* PortAudio Portable Real-Time Audio Library * PortAudio Portable Real-Time Audio Library
* PortAudio API Header File * PortAudio API Header File
* Latest version available at: http://www.portaudio.com/ * Latest version available at: http://www.portaudio.com/
......
差异被折叠。
...@@ -202,4 +202,10 @@ testNames = ["patest_sine", "paqa_devs", "paqa_errs", "patest1", "patest_buffer" ...@@ -202,4 +202,10 @@ testNames = ["patest_sine", "paqa_devs", "paqa_errs", "patest1", "patest_buffer"
tests = [env.Program(target=os.path.join("#", "bin", name), source=[os.path.join("#", "test", name + ".c"), tests = [env.Program(target=os.path.join("#", "bin", name), source=[os.path.join("#", "test", name + ".c"),
staticLib]) for name in testNames] staticLib]) for name in testNames]
Return("sources", "sharedLib", "staticLib", "tests", "env") # Detect host APIs
hostApis = []
for cppdef in env["CPPDEFINES"]:
if cppdef.startswith("PA_USE_"):
hostApis.append(cppdef[7:-2])
Return("sources", "sharedLib", "staticLib", "tests", "env", "hostApis")
...@@ -74,7 +74,7 @@ void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb) ...@@ -74,7 +74,7 @@ void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb)
VERY dangerous alternative, vsprintf (with no n) VERY dangerous alternative, vsprintf (with no n)
*/ */
#if (_MSC_VER) && (_MSC_VER < 1400) #if (_MSC_VER) && (_MSC_VER <= 1400)
#define VSNPRINTF _vsnprintf #define VSNPRINTF _vsnprintf
#else #else
#define VSNPRINTF vsnprintf #define VSNPRINTF vsnprintf
......
...@@ -72,7 +72,7 @@ void PaUtil_DebugPrint( const char *format, ... ); ...@@ -72,7 +72,7 @@ void PaUtil_DebugPrint( const char *format, ... );
Function exit (simple return value): Function exit (simple return value):
"FunctionName returned:\n" "FunctionName returned:\n"
"\tReturnType: returnValue\n\n" "\tReturnType: returnValue\n"
If the return type is an error code, the error text is displayed in () If the return type is an error code, the error text is displayed in ()
...@@ -101,9 +101,36 @@ void PaUtil_DebugPrint( const char *format, ... ); ...@@ -101,9 +101,36 @@ void PaUtil_DebugPrint( const char *format, ... );
#ifdef PA_LOG_API_CALLS #ifdef PA_LOG_API_CALLS
#define PA_LOGAPI(x) PaUtil_DebugPrint x ; #define PA_LOGAPI(x) PaUtil_DebugPrint x
#define PA_LOGAPI_ENTER(functionName) PaUtil_DebugPrint( functionName " called.\n" )
#define PA_LOGAPI_ENTER_PARAMS(functionName) PaUtil_DebugPrint( functionName " called:\n" )
#define PA_LOGAPI_EXIT(functionName) PaUtil_DebugPrint( functionName " returned.\n" )
#define PA_LOGAPI_EXIT_PAERROR( functionName, result ) \
PaUtil_DebugPrint( functionName " returned:\n" ); \
PaUtil_DebugPrint("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) )
#define PA_LOGAPI_EXIT_T( functionName, resultFormatString, result ) \
PaUtil_DebugPrint( functionName " returned:\n" ); \
PaUtil_DebugPrint("\t" resultFormatString "\n", result )
#define PA_LOGAPI_EXIT_PAERROR_OR_T_RESULT( functionName, positiveResultFormatString, result ) \
PaUtil_DebugPrint( functionName " returned:\n" ); \
if( result > 0 ) \
PaUtil_DebugPrint("\t" positiveResultFormatString "\n", result ); \
else \
PaUtil_DebugPrint("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) )
#else #else
#define PA_LOGAPI(x) #define PA_LOGAPI(x)
#define PA_LOGAPI_ENTER(functionName)
#define PA_LOGAPI_ENTER_PARAMS(functionName)
#define PA_LOGAPI_EXIT(functionName)
#define PA_LOGAPI_EXIT_PAERROR( functionName, result )
#define PA_LOGAPI_EXIT_T( functionName, resultFormatString, result )
#define PA_LOGAPI_EXIT_PAERROR_OR_T_RESULT( functionName, positiveResultFormatString, result )
#endif #endif
......
#ifndef PA_ENDIANNESS_H #ifndef PA_ENDIANNESS_H
#define PA_ENDIANNESS_H #define PA_ENDIANNESS_H
/* /*
* $Id: pa_endianness.h 1136 2006-11-22 03:52:34Z rossb $ * $Id: pa_endianness.h 1216 2007-06-10 09:26:00Z aknudsen $
* Portable Audio I/O Library current platform endianness macros * Portable Audio I/O Library current platform endianness macros
* *
* Based on the Open Source API proposed by Ross Bencina * Based on the Open Source API proposed by Ross Bencina
...@@ -97,7 +97,7 @@ extern "C" ...@@ -97,7 +97,7 @@ extern "C"
/* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */ /* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(LITTLE_ENDIAN) || defined(__i386) || defined(_M_IX86) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(LITTLE_ENDIAN) || defined(__i386) || defined(_M_IX86) || defined(__x86_64__)
#define PA_LITTLE_ENDIAN /* win32, assume intel byte order */ #define PA_LITTLE_ENDIAN /* win32, assume intel byte order */
#else #else
#define PA_BIG_ENDIAN #define PA_BIG_ENDIAN
......
#ifndef PA_UTIL_H #ifndef PA_UTIL_H
#define PA_UTIL_H #define PA_UTIL_H
/* /*
* $Id: pa_util.h 1097 2006-08-26 08:27:53Z rossb $ * $Id: pa_util.h 1229 2007-06-15 16:11:11Z rossb $
* Portable Audio I/O Library implementation utilities header * Portable Audio I/O Library implementation utilities header
* common implementation utilities and interfaces * common implementation utilities and interfaces
* *
...@@ -113,23 +113,6 @@ void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, ...@@ -113,23 +113,6 @@ void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode,
/** PA_DEBUG() provides a simple debug message printing facility. The macro
passes it's argument to a printf-like function called PaUtil_DebugPrint()
which prints to stderr and always flushes the stream after printing.
Because preprocessor macros cannot directly accept variable length argument
lists, calls to the macro must include an additional set of parenthesis, eg:
PA_DEBUG(("errorno: %d", 1001 ));
*/
void PaUtil_DebugPrint( const char *format, ... );
#ifdef PA_ENABLE_DEBUG_OUTPUT
#define PA_DEBUG(x) PaUtil_DebugPrint x ;
#else
#define PA_DEBUG(x)
#endif
/* the following functions are implemented in a platform platform specific /* the following functions are implemented in a platform platform specific
.c file .c file
*/ */
......
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论