forked from bartvdbraak/blender
Merge with 2.5 -r 22173:22620.
This commit is contained in:
commit
7c786e28c4
@ -42,14 +42,37 @@ MACRO(SETUP_LIBDIRS)
|
||||
if(COMMAND cmake_policy)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
|
||||
LINK_DIRECTORIES(${FREETYPE_LIBPATH})
|
||||
|
||||
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
|
||||
|
||||
IF(WITH_PYTHON)
|
||||
LINK_DIRECTORIES(${PYTHON_LIBPATH})
|
||||
ENDIF(WITH_PYTHON)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
LINK_DIRECTORIES(${ICONV_LIBPATH})
|
||||
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
IF(WITH_SDL)
|
||||
LINK_DIRECTORIES(${SDL_LIBPATH})
|
||||
ENDIF(WITH_SDL)
|
||||
IF(WITH_FFMPEG)
|
||||
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
|
||||
ENDIF(WITH_FFMPEG)
|
||||
IF(WITH_OPENEXR)
|
||||
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
|
||||
ENDIF(WITH_OPENEXR)
|
||||
IF(WITH_QUICKTIME)
|
||||
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
IF(WITH_OPENAL)
|
||||
LINK_DIRECTORIES(${OPENAL_LIBPATH})
|
||||
ENDIF(WITH_OPENAL)
|
||||
IF(WITH_JACK)
|
||||
LINK_DIRECTORIES(${JACK_LIBPATH})
|
||||
ENDIF(WITH_JACK)
|
||||
IF(WITH_FFTW3)
|
||||
LINK_DIRECTORIES(${FFTW3_LIBPATH})
|
||||
ENDIF(WITH_FFTW3)
|
||||
|
||||
IF(WIN32)
|
||||
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
|
||||
@ -59,48 +82,45 @@ ENDMACRO(SETUP_LIBDIRS)
|
||||
MACRO(SETUP_LIBLINKS
|
||||
target)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
|
||||
#TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
|
||||
#TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIBRARY} ${LLIBS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIB} ${LLIBS})
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
|
||||
|
||||
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
||||
|
||||
IF(WIN32)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
|
||||
ELSE(WIN32)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
|
||||
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB})
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${LLIBS})
|
||||
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
|
||||
|
||||
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
||||
|
||||
IF(WIN32)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
|
||||
|
||||
ELSE(WIN32)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
IF(WITH_OPENAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
|
||||
ENDIF(WITH_OPENAL)
|
||||
IF(WITH_FFTW3)
|
||||
TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
|
||||
ENDIF(WITH_FFTW3)
|
||||
IF(WITH_JACK)
|
||||
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
|
||||
ENDIF(WITH_JACK)
|
||||
IF(WITH_SDL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
|
||||
ENDIF(WITH_SDL)
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
|
||||
ENDIF(WIN32)
|
||||
@ -117,3 +137,4 @@ MACRO(SETUP_LIBLINKS
|
||||
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(SETUP_LIBLINKS)
|
||||
|
||||
|
220
CMakeLists.txt
220
CMakeLists.txt
@ -53,21 +53,25 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set default config options
|
||||
OPTION(WITH_PLAYER "Build Player" OFF)
|
||||
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
||||
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
|
||||
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
|
||||
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
|
||||
OPTION(WITH_DDS "Enable DDS Support" ON)
|
||||
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
|
||||
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
|
||||
OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
|
||||
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
|
||||
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
|
||||
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||
OPTION(WITH_PLAYER "Build Player" OFF)
|
||||
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
||||
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
|
||||
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
|
||||
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
|
||||
OPTION(WITH_DDS "Enable DDS Support" ON)
|
||||
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
|
||||
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
|
||||
OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
|
||||
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
|
||||
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
|
||||
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||
OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF)
|
||||
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
|
||||
OPTION(WITH_CXX_GUARDEDALLOC "" OFF)
|
||||
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
|
||||
|
||||
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
|
||||
@ -93,13 +97,18 @@ IF(UNIX AND NOT APPLE)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
IF(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL ON)
|
||||
SET(OPENAL_LIB ${OPENAL_LIBRARY})
|
||||
SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
|
||||
ELSE(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL OFF)
|
||||
ENDIF(OPENAL_FOUND)
|
||||
ENDIF(WITH_OPENAL)
|
||||
|
||||
IF(WITH_JACK)
|
||||
SET(JACK /usr)
|
||||
SET(JACK_INC ${JACK}/include/jack)
|
||||
SET(JACK_LIB jack)
|
||||
SET(JACK_LIBPATH ${JACK}/lib)
|
||||
ENDIF(WITH_JACK)
|
||||
|
||||
FIND_LIBRARY(INTL_LIBRARY
|
||||
NAMES intl
|
||||
PATHS
|
||||
@ -110,34 +119,34 @@ IF(UNIX AND NOT APPLE)
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
IF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
|
||||
FIND_PATH(FREETYPE_INC
|
||||
freetype
|
||||
PATHS
|
||||
/usr/local/include/freetype2
|
||||
/usr/include/freetype2
|
||||
/sw/include/freetype2
|
||||
/opt/local/include/freetype2
|
||||
/opt/csw/include/freetype2
|
||||
/opt/include/freetype2
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
SET(FREETYPE_LIB freetype)
|
||||
|
||||
FIND_PACKAGE(PythonLibs)
|
||||
SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
|
||||
SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
|
||||
FIND_PACKAGE(PythonInterp)
|
||||
SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||
FIND_PACKAGE(Freetype)
|
||||
# UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
|
||||
|
||||
# No way to set py31. remove for now.
|
||||
# FIND_PACKAGE(PythonLibs)
|
||||
SET(PYTHON /usr)
|
||||
SET(PYTHON_VERSION 3.1)
|
||||
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
# SET(PYTHON_BINARY python) # not used yet
|
||||
SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
|
||||
SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
|
||||
|
||||
# FIND_PACKAGE(PythonInterp) # not used yet
|
||||
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
|
||||
|
||||
IF(WITH_SDL)
|
||||
FIND_PACKAGE(SDL)
|
||||
SET(SDL_INC ${SDL_INCLUDE_DIR})
|
||||
SET(SDL_LIB ${SDL_LIBRARY})
|
||||
# UNSET(SDLMAIN_LIBRARY CACHE)
|
||||
IF(NOT SDL_FOUND)
|
||||
SET(WITH_SDL OFF)
|
||||
ENDIF(NOT SDL_FOUND)
|
||||
ENDIF(WITH_SDL)
|
||||
|
||||
FIND_PATH(OPENEXR_INC
|
||||
@ -156,6 +165,18 @@ IF(UNIX AND NOT APPLE)
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
|
||||
IF(WITH_FFTW3)
|
||||
SET(FFTW3 /usr)
|
||||
SET(FFTW3_INC ${FFTW3}/include)
|
||||
SET(FFTW3_LIB fftw3)
|
||||
SET(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
ENDIF(WITH_FFTW3)
|
||||
|
||||
SET(LIBSAMPLERATE /usr)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
SET(LIBSAMPLERATE_LIB samplerate)
|
||||
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
|
||||
FIND_PACKAGE(JPEG REQUIRED)
|
||||
|
||||
@ -163,7 +184,13 @@ IF(UNIX AND NOT APPLE)
|
||||
|
||||
FIND_PACKAGE(ZLIB REQUIRED)
|
||||
|
||||
SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11 -ldl")
|
||||
# Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too
|
||||
SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11")
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# BSD's dont use libdl.so
|
||||
SET(LLIBS "${LLIBS} -ldl")
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
IF(WITH_OPENMP)
|
||||
SET(LLIBS "${LLIBS} -lgomp")
|
||||
@ -178,6 +205,7 @@ IF(UNIX AND NOT APPLE)
|
||||
|
||||
# Better warnings
|
||||
SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement")
|
||||
SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
|
||||
|
||||
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
|
||||
ENDIF(UNIX AND NOT APPLE)
|
||||
@ -196,10 +224,10 @@ IF(WIN32)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
SET(PYTHON ${LIBDIR}/python)
|
||||
SET(PYTHON_VERSION 2.6)
|
||||
SET(PYTHON_VERSION 3.1)
|
||||
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
|
||||
SET(PYTHON_BINARY python)
|
||||
SET(PYTHON_LIB python26)
|
||||
# SET(PYTHON_BINARY python) # not used yet
|
||||
SET(PYTHON_LIB python31)
|
||||
SET(PYTHON_LIBPATH ${PYTHON}/lib)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
@ -207,13 +235,20 @@ IF(WIN32)
|
||||
ELSE(CMAKE_CL_64)
|
||||
#SET(WITH_OPENAL ON)
|
||||
SET(OPENAL ${LIBDIR}/openal)
|
||||
SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
|
||||
SET(OPENAL_LIB openal_static)
|
||||
SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
|
||||
SET(OPENAL_LIBRARY wrap_oal)
|
||||
SET(OPENAL_LIBPATH ${OPENAL}/lib)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
IF(WITH_JACK)
|
||||
SET(JACK ${LIBDIR}/jack)
|
||||
SET(JACK_INC ${JACK}/include/jack)
|
||||
SET(JACK_LIB jack)
|
||||
SET(JACK_LIBPATH ${JACK}/lib)
|
||||
ENDIF(WITH_JACK)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PNG_LIBRARIES libpng)
|
||||
SET(PNG_LIBRARIES libpng)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(PNG_LIBRARIES libpng_st)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
@ -234,30 +269,37 @@ IF(WIN32)
|
||||
SET(ICONV_LIB iconv)
|
||||
SET(ICONV_LIBPATH ${ICONV}/lib)
|
||||
|
||||
IF(WITH_FFTW3)
|
||||
SET(FFTW3 ${LIBDIR}/fftw3)
|
||||
SET(FFTW3_INC ${FFTW3}/include)
|
||||
SET(FFTW3_LIB libfftw)
|
||||
SET(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
ENDIF(WITH_FFTW3)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gettextlib)
|
||||
SET(GETTEXT_LIB gettextlib)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gnu_gettext)
|
||||
SET(GETTEXT_LIB gnu_gettext)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
|
||||
SET(FREETYPE ${LIBDIR}/freetype)
|
||||
SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
SET(FREETYPE_LIB freetype2ST)
|
||||
SET(FREETYPE_LIBRARY freetype2ST)
|
||||
|
||||
SET(OPENEXR ${LIBDIR}/openexr)
|
||||
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
|
||||
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
|
||||
IF (MSVC80)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
|
||||
ELSE (MSVC80)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
|
||||
ENDIF(MSVC80)
|
||||
IF (MSVC90)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
|
||||
ENDIF(MSVC90)
|
||||
|
||||
|
||||
@ -271,15 +313,16 @@ IF(WIN32)
|
||||
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
|
||||
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
SET(LIBSAMPLERATE_LIB libsamplerate)
|
||||
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
|
||||
SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
|
||||
SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
SET(LLIBS ${LLIBS} dxguid)
|
||||
ENDIF(WITH_OPENAL)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
|
||||
@ -296,8 +339,8 @@ IF(WIN32)
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
SET(SDL ${LIBDIR}/sdl)
|
||||
SET(SDL_INC ${SDL}/include)
|
||||
SET(SDL_LIB SDL)
|
||||
SET(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
SET(SDL_LIBRARY SDL)
|
||||
SET(SDL_LIBPATH ${SDL}/lib)
|
||||
|
||||
SET(PNG "${LIBDIR}/png")
|
||||
@ -314,10 +357,11 @@ IF(WIN32)
|
||||
SET(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
|
||||
SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
|
||||
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
|
||||
ENDIF(WIN32)
|
||||
|
||||
@ -332,13 +376,17 @@ IF(APPLE)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
IF(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL ON)
|
||||
SET(OPENAL_LIB ${OPENAL_LIBRARY})
|
||||
SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
|
||||
ELSE(OPENAL_FOUND)
|
||||
SET(WITH_OPENAL OFF)
|
||||
ENDIF(OPENAL_FOUND)
|
||||
ENDIF(WITH_OPENAL)
|
||||
|
||||
IF(WITH_JACK)
|
||||
SET(JACK /usr)
|
||||
SET(JACK_INC ${JACK}/include/jack)
|
||||
SET(JACK_LIB jack)
|
||||
SET(JACK_LIBPATH ${JACK}/lib)
|
||||
ENDIF(WITH_JACK)
|
||||
|
||||
SET(PYTHON_VERSION 3.1)
|
||||
|
||||
@ -347,7 +395,7 @@ IF(APPLE)
|
||||
|
||||
SET(PYTHON ${LIBDIR}/python)
|
||||
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
# SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") # not used yet
|
||||
SET(PYTHON_LIB python${PYTHON_VERSION})
|
||||
SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
# SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
||||
@ -357,7 +405,7 @@ IF(APPLE)
|
||||
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
|
||||
SET(PYTHON_VERSION 2.5)
|
||||
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
|
||||
SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
|
||||
# SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet
|
||||
SET(PYTHON_LIB "")
|
||||
SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
|
||||
SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
|
||||
@ -367,6 +415,13 @@ IF(APPLE)
|
||||
SET(GETTEXT_INC "${GETTEXT}/include")
|
||||
SET(GETTEXT_LIB intl iconv)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
|
||||
IF(WITH_FFTW3)
|
||||
SET(FFTW3 ${LIBDIR}/fftw3)
|
||||
SET(FFTW3_INC ${FFTW3}/include)
|
||||
SET(FFTW3_LIB libfftw)
|
||||
SET(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
ENDIF(WITH_FFTW3)
|
||||
|
||||
SET(PNG_LIBRARIES png)
|
||||
SET(JPEG_LIBRARY jpeg)
|
||||
@ -376,15 +431,25 @@ IF(APPLE)
|
||||
SET(ZLIB_LIBRARIES z)
|
||||
|
||||
SET(FREETYPE ${LIBDIR}/freetype)
|
||||
SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
SET(FREETYPE_LIB freetype)
|
||||
SET(FREETYPE_LIBRARY freetype)
|
||||
|
||||
SET(OPENEXR ${LIBDIR}/openexr)
|
||||
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
|
||||
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
|
||||
SET(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
SET(FFMPEG_INC ${CMAKE_SOURCE_DIR}/extern/ffmpeg)
|
||||
SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
|
||||
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
SET(LIBSAMPLERATE_LIB samplerate)
|
||||
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
|
||||
SET(LLIBS stdc++ SystemStubs)
|
||||
|
||||
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
||||
@ -397,8 +462,8 @@ IF(APPLE)
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
SET(SDL ${LIBDIR}/sdl)
|
||||
SET(SDL_INC ${SDL}/include)
|
||||
SET(SDL_LIB SDL)
|
||||
SET(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
SET(SDL_LIBRARY SDL)
|
||||
SET(SDL_LIBPATH ${SDL}/lib)
|
||||
|
||||
SET(PNG "${LIBDIR}/png")
|
||||
@ -442,16 +507,18 @@ ENDIF(WITH_WEBPLUGIN)
|
||||
# Configure OpenGL.
|
||||
FIND_PACKAGE(OpenGL)
|
||||
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
|
||||
# UNSET(OPENGL_LIBRARIES CACHE) # not compat with older cmake
|
||||
# UNSET(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Extra compile flags
|
||||
IF(WITH_GAMEENGINE)
|
||||
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
|
||||
ENDIF(WITH_GAMEENGINE)
|
||||
IF(WITH_BULLET)
|
||||
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
|
||||
ENDIF(WITH_BULLET)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
|
||||
|
||||
# better not define flags here but this is a debugging option thats off by default.
|
||||
IF(WITH_CXX_GUARDEDALLOC)
|
||||
SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}")
|
||||
ENDIF(WITH_CXX_GUARDEDALLOC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Libraries
|
||||
@ -471,3 +538,4 @@ ADD_SUBDIRECTORY(source/creator)
|
||||
IF(WITH_PLAYER)
|
||||
ADD_SUBDIRECTORY(blenderplayer)
|
||||
ENDIF(WITH_PLAYER)
|
||||
|
||||
|
23
SConstruct
23
SConstruct
@ -31,6 +31,7 @@
|
||||
|
||||
import platform as pltfrm
|
||||
|
||||
# Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
|
||||
if pltfrm.architecture()[0] == '64bit':
|
||||
bitness = 64
|
||||
else:
|
||||
@ -59,7 +60,6 @@ B = tools.Blender
|
||||
platform = sys.platform
|
||||
quickie = None
|
||||
quickdebug = None
|
||||
nsis_build = None
|
||||
|
||||
##### BEGIN SETUP #####
|
||||
|
||||
@ -425,8 +425,6 @@ if env['OURPLATFORM']=='darwin':
|
||||
bundle = '%s.app' % prg[0]
|
||||
bundledir = os.path.dirname(bundle)
|
||||
for dp, dn, df in os.walk(bundle):
|
||||
if 'CVS' in dn:
|
||||
dn.remove('CVS')
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
|
||||
@ -443,8 +441,6 @@ scriptinstall = []
|
||||
|
||||
if env['OURPLATFORM']!='darwin':
|
||||
for dp, dn, df in os.walk('bin/.blender'):
|
||||
if 'CVS' in dn:
|
||||
dn.remove('CVS')
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
|
||||
@ -471,8 +467,6 @@ if env['OURPLATFORM']!='darwin':
|
||||
scriptpaths=['release/scripts', 'release/ui', 'release/io']
|
||||
for scriptpath in scriptpaths:
|
||||
for dp, dn, df in os.walk(scriptpath):
|
||||
if 'CVS' in dn:
|
||||
dn.remove('CVS')
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
|
||||
@ -485,8 +479,6 @@ if env['OURPLATFORM']=='linux2':
|
||||
icontargetlist = []
|
||||
|
||||
for tp, tn, tf in os.walk('release/freedesktop/icons'):
|
||||
if 'CVS' in tn:
|
||||
tn.remove('CVS')
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
@ -509,8 +501,6 @@ if env['OURPLATFORM']=='linuxcross':
|
||||
pluglist = []
|
||||
plugtargetlist = []
|
||||
for tp, tn, tf in os.walk('release/plugins'):
|
||||
if 'CVS' in tn:
|
||||
tn.remove('CVS')
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
@ -541,8 +531,6 @@ for targetdir,srcfile in zip(plugtargetlist, pluglist):
|
||||
textlist = []
|
||||
texttargetlist = []
|
||||
for tp, tn, tf in os.walk('release/text'):
|
||||
if 'CVS' in tn:
|
||||
tn.remove('CVS')
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
@ -574,8 +562,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
|
||||
if env['WITH_BF_PYTHON']:
|
||||
ver = env["BF_PYTHON_VERSION"].replace(".", "")
|
||||
|
||||
dllsources.append('#release/windows/extra/python' + ver + '.zip')
|
||||
dllsources.append('#release/windows/extra/zlib.pyd')
|
||||
dllsources.append('${LCGDIR}/release/python' + ver + '.zip')
|
||||
dllsources.append('${LCGDIR}/release/zlib.pyd')
|
||||
if env['BF_DEBUG']:
|
||||
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll')
|
||||
else:
|
||||
@ -585,6 +573,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
|
||||
pass # we link statically to iconv on win64
|
||||
else:
|
||||
dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
|
||||
if env['WITH_BF_OPENAL']:
|
||||
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
|
||||
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avformat-52.dll',
|
||||
@ -596,6 +587,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
|
||||
'${LCGDIR}/ffmpeg/lib/libx264-67.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/xvidcore.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/swscale-0.dll']
|
||||
if env['WITH_BF_JACK']:
|
||||
dllsources += ['${LCGDIR}/jack/lib/libjack.dll']
|
||||
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
|
||||
allinstall += windlls
|
||||
|
||||
|
@ -87,7 +87,6 @@ IF(UNIX)
|
||||
bf_scenegraph
|
||||
bf_IK
|
||||
bf_moto
|
||||
bf_soundsystem
|
||||
bf_kernel
|
||||
bf_nodes
|
||||
bf_gpu
|
||||
@ -111,6 +110,10 @@ IF(UNIX)
|
||||
extern_glew
|
||||
)
|
||||
|
||||
IF(WITH_CXX_GUARDEDALLOC)
|
||||
SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
|
||||
ENDIF(WITH_CXX_GUARDEDALLOC)
|
||||
|
||||
FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
|
||||
SET(REMLIB ${SORTLIB})
|
||||
FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
|
||||
|
@ -32,22 +32,28 @@ BF_PYTHON_VERSION = '3.1'
|
||||
if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3':
|
||||
MAC_MIN_VERS = '10.3'
|
||||
MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
|
||||
elif MAC_CUR_VER=='10.4':
|
||||
else:
|
||||
MAC_MIN_VERS = '10.4'
|
||||
MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
|
||||
else:
|
||||
MAC_MIN_VERS = '10.5'
|
||||
MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
|
||||
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
|
||||
BF_FFMPEG = "#extern/ffmpeg"
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}'
|
||||
if USE_SDK==True:
|
||||
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
|
||||
#BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
#BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a'
|
||||
FFMPEG_PRECOMPILED = False
|
||||
if FFMPEG_PRECOMPILED:
|
||||
# use precompiled ffmpeg in /lib
|
||||
BF_FFMPEG = LIBDIR + '/ffmpeg'
|
||||
BF_FFMPEG_INC = "#extern/ffmpeg"
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore'
|
||||
else:
|
||||
# use ffmpeg in extern
|
||||
BF_FFMPEG = "#extern/ffmpeg"
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}'
|
||||
if USE_SDK==True:
|
||||
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
|
||||
BF_XVIDCORE_CONFIG = '--disable-assembly' # currently causes errors, even with yasm installed
|
||||
BF_X264_CONFIG = '--disable-pthread'
|
||||
|
||||
if BF_PYTHON_VERSION=='3.1':
|
||||
# python 3.1 uses precompiled libraries in bf svn /lib by default
|
||||
@ -57,7 +63,7 @@ if BF_PYTHON_VERSION=='3.1':
|
||||
# BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
|
||||
# BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System'
|
||||
# BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
|
||||
else:
|
||||
# python 2.5 etc. uses built-in framework
|
||||
|
||||
@ -73,18 +79,13 @@ else:
|
||||
BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_LIB = ''
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
|
||||
BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System -framework Python'
|
||||
BF_PYTHON_LINKFLAGS = ['-u','_PyMac_Error','-framework','System','-framework','Python']
|
||||
if MAC_CUR_VER=='10.3' or MAC_CUR_VER=='10.4':
|
||||
BF_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS
|
||||
BF_PYTHON_LINKFLAGS = ['-u', '__dummy']+BF_PYTHON_LINKFLAGS
|
||||
|
||||
BF_QUIET = '1'
|
||||
WITH_BF_OPENMP = '0'
|
||||
|
||||
# Note : should be true, but openal simply dont work on intel
|
||||
if MAC_PROC == 'i386':
|
||||
WITH_BF_OPENAL = False
|
||||
else:
|
||||
WITH_BF_OPENAL = True
|
||||
#different lib must be used following version of gcc
|
||||
# for gcc 3.3
|
||||
#BF_OPENAL = LIBDIR + '/openal'
|
||||
@ -106,6 +107,18 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
# TODO - set proper paths here (add precompiled to lib/ ? )
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
BF_JACK_LIB = 'jack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
@ -158,6 +171,12 @@ BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
WITH_BF_FFTW3 = False
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
#WITH_BF_NSPR = True
|
||||
#BF_NSPR = $(LIBDIR)/nspr
|
||||
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
|
||||
@ -193,14 +212,14 @@ BF_ICONV_LIB = 'iconv'
|
||||
WITH_BF_STATICOPENGL = True
|
||||
BF_OPENGL_LIB = 'GL GLU'
|
||||
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
|
||||
BF_OPENGL_LINKFLAGS = '-framework OpenGL'
|
||||
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
|
||||
|
||||
CFLAGS = ['-pipe','-fPIC','-funsigned-char']
|
||||
|
||||
CPPFLAGS = ['-fpascal-strings']
|
||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
|
||||
CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
|
||||
PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
|
||||
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','QuickTime']
|
||||
|
||||
#note to build succesfully on 10.3.9 SDK you need to patch 10.3.9 by adding the SystemStubs.a lib from 10.4
|
||||
LLIBS = ['stdc++', 'SystemStubs']
|
||||
@ -209,12 +228,12 @@ LLIBS = ['stdc++', 'SystemStubs']
|
||||
if MAC_MIN_VERS == '10.3':
|
||||
CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
|
||||
CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
|
||||
PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
|
||||
PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
|
||||
LLIBS.append('crt3.o')
|
||||
|
||||
if USE_SDK==True:
|
||||
SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]
|
||||
PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS
|
||||
PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS, '-Wl,-syslibroot,' + MACOSX_SDK]+PLATFORM_LINKFLAGS
|
||||
CCFLAGS=SDK_FLAGS+CCFLAGS
|
||||
CXXFLAGS=SDK_FLAGS+CXXFLAGS
|
||||
|
||||
|
@ -24,6 +24,11 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = 'false'
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LCGDIR+'/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = 'true'
|
||||
BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
|
@ -22,6 +22,17 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
BF_JACK_LIB = 'jack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
@ -130,6 +141,12 @@ BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = False
|
||||
BF_FFTW3 = LIBDIR + '/usr'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'fftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE = '#extern/libredcode'
|
||||
BF_REDCODE_LIB = ''
|
||||
|
@ -28,6 +28,11 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
|
@ -16,6 +16,11 @@ WITH_BF_OPENAL = False
|
||||
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
|
@ -22,6 +22,11 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
@ -109,7 +114,7 @@ BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = False # -DWITH_FFMPEG
|
||||
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
|
||||
BF_FFMPEG = '/usr/local'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
|
@ -16,19 +16,27 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a'
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
WITH_BF_STATICOPENAL = False
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include'
|
||||
BF_OPENAL_LIB = 'dxguid openal_static'
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
WITH_BF_FFMPEG = False
|
||||
BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264'
|
||||
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
|
||||
BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
|
@ -16,13 +16,10 @@ BF_PYTHON_LIB = 'python31'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
WITH_BF_STATICOPENAL = False
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL '
|
||||
BF_OPENAL_LIB = 'dxguid openal_static'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
# TODO - are these useful on win32?
|
||||
# BF_CXX = '/usr'
|
||||
@ -35,6 +32,17 @@ BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
@ -136,6 +144,12 @@ BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = False
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
|
@ -16,13 +16,10 @@ BF_PYTHON_LIB = 'python31'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_OPENAL = False
|
||||
WITH_BF_STATICOPENAL = False
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL '
|
||||
BF_OPENAL_LIB = 'dxguid openal_static'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
# TODO - are these useful on win32?
|
||||
# BF_CXX = '/usr'
|
||||
@ -35,6 +32,11 @@ BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
@ -139,6 +141,12 @@ BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = True
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
|
5
extern/glew/CMakeLists.txt
vendored
5
extern/glew/CMakeLists.txt
vendored
@ -26,8 +26,13 @@
|
||||
|
||||
SET(INC include src)
|
||||
|
||||
IF(UNIX)
|
||||
SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
|
||||
ENDIF(UNIX)
|
||||
|
||||
SET(SRC
|
||||
src/glew.c
|
||||
)
|
||||
|
||||
BLENDERLIB(extern_glew "${SRC}" "${INC}")
|
||||
|
||||
|
2
extern/libopenjpeg/CMakeLists.txt
vendored
2
extern/libopenjpeg/CMakeLists.txt
vendored
@ -24,7 +24,7 @@
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
SET(INC . src ${FREETYPE_INC})
|
||||
SET(INC . src)
|
||||
|
||||
FILE(GLOB SRC *.c except t1_generate_luts.c)
|
||||
ADD_DEFINITIONS(-DWITH_OPENJPEG)
|
||||
|
@ -24,7 +24,7 @@
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
ADD_SUBDIRECTORY(SoundSystem)
|
||||
ADD_SUBDIRECTORY(audaspace)
|
||||
ADD_SUBDIRECTORY(string)
|
||||
ADD_SUBDIRECTORY(ghost)
|
||||
ADD_SUBDIRECTORY(guardedalloc)
|
||||
|
@ -32,7 +32,7 @@ SOURCEDIR = intern
|
||||
# include nan_subdirs.mk
|
||||
|
||||
ALLDIRS = string ghost guardedalloc moto container memutil
|
||||
ALLDIRS += decimation iksolver bsp SoundSystem opennl elbeem boolop smoke
|
||||
ALLDIRS += decimation iksolver bsp opennl elbeem boolop smoke audaspace
|
||||
|
||||
all::
|
||||
@for i in $(ALLDIRS); do \
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
Import ('env')
|
||||
|
||||
SConscript(['SoundSystem/SConscript',
|
||||
SConscript(['audaspace/SConscript',
|
||||
'string/SConscript',
|
||||
'ghost/SConscript',
|
||||
'guardedalloc/SConscript',
|
||||
|
@ -1,42 +0,0 @@
|
||||
# $Id$
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
SET(INC . intern ../moto/include ../string dummy openal sdl)
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
FILE(GLOB SRC dummy/*.cpp intern/*.cpp openal/*.cpp sdl/*.cpp)
|
||||
INCLUDE_DIRECTORIES(${OPENAL_INC} ${SDL_INC})
|
||||
STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INC})
|
||||
IF(FRAMEWORK)
|
||||
ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX)
|
||||
ENDIF(FRAMEWORK)
|
||||
ELSE(WITH_OPENAL)
|
||||
FILE(GLOB SRC dummy/*.cpp intern/*.cpp)
|
||||
ADD_DEFINITIONS(-DNO_SOUND)
|
||||
ENDIF(WITH_OPENAL)
|
||||
|
||||
BLENDERLIB(bf_soundsystem "${SRC}" "${INC}")
|
||||
#, libtype=['core','player'], priority = [20,140] )
|
@ -1,20 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
Import ('env')
|
||||
|
||||
sources = env.Glob('dummy/*.cpp') + env.Glob('intern/*.cpp')
|
||||
|
||||
incs = '. intern ../moto/include ../string dummy openal sdl'
|
||||
defs = ''
|
||||
if env['WITH_BF_OPENAL']:
|
||||
sources += env.Glob('openal/*.cpp') + env.Glob('sdl/*.cpp')
|
||||
incs += ' ' + env['BF_OPENAL_INC']
|
||||
incs += ' ' + env['BF_SDL_INC']
|
||||
defs = 'USE_OPENAL'
|
||||
else:
|
||||
defs = 'NO_SOUND'
|
||||
|
||||
if not env['WITH_BF_SDL']:
|
||||
defs += ' DISABLE_SDL'
|
||||
|
||||
env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['intern','player'], priority = [25,135] )
|
@ -1,354 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef SND_BLENDER_H
|
||||
#define SND_BLENDER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "SoundDefines.h"
|
||||
|
||||
#define SND_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
|
||||
|
||||
SND_DECLARE_HANDLE(SND_AudioDeviceInterfaceHandle);
|
||||
SND_DECLARE_HANDLE(SND_SceneHandle);
|
||||
SND_DECLARE_HANDLE(SND_ObjectHandle);
|
||||
SND_DECLARE_HANDLE(SND_ListenerHandle);
|
||||
|
||||
/**
|
||||
* set the specified type
|
||||
*/
|
||||
extern void SND_SetDeviceType(int device_type);
|
||||
|
||||
/**
|
||||
* get an audiodevice
|
||||
*/
|
||||
extern SND_AudioDeviceInterfaceHandle SND_GetAudioDevice(void);
|
||||
|
||||
/**
|
||||
* and let go of it
|
||||
*/
|
||||
extern void SND_ReleaseDevice(void);
|
||||
|
||||
/**
|
||||
* check if playback is desired
|
||||
*/
|
||||
extern int SND_IsPlaybackWanted(SND_SceneHandle scene);
|
||||
|
||||
/**
|
||||
* add memlocation to cache
|
||||
*/
|
||||
extern int SND_AddSample(SND_SceneHandle scene,
|
||||
const char* filename,
|
||||
void* memlocation,
|
||||
int size);
|
||||
|
||||
/**
|
||||
* remove all samples
|
||||
*/
|
||||
extern void SND_RemoveAllSamples(SND_SceneHandle scene);
|
||||
|
||||
/**
|
||||
* forces the object to check its buffer, and fix it if it's wrong
|
||||
*/
|
||||
extern int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Creates a scene, initializes it and returns a handle to that scene.
|
||||
*
|
||||
* @param audiodevice: handle to the audiodevice.
|
||||
*/
|
||||
extern SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice);
|
||||
|
||||
/**
|
||||
* Stops all sounds, suspends the scene (so all resources will be freed) and deletes the scene.
|
||||
*
|
||||
* @param scene: handle to the soundscene.
|
||||
*/
|
||||
extern void SND_DeleteScene(SND_SceneHandle scene);
|
||||
|
||||
/**
|
||||
* Adds a soundobject to the scene, gets the buffer the sample is loaded into.
|
||||
*
|
||||
* @param scene: handle to the soundscene.
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Removes a soundobject from the scene.
|
||||
*
|
||||
* @param scene: handle to the soundscene.
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Removes all soundobjects from the scene.
|
||||
*
|
||||
* @param scene: handle to the soundscene.
|
||||
*/
|
||||
extern void SND_RemoveAllSounds(SND_SceneHandle scene);
|
||||
|
||||
/**
|
||||
* Stopss all soundobjects in the scene.
|
||||
*
|
||||
* @param scene: handle to the soundscene.
|
||||
*/
|
||||
extern void SND_StopAllSounds(SND_SceneHandle scene);
|
||||
|
||||
/**
|
||||
* Updates the listener, checks the status of all soundobjects, builds a list of all active
|
||||
* objects, updates the active objects.
|
||||
*
|
||||
* @param audiodevice: handle to the audiodevice.
|
||||
* @param scene: handle to the soundscene.
|
||||
*/
|
||||
extern void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene);
|
||||
|
||||
/**
|
||||
* Returns a handle to the listener.
|
||||
*
|
||||
* @param scene: handle to the soundscene.
|
||||
*/
|
||||
extern SND_ListenerHandle SND_GetListener(SND_SceneHandle scene);
|
||||
|
||||
/**
|
||||
* Sets the gain of the listener.
|
||||
*
|
||||
* @param scene: handle to the soundscene.
|
||||
* @param gain: factor the gain gets multiplied with.
|
||||
*/
|
||||
extern void SND_SetListenerGain(SND_SceneHandle scene, double gain);
|
||||
|
||||
/**
|
||||
* Sets a scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the
|
||||
* calculation.
|
||||
* @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
|
||||
* @attention f: frequency in sample (soundobject)
|
||||
* @attention f': effective Doppler shifted frequency
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param dopplerfactor: the dopplerfactor.
|
||||
*/
|
||||
extern void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor);
|
||||
|
||||
/**
|
||||
* Sets the value of the propagation speed relative to which the source velocities are interpreted.
|
||||
* @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
|
||||
* @attention f: frequency in sample (soundobject)
|
||||
* @attention f': effective Doppler shifted frequency
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param dopplervelocity: the dopplervelocity.
|
||||
*/
|
||||
extern void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity);
|
||||
|
||||
/**
|
||||
* Creates a new soundobject and returns a handle to it.
|
||||
*/
|
||||
extern SND_ObjectHandle SND_CreateSound(void);
|
||||
|
||||
/**
|
||||
* Deletes a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern void SND_DeleteSound(SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Sets a soundobject to SND_MUST_PLAY, so with the next proceed it will be updated and played.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Sets a soundobject to SND_MUST_STOP, so with the next proceed it will be stopped.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Sets a soundobject to SND_MUST_PAUSE, so with the next proceed it will be paused.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Sets the name of the sample to reference the soundobject to it.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param samplename: the name of the sample
|
||||
*/
|
||||
extern void SND_SetSampleName(SND_ObjectHandle object, char* samplename);
|
||||
|
||||
/**
|
||||
* Sets the gain of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param gain: factor the gain gets multiplied with.
|
||||
*/
|
||||
extern void SND_SetGain(SND_ObjectHandle object, double gain);
|
||||
|
||||
/**
|
||||
* Sets the minimum gain of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param minimumgain: lower threshold for the gain.
|
||||
*/
|
||||
extern void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain);
|
||||
|
||||
/**
|
||||
* Sets the maximum gain of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param maximumgain: upper threshold for the gain.
|
||||
*/
|
||||
extern void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain);
|
||||
|
||||
/**
|
||||
* Sets the rollofffactor. The rollofffactor is a per-Source parameter the application
|
||||
* can use to increase or decrease the range of a source by decreasing or increasing the
|
||||
* attenuation, respectively. The default value is 1. The implementation is free to optimize
|
||||
* for a rollofffactor value of 0, which indicates that the application does not wish any
|
||||
* distance attenuation on the respective Source.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param rollofffactor: the rollofffactor.
|
||||
*/
|
||||
extern void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor);
|
||||
|
||||
/**
|
||||
* Sets the referencedistance at which the listener will experience gain.
|
||||
* @attention G_dB = gain - 20 * log10(1 + rollofffactor * (dist - referencedistance)/referencedistance);
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param distance: the reference distance.
|
||||
*/
|
||||
extern void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance);
|
||||
|
||||
/**
|
||||
* Sets the pitch of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param pitch: pitchingfactor: 2.0 for doubling the frequency, 0.5 for half the frequency.
|
||||
*/
|
||||
extern void SND_SetPitch(SND_ObjectHandle object, double pitch);
|
||||
|
||||
/**
|
||||
* Sets the position a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param position: position[3].
|
||||
*/
|
||||
extern void SND_SetPosition(SND_ObjectHandle object, double* position);
|
||||
|
||||
/**
|
||||
* Sets the velocity of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param velocity: velocity[3].
|
||||
*/
|
||||
extern void SND_SetVelocity(SND_ObjectHandle object, double* velocity);
|
||||
|
||||
/**
|
||||
* Sets the orientation of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param orientation: orientation[9].
|
||||
*/
|
||||
extern void SND_SetOrientation(SND_ObjectHandle object, double* orientation);
|
||||
|
||||
/**
|
||||
* Sets the loopmode of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param loopmode type of the loop (SND_LOOP_OFF, SND_LOOP_NORMAL, SND_LOOP_BIDIRECTIONAL);
|
||||
*/
|
||||
extern void SND_SetLoopMode(SND_ObjectHandle object, int loopmode);
|
||||
|
||||
/**
|
||||
* Sets the looppoints of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
* @param loopstart startpoint of the loop
|
||||
* @param loopend endpoint of the loop
|
||||
*/
|
||||
extern void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend);
|
||||
|
||||
/**
|
||||
* Gets the gain of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern float SND_GetGain(SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Gets the pitch of a soundobject.
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern float SND_GetPitch(SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Gets the looping of a soundobject.
|
||||
* 0: SND_LOOP_OFF
|
||||
* 1: SND_LOOP_NORMAL
|
||||
* 2: SND_LOOP_BIDIRECTIONAL
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern int SND_GetLoopMode(SND_ObjectHandle object);
|
||||
|
||||
/**
|
||||
* Gets the playstate of a soundobject.
|
||||
* SND_UNKNOWN = -1
|
||||
* SND_INITIAL
|
||||
* SND_MUST_PLAY
|
||||
* SND_PLAYING
|
||||
* SND_MUST_STOP
|
||||
* SND_STOPPED
|
||||
* SND_MUST_PAUSE
|
||||
* SND_PAUSED
|
||||
* SND_MUST_BE_DELETED
|
||||
*
|
||||
* @param object: handle to soundobject.
|
||||
*/
|
||||
extern int SND_GetPlaystate(SND_ObjectHandle object);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,83 +0,0 @@
|
||||
/*
|
||||
* SND_CDObject.h
|
||||
*
|
||||
* Implementation for CD playback
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SND_CDOBJECT_H
|
||||
#define __SND_CDOBJECT_H
|
||||
|
||||
#include "SND_Object.h"
|
||||
|
||||
class SND_CDObject : public SND_Object
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* Private to enforce singleton
|
||||
*/
|
||||
SND_CDObject();
|
||||
SND_CDObject(const SND_CDObject&);
|
||||
|
||||
static SND_CDObject* m_instance;
|
||||
MT_Scalar m_gain; /* the gain of the object */
|
||||
int m_playmode; /* the way CD is played back (all, random, track, trackloop) */
|
||||
int m_track; /* the track for 'track' and 'trackloop' */
|
||||
int m_playstate; /* flag for current state of object */
|
||||
bool m_modified;
|
||||
bool m_used; /* flag for checking if we used the cd, if not don't
|
||||
call the stop cd at the end */
|
||||
|
||||
public:
|
||||
static bool CreateSystem();
|
||||
static bool DisposeSystem();
|
||||
static SND_CDObject* Instance();
|
||||
|
||||
~SND_CDObject();
|
||||
|
||||
void SetGain(MT_Scalar gain);
|
||||
void SetPlaymode(int playmode);
|
||||
void SetTrack(int track);
|
||||
void SetPlaystate(int playstate);
|
||||
void SetModified(bool modified);
|
||||
void SetUsed();
|
||||
bool GetUsed();
|
||||
|
||||
bool IsModified() const;
|
||||
|
||||
int GetTrack() const;
|
||||
MT_Scalar GetGain() const;
|
||||
int GetPlaymode() const;
|
||||
int GetPlaystate() const;
|
||||
|
||||
};
|
||||
|
||||
#endif //__SND_CDOBJECT_H
|
||||
|
@ -1,79 +0,0 @@
|
||||
/*
|
||||
* SND_DeviceManager.h
|
||||
*
|
||||
* singleton for creating, switching and deleting audiodevices
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SND_DEVICEMANAGER_H
|
||||
#define __SND_DEVICEMANAGER_H
|
||||
|
||||
#include "SND_IAudioDevice.h"
|
||||
|
||||
class SND_DeviceManager
|
||||
{
|
||||
public :
|
||||
|
||||
/**
|
||||
* a subscription is needed before instances are given away
|
||||
* applications must call subscribe first, get an instance, and
|
||||
* when they are finished with sound, unsubscribe
|
||||
*/
|
||||
static void Subscribe();
|
||||
static void Unsubscribe();
|
||||
|
||||
static SND_IAudioDevice* Instance();
|
||||
static void SetDeviceType(int device_type);
|
||||
|
||||
private :
|
||||
|
||||
/**
|
||||
* Private to enforce singleton
|
||||
*/
|
||||
SND_DeviceManager();
|
||||
SND_DeviceManager(const SND_DeviceManager&);
|
||||
~SND_DeviceManager();
|
||||
|
||||
static SND_IAudioDevice* m_instance;
|
||||
|
||||
/**
|
||||
* The type of device to be created on a call
|
||||
* to Instance().
|
||||
*/
|
||||
static int m_device_type;
|
||||
|
||||
/**
|
||||
* Remember the number of subscriptions.
|
||||
* if 0, delete the device
|
||||
*/
|
||||
static int m_subscriptions;
|
||||
};
|
||||
|
||||
#endif //__SND_DEVICEMANAGER_H
|
||||
|
@ -1,343 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef SND_IAUDIODEVICE
|
||||
#define SND_IAUDIODEVICE
|
||||
|
||||
#include "SND_SoundObject.h"
|
||||
#include "SND_CDObject.h"
|
||||
#include "SND_WaveCache.h"
|
||||
#include "SND_WaveSlot.h"
|
||||
#include "MT_Matrix3x3.h"
|
||||
|
||||
class SND_IAudioDevice
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
SND_IAudioDevice() {};
|
||||
|
||||
/**
|
||||
* destructor
|
||||
*/
|
||||
virtual ~SND_IAudioDevice() {};
|
||||
|
||||
/**
|
||||
* check to see if initialization was successfull
|
||||
*
|
||||
* @return indication of succes
|
||||
*/
|
||||
virtual bool IsInitialized()=0;
|
||||
|
||||
/**
|
||||
* get the wavecache (which does sample (un)loading)
|
||||
*
|
||||
* @return pointer to the wavecache
|
||||
*/
|
||||
virtual SND_WaveCache* GetWaveCache() const =0;
|
||||
|
||||
/**
|
||||
* loads a sample into the device
|
||||
*
|
||||
* @param samplename the name of the sample
|
||||
* @param memlocation pointer where the sample is stored
|
||||
* @param size size of the sample in memory
|
||||
*
|
||||
* @return pointer to the slot with sample data
|
||||
*/
|
||||
virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
|
||||
void* memlocation,
|
||||
int size)=0;
|
||||
|
||||
/**
|
||||
* remove a sample from the wavecache
|
||||
*
|
||||
* @param filename pointer to filename
|
||||
*/
|
||||
// virtual void RemoveSample(const char* filename)=0;
|
||||
|
||||
/**
|
||||
* remove all samples from the wavecache
|
||||
*/
|
||||
virtual void RemoveAllSamples()=0;
|
||||
|
||||
/**
|
||||
* get a new id from the device
|
||||
*
|
||||
* @param pObject pointer to soundobject
|
||||
*
|
||||
* @return indication of success
|
||||
*/
|
||||
virtual bool GetNewId(SND_SoundObject* pObject)=0;
|
||||
|
||||
/**
|
||||
* clear an id
|
||||
*
|
||||
* @param pObject pointer to soundobject
|
||||
*/
|
||||
virtual void ClearId(SND_SoundObject* pObject)=0;
|
||||
|
||||
/**
|
||||
* initialize the listener
|
||||
*/
|
||||
virtual void InitListener()=0;
|
||||
|
||||
/**
|
||||
* set the value of the propagation speed relative to which the
|
||||
* source velocities are interpreted.
|
||||
* f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Vl) / (DOPPLER_VELOCITY + Vo)
|
||||
* f: frequency in sample (soundobject)
|
||||
* f': effective Doppler shifted frequency
|
||||
* Vl: velocity listener
|
||||
* Vo: velocity soundobject
|
||||
*
|
||||
* @param dopplervelocity scaling factor for doppler effect
|
||||
*/
|
||||
virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
|
||||
|
||||
/**
|
||||
* set a scaling to exaggerate or deemphasize the Doppler (pitch)
|
||||
* shift resulting from the calculation.
|
||||
* f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Listener_velocity )/(DOPPLER_VELOCITY + object_velocity )
|
||||
*
|
||||
* @param dopplerfactor scaling factor for doppler effect
|
||||
*/
|
||||
virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
|
||||
|
||||
/**
|
||||
* set the roll-off factor
|
||||
*
|
||||
* @param rollofffactor a global volume scaling factor
|
||||
*/
|
||||
virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
|
||||
|
||||
/**
|
||||
* make the context the current one
|
||||
*/
|
||||
virtual void MakeCurrent() const =0;
|
||||
|
||||
/**
|
||||
* update the device
|
||||
*/
|
||||
virtual void NextFrame() const =0;
|
||||
|
||||
/**
|
||||
* set the volume of the listener.
|
||||
*
|
||||
* @param gain the mastergain
|
||||
*/
|
||||
virtual void SetListenerGain(float gain) const =0;
|
||||
|
||||
/**
|
||||
* connect the buffer with the source
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param buffer the buffer the sample is stored in
|
||||
*/
|
||||
virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
|
||||
|
||||
/**
|
||||
* pause playback of the cd
|
||||
* @param id the id of the object
|
||||
*
|
||||
* @return the state the object is in
|
||||
*/
|
||||
virtual int GetPlayState(int id) =0;
|
||||
|
||||
/**
|
||||
* play a sound belonging to an object.
|
||||
*
|
||||
* @param id the id of the object
|
||||
*/
|
||||
virtual void PlayObject(int id) =0;
|
||||
|
||||
/**
|
||||
* stop a sound belonging to an object.
|
||||
*
|
||||
* @param id the id of the object
|
||||
*/
|
||||
virtual void StopObject(int id) const =0;
|
||||
|
||||
/**
|
||||
* stop all sounds.
|
||||
*/
|
||||
virtual void StopAllObjects()=0;
|
||||
|
||||
/**
|
||||
* pause the sound belonging to an object.
|
||||
*
|
||||
* @param id the id of the object
|
||||
*/
|
||||
virtual void PauseObject(int id) const =0;
|
||||
|
||||
/**
|
||||
* set the sound to looping or non-looping.
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param loopmode type of looping (no loop, normal, bidirectional)
|
||||
*/
|
||||
virtual void SetObjectLoop(int id, unsigned int loopmode) const =0;
|
||||
|
||||
/**
|
||||
* set the looppoints of a sound
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param loopstart the startpoint of the loop (in samples)
|
||||
* @param loopend the endpoint of the loop (in samples)
|
||||
*/
|
||||
virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
|
||||
|
||||
/**
|
||||
* set the pitch of the sound.
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param pitch the pitch
|
||||
*/
|
||||
virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
|
||||
|
||||
/**
|
||||
* set the gain of the sound.
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param gain the gain
|
||||
*/
|
||||
virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
|
||||
|
||||
/**
|
||||
* ROLLOFF_FACTOR is per-Source parameter the application can use to increase or decrease
|
||||
* the range of a source by decreasing or increasing the attenuation, respectively. The
|
||||
* default value is 1. The implementation is free to optimize for a ROLLOFF_FACTOR value
|
||||
* of 0, which indicates that the application does not wish any distance attenuation on
|
||||
* the respective Source.
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param rolloff a per-source volume scaling factor
|
||||
*/
|
||||
virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
|
||||
|
||||
/**
|
||||
* min_gain indicates the minimal gain which is always guaranteed for this sound
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param mingain the minimum gain of the object
|
||||
*/
|
||||
virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
|
||||
|
||||
/**
|
||||
* max_gain indicates the maximal gain which is always guaranteed for this sound
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param maxgain the maximum gain of the object
|
||||
*/
|
||||
virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
|
||||
/**
|
||||
* set the distance at which the Listener will experience gain.
|
||||
* G_dB = GAIN - 20*log10(1 + ROLLOFF_FACTOR*(dist-REFERENCE_DISTANCE)/REFERENCE_DISTANCE );
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param referencedistance the distance at which the listener will start hearing
|
||||
*/
|
||||
virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
|
||||
|
||||
/**
|
||||
* set the position, velocity and orientation of a sound.
|
||||
*
|
||||
* @param id the id of the object
|
||||
* @param position the position of the object
|
||||
* @param velocity the velocity of the object
|
||||
* @param orientation the orientation of the object
|
||||
* @param lisposition the position of the listener
|
||||
* @param rollofffactor the rollofffactor of the object
|
||||
*/
|
||||
virtual void SetObjectTransform(int id,
|
||||
const MT_Vector3& position,
|
||||
const MT_Vector3& velocity,
|
||||
const MT_Matrix3x3& orientation,
|
||||
const MT_Vector3& lisposition,
|
||||
const MT_Scalar& rollofffactor) const =0;
|
||||
|
||||
/**
|
||||
* make a sound 2D
|
||||
*
|
||||
* @param id the id of the object
|
||||
*/
|
||||
virtual void ObjectIs2D(int id) const =0;
|
||||
|
||||
/**
|
||||
* tell the device we want cd suppport
|
||||
*/
|
||||
virtual void UseCD() const =0;
|
||||
|
||||
/**
|
||||
* start playback of the cd
|
||||
*
|
||||
* @param track the tracknumber to start playback from
|
||||
*/
|
||||
virtual void PlayCD(int track) const =0;
|
||||
|
||||
/**
|
||||
* pause playback of the cd (true == pause, false == resume)
|
||||
*/
|
||||
virtual void PauseCD(bool pause) const =0;
|
||||
|
||||
/**
|
||||
* stop playback of the cd
|
||||
*/
|
||||
virtual void StopCD() const =0;
|
||||
|
||||
/**
|
||||
* set the playbackmode of the cd
|
||||
* SND_CD_ALL play all tracks
|
||||
* SND_CD_TRACK play one track
|
||||
* SND_CD_TRACKLOOP play one track looped
|
||||
* SND_CD_RANDOM play all tracks in random order
|
||||
*
|
||||
* @param playmode playmode
|
||||
*/
|
||||
virtual void SetCDPlaymode(int playmode) const =0;
|
||||
|
||||
/**
|
||||
* set the volume playback of the cd
|
||||
*
|
||||
* @param gain the gain
|
||||
*/
|
||||
virtual void SetCDGain(MT_Scalar gain) const =0;
|
||||
|
||||
virtual void StartUsingDSP() =0;
|
||||
virtual float* GetSpectrum() =0;
|
||||
virtual void StopUsingDSP() =0;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void RevokeSoundObject(SND_SoundObject* pObject)=0;
|
||||
};
|
||||
|
||||
#endif //SND_IAUDIODEVICE
|
||||
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* SND_Object.h
|
||||
*
|
||||
* Abstract sound object
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SND_OBJECT_H
|
||||
#define __SND_OBJECT_H
|
||||
|
||||
#include "GEN_List.h"
|
||||
#include "MT_Matrix3x3.h"
|
||||
#include "SoundDefines.h"
|
||||
|
||||
/**
|
||||
* SND_Object is an interface class for soundobjects, listeners and other
|
||||
* kinds of sound related thingies.
|
||||
*/
|
||||
|
||||
class SND_Object : public GEN_Link
|
||||
{
|
||||
public:
|
||||
SND_Object() {};
|
||||
virtual ~SND_Object() {};
|
||||
};
|
||||
|
||||
#endif //__SND_OBJECT_H
|
||||
|
@ -1,104 +0,0 @@
|
||||
/*
|
||||
* SND_Scene.h
|
||||
*
|
||||
* The scene for sounds.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
|
||||
#endif //WIN32
|
||||
|
||||
#ifndef __SND_SCENE_H
|
||||
#define __SND_SCENE_H
|
||||
|
||||
#include "SoundDefines.h"
|
||||
#include "SND_SoundObject.h"
|
||||
#include "SND_CDObject.h"
|
||||
#include "SND_SoundListener.h"
|
||||
#include "SND_WaveSlot.h"
|
||||
|
||||
#include "MT_Vector3.h"
|
||||
#include "MT_Matrix3x3.h"
|
||||
#include "STR_String.h"
|
||||
|
||||
#include <set>
|
||||
|
||||
|
||||
class SND_Scene
|
||||
{
|
||||
std::set<class SND_SoundObject*> m_soundobjects;
|
||||
|
||||
GEN_List m_activeobjects;
|
||||
class SND_IAudioDevice* m_audiodevice;
|
||||
class SND_WaveCache* m_wavecache;
|
||||
class SND_SoundListener m_listener;
|
||||
bool m_audio; // to check if audio works
|
||||
bool m_audioplayback; // to check if audioplayback is wanted
|
||||
|
||||
void UpdateListener();
|
||||
void BuildActiveList(MT_Scalar curtime);
|
||||
void UpdateActiveObects();
|
||||
void UpdateCD();
|
||||
|
||||
public:
|
||||
SND_Scene(SND_IAudioDevice* adi);
|
||||
~SND_Scene();
|
||||
|
||||
bool IsPlaybackWanted();
|
||||
|
||||
void AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime);
|
||||
void RemoveActiveObject(SND_SoundObject* pObject);
|
||||
void DeleteObjectWhenFinished(SND_SoundObject* pObject);
|
||||
|
||||
void Proceed();
|
||||
|
||||
int LoadSample(const STR_String& samplename,
|
||||
void* memlocation,
|
||||
int size);
|
||||
void RemoveAllSamples();
|
||||
bool CheckBuffer(SND_SoundObject* pObject);
|
||||
bool IsSampleLoaded(STR_String& samplename);
|
||||
|
||||
void AddObject(SND_SoundObject* pObject);
|
||||
bool SetCDObject(SND_CDObject* cdobject);
|
||||
void DeleteObject(SND_SoundObject* pObject);
|
||||
void RemoveAllObjects();
|
||||
void StopAllObjects();
|
||||
int GetObjectStatus(SND_SoundObject* pObject) const;
|
||||
|
||||
void SetListenerTransform(const MT_Vector3& pos,
|
||||
const MT_Vector3& vel,
|
||||
const MT_Matrix3x3& mat);
|
||||
|
||||
SND_SoundListener* GetListener();
|
||||
};
|
||||
|
||||
#endif //__SND_SCENE_H
|
||||
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
* SND_SoundListener.h
|
||||
*
|
||||
* A SoundListener is for sound what a camera is for vision.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SND_SOUNDLISTENER_H
|
||||
#define __SND_SOUNDLISTENER_H
|
||||
|
||||
#include "SND_Object.h"
|
||||
|
||||
class SND_SoundListener : public SND_Object
|
||||
{
|
||||
public:
|
||||
SND_SoundListener();
|
||||
virtual ~SND_SoundListener();
|
||||
|
||||
void SetStateFlag(unsigned int stateflags);
|
||||
void SetGain(MT_Scalar gain);
|
||||
void SetPosition(const MT_Vector3& pos);
|
||||
void SetVelocity(const MT_Vector3& vel);
|
||||
void SetOrientation(const MT_Matrix3x3& ori);
|
||||
void SetDopplerFactor(MT_Scalar dopplerfactor);
|
||||
void SetDopplerVelocity(MT_Scalar dopplervelocity);
|
||||
void SetScale(MT_Scalar scale);
|
||||
|
||||
void SetModified(bool modified);
|
||||
bool IsModified() const;
|
||||
|
||||
unsigned int GetStateFlags() const;
|
||||
MT_Scalar GetGain() const;
|
||||
MT_Vector3 GetPosition() const;
|
||||
MT_Vector3 GetVelocity() const;
|
||||
MT_Matrix3x3 GetOrientation();
|
||||
|
||||
MT_Scalar GetDopplerFactor() const;
|
||||
MT_Scalar GetDopplerVelocity() const;
|
||||
MT_Scalar GetScale() const;
|
||||
|
||||
private:
|
||||
void* m_listener;
|
||||
bool m_modified;
|
||||
|
||||
MT_Scalar m_gain; /* overall gain */
|
||||
MT_Vector3 m_position; /* position; left/right, up/down, in/out */
|
||||
MT_Vector3 m_velocity; /* velocity of the listener */
|
||||
MT_Matrix3x3 m_orientation; /* orientation of the listener */
|
||||
|
||||
MT_Scalar m_dopplerfactor; /* scaling factor for the Doppler (pitch) shift */
|
||||
MT_Scalar m_dopplervelocity; /* factor for the reference velocity (for Dopplereffect) */
|
||||
MT_Scalar m_scale;
|
||||
};
|
||||
|
||||
#endif //__SND_SOUNDLISTENER_H
|
||||
|
@ -1,159 +0,0 @@
|
||||
/*
|
||||
* SND_SoundObject.h
|
||||
*
|
||||
* Implementation of the abstract sound object
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SND_SOUNDOBJECT_H
|
||||
#define __SND_SOUNDOBJECT_H
|
||||
|
||||
#include "SND_Object.h"
|
||||
#include "STR_String.h"
|
||||
|
||||
/**
|
||||
* SND_SoundObject is a class for api independent sounddata storage conected to an actuator
|
||||
*/
|
||||
|
||||
class SND_SoundObject : public SND_Object
|
||||
{
|
||||
private:
|
||||
STR_String m_samplename; /* name of the sample */
|
||||
STR_String m_objectname; /* name of the object */
|
||||
unsigned int m_buffer;
|
||||
|
||||
bool m_active; /* is the object active or not? */
|
||||
int m_id;
|
||||
MT_Scalar m_lifespan; /* the lifespan of the sound seconds */
|
||||
MT_Scalar m_timestamp;
|
||||
|
||||
MT_Scalar m_length; /* length of the sample in seconds */
|
||||
|
||||
MT_Scalar m_gain; /* the gain of the object */
|
||||
MT_Scalar m_rollofffactor; /* the scaling factor to increase or decrease the range
|
||||
of a source by decreasing or increasing the
|
||||
attenuation, respectively */
|
||||
MT_Scalar m_referencedistance;/* the distance at which the listener will experience
|
||||
gain */
|
||||
MT_Scalar m_mingain; /* indicates the minimal gain which is always guaranteed
|
||||
for this source */
|
||||
MT_Scalar m_maxgain; /* indicates the maximal gain which is always guaranteed
|
||||
for this source */
|
||||
|
||||
MT_Scalar m_pitch; /* the pitch of the object */
|
||||
MT_Vector3 m_position; /* position; left/right, up/down, in/out */
|
||||
MT_Vector3 m_velocity; /* velocity of the object */
|
||||
MT_Matrix3x3 m_orientation; /* orientation of the object */
|
||||
unsigned int m_loopmode; /* loop normal or bidirectional? */
|
||||
unsigned int m_loopstart; /* start of looppoint in samples! */
|
||||
unsigned int m_loopend; /* end of looppoint in samples! */
|
||||
bool m_is3d; /* is the object 3D or 2D? */
|
||||
int m_playstate; /* flag for current state of object */
|
||||
bool m_modified;
|
||||
unsigned int m_running;
|
||||
bool m_highpriority; /* may the sound be ditched when we run out of voices? */
|
||||
|
||||
public:
|
||||
|
||||
SND_SoundObject();
|
||||
~SND_SoundObject();
|
||||
|
||||
void SetBuffer(unsigned int buffer);
|
||||
void SetActive(bool active);
|
||||
|
||||
void StartSound();
|
||||
void StopSound();
|
||||
void PauseSound();
|
||||
void DeleteWhenFinished();
|
||||
|
||||
void SetObjectName(STR_String objectname);
|
||||
void SetSampleName(STR_String samplename);
|
||||
void SetLength(MT_Scalar length);
|
||||
|
||||
void SetPitch(MT_Scalar pitch);
|
||||
void SetGain(MT_Scalar gain);
|
||||
void SetMinGain(MT_Scalar mingain);
|
||||
void SetMaxGain(MT_Scalar maxgain);
|
||||
void SetRollOffFactor(MT_Scalar rollofffactor);
|
||||
void SetReferenceDistance(MT_Scalar distance);
|
||||
void SetPosition(const MT_Vector3& pos);
|
||||
void SetVelocity(const MT_Vector3& vel);
|
||||
void SetOrientation(const MT_Matrix3x3& orient);
|
||||
void SetLoopMode(unsigned int loopmode);
|
||||
void SetLoopStart(unsigned int loopstart);
|
||||
void SetLoopEnd(unsigned int loopend);
|
||||
void Set3D(bool threedee);
|
||||
void SetPlaystate(int playstate);
|
||||
void SetHighPriority(bool priority);
|
||||
|
||||
void SetId(int id);
|
||||
void SetLifeSpan();
|
||||
void SetTimeStamp(MT_Scalar timestamp);
|
||||
|
||||
void SetModified(bool modified);
|
||||
|
||||
bool IsLifeSpanOver(MT_Scalar curtime) const;
|
||||
bool IsActive() const;
|
||||
bool IsModified() const;
|
||||
bool IsHighPriority() const;
|
||||
|
||||
void InitRunning();
|
||||
bool IsRunning() const;
|
||||
void AddRunning();
|
||||
|
||||
int GetId() const;
|
||||
MT_Scalar GetLifeSpan() const;
|
||||
MT_Scalar GetTimestamp() const;
|
||||
|
||||
unsigned int GetBuffer();
|
||||
const STR_String& GetSampleName();
|
||||
const STR_String& GetObjectName();
|
||||
|
||||
MT_Scalar GetLength() const;
|
||||
MT_Scalar GetGain() const;
|
||||
MT_Scalar GetPitch() const;
|
||||
|
||||
MT_Scalar GetMinGain() const;
|
||||
MT_Scalar GetMaxGain() const;
|
||||
MT_Scalar GetRollOffFactor() const;
|
||||
MT_Scalar GetReferenceDistance() const;
|
||||
|
||||
MT_Vector3 GetPosition() const;
|
||||
MT_Vector3 GetVelocity() const;
|
||||
MT_Matrix3x3 GetOrientation() const;
|
||||
unsigned int GetLoopMode() const;
|
||||
unsigned int GetLoopStart() const;
|
||||
unsigned int GetLoopEnd() const;
|
||||
bool Is3D() const;
|
||||
int GetPlaystate() const;
|
||||
|
||||
};
|
||||
|
||||
#endif //__SND_SOUNDOBJECT_H
|
||||
|
@ -1,111 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef SND_UTILS_H
|
||||
#define SND_UTILS_H
|
||||
|
||||
#include "SND_WaveSlot.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char riff[4];
|
||||
signed int size;
|
||||
unsigned char type[4];
|
||||
} WavFileHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short format;
|
||||
unsigned short numberofchannels;
|
||||
unsigned int samplerate;
|
||||
unsigned int bytespersec;
|
||||
unsigned short blockalignment;
|
||||
unsigned short bitrate;
|
||||
} WavFmtHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short size;
|
||||
unsigned short samplesperblock;
|
||||
} WavFmtExHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int Manufacturer;
|
||||
unsigned int Product;
|
||||
unsigned int SamplePeriod;
|
||||
unsigned int Note;
|
||||
unsigned int FineTune;
|
||||
unsigned int SMPTEFormat;
|
||||
unsigned int SMPTEOffest;
|
||||
unsigned int loops;
|
||||
unsigned int SamplerData;
|
||||
struct
|
||||
{
|
||||
unsigned int Identifier;
|
||||
unsigned int Type;
|
||||
unsigned int Start;
|
||||
unsigned int End;
|
||||
unsigned int Fraction;
|
||||
unsigned int Count;
|
||||
} Loop[1];
|
||||
} WavSampleHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char id[4];
|
||||
unsigned int size;
|
||||
} WavChunkHeader;
|
||||
|
||||
/**
|
||||
* loads a sample and returns a pointer
|
||||
*/
|
||||
extern void* SND_LoadSample(char *filename);
|
||||
|
||||
extern bool SND_IsSampleValid(const STR_String& name, void* memlocation);
|
||||
extern unsigned int SND_GetSampleFormat(void* sample);
|
||||
extern unsigned int SND_GetNumberOfChannels(void* sample);
|
||||
extern unsigned int SND_GetSampleRate(void* sample);
|
||||
extern unsigned int SND_GetBitRate(void* sample);
|
||||
extern unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length);
|
||||
extern unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length);
|
||||
extern unsigned int SND_GetExtraChunk(void* sample);
|
||||
|
||||
extern void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* SND_WaveCache.h
|
||||
*
|
||||
* abstract wavecache, a way to organize samples
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
|
||||
#endif //WIN32
|
||||
|
||||
#ifndef __SND_WAVECACHE_H
|
||||
#define __SND_WAVECACHE_H
|
||||
|
||||
#include "SND_WaveSlot.h"
|
||||
#include "SoundDefines.h"
|
||||
#include "SND_SoundObject.h"
|
||||
#include <map>
|
||||
|
||||
class SND_WaveCache
|
||||
{
|
||||
public:
|
||||
SND_WaveCache();
|
||||
virtual ~SND_WaveCache();
|
||||
|
||||
SND_WaveSlot* GetWaveSlot(const STR_String& samplename);
|
||||
|
||||
void RemoveAllSamples();
|
||||
void RemoveSample(const STR_String& samplename, int buffer);
|
||||
|
||||
private:
|
||||
std::map<STR_String, SND_WaveSlot*> m_samplecache;
|
||||
|
||||
SND_WaveSlot* m_bufferList[NUM_BUFFERS];
|
||||
|
||||
void FreeSamples();
|
||||
};
|
||||
|
||||
#endif //__SND_WAVECACHE_H
|
||||
|
@ -1,92 +0,0 @@
|
||||
/*
|
||||
* SND_WaveSlot.cpp
|
||||
*
|
||||
* class for storing sample related information
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SND_WAVESLOT_H
|
||||
#define __SND_WAVESLOT_H
|
||||
|
||||
#include "STR_String.h"
|
||||
|
||||
class SND_WaveSlot
|
||||
{
|
||||
STR_String m_samplename;
|
||||
bool m_loaded;
|
||||
void* m_data;
|
||||
unsigned int m_buffer;
|
||||
unsigned int m_sampleformat;
|
||||
unsigned int m_numberofchannels;
|
||||
unsigned int m_samplerate;
|
||||
unsigned int m_bitrate;
|
||||
unsigned int m_numberofsamples;
|
||||
unsigned int m_filesize;
|
||||
|
||||
public:
|
||||
|
||||
SND_WaveSlot(): m_loaded(false),
|
||||
m_data(NULL),
|
||||
m_buffer(0),
|
||||
m_sampleformat(0),
|
||||
m_numberofchannels(0),
|
||||
m_samplerate(0),
|
||||
m_bitrate(0),
|
||||
m_numberofsamples(0),
|
||||
m_filesize(0)
|
||||
{};
|
||||
~SND_WaveSlot();
|
||||
|
||||
void SetSampleName(STR_String samplename);
|
||||
void SetLoaded(bool loaded);
|
||||
void SetData(void* data);
|
||||
void SetBuffer(unsigned int buffer);
|
||||
void SetSampleFormat(unsigned int sampleformat);
|
||||
void SetNumberOfChannels(unsigned int numberofchannels);
|
||||
void SetSampleRate(unsigned int samplerate);
|
||||
void SetBitRate(unsigned int bitrate);
|
||||
void SetNumberOfSamples(unsigned int numberofsamples);
|
||||
void SetFileSize(unsigned int filesize);
|
||||
|
||||
|
||||
const STR_String& GetSampleName();
|
||||
bool IsLoaded() const;
|
||||
void* GetData();
|
||||
unsigned int GetBuffer() const;
|
||||
unsigned int GetSampleFormat() const;
|
||||
unsigned int GetNumberOfChannels() const;
|
||||
unsigned int GetSampleRate() const;
|
||||
unsigned int GetBitRate() const;
|
||||
unsigned int GetNumberOfSamples() const;
|
||||
unsigned int GetFileSize() const;
|
||||
|
||||
};
|
||||
|
||||
#endif //__SND_WAVESLOT_H
|
||||
|
@ -1,48 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): none yet.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
#
|
||||
#
|
||||
|
||||
LIBNAME = soundsystem
|
||||
DIR = $(OCGDIR)/intern/SoundSystem
|
||||
ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)SoundSystem
|
||||
|
||||
include nan_compile.mk
|
||||
|
||||
CPPFLAGS += $(NAN_LEVEL_1_WARNINGS)
|
||||
|
||||
CPPFLAGS += -I$(NAN_MOTO)/include
|
||||
CPPFLAGS += -I.. -I../SND_BlenderWaveCache -I../SND_OpenAL
|
||||
|
||||
TESTLIB = $(OCGDIR)/gameengine/OpenALSoundSystem/$(DEBUG_DIR)libOpenALSoundSystem.a
|
||||
TESTLIB += $(OCGDIR)/gameengine/BlenderWaveCache/$(DEBUG_DIR)libBlenderWaveCache.a
|
||||
TESTLIB += $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libsoundsystem.a
|
||||
TESTLIB += $(NAN_OPENAL)/lib/libopenal.a
|
||||
|
||||
$(DIR)/$(DEBUG_DIR)SoundSystem: $(OBJS) $(TESTLIB)
|
||||
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(TESTLIB) -lm -pthread -ldl -lstdc++
|
@ -1,154 +0,0 @@
|
||||
/* SND_test.c nov 2000
|
||||
*
|
||||
* testfile for the SND module
|
||||
*
|
||||
* janco verduin
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_C-api.h"
|
||||
#include "BlenderWaveCacheCApi.h"
|
||||
#include "OpenALC-Api.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
||||
static int buf[3];
|
||||
|
||||
float oPos[3]={3.0, 0.0,-1.0};
|
||||
float oVel[3]={0.0, 0.0, 1.0};
|
||||
float oOri[6]={0.0, 0.0, 1.0, 0.0, 1.0, 0.0};
|
||||
|
||||
void* ReadFile(char *filename)
|
||||
{
|
||||
int file, filelen;
|
||||
void *data = NULL;
|
||||
|
||||
#if defined(WIN32)
|
||||
file = open(filename, O_BINARY|O_RDONLY);
|
||||
#else
|
||||
file = open(filename, 0|O_RDONLY);
|
||||
#endif
|
||||
|
||||
if (file == -1) {
|
||||
printf("can't open file.\n");
|
||||
printf("press q for quit.\n");
|
||||
|
||||
}
|
||||
else {
|
||||
filelen = lseek(file, 0, SEEK_END);
|
||||
lseek(file, 0, SEEK_SET);
|
||||
|
||||
if (filelen != 0){
|
||||
data = malloc(filelen);
|
||||
if (read(file, data, filelen) != filelen) {
|
||||
free(data);
|
||||
data = NULL;
|
||||
}
|
||||
}
|
||||
close(file);
|
||||
|
||||
}
|
||||
return (data);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int ch;
|
||||
char* samplename = NULL;
|
||||
void* sampleinmemory = NULL;
|
||||
SND_CacheHandle wavecache = NULL;
|
||||
SND_SceneHandle scene = NULL;
|
||||
SND_ObjectHandle object = NULL;
|
||||
|
||||
wavecache = SND_GetWaveCache();
|
||||
scene = SND_CreateOpenALScene(wavecache);
|
||||
|
||||
samplename = "2.wav";
|
||||
sampleinmemory = ReadFile(samplename);
|
||||
|
||||
if (sampleinmemory) {
|
||||
|
||||
object = SND_CreateObject();
|
||||
SND_AddMemoryLocation(samplename, sampleinmemory);
|
||||
SND_SetSampleName(object, samplename);
|
||||
SND_AddObject(scene, object);
|
||||
printf("go your gang...\n");
|
||||
printf("1: play\n");
|
||||
printf("2: stop\n");
|
||||
printf("q: quit\n");
|
||||
}
|
||||
do
|
||||
{
|
||||
ch = getchar();
|
||||
ch = toupper(ch);
|
||||
switch (ch)
|
||||
{
|
||||
case '1':
|
||||
{
|
||||
SND_SetPitch(object, 1.0);
|
||||
SND_SetGain(object, 1.0);
|
||||
SND_StartSound(object);
|
||||
break;
|
||||
}
|
||||
case '2':
|
||||
{
|
||||
SND_StopSound(object);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SND_Proceed(scene);
|
||||
|
||||
} while (ch != 'Q');
|
||||
|
||||
if (object) {
|
||||
|
||||
SND_RemoveObject(scene, object);
|
||||
SND_DeleteObject(object);
|
||||
}
|
||||
|
||||
SND_DeleteScene(scene);
|
||||
SND_DeleteCache();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
/*
|
||||
* SoundDefines.h
|
||||
*
|
||||
* this is where all kinds of defines are stored
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SOUNDDEFINES_H
|
||||
#define __SOUNDDEFINES_H
|
||||
|
||||
/* the types of devices */
|
||||
enum
|
||||
{
|
||||
snd_e_dummydevice = 0,
|
||||
snd_e_openaldevice
|
||||
};
|
||||
|
||||
/* general stuff */
|
||||
#define NUM_BUFFERS 128
|
||||
#define NUM_SOURCES 24 /* 24 is the limit for openal on windows, was 16 in 2.47 and previous */
|
||||
|
||||
/* openal related stuff */
|
||||
#define AL_LOOPING 0x1007
|
||||
|
||||
/* activelist defines */
|
||||
enum
|
||||
{
|
||||
SND_REMOVE_ACTIVE_OBJECT = 0,
|
||||
SND_ADD_ACTIVE_OBJECT,
|
||||
SND_DO_NOTHING
|
||||
};
|
||||
|
||||
/* playstate flags */
|
||||
enum
|
||||
{
|
||||
SND_UNKNOWN = -1,
|
||||
SND_INITIAL,
|
||||
SND_MUST_PLAY,
|
||||
SND_PLAYING,
|
||||
SND_MUST_STOP,
|
||||
SND_STOPPED,
|
||||
SND_MUST_PAUSE,
|
||||
SND_PAUSED,
|
||||
SND_MUST_RESUME,
|
||||
SND_MUST_STOP_WHEN_FINISHED,
|
||||
SND_MUST_BE_DELETED
|
||||
};
|
||||
|
||||
/* loopmodes */
|
||||
enum
|
||||
{
|
||||
SND_LOOP_OFF = 0,
|
||||
SND_LOOP_NORMAL,
|
||||
SND_LOOP_BIDIRECTIONAL
|
||||
};
|
||||
|
||||
|
||||
/* cd playstate flags */
|
||||
enum
|
||||
{
|
||||
SND_CD_ALL = 0,
|
||||
SND_CD_TRACK,
|
||||
SND_CD_TRACKLOOP
|
||||
};
|
||||
|
||||
/* sample types */
|
||||
enum
|
||||
{
|
||||
SND_WAVE_FORMAT_UNKNOWN = 0,
|
||||
SND_WAVE_FORMAT_PCM,
|
||||
SND_WAVE_FORMAT_ADPCM,
|
||||
SND_WAVE_FORMAT_ALAW = 6,
|
||||
SND_WAVE_FORMAT_MULAW,
|
||||
SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 17,
|
||||
SND_WAVE_FORMAT_CONTROL_RES_VQLPC = 34,
|
||||
SND_WAVE_FORMAT_GSM_610 = 49,
|
||||
SND_WAVE_FORMAT_MPEG3 = 85
|
||||
};
|
||||
|
||||
#endif //__SOUNDDEFINES_H
|
||||
|
@ -1,93 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef SND_DUMMYDEVICE
|
||||
#define SND_DUMMYDEVICE
|
||||
|
||||
#include "SND_AudioDevice.h"
|
||||
|
||||
class SND_DummyDevice : public SND_AudioDevice
|
||||
{
|
||||
public:
|
||||
SND_DummyDevice();
|
||||
~SND_DummyDevice();
|
||||
|
||||
bool Init() { return false; }
|
||||
|
||||
SND_WaveSlot* LoadSample(const STR_String& samplename,
|
||||
void* memlocation,
|
||||
int size) { return NULL; }
|
||||
|
||||
void InitListener() {};
|
||||
void SetListenerGain(float gain) const {};
|
||||
void SetDopplerVelocity(MT_Scalar dopplervelocity) const {};
|
||||
void SetDopplerFactor(MT_Scalar dopplerfactor) const {};
|
||||
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const {};
|
||||
|
||||
void MakeCurrent() const {};
|
||||
|
||||
void NextFrame() const {};
|
||||
|
||||
void SetObjectBuffer(int id, unsigned int buffer) {};
|
||||
|
||||
int GetPlayState(int id) { return SND_UNKNOWN; }
|
||||
void PlayObject(int id) {};
|
||||
void StopObject(int id) const {};
|
||||
void StopAllObjects() {};
|
||||
void PauseObject(int id) const {};
|
||||
|
||||
void SetObjectLoop(int id, unsigned int loopmode) const {};
|
||||
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const {};
|
||||
void SetObjectPitch(int id, MT_Scalar pitch) const {};
|
||||
void SetObjectGain(int id, MT_Scalar gain) const {};
|
||||
void SetObjectMinGain(int id, MT_Scalar mingain) const {};
|
||||
void SetObjectMaxGain(int id, MT_Scalar maxgain) const {};
|
||||
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const {};
|
||||
void SetObjectReferenceDistance(int id, MT_Scalar distance) const {};
|
||||
|
||||
void SetObjectTransform(int id,
|
||||
const MT_Vector3& position,
|
||||
const MT_Vector3& velocity,
|
||||
const MT_Matrix3x3& orientation,
|
||||
const MT_Vector3& lisposition,
|
||||
const MT_Scalar& rollofffactor) const {};
|
||||
void ObjectIs2D(int id) const {};
|
||||
|
||||
void PlayCD(int track) const {};
|
||||
void PauseCD(bool pause) const {};
|
||||
void StopCD() const {};
|
||||
void SetCDPlaymode(int playmode) const {};
|
||||
void SetCDGain(MT_Scalar gain) const {};
|
||||
|
||||
void StartUsingDSP() {};
|
||||
float* GetSpectrum() { return NULL; }
|
||||
void StopUsingDSP() {};
|
||||
};
|
||||
|
||||
#endif //SND_DUMMYDEVICE
|
||||
|
@ -1,242 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_AudioDevice.h"
|
||||
#include "SND_SoundObject.h"
|
||||
|
||||
#ifdef WIN32
|
||||
// This warning tells us about truncation of __long__ stl-generated names.
|
||||
// It can occasionally cause DevStudio to have internal compiler warnings.
|
||||
#pragma warning( disable : 4786 )
|
||||
#endif
|
||||
|
||||
|
||||
SND_AudioDevice::SND_AudioDevice()
|
||||
{
|
||||
m_wavecache = NULL;
|
||||
m_audio = false;
|
||||
|
||||
for (int i = 0; i < NUM_SOURCES; i++)
|
||||
{
|
||||
m_idObjectArray[i] = new SND_IdObject();
|
||||
m_idObjectArray[i]->SetId(i);
|
||||
m_idObjectArray[i]->SetSoundObject(NULL);
|
||||
m_idObjectList.addTail(m_idObjectArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_AudioDevice::~SND_AudioDevice()
|
||||
{
|
||||
for (int i = 0; i < NUM_SOURCES; i++)
|
||||
{
|
||||
delete m_idObjectArray[i];
|
||||
m_idObjectArray[i] = NULL;
|
||||
}
|
||||
|
||||
if (m_wavecache)
|
||||
{
|
||||
delete m_wavecache;
|
||||
m_wavecache = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_AudioDevice::IsInitialized()
|
||||
{
|
||||
return m_audio;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_WaveCache* SND_AudioDevice::GetWaveCache() const
|
||||
{
|
||||
return m_wavecache;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* seeks an unused id and returns it */
|
||||
bool SND_AudioDevice::GetNewId(SND_SoundObject* pObject)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_AudioDevice::GetNewId\n");
|
||||
#endif
|
||||
|
||||
bool result = false;
|
||||
|
||||
// first, get the oldest (the first) idobject
|
||||
SND_IdObject* pIdObject = (SND_IdObject*)m_idObjectList.getHead();
|
||||
|
||||
if (pIdObject->isTail())
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
// find the first id object which doesn't have a high priority soundobject
|
||||
bool ThisSoundMustStay = false;
|
||||
bool OutOfIds = false;
|
||||
|
||||
do
|
||||
{
|
||||
// if no soundobject present, it's seat may be taken
|
||||
if (pIdObject->GetSoundObject())
|
||||
{
|
||||
// and also if it ain't highprio
|
||||
if (pIdObject->GetSoundObject()->IsHighPriority())
|
||||
{
|
||||
ThisSoundMustStay = true;
|
||||
pIdObject = (SND_IdObject*)pIdObject->getNext();
|
||||
|
||||
// if the last one is a priority sound too, then there are no id's left
|
||||
// and we won't add any new sounds
|
||||
if (pIdObject->isTail())
|
||||
OutOfIds = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ThisSoundMustStay = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ThisSoundMustStay = false;
|
||||
}
|
||||
|
||||
} while (ThisSoundMustStay && !OutOfIds);
|
||||
|
||||
if (!OutOfIds)
|
||||
{
|
||||
SND_SoundObject* oldobject = pIdObject->GetSoundObject();
|
||||
|
||||
// revoke the old object if present
|
||||
if (oldobject)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("oldobject: %x\n", oldobject);
|
||||
#endif
|
||||
RevokeSoundObject(oldobject);
|
||||
}
|
||||
|
||||
// set the new soundobject into the idobject
|
||||
pIdObject->SetSoundObject(pObject);
|
||||
|
||||
// set the id into the soundobject
|
||||
int id = pIdObject->GetId();
|
||||
pObject->SetId(id);
|
||||
|
||||
// connect the new id to the buffer the sample is stored in
|
||||
SetObjectBuffer(id, pObject->GetBuffer());
|
||||
|
||||
// remove the idobject from the list and add it in the back again
|
||||
pIdObject->remove();
|
||||
m_idObjectList.addTail(pIdObject);
|
||||
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_AudioDevice::ClearId(SND_SoundObject* pObject)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_AudioDevice::ClearId\n");
|
||||
#endif
|
||||
|
||||
if (pObject)
|
||||
{
|
||||
int id = pObject->GetId();
|
||||
|
||||
if (id != -1)
|
||||
{
|
||||
// lets get the idobject belonging to the soundobject
|
||||
SND_IdObject* pIdObject = m_idObjectArray[id];
|
||||
SND_SoundObject* oldobject = pIdObject->GetSoundObject();
|
||||
|
||||
if (oldobject)
|
||||
{
|
||||
RevokeSoundObject(oldobject);
|
||||
|
||||
// clear the idobject from the soundobject
|
||||
pIdObject->SetSoundObject(NULL);
|
||||
}
|
||||
|
||||
// remove the idobject and place it in front
|
||||
pIdObject->remove();
|
||||
m_idObjectList.addHead(pIdObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_AudioDevice::RevokeSoundObject(SND_SoundObject* pObject)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_AudioDevice::RevokeSoundObject\n");
|
||||
#endif
|
||||
|
||||
// stop the soundobject
|
||||
int id = pObject->GetId();
|
||||
|
||||
if (id >= 0 && id < NUM_SOURCES)
|
||||
{
|
||||
StopObject(id);
|
||||
|
||||
// remove the object from the 'activelist'
|
||||
pObject->SetActive(false);
|
||||
|
||||
#ifdef ONTKEVER
|
||||
printf("pObject->remove();\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// make sure its id is invalid
|
||||
pObject->SetId(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
void SND_AudioDevice::RemoveSample(const char* filename)
|
||||
{
|
||||
if (m_wavecache)
|
||||
m_wavecache->RemoveSample(filename);
|
||||
}
|
||||
*/
|
||||
|
||||
void SND_AudioDevice::RemoveAllSamples()
|
||||
{
|
||||
if (m_wavecache)
|
||||
m_wavecache->RemoveAllSamples();
|
||||
}
|
||||
|
@ -1,115 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef SND_AUDIODEVICE
|
||||
#define SND_AUDIODEVICE
|
||||
|
||||
#include "SND_IAudioDevice.h"
|
||||
#include "SoundDefines.h"
|
||||
#include "SND_IdObject.h"
|
||||
|
||||
class SND_AudioDevice : public SND_IAudioDevice
|
||||
{
|
||||
public:
|
||||
SND_AudioDevice();
|
||||
virtual ~SND_AudioDevice();
|
||||
|
||||
virtual bool IsInitialized();
|
||||
|
||||
SND_WaveCache* GetWaveCache() const;
|
||||
|
||||
bool GetNewId(SND_SoundObject* pObject);
|
||||
void ClearId(SND_SoundObject* pObject);
|
||||
|
||||
void UseCD() const {};
|
||||
|
||||
/* to be implemented in derived class
|
||||
|
||||
virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
|
||||
void* memlocation,
|
||||
int size) =0;
|
||||
*/
|
||||
// void RemoveSample(const char* filename);
|
||||
void RemoveAllSamples();
|
||||
|
||||
/* to be implemented in derived class
|
||||
|
||||
virtual void InitListener()=0;
|
||||
virtual void SetListenerGain(float gain) const =0;
|
||||
virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
|
||||
virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
|
||||
virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
|
||||
|
||||
virtual void MakeCurrent() const =0;
|
||||
|
||||
virtual void UpdateDevice() const =0;
|
||||
|
||||
virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
|
||||
virtual int GetPlayState(int id)=0;
|
||||
virtual void PlayObject(int id)=0;
|
||||
virtual void StopObject(int id) const =0;
|
||||
virtual void StopAllObjects()=0;
|
||||
virtual void PauseObject(int id) const =0;
|
||||
|
||||
virtual void SetObjectLoop(int id, bool loop) const =0;
|
||||
virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
|
||||
virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
|
||||
virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
|
||||
virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
|
||||
virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
|
||||
virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
|
||||
virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
|
||||
|
||||
virtual void SetObjectTransform(int id,
|
||||
const MT_Vector3& position,
|
||||
const MT_Vector3& velocity,
|
||||
const MT_Matrix3x3& orientation,
|
||||
const MT_Vector3& lisposition,
|
||||
const MT_Scalar& rollofffactor) const =0;
|
||||
virtual void ObjectIs2D(int id) const =0;
|
||||
|
||||
virtual void PlayCD(int track) const =0;
|
||||
virtual void PauseCD(bool pause) const =0;
|
||||
virtual void StopCD() const =0;
|
||||
virtual void SetCDPlaymode(int playmode) const =0;
|
||||
virtual void SetCDGain(MT_Scalar gain) const =0;
|
||||
virtual float* GetSpectrum() =0;
|
||||
*/
|
||||
|
||||
protected:
|
||||
bool m_audio;
|
||||
GEN_List m_idObjectList;
|
||||
SND_IdObject* m_idObjectArray[NUM_SOURCES];
|
||||
SND_WaveCache* m_wavecache;
|
||||
|
||||
private:
|
||||
void RevokeSoundObject(SND_SoundObject* pObject);
|
||||
};
|
||||
|
||||
#endif //SND_AUDIODEVICE
|
||||
|
@ -1,392 +0,0 @@
|
||||
/*
|
||||
* SND_C-Api.cpp
|
||||
*
|
||||
* C Api for soundmodule
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "SND_C-api.h"
|
||||
#include "SND_DeviceManager.h"
|
||||
#include "SND_Scene.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
|
||||
#endif //WIN32
|
||||
|
||||
|
||||
|
||||
void SND_SetDeviceType(int device_type)
|
||||
{
|
||||
SND_DeviceManager::SetDeviceType(device_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_AudioDeviceInterfaceHandle SND_GetAudioDevice()
|
||||
{
|
||||
SND_IAudioDevice* audiodevice = NULL;
|
||||
|
||||
SND_DeviceManager::Subscribe();
|
||||
audiodevice = SND_DeviceManager::Instance();
|
||||
|
||||
if (!audiodevice->IsInitialized())
|
||||
{
|
||||
SND_DeviceManager::SetDeviceType(snd_e_dummydevice);
|
||||
audiodevice = SND_DeviceManager::Instance();
|
||||
}
|
||||
|
||||
return (SND_AudioDeviceInterfaceHandle)audiodevice;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_ReleaseDevice()
|
||||
{
|
||||
SND_DeviceManager::Unsubscribe();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_IsPlaybackWanted(SND_SceneHandle scene)
|
||||
{
|
||||
assert(scene);
|
||||
bool result = ((SND_Scene*)scene)->IsPlaybackWanted();
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// create a scene
|
||||
SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice)
|
||||
{
|
||||
// initialize sound scene and object
|
||||
SND_Scene* scene = new SND_Scene((SND_IAudioDevice*)audiodevice);
|
||||
|
||||
return (SND_SceneHandle)scene;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_DeleteScene(SND_SceneHandle scene)
|
||||
{
|
||||
assert(scene);
|
||||
delete (SND_Scene*)scene;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_AddSample(SND_SceneHandle scene,
|
||||
const char* filename,
|
||||
void* memlocation,
|
||||
int size)
|
||||
{
|
||||
assert(scene);
|
||||
assert(memlocation);
|
||||
int buffer = ((SND_Scene*)scene)->LoadSample(filename, memlocation, size);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_RemoveAllSamples(SND_SceneHandle scene)
|
||||
{
|
||||
assert(scene);
|
||||
((SND_Scene*)scene)->RemoveAllSamples();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object)
|
||||
{
|
||||
assert(scene);
|
||||
assert(object);
|
||||
int result = (int)((SND_Scene*)scene)->CheckBuffer((SND_SoundObject*)object);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object)
|
||||
{
|
||||
assert(scene);
|
||||
assert(object);
|
||||
((SND_Scene*)scene)->AddObject((SND_SoundObject *)object);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object)
|
||||
{
|
||||
assert(scene);
|
||||
assert(object);
|
||||
((SND_Scene*)scene)->DeleteObject((SND_SoundObject *)object);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_RemoveAllSounds(SND_SceneHandle scene)
|
||||
{
|
||||
assert(scene);
|
||||
((SND_Scene*)scene)->RemoveAllObjects();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_StopAllSounds(SND_SceneHandle scene)
|
||||
{
|
||||
assert(scene);
|
||||
((SND_Scene*)scene)->StopAllObjects();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene)
|
||||
{
|
||||
assert(scene);
|
||||
((SND_Scene*)scene)->Proceed();
|
||||
((SND_IAudioDevice*)audiodevice)->NextFrame();
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_ListenerHandle SND_GetListener(SND_SceneHandle scene)
|
||||
{
|
||||
assert(scene);
|
||||
return (SND_ListenerHandle)((SND_Scene*)scene)->GetListener();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetListenerGain(SND_SceneHandle scene, double gain)
|
||||
{
|
||||
assert(scene);
|
||||
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
|
||||
listener->SetGain((MT_Scalar)gain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor)
|
||||
{
|
||||
assert(scene);
|
||||
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
|
||||
listener->SetDopplerFactor(dopplerfactor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity)
|
||||
{
|
||||
assert(scene);
|
||||
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
|
||||
listener->SetDopplerVelocity(dopplervelocity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Object instantiation
|
||||
SND_ObjectHandle SND_CreateSound()
|
||||
{
|
||||
return (SND_ObjectHandle)new SND_SoundObject();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_DeleteSound(SND_ObjectHandle object)
|
||||
{
|
||||
assert(object);
|
||||
delete (SND_SoundObject*)object;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Object control
|
||||
void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object)
|
||||
{
|
||||
assert(scene);
|
||||
assert(object);
|
||||
((SND_Scene*)scene)->AddActiveObject((SND_SoundObject*)object, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object)
|
||||
{
|
||||
assert(scene);
|
||||
assert(object);
|
||||
((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object)
|
||||
{
|
||||
assert(scene);
|
||||
assert(object);
|
||||
((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetSampleName(SND_ObjectHandle object, char* samplename)
|
||||
{
|
||||
assert(object);
|
||||
STR_String name = samplename;
|
||||
((SND_SoundObject*)object)->SetSampleName(name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetGain(SND_ObjectHandle object, double gain)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetGain(gain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetMinGain(minimumgain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetMaxGain(maximumgain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetRollOffFactor(rollofffactor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetReferenceDistance(referencedistance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetPitch(SND_ObjectHandle object, double pitch)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetPitch(pitch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetPosition(SND_ObjectHandle object, double* position)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetPosition(position);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetVelocity(SND_ObjectHandle object, double* velocity)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetVelocity(velocity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetOrientation(SND_ObjectHandle object, double* orientation)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetOrientation(orientation);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetLoopMode(SND_ObjectHandle object, int loopmode)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetLoopMode(loopmode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend)
|
||||
{
|
||||
assert(object);
|
||||
((SND_SoundObject*)object)->SetLoopStart(loopstart);
|
||||
((SND_SoundObject*)object)->SetLoopEnd(loopend);
|
||||
}
|
||||
|
||||
|
||||
|
||||
float SND_GetGain(SND_ObjectHandle object)
|
||||
{
|
||||
assert(object);
|
||||
MT_Scalar gain = ((SND_SoundObject*)object)->GetGain();
|
||||
return (float) gain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
float SND_GetPitch(SND_ObjectHandle object)
|
||||
{
|
||||
assert(object);
|
||||
MT_Scalar pitch = ((SND_SoundObject*)object)->GetPitch();
|
||||
return (float) pitch;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_GetLoopMode(SND_ObjectHandle object)
|
||||
{
|
||||
assert(object);
|
||||
return ((SND_SoundObject*)object)->GetLoopMode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_GetPlaystate(SND_ObjectHandle object)
|
||||
{
|
||||
assert(object);
|
||||
return ((SND_SoundObject*)object)->GetPlaystate();
|
||||
}
|
@ -1,182 +0,0 @@
|
||||
/*
|
||||
* SND_CDObject.cpp
|
||||
*
|
||||
* Implementation for CD playback
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_CDObject.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
SND_CDObject* SND_CDObject::m_instance = NULL;
|
||||
|
||||
bool SND_CDObject::CreateSystem()
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (!m_instance)
|
||||
{
|
||||
m_instance = new SND_CDObject();
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_CDObject::DisposeSystem()
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (m_instance)
|
||||
{
|
||||
delete m_instance;
|
||||
m_instance = NULL;
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_CDObject* SND_CDObject::Instance()
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_CDObject::SND_CDObject()
|
||||
{
|
||||
m_gain = 1;
|
||||
m_playmode = SND_CD_ALL;
|
||||
m_track = 1;
|
||||
m_playstate = SND_STOPPED;
|
||||
m_used = false;
|
||||
|
||||
// don't set the cd standard on modified:
|
||||
// if not used, we don't wanna touch it (performance)
|
||||
m_modified = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_CDObject::~SND_CDObject()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_CDObject::SetGain(MT_Scalar gain)
|
||||
{
|
||||
m_gain = gain;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_CDObject::SetPlaymode(int playmode)
|
||||
{
|
||||
m_playmode = playmode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_CDObject::SetPlaystate(int playstate)
|
||||
{
|
||||
m_playstate = playstate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_CDObject::SetTrack(int track)
|
||||
{
|
||||
m_track = track;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_CDObject::GetTrack() const
|
||||
{
|
||||
return m_track;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_CDObject::GetGain() const
|
||||
{
|
||||
return m_gain;
|
||||
}
|
||||
|
||||
|
||||
int SND_CDObject::GetPlaystate() const
|
||||
{
|
||||
return m_playstate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_CDObject::IsModified() const
|
||||
{
|
||||
return m_modified;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_CDObject::SetModified(bool modified)
|
||||
{
|
||||
m_modified = modified;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_CDObject::GetPlaymode() const
|
||||
{
|
||||
return m_playmode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_CDObject::SetUsed()
|
||||
{
|
||||
m_used = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_CDObject::GetUsed()
|
||||
{
|
||||
return m_used;
|
||||
}
|
||||
|
@ -1,126 +0,0 @@
|
||||
/*
|
||||
* SND_DeviceManager.h
|
||||
*
|
||||
* singleton for creating, switching and deleting audiodevices
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "SND_DeviceManager.h"
|
||||
#include "SND_DependKludge.h"
|
||||
#include "SND_DummyDevice.h"
|
||||
#ifdef USE_OPENAL
|
||||
#include "SND_OpenALDevice.h"
|
||||
#endif
|
||||
|
||||
SND_IAudioDevice* SND_DeviceManager::m_instance = NULL;
|
||||
int SND_DeviceManager::m_subscriptions = 0;
|
||||
|
||||
#ifdef USE_OPENAL
|
||||
int SND_DeviceManager::m_device_type = snd_e_openaldevice;
|
||||
#else
|
||||
int SND_DeviceManager::m_device_type = snd_e_dummydevice;
|
||||
#endif
|
||||
|
||||
void SND_DeviceManager::Subscribe()
|
||||
{
|
||||
++m_subscriptions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_DeviceManager::Unsubscribe()
|
||||
{
|
||||
--m_subscriptions;
|
||||
|
||||
// only release memory if there is a m_instance but no subscriptions left
|
||||
if (m_subscriptions == 0 && m_instance)
|
||||
{
|
||||
delete m_instance;
|
||||
m_instance = NULL;
|
||||
}
|
||||
|
||||
if (m_subscriptions < 0)
|
||||
m_subscriptions = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_IAudioDevice* SND_DeviceManager::Instance()
|
||||
{
|
||||
// only give away an instance if there are subscriptions
|
||||
if (m_subscriptions)
|
||||
{
|
||||
// if there's no instance yet, set and create a new one
|
||||
if (m_instance == NULL)
|
||||
{
|
||||
SetDeviceType(m_device_type);
|
||||
}
|
||||
|
||||
return m_instance;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_DeviceManager::SetDeviceType(int device_type)
|
||||
{
|
||||
// if we want to change devicetype, first delete the old one
|
||||
if (m_instance)
|
||||
{
|
||||
delete m_instance;
|
||||
m_instance = NULL;
|
||||
}
|
||||
|
||||
// let's create the chosen device
|
||||
switch (device_type)
|
||||
{
|
||||
#ifdef USE_OPENAL
|
||||
case snd_e_openaldevice:
|
||||
{
|
||||
m_instance = new SND_OpenALDevice();
|
||||
m_device_type = device_type;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
m_instance = new SND_DummyDevice();
|
||||
m_device_type = device_type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* SND_IdObject.cpp
|
||||
*
|
||||
* Object for storing runtime data, like id's, soundobjects etc
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_IdObject.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
SND_IdObject::SND_IdObject()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_IdObject::~SND_IdObject()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_SoundObject* SND_IdObject::GetSoundObject()
|
||||
{
|
||||
return m_soundObject;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_IdObject::SetSoundObject(SND_SoundObject* pObject)
|
||||
{
|
||||
m_soundObject = pObject;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_IdObject::GetId()
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_IdObject::SetId(int id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* SND_IdObject.h
|
||||
*
|
||||
* Object for storing runtime data, like id's, soundobjects etc
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __SND_IDOBJECT_H
|
||||
#define __SND_IDOBJECT_H
|
||||
|
||||
#include "SND_SoundObject.h"
|
||||
#include "GEN_List.h"
|
||||
#include "SoundDefines.h"
|
||||
|
||||
class SND_IdObject : public GEN_Link
|
||||
{
|
||||
SND_SoundObject* m_soundObject;
|
||||
int m_id;
|
||||
|
||||
public:
|
||||
SND_IdObject();
|
||||
virtual ~SND_IdObject();
|
||||
|
||||
SND_SoundObject* GetSoundObject();
|
||||
void SetSoundObject(SND_SoundObject* pObject);
|
||||
|
||||
int GetId();
|
||||
void SetId(int id);
|
||||
};
|
||||
|
||||
#endif //__SND_OBJECT_H
|
||||
|
@ -1,544 +0,0 @@
|
||||
/*
|
||||
* SND_Scene.cpp
|
||||
*
|
||||
* The scene for sounds.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
|
||||
#endif //WIN32
|
||||
|
||||
#include "SND_Scene.h"
|
||||
#include "SND_DependKludge.h"
|
||||
#include "SND_IAudioDevice.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
|
||||
//static unsigned int tijd = 0;
|
||||
|
||||
SND_Scene::SND_Scene(SND_IAudioDevice* audiodevice)
|
||||
: m_audiodevice(audiodevice)
|
||||
{
|
||||
if (m_audiodevice)
|
||||
m_wavecache = m_audiodevice->GetWaveCache();
|
||||
|
||||
if (!m_wavecache || !audiodevice)
|
||||
{
|
||||
m_audio = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//if so, go ahead!
|
||||
m_audio = true;
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_Scene::SND_Scene() m_audio == true\n");
|
||||
#endif
|
||||
m_audiodevice->InitListener();
|
||||
}
|
||||
|
||||
IsPlaybackWanted();
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_Scene::~SND_Scene()
|
||||
{
|
||||
StopAllObjects();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// check if audioplayback is wanted
|
||||
bool SND_Scene::IsPlaybackWanted()
|
||||
{
|
||||
/* Removed the functionality for checking if noaudio was provided on */
|
||||
/* the commandline. */
|
||||
if (m_audiodevice && m_wavecache)
|
||||
{
|
||||
m_audioplayback = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
StopAllObjects();
|
||||
m_audioplayback = false;
|
||||
}
|
||||
|
||||
return m_audioplayback;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_Scene::LoadSample(const STR_String& samplename,
|
||||
void* memlocation,
|
||||
int size)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
if (m_audiodevice)
|
||||
{
|
||||
SND_WaveSlot* waveslot = m_audiodevice->LoadSample(samplename, memlocation, size);
|
||||
|
||||
if (waveslot)
|
||||
result = waveslot->GetBuffer();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::RemoveAllSamples()
|
||||
{
|
||||
if (m_audio && m_audiodevice)
|
||||
m_audiodevice->RemoveAllSamples();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_Scene::CheckBuffer(SND_SoundObject* pObject)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (pObject && m_wavecache)
|
||||
{
|
||||
SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(pObject->GetSampleName());
|
||||
|
||||
if (waveslot)
|
||||
{
|
||||
pObject->SetBuffer(waveslot->GetBuffer());
|
||||
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_Scene::IsSampleLoaded(STR_String& samplename)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (samplename && m_wavecache)
|
||||
{
|
||||
SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(samplename);
|
||||
|
||||
if (waveslot && waveslot->IsLoaded())
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::AddObject(SND_SoundObject* pObject)
|
||||
{
|
||||
if (m_audio)
|
||||
{
|
||||
STR_String samplename = pObject->GetSampleName();
|
||||
SND_WaveSlot* slot = NULL;
|
||||
|
||||
// don't add the object if no valid sample is referenced
|
||||
if (samplename != "")
|
||||
{
|
||||
// check if the sample is already loaded
|
||||
slot = m_wavecache->GetWaveSlot(samplename);
|
||||
}
|
||||
|
||||
if (slot)
|
||||
{
|
||||
pObject->SetBuffer(slot->GetBuffer());
|
||||
|
||||
// needed for expected lifespan of the sample, but ain't necesary anymore i think
|
||||
MT_Scalar samplelength = slot->GetNumberOfSamples();
|
||||
MT_Scalar samplerate = slot->GetSampleRate();
|
||||
MT_Scalar soundlength = samplelength/samplerate;
|
||||
pObject->SetLength(soundlength);
|
||||
|
||||
// add the object to the list
|
||||
m_soundobjects.insert((SND_SoundObject*)pObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::SetListenerTransform(const MT_Vector3& pos,
|
||||
const MT_Vector3& vel,
|
||||
const MT_Matrix3x3& ori)
|
||||
{
|
||||
if (m_audio)
|
||||
{
|
||||
GetListener()->SetPosition(pos);
|
||||
GetListener()->SetVelocity(vel);
|
||||
GetListener()->SetOrientation(ori);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::UpdateListener()
|
||||
{
|
||||
// process the listener if modified
|
||||
if (m_listener.IsModified())
|
||||
{
|
||||
m_audiodevice->SetListenerGain(m_listener.GetGain());
|
||||
m_audiodevice->SetDopplerVelocity(m_listener.GetDopplerVelocity());
|
||||
m_audiodevice->SetDopplerFactor(m_listener.GetDopplerFactor());
|
||||
m_listener.SetModified(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime)
|
||||
{
|
||||
if (m_audio)
|
||||
{
|
||||
if (pObject)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_Scene::AddActiveObject\n");
|
||||
#endif
|
||||
|
||||
// first check if the object is already on the list
|
||||
if (pObject->IsActive())
|
||||
{
|
||||
pObject->SetTimeStamp(curtime);
|
||||
pObject->StartSound();
|
||||
}
|
||||
else
|
||||
{
|
||||
pObject->SetTimeStamp(curtime);
|
||||
|
||||
// compute the expected lifespan
|
||||
pObject->SetLifeSpan();
|
||||
|
||||
// lets give the new active-to-be object an id
|
||||
if (m_audiodevice->GetNewId(pObject))
|
||||
{
|
||||
// and add the object
|
||||
m_activeobjects.addTail(pObject);
|
||||
pObject->StartSound();
|
||||
pObject->SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::RemoveActiveObject(SND_SoundObject* pObject)
|
||||
{
|
||||
if (m_audio)
|
||||
{
|
||||
if (pObject)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_Scene::RemoveActiveObject\n");
|
||||
#endif
|
||||
// if inactive, remove it from the list
|
||||
if (pObject->IsActive())
|
||||
{
|
||||
// first make sure it is stopped
|
||||
m_audiodevice->ClearId(pObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::UpdateActiveObects()
|
||||
{
|
||||
// ++tijd;
|
||||
|
||||
SND_SoundObject* pObject;
|
||||
// update only the objects that need to be updated
|
||||
for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
|
||||
!pObject->isTail();
|
||||
pObject = (SND_SoundObject*)pObject->getNext())
|
||||
{
|
||||
int id = pObject->GetId();
|
||||
|
||||
if (id >= 0)
|
||||
{
|
||||
if (pObject->Is3D())
|
||||
{
|
||||
// Get the global positions and velocity vectors
|
||||
// of the listener and soundobject
|
||||
MT_Vector3 op = pObject->GetPosition();
|
||||
MT_Vector3 lp = m_listener.GetPosition();
|
||||
MT_Vector3 position = op - lp;
|
||||
|
||||
// Calculate relative velocity in global coordinates
|
||||
// of the sound with respect to the listener.
|
||||
MT_Vector3 ov = pObject->GetVelocity();
|
||||
MT_Vector3 lv = m_listener.GetVelocity();
|
||||
MT_Vector3 velocity = ov - lv;
|
||||
|
||||
// Now map the object position and velocity into
|
||||
// the local coordinates of the listener.
|
||||
MT_Matrix3x3 lo = m_listener.GetOrientation();
|
||||
|
||||
MT_Vector3 local_sound_pos = position * lo;
|
||||
MT_Vector3 local_sound_vel = velocity * lo;
|
||||
|
||||
m_audiodevice->SetObjectTransform(
|
||||
id,
|
||||
local_sound_pos,
|
||||
local_sound_vel,
|
||||
pObject->GetOrientation(), // make relative to listener!
|
||||
lp,
|
||||
pObject->GetRollOffFactor());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_audiodevice->ObjectIs2D(id);
|
||||
}
|
||||
|
||||
// update the situation
|
||||
if (pObject->IsModified())
|
||||
{
|
||||
m_audiodevice->SetObjectPitch(id, pObject->GetPitch());
|
||||
m_audiodevice->SetObjectGain(id, pObject->GetGain());
|
||||
m_audiodevice->SetObjectMinGain(id, pObject->GetMinGain());
|
||||
m_audiodevice->SetObjectMaxGain(id, pObject->GetMaxGain());
|
||||
m_audiodevice->SetObjectReferenceDistance(id, pObject->GetReferenceDistance());
|
||||
m_audiodevice->SetObjectRollOffFactor(id, pObject->GetRollOffFactor());
|
||||
m_audiodevice->SetObjectLoop(id, pObject->GetLoopMode());
|
||||
m_audiodevice->SetObjectLoopPoints(id, pObject->GetLoopStart(), pObject->GetLoopEnd());
|
||||
pObject->SetModified(false);
|
||||
}
|
||||
|
||||
pObject->AddRunning();
|
||||
|
||||
#ifdef ONTKEVER
|
||||
STR_String naam = pObject->GetObjectName();
|
||||
STR_String sample = pObject->GetSampleName();
|
||||
|
||||
int id = pObject->GetId();
|
||||
int buffer = pObject->GetBuffer();
|
||||
|
||||
float gain = pObject->GetGain();
|
||||
float pitch = pObject->GetPitch();
|
||||
float timestamp = pObject->GetTimestamp();
|
||||
|
||||
printf("naam: %s, sample: %s \n", naam.Ptr(), sample.Ptr());
|
||||
printf("id: %d, buffer: %d \n", id, buffer);
|
||||
printf("gain: %f, pitch: %f, ts: %f \n\n", gain, pitch, timestamp);
|
||||
#endif
|
||||
#ifdef USE_OPENAL
|
||||
// ok, properties Set. now see if it must play
|
||||
switch (pObject->GetPlaystate()){
|
||||
case SND_MUST_PLAY:
|
||||
m_audiodevice->PlayObject(id);
|
||||
pObject->SetPlaystate(SND_PLAYING);
|
||||
break;
|
||||
case SND_MUST_STOP:
|
||||
RemoveActiveObject(pObject);
|
||||
break;
|
||||
case SND_MUST_PAUSE:
|
||||
m_audiodevice->PauseObject(id);
|
||||
pObject->SetPlaystate(SND_PAUSED);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// check to see if the sound is still playing
|
||||
// if not: release its id
|
||||
int playstate = m_audiodevice->GetPlayState(id);
|
||||
#ifdef ONTKEVER
|
||||
if (playstate != 2)
|
||||
printf("%d - ",playstate);
|
||||
#endif
|
||||
|
||||
if ((playstate == SND_STOPPED) && !pObject->GetLoopMode())
|
||||
{
|
||||
RemoveActiveObject(pObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::UpdateCD()
|
||||
{
|
||||
if (m_audiodevice)
|
||||
{
|
||||
SND_CDObject* pCD = SND_CDObject::Instance();
|
||||
|
||||
if (pCD)
|
||||
{
|
||||
int playstate = pCD->GetPlaystate();
|
||||
|
||||
switch (playstate)
|
||||
{
|
||||
case SND_MUST_PLAY:
|
||||
{
|
||||
// initialize the cd only when you need it
|
||||
m_audiodevice->SetCDGain(pCD->GetGain());
|
||||
m_audiodevice->SetCDPlaymode(pCD->GetPlaymode());
|
||||
m_audiodevice->PlayCD(pCD->GetTrack());
|
||||
pCD->SetPlaystate(SND_PLAYING);
|
||||
pCD->SetUsed();
|
||||
break;
|
||||
}
|
||||
case SND_MUST_PAUSE:
|
||||
{
|
||||
m_audiodevice->PauseCD(true);
|
||||
pCD->SetPlaystate(SND_PAUSED);
|
||||
break;
|
||||
}
|
||||
case SND_MUST_RESUME:
|
||||
{
|
||||
m_audiodevice->PauseCD(false);
|
||||
pCD->SetPlaystate(SND_PLAYING);
|
||||
break;
|
||||
}
|
||||
case SND_MUST_STOP:
|
||||
{
|
||||
m_audiodevice->StopCD();
|
||||
pCD->SetPlaystate(SND_STOPPED);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// this one is only for realtime modifying settings
|
||||
if (pCD->IsModified())
|
||||
{
|
||||
m_audiodevice->SetCDGain(pCD->GetGain());
|
||||
pCD->SetModified(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::Proceed()
|
||||
{
|
||||
if (m_audio && m_audioplayback)
|
||||
{
|
||||
m_audiodevice->MakeCurrent();
|
||||
|
||||
UpdateListener();
|
||||
UpdateActiveObects();
|
||||
UpdateCD();
|
||||
|
||||
// m_audiodevice->UpdateDevice();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SND_Scene::DeleteObject(SND_SoundObject* pObject)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_Scene::DeleteObject\n");
|
||||
#endif
|
||||
|
||||
if (pObject)
|
||||
{
|
||||
if (m_audiodevice)
|
||||
m_audiodevice->ClearId(pObject);
|
||||
|
||||
// must remove object from m_activeList
|
||||
std::set<SND_SoundObject*>::iterator set_it;
|
||||
set_it = m_soundobjects.find(pObject);
|
||||
|
||||
if (set_it != m_soundobjects.end())
|
||||
m_soundobjects.erase(set_it);
|
||||
|
||||
// release the memory
|
||||
delete pObject;
|
||||
pObject = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::RemoveAllObjects()
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_Scene::RemoveAllObjects\n");
|
||||
#endif
|
||||
|
||||
StopAllObjects();
|
||||
|
||||
std::set<SND_SoundObject*>::iterator it = m_soundobjects.begin();
|
||||
|
||||
while (it != m_soundobjects.end())
|
||||
{
|
||||
delete (*it);
|
||||
it++;
|
||||
}
|
||||
|
||||
m_soundobjects.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_Scene::StopAllObjects()
|
||||
{
|
||||
if (m_audio)
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("SND_Scene::StopAllObjects\n");
|
||||
#endif
|
||||
|
||||
SND_SoundObject* pObject;
|
||||
|
||||
for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
|
||||
!pObject->isTail();
|
||||
pObject = (SND_SoundObject*)pObject->getNext())
|
||||
{
|
||||
m_audiodevice->ClearId(pObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_SoundListener* SND_Scene::GetListener()
|
||||
{
|
||||
return &m_listener;
|
||||
}
|
@ -1,185 +0,0 @@
|
||||
/*
|
||||
* SND_SoundListener.cpp
|
||||
*
|
||||
* A SoundListener is for sound what a camera is for vision.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_SoundListener.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
SND_SoundListener::SND_SoundListener()
|
||||
{
|
||||
m_modified = true;
|
||||
m_gain = 1.0;
|
||||
m_dopplerfactor = 1.0;
|
||||
m_dopplervelocity = 1.0;
|
||||
m_scale = 1.0;
|
||||
m_position[0] = 0.0;
|
||||
m_position[1] = 0.0;
|
||||
m_position[2] = 0.0;
|
||||
m_velocity[0] = 0.0;
|
||||
m_velocity[1] = 0.0;
|
||||
m_velocity[2] = 0.0;
|
||||
m_orientation[0][0] = 1.0;
|
||||
m_orientation[0][1] = 0.0;
|
||||
m_orientation[0][2] = 0.0;
|
||||
m_orientation[1][0] = 0.0;
|
||||
m_orientation[1][1] = 1.0;
|
||||
m_orientation[1][2] = 0.0;
|
||||
m_orientation[2][0] = 0.0;
|
||||
m_orientation[2][1] = 0.0;
|
||||
m_orientation[2][2] = 1.0;
|
||||
}
|
||||
|
||||
|
||||
SND_SoundListener::~SND_SoundListener()
|
||||
{
|
||||
; /* intentionally empty */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetGain(MT_Scalar gain)
|
||||
{
|
||||
m_gain = gain;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetPosition (const MT_Vector3& pos)
|
||||
{
|
||||
m_position = pos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetVelocity(const MT_Vector3& vel)
|
||||
{
|
||||
m_velocity = vel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetOrientation(const MT_Matrix3x3& ori)
|
||||
{
|
||||
m_orientation = ori;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetDopplerFactor(MT_Scalar dopplerfactor)
|
||||
{
|
||||
m_dopplerfactor = dopplerfactor;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetDopplerVelocity(MT_Scalar dopplervelocity)
|
||||
{
|
||||
m_dopplervelocity = dopplervelocity;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetScale(MT_Scalar scale)
|
||||
{
|
||||
m_scale = scale;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundListener::GetGain() const
|
||||
{
|
||||
return m_gain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Vector3 SND_SoundListener::GetPosition() const
|
||||
{
|
||||
return m_position;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Vector3 SND_SoundListener::GetVelocity() const
|
||||
{
|
||||
return m_velocity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Matrix3x3 SND_SoundListener::GetOrientation()
|
||||
{
|
||||
return m_orientation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundListener::GetDopplerFactor() const
|
||||
{
|
||||
return m_dopplerfactor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundListener::GetDopplerVelocity() const
|
||||
{
|
||||
return m_dopplervelocity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundListener::GetScale() const
|
||||
{
|
||||
return m_scale;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_SoundListener::IsModified() const
|
||||
{
|
||||
return m_modified;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundListener::SetModified(bool modified)
|
||||
{
|
||||
m_modified = modified;
|
||||
}
|
@ -1,508 +0,0 @@
|
||||
/*
|
||||
* SND_SoundObject.cpp
|
||||
*
|
||||
* Implementation of the abstract sound object
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_SoundObject.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
SND_SoundObject::SND_SoundObject()// : m_modified(true)
|
||||
{
|
||||
m_samplename = "";
|
||||
m_length = 0;
|
||||
m_buffer = 0;
|
||||
|
||||
m_gain = 0.0;
|
||||
m_pitch = 1.0;
|
||||
|
||||
m_mingain = 0.0;
|
||||
m_maxgain = 1.0;
|
||||
m_rollofffactor = 1.0;
|
||||
m_referencedistance = 1.0;
|
||||
|
||||
m_position[0] = 0.0;
|
||||
m_position[1] = 0.0;
|
||||
m_position[2] = 0.0;
|
||||
m_velocity[0] = 0.0;
|
||||
m_velocity[1] = 0.0;
|
||||
m_velocity[2] = 0.0;
|
||||
m_orientation[0][0] = 1.0;
|
||||
m_orientation[0][1] = 0.0;
|
||||
m_orientation[0][2] = 0.0;
|
||||
m_orientation[1][0] = 0.0;
|
||||
m_orientation[1][1] = 1.0;
|
||||
m_orientation[1][2] = 0.0;
|
||||
m_orientation[2][0] = 0.0;
|
||||
m_orientation[2][1] = 0.0;
|
||||
m_orientation[2][2] = 1.0;
|
||||
|
||||
m_loopstart = 0;
|
||||
m_loopend = 0;
|
||||
m_loopmode = SND_LOOP_NORMAL;
|
||||
m_is3d = true;
|
||||
m_playstate = SND_INITIAL;
|
||||
m_active = false;
|
||||
m_id = -1;
|
||||
m_lifespan = 0;
|
||||
m_timestamp = 0;
|
||||
m_modified = true;
|
||||
m_running = 0;
|
||||
m_highpriority = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_SoundObject::~SND_SoundObject()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::StartSound()
|
||||
{
|
||||
if (m_id >= 0)
|
||||
m_playstate = SND_MUST_PLAY;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::StopSound()
|
||||
{
|
||||
if (m_id >= 0)
|
||||
m_playstate = SND_MUST_STOP;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::PauseSound()
|
||||
{
|
||||
if (m_id >= 0)
|
||||
m_playstate = SND_MUST_PAUSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::DeleteWhenFinished()
|
||||
{
|
||||
m_playstate = SND_MUST_BE_DELETED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetGain(MT_Scalar gain)
|
||||
{
|
||||
m_gain = gain;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetMinGain(MT_Scalar mingain)
|
||||
{
|
||||
m_mingain = mingain;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetMaxGain(MT_Scalar maxgain)
|
||||
{
|
||||
m_maxgain = maxgain;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetRollOffFactor(MT_Scalar rollofffactor)
|
||||
{
|
||||
m_rollofffactor = rollofffactor;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetReferenceDistance(MT_Scalar referencedistance)
|
||||
{
|
||||
m_referencedistance = referencedistance;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetPitch(MT_Scalar pitch)
|
||||
{
|
||||
m_pitch = pitch;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetLoopMode(unsigned int loopmode)
|
||||
{
|
||||
m_loopmode = loopmode;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetLoopStart(unsigned int loopstart)
|
||||
{
|
||||
m_loopstart = loopstart;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetLoopEnd(unsigned int loopend)
|
||||
{
|
||||
m_loopend = loopend;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::Set3D(bool threedee)
|
||||
{
|
||||
m_is3d = threedee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetLifeSpan()
|
||||
{
|
||||
m_lifespan = m_length / m_pitch;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_SoundObject::IsLifeSpanOver(MT_Scalar curtime) const
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if ((curtime - m_timestamp) > m_lifespan)
|
||||
result = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetActive(bool active)
|
||||
{
|
||||
m_active = active;
|
||||
|
||||
if (!active)
|
||||
{
|
||||
m_playstate = SND_STOPPED;
|
||||
(this)->remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetBuffer(unsigned int buffer)
|
||||
{
|
||||
m_buffer = buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetObjectName(STR_String objectname)
|
||||
{
|
||||
m_objectname = objectname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetSampleName(STR_String samplename)
|
||||
{
|
||||
m_samplename = samplename;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetLength(MT_Scalar length)
|
||||
{
|
||||
m_length = length;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetPosition(const MT_Vector3& pos)
|
||||
{
|
||||
m_position = pos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetVelocity(const MT_Vector3& vel)
|
||||
{
|
||||
m_velocity = vel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetOrientation(const MT_Matrix3x3& orient)
|
||||
{
|
||||
m_orientation = orient;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetPlaystate(int playstate)
|
||||
{
|
||||
m_playstate = playstate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetId(int id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetTimeStamp(MT_Scalar timestamp)
|
||||
{
|
||||
m_timestamp = timestamp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetHighPriority(bool priority)
|
||||
{
|
||||
m_highpriority = priority;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_SoundObject::IsHighPriority() const
|
||||
{
|
||||
return m_highpriority;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_SoundObject::IsActive()const
|
||||
{
|
||||
return m_active;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_SoundObject::GetId()const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetLifeSpan()const
|
||||
{
|
||||
return m_lifespan;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetTimestamp()const
|
||||
{
|
||||
return m_timestamp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_SoundObject::GetBuffer()
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const STR_String& SND_SoundObject::GetSampleName()
|
||||
{
|
||||
return m_samplename;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const STR_String& SND_SoundObject::GetObjectName()
|
||||
{
|
||||
return m_objectname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetLength() const
|
||||
{
|
||||
return m_length;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetGain() const
|
||||
{
|
||||
return m_gain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetPitch() const
|
||||
{
|
||||
return m_pitch;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetMinGain() const
|
||||
{
|
||||
return m_mingain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetMaxGain() const
|
||||
{
|
||||
return m_maxgain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetRollOffFactor() const
|
||||
{
|
||||
return m_rollofffactor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Scalar SND_SoundObject::GetReferenceDistance() const
|
||||
{
|
||||
return m_referencedistance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Vector3 SND_SoundObject::GetPosition() const
|
||||
{
|
||||
return m_position;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Vector3 SND_SoundObject::GetVelocity() const
|
||||
{
|
||||
return m_velocity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MT_Matrix3x3 SND_SoundObject::GetOrientation() const
|
||||
{
|
||||
return m_orientation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_SoundObject::GetLoopMode() const
|
||||
{
|
||||
return m_loopmode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_SoundObject::GetLoopStart() const
|
||||
{
|
||||
return m_loopstart;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_SoundObject::GetLoopEnd() const
|
||||
{
|
||||
return m_loopend;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_SoundObject::Is3D() const
|
||||
{
|
||||
return m_is3d;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SND_SoundObject::GetPlaystate() const
|
||||
{
|
||||
return m_playstate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_SoundObject::IsModified() const
|
||||
{
|
||||
return m_modified;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::SetModified(bool modified)
|
||||
{
|
||||
m_modified = modified;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::InitRunning()
|
||||
{
|
||||
m_running = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_SoundObject::IsRunning() const
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (m_running > 100)
|
||||
result = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_SoundObject::AddRunning()
|
||||
{
|
||||
++m_running;
|
||||
}
|
@ -1,424 +0,0 @@
|
||||
/*
|
||||
* SND_Utils.cpp
|
||||
*
|
||||
* Util functions for soundthingies
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_Utils.h"
|
||||
#include "SoundDefines.h"
|
||||
#include "SND_DependKludge.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <io.h>
|
||||
#define open _open
|
||||
#define read _read
|
||||
#define close _close
|
||||
#define write _write
|
||||
#define lseek _lseek
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define BUFFERSIZE 32
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Begin of temporary Endian stuff.
|
||||
* I think there should be a central place to handle endian conversion but for
|
||||
* the time being it suffices. Note that the defines come from the Blender
|
||||
* source.
|
||||
*****************************************************************************/
|
||||
typedef enum
|
||||
{
|
||||
SND_endianBig = 0,
|
||||
SND_endianLittle
|
||||
} SND_TEndian;
|
||||
|
||||
#if defined(__BIG_ENDIAN__) || defined(__sparc) || defined(__sparc__)
|
||||
const SND_TEndian SND_fEndian = SND_endianBig;
|
||||
#else
|
||||
const SND_TEndian SND_fEndian = SND_endianLittle;
|
||||
#endif
|
||||
|
||||
/* This one swaps the bytes in a short */
|
||||
#define SWITCH_SHORT(a) { \
|
||||
char s_i, *p_i; \
|
||||
p_i= (char *)&(a); \
|
||||
s_i=p_i[0]; \
|
||||
p_i[0] = p_i[1]; \
|
||||
p_i[1] = s_i; }
|
||||
|
||||
/* This one rotates the bytes in an int */
|
||||
#define SWITCH_INT(a) { \
|
||||
char s_i, *p_i; \
|
||||
p_i= (char *)&(a); \
|
||||
s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
|
||||
s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
|
||||
/*****************************************************************************
|
||||
* End of temporary Endian stuff.
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
/* loads a file */
|
||||
void* SND_LoadSample(char *filename)
|
||||
{
|
||||
int file, filelen, buffersize = BUFFERSIZE;
|
||||
void* data = NULL;
|
||||
|
||||
#if defined(WIN32)
|
||||
file = open(filename, O_BINARY|O_RDONLY);
|
||||
#else
|
||||
file = open(filename, 0|O_RDONLY);
|
||||
#endif
|
||||
|
||||
if (file == -1)
|
||||
{
|
||||
//printf("can't open file.\n");
|
||||
//printf("press q for quit.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
filelen = lseek(file, 0, SEEK_END);
|
||||
lseek(file, 0, SEEK_SET);
|
||||
|
||||
if (filelen != 0)
|
||||
{
|
||||
data = malloc(buffersize);
|
||||
|
||||
if (read(file, data, buffersize) != buffersize)
|
||||
{
|
||||
free(data);
|
||||
data = NULL;
|
||||
}
|
||||
}
|
||||
close(file);
|
||||
|
||||
}
|
||||
return (data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_IsSampleValid(const STR_String& name, void* memlocation)
|
||||
{
|
||||
bool result = false;
|
||||
bool loadedsample = false;
|
||||
char buffer[BUFFERSIZE];
|
||||
|
||||
if (!memlocation)
|
||||
{
|
||||
STR_String samplename = name;
|
||||
memlocation = SND_LoadSample(samplename.Ptr());
|
||||
|
||||
if (memlocation)
|
||||
loadedsample = true;
|
||||
}
|
||||
|
||||
if (memlocation)
|
||||
{
|
||||
memcpy(&buffer, memlocation, BUFFERSIZE);
|
||||
|
||||
if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
|
||||
{
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
short shortbuf = *((short *) &buffer[20]);
|
||||
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(shortbuf);
|
||||
|
||||
if (shortbuf == SND_WAVE_FORMAT_PCM)
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
if (loadedsample)
|
||||
{
|
||||
free(memlocation);
|
||||
memlocation = NULL;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* checks if the passed pointer is a valid sample */
|
||||
static bool CheckSample(void* sample)
|
||||
{
|
||||
bool valid = false;
|
||||
char buffer[32];
|
||||
|
||||
memcpy(buffer, sample, 16);
|
||||
|
||||
if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* gets the type of the sample (0 == unknown, 1 == PCM etc */
|
||||
unsigned int SND_GetSampleFormat(void* sample)
|
||||
{
|
||||
short sampletype = 0;
|
||||
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&sampletype, ((char*)sample) + 20, 2);
|
||||
}
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(sampletype);
|
||||
|
||||
return (unsigned int)sampletype;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* gets the number of channels in a sample */
|
||||
unsigned int SND_GetNumberOfChannels(void* sample)
|
||||
{
|
||||
short numberofchannels = 0;
|
||||
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&numberofchannels, ((char*)sample) + 22, 2);
|
||||
}
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(numberofchannels);
|
||||
|
||||
return (unsigned int)numberofchannels;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* gets the samplerate of a sample */
|
||||
unsigned int SND_GetSampleRate(void* sample)
|
||||
{
|
||||
unsigned int samplerate = 0;
|
||||
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&samplerate, ((char*)sample) + 24, 4);
|
||||
}
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
if (SND_fEndian == SND_endianBig) SWITCH_INT(samplerate);
|
||||
|
||||
return samplerate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* gets the bitrate of a sample */
|
||||
unsigned int SND_GetBitRate(void* sample)
|
||||
{
|
||||
short bitrate = 0;
|
||||
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&bitrate, ((char*)sample) + 34, 2);
|
||||
}
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
if (SND_fEndian == SND_endianBig) SWITCH_SHORT(bitrate);
|
||||
|
||||
return (unsigned int)bitrate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* gets the length of the actual sample data (without the header) */
|
||||
unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length)
|
||||
{
|
||||
unsigned int chunklength, length = 0, offset;
|
||||
unsigned short block_align;
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&chunklength, ((char*)sample) + 16, 4);
|
||||
memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */
|
||||
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
if (SND_fEndian == SND_endianBig)
|
||||
{
|
||||
SWITCH_INT(chunklength);
|
||||
SWITCH_SHORT(block_align);
|
||||
}
|
||||
|
||||
offset = 16 + chunklength + 4;
|
||||
|
||||
/* This seems very unsafe, what if data is never found (f.i. corrupt file)... */
|
||||
// lets find "data"
|
||||
while (memcmp(((char*)sample) + offset, "data", 4))
|
||||
{
|
||||
offset += block_align;
|
||||
|
||||
if (offset+block_align > sample_length) /* save us from crashing */
|
||||
return 0;
|
||||
}
|
||||
offset += 4;
|
||||
memcpy(&length, ((char*)sample) + offset, 4);
|
||||
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
if (SND_fEndian == SND_endianBig) SWITCH_INT(length);
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* gets the size of the entire header (file - sampledata) */
|
||||
unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length)
|
||||
{
|
||||
unsigned int chunklength, headersize = 0, offset = 16;
|
||||
unsigned short block_align;
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&chunklength, ((char*)sample) + offset, 4);
|
||||
memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */
|
||||
|
||||
/* This was endian unsafe. See top of the file for the define. */
|
||||
if (SND_fEndian == SND_endianBig)
|
||||
{
|
||||
SWITCH_INT(chunklength);
|
||||
SWITCH_SHORT(block_align);
|
||||
}
|
||||
offset = offset + chunklength + 4;
|
||||
|
||||
// lets find "data"
|
||||
while (memcmp(((char*)sample) + offset, "data", 4))
|
||||
{
|
||||
offset += block_align;
|
||||
|
||||
if (offset+block_align > sample_length) /* save us from crashing */
|
||||
return 0;
|
||||
}
|
||||
headersize = offset + 8;
|
||||
}
|
||||
|
||||
return headersize;
|
||||
}
|
||||
|
||||
|
||||
unsigned int SND_GetExtraChunk(void* sample)
|
||||
{
|
||||
unsigned int extrachunk = 0, chunklength, offset = 16;
|
||||
char data[4];
|
||||
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&chunklength, ((char*)sample) + offset, 4);
|
||||
offset = offset + chunklength + 4;
|
||||
memcpy(data, ((char*)sample) + offset, 4);
|
||||
|
||||
// lets find "cue"
|
||||
while (memcmp(data, "cue", 3))
|
||||
{
|
||||
offset += 4;
|
||||
memcpy(data, ((char*)sample) + offset, 4);
|
||||
}
|
||||
}
|
||||
|
||||
return extrachunk;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot)
|
||||
{
|
||||
WavFileHeader fileheader;
|
||||
WavFmtHeader fmtheader;
|
||||
WavFmtExHeader fmtexheader;
|
||||
WavSampleHeader sampleheader;
|
||||
WavChunkHeader chunkheader;
|
||||
|
||||
if (CheckSample(sample))
|
||||
{
|
||||
memcpy(&fileheader, sample, sizeof(WavFileHeader));
|
||||
fileheader.size = SND_GetHeaderSize(sample, waveslot->GetFileSize());
|
||||
if (fileheader.size) { /* this may fail for corrupt files */
|
||||
sample += sizeof(WavFileHeader);
|
||||
fileheader.size = ((fileheader.size+1) & ~1) - 4;
|
||||
|
||||
while ((fileheader.size > 0) && (memcpy(&chunkheader, sample, sizeof(WavChunkHeader))))
|
||||
{
|
||||
sample += sizeof(WavChunkHeader);
|
||||
if (!memcmp(chunkheader.id, "fmt ", 4))
|
||||
{
|
||||
memcpy(&fmtheader, sample, sizeof(WavFmtHeader));
|
||||
waveslot->SetSampleFormat(fmtheader.format);
|
||||
|
||||
if (fmtheader.format == 0x0001)
|
||||
{
|
||||
waveslot->SetNumberOfChannels(fmtheader.numberofchannels);
|
||||
waveslot->SetBitRate(fmtheader.bitrate);
|
||||
waveslot->SetSampleRate(fmtheader.samplerate);
|
||||
sample += chunkheader.size;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(&fmtexheader, sample, sizeof(WavFmtExHeader));
|
||||
sample += chunkheader.size;
|
||||
}
|
||||
}
|
||||
else if (!memcmp(chunkheader.id, "data", 4))
|
||||
{
|
||||
if (fmtheader.format == 0x0001)
|
||||
{
|
||||
waveslot->SetNumberOfSamples(chunkheader.size);
|
||||
sample += chunkheader.size;
|
||||
}
|
||||
else if (fmtheader.format == 0x0011)
|
||||
{
|
||||
//IMA ADPCM
|
||||
}
|
||||
else if (fmtheader.format == 0x0055)
|
||||
{
|
||||
//MP3 WAVE
|
||||
}
|
||||
}
|
||||
else if (!memcmp(chunkheader.id, "smpl", 4))
|
||||
{
|
||||
memcpy(&sampleheader, sample, sizeof(WavSampleHeader));
|
||||
//loop = sampleheader.loops;
|
||||
sample += chunkheader.size;
|
||||
}
|
||||
else
|
||||
sample += chunkheader.size;
|
||||
|
||||
sample += chunkheader.size & 1;
|
||||
fileheader.size -= (((chunkheader.size + 1) & ~1) + 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
/*
|
||||
* SND_WaveCache.cpp
|
||||
*
|
||||
* abstract wavecache, a way to organize samples
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
|
||||
#endif //WIN32
|
||||
|
||||
#include "SND_WaveCache.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
# include <sys/malloc.h>
|
||||
#else
|
||||
# ifdef __FreeBSD__
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
SND_WaveCache::SND_WaveCache()
|
||||
{
|
||||
// do the buffer administration
|
||||
for (int i = 0; i < NUM_BUFFERS; i++)
|
||||
m_bufferList[i] = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_WaveCache::~SND_WaveCache()
|
||||
{
|
||||
// clean up the mess
|
||||
FreeSamples();
|
||||
RemoveAllSamples();
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_WaveSlot* SND_WaveCache::GetWaveSlot(const STR_String& samplename)
|
||||
{
|
||||
SND_WaveSlot* waveslot = NULL;
|
||||
|
||||
std::map<STR_String, SND_WaveSlot*>::iterator find_result = m_samplecache.find(samplename);
|
||||
|
||||
// let's see if we have already loaded this sample
|
||||
if (find_result != m_samplecache.end())
|
||||
{
|
||||
waveslot = (*find_result).second;
|
||||
}
|
||||
else
|
||||
{
|
||||
// so the sample wasn't loaded, so do it here
|
||||
for (int bufnum = 0; bufnum < NUM_BUFFERS; bufnum++)
|
||||
{
|
||||
// find an empty buffer
|
||||
if (m_bufferList[bufnum] == NULL)
|
||||
{
|
||||
waveslot = new SND_WaveSlot();
|
||||
waveslot->SetSampleName(samplename);
|
||||
waveslot->SetBuffer(bufnum);
|
||||
m_bufferList[bufnum] = waveslot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_samplecache.insert(std::pair<STR_String, SND_WaveSlot*>(samplename, waveslot));
|
||||
}
|
||||
|
||||
return waveslot;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveCache::RemoveAllSamples()
|
||||
{
|
||||
// remove all samples
|
||||
m_samplecache.clear();
|
||||
|
||||
// reset the list of buffers
|
||||
for (int i = 0; i < NUM_BUFFERS; i++)
|
||||
m_bufferList[i] = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveCache::RemoveSample(const STR_String& samplename, int buffer)
|
||||
{
|
||||
m_samplecache.erase(samplename);
|
||||
m_bufferList[buffer] = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveCache::FreeSamples()
|
||||
{
|
||||
// iterate through the bufferlist and delete the waveslot if present
|
||||
for (int i = 0; i < NUM_BUFFERS; i++)
|
||||
{
|
||||
if (m_bufferList[i])
|
||||
{
|
||||
delete m_bufferList[i];
|
||||
m_bufferList[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,180 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "SND_WaveSlot.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
SND_WaveSlot::~SND_WaveSlot()
|
||||
{
|
||||
#ifdef ONTKEVER
|
||||
printf("neeeeeee...\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetSampleName(STR_String samplename)
|
||||
{
|
||||
m_samplename = samplename;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetLoaded(bool loaded)
|
||||
{
|
||||
m_loaded = loaded;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetData(void* data)
|
||||
{
|
||||
m_data = data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetBuffer(unsigned int buffer)
|
||||
{
|
||||
m_buffer = buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetSampleFormat(unsigned int sampleformat)
|
||||
{
|
||||
m_sampleformat = sampleformat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetNumberOfChannels(unsigned int numberofchannels)
|
||||
{
|
||||
m_numberofchannels = numberofchannels;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetSampleRate(unsigned int samplerate)
|
||||
{
|
||||
m_samplerate = samplerate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetBitRate(unsigned int bitrate)
|
||||
{
|
||||
m_bitrate = bitrate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetNumberOfSamples(unsigned int numberofsamples)
|
||||
{
|
||||
m_numberofsamples = numberofsamples;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_WaveSlot::SetFileSize(unsigned int filesize)
|
||||
{
|
||||
m_filesize = filesize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const STR_String& SND_WaveSlot::GetSampleName()
|
||||
{
|
||||
return m_samplename;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SND_WaveSlot::IsLoaded() const
|
||||
{
|
||||
return m_loaded;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void* SND_WaveSlot::GetData()
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_WaveSlot::GetBuffer() const
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_WaveSlot::GetSampleFormat() const
|
||||
{
|
||||
return m_sampleformat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_WaveSlot::GetNumberOfChannels() const
|
||||
{
|
||||
return m_numberofchannels;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_WaveSlot::GetSampleRate() const
|
||||
{
|
||||
return m_samplerate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_WaveSlot::GetBitRate() const
|
||||
{
|
||||
return m_bitrate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_WaveSlot::GetNumberOfSamples() const
|
||||
{
|
||||
return m_numberofsamples;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned int SND_WaveSlot::GetFileSize() const
|
||||
{
|
||||
return m_filesize;
|
||||
}
|
@ -1,206 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="SoundSystem" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=SoundSystem - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "SoundSystem.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "SoundSystem.mak" CFG="SoundSystem - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "SoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "SoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "SoundSystem - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\..\obj\windows\intern\soundsystem"
|
||||
# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem"
|
||||
# PROP Target_Dir ""
|
||||
LINK32=link.exe -lib
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\..\obj\windows\intern\soundsystem\libSoundSystem.lib"
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\*.a ECHO Done
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "SoundSystem - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "SoundSystem___Win32_Debug"
|
||||
# PROP BASE Intermediate_Dir "SoundSystem___Win32_Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug"
|
||||
# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug"
|
||||
# PROP Target_Dir ""
|
||||
LINK32=link.exe -lib
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\..\obj\windows\intern\soundsystem\debug\libSoundSystem.lib"
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\debug\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\debug\*.a ECHO Done
|
||||
# End Special Build Tool
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "SoundSystem - Win32 Release"
|
||||
# Name "SoundSystem - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_AudioDevice.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\intern\SND_C-api.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_CDObject.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_DeviceManager.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_IdObject.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_Scene.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_SoundListener.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_SoundObject.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_Utils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_WaveCache.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_WaveSlot.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_AudioDevice.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\SND_C-api.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_CDObject.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_DependKludge.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_DeviceManager.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_IAudioDevice.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\intern\SND_IdObject.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_Object.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_Scene.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_SoundListener.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_SoundObject.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_Utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_WaveCache.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SND_WaveSlot.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\SoundDefines.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -1,103 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="DummySoundSystem" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=DummySoundSystem - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DummySoundSystem.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DummySoundSystem.mak" CFG="DummySoundSystem - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DummySoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "DummySoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "DummySoundSystem - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy"
|
||||
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy"
|
||||
# PROP Target_Dir ""
|
||||
LINK32=link.exe -lib
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\libDummySoundSystem.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "DummySoundSystem - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug"
|
||||
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug"
|
||||
# PROP Target_Dir ""
|
||||
LINK32=link.exe -lib
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug\libDummySoundSystem.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "DummySoundSystem - Win32 Release"
|
||||
# Name "DummySoundSystem - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\dummy\SND_DummyDevice.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\dummy\SND_DummyDevice.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -1,106 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="OpenALSoundSystem" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=OpenALSoundSystem - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "OpenALSoundSystem.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "OpenALSoundSystem.mak" CFG="OpenALSoundSystem - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "OpenALSoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "OpenALSoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "OpenALSoundSystem - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal"
|
||||
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal"
|
||||
# PROP Target_Dir ""
|
||||
LINK32=link.exe -lib
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\openal\include" /I "..\..\..\..\..\..\lib\windows\sdl\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\libOpenALSoundSystem.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "OpenALSoundSystem - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "OpenALSoundSystem___Win32_Debug"
|
||||
# PROP BASE Intermediate_Dir "OpenALSoundSystem___Win32_Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug"
|
||||
# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug"
|
||||
# PROP Target_Dir ""
|
||||
LINK32=link.exe -lib
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\sdl\include" /I "..\..\..\..\..\..\lib\windows\openal\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug\libOpenALSoundSystem.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "OpenALSoundSystem - Win32 Release"
|
||||
# Name "OpenALSoundSystem - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\openal\SND_OpenALDevice.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\sdl\SND_SDLCDDevice.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\openal\SND_OpenALDevice.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -1,339 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="SoundSystem"
|
||||
ProjectGUID="{98330220-47A6-42E0-9DE4-AD0FF5D204D6}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\debug\libSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library (debug target) to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\libSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library (debug target) to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_AudioDevice.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_C-api.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_CDObject.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_DeviceManager.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_IdObject.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_Scene.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_SoundListener.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_SoundObject.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_Utils.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_WaveCache.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_WaveSlot.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_AudioDevice.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_C-api.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_CDObject.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_DependKludge.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_DeviceManager.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_IAudioDevice.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_IdObject.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_Object.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_Scene.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_SoundListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_SoundObject.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_Utils.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_WaveCache.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_WaveSlot.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SoundDefines.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,243 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="DummySoundSystem"
|
||||
ProjectGUID="{FAF46346-65CC-4DB2-85C4-B99826F79D0C}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\debug\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\..\dummy\SND_DummyDevice.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\..\dummy\SND_DummyDevice.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,249 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="OpenALSoundSystem"
|
||||
ProjectGUID="{213356A9-3A1F-41DA-9819-1297BCD17DEE}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\debug\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\..\openal\SND_OpenALDevice.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\sdl\SND_SDLCDDevice.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\..\openal\SND_OpenALDevice.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\sdl\SND_SDLCDDevice.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,447 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="INT_SoundSystem"
|
||||
ProjectGUID="{98330220-47A6-42E0-9DE4-AD0FF5D204D6}"
|
||||
RootNamespace="SoundSystem"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\debug\libSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library (debug target) to lib tree."
|
||||
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
ECHO Done
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\libSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library to lib tree."
|
||||
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
ECHO Done
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library to lib tree."
|
||||
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
ECHO Done
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\SoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying SND SoundSystem files library (debug target) to lib tree."
|
||||
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include
ECHO Done
"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_AudioDevice.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_C-api.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_CDObject.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_DeviceManager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_IdObject.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_Scene.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_SoundListener.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_SoundObject.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_Utils.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_WaveCache.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_WaveSlot.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_AudioDevice.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_C-api.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_CDObject.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_DependKludge.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_DeviceManager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_IAudioDevice.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\SND_IdObject.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_Object.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_Scene.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_SoundListener.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_SoundObject.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_Utils.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_WaveCache.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SND_WaveSlot.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\SoundDefines.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,343 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="INT_DummySoundSystem"
|
||||
ProjectGUID="{FAF46346-65CC-4DB2-85C4-B99826F79D0C}"
|
||||
RootNamespace="DummySoundSystem"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\debug\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
|
||||
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\DummySoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libDummySoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\dummy\SND_DummyDevice.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\dummy\SND_DummyDevice.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,351 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="INT_OpenALSoundSystem"
|
||||
ProjectGUID="{213356A9-3A1F-41DA-9819-1297BCD17DEE}"
|
||||
RootNamespace="OpenALSoundSystem"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\debug\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="3DPlugin Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\OpenALSoundSystem.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
|
||||
ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
|
||||
WarningLevel="2"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libOpenALSoundSystem.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\openal\SND_OpenALDevice.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\sdl\SND_SDLCDDevice.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\openal\SND_OpenALDevice.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\sdl\SND_SDLCDDevice.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,864 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
* SND_OpenALDevice derived from SND_IAudioDevice
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
|
||||
#endif //WIN32
|
||||
|
||||
#include "SND_OpenALDevice.h"
|
||||
#ifndef __APPLE__
|
||||
#include "SND_SDLCDDevice.h"
|
||||
#endif
|
||||
#include "SoundDefines.h"
|
||||
|
||||
#include "SND_Utils.h"
|
||||
|
||||
#ifdef APPLE_FRAMEWORK_FIX
|
||||
#include <al.h>
|
||||
#include <alc.h>
|
||||
#else
|
||||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if defined(WIN32)
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
/*************************** ALUT replacement *****************************/
|
||||
|
||||
/* instead of relying on alut, we just implement our own
|
||||
* WAV loading functions, hopefully more reliable */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct /* WAV File-header */
|
||||
{
|
||||
ALubyte Id[4];
|
||||
ALsizei Size;
|
||||
ALubyte Type[4];
|
||||
} WAVFileHdr_Struct;
|
||||
|
||||
typedef struct /* WAV Fmt-header */
|
||||
{
|
||||
ALushort Format;
|
||||
ALushort Channels;
|
||||
ALuint SamplesPerSec;
|
||||
ALuint BytesPerSec;
|
||||
ALushort BlockAlign;
|
||||
ALushort BitsPerSample;
|
||||
} WAVFmtHdr_Struct;
|
||||
|
||||
typedef struct /* WAV FmtEx-header */
|
||||
{
|
||||
ALushort Size;
|
||||
ALushort SamplesPerBlock;
|
||||
} WAVFmtExHdr_Struct;
|
||||
|
||||
typedef struct /* WAV Smpl-header */
|
||||
{
|
||||
ALuint Manufacturer;
|
||||
ALuint Product;
|
||||
ALuint SamplePeriod;
|
||||
ALuint Note;
|
||||
ALuint FineTune;
|
||||
ALuint SMPTEFormat;
|
||||
ALuint SMPTEOffest;
|
||||
ALuint Loops;
|
||||
ALuint SamplerData;
|
||||
struct
|
||||
{
|
||||
ALuint Identifier;
|
||||
ALuint Type;
|
||||
ALuint Start;
|
||||
ALuint End;
|
||||
ALuint Fraction;
|
||||
ALuint Count;
|
||||
} Loop[1];
|
||||
} WAVSmplHdr_Struct;
|
||||
|
||||
typedef struct /* WAV Chunk-header */
|
||||
{
|
||||
ALubyte Id[4];
|
||||
ALuint Size;
|
||||
} WAVChunkHdr_Struct;
|
||||
|
||||
static void *SND_loadFileIntoMemory(const char *filename, int *len_r)
|
||||
{
|
||||
FILE *fp= fopen(filename, "rb");
|
||||
void *data;
|
||||
|
||||
if (!fp) {
|
||||
*len_r= -1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
*len_r= ftell(fp);
|
||||
fseek(fp, 0L, SEEK_SET);
|
||||
|
||||
data= malloc(*len_r);
|
||||
if (!data) {
|
||||
*len_r= -1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fread(data, *len_r, 1, fp)!=1) {
|
||||
*len_r= -1;
|
||||
free(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#define TEST_SWITCH_INT(a) if(big_endian) { \
|
||||
char s_i, *p_i; \
|
||||
p_i= (char *)&(a); \
|
||||
s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
|
||||
s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
|
||||
|
||||
#define TEST_SWITCH_SHORT(a) if(big_endian) { \
|
||||
char s_i, *p_i; \
|
||||
p_i= (char *)&(a); \
|
||||
s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; }
|
||||
|
||||
static int stream_read(void *out, ALbyte **stream, ALsizei size, ALsizei *memsize)
|
||||
{
|
||||
if(size <= *memsize) {
|
||||
memcpy(out, *stream, size);
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
memset(out, 0, size);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int stream_skip(ALbyte **stream, ALsizei size, ALsizei *memsize)
|
||||
{
|
||||
if(size <= *memsize) {
|
||||
*stream += size;
|
||||
*memsize -= size;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
ALvoid SND_alutLoadWAVMemory(ALbyte *memory,ALsizei memsize,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop)
|
||||
{
|
||||
WAVChunkHdr_Struct ChunkHdr;
|
||||
WAVFmtExHdr_Struct FmtExHdr;
|
||||
WAVFileHdr_Struct FileHdr;
|
||||
WAVSmplHdr_Struct SmplHdr;
|
||||
WAVFmtHdr_Struct FmtHdr;
|
||||
ALbyte *Stream= memory;
|
||||
int test_endian= 1;
|
||||
int big_endian= !((char*)&test_endian)[0];
|
||||
|
||||
*format=AL_FORMAT_MONO16;
|
||||
*data=NULL;
|
||||
*size=0;
|
||||
*freq=22050;
|
||||
*loop=AL_FALSE;
|
||||
|
||||
if(!Stream)
|
||||
return;
|
||||
|
||||
stream_read(&FileHdr,&Stream,sizeof(WAVFileHdr_Struct),&memsize);
|
||||
stream_skip(&Stream,sizeof(WAVFileHdr_Struct),&memsize);
|
||||
|
||||
TEST_SWITCH_INT(FileHdr.Size);
|
||||
FileHdr.Size=((FileHdr.Size+1)&~1)-4;
|
||||
|
||||
while((FileHdr.Size!=0) && stream_read(&ChunkHdr,&Stream,sizeof(WAVChunkHdr_Struct),&memsize))
|
||||
{
|
||||
TEST_SWITCH_INT(ChunkHdr.Size);
|
||||
stream_skip(&Stream,sizeof(WAVChunkHdr_Struct),&memsize);
|
||||
|
||||
if (!memcmp(ChunkHdr.Id,"fmt ",4))
|
||||
{
|
||||
stream_read(&FmtHdr,&Stream,sizeof(WAVFmtHdr_Struct),&memsize);
|
||||
|
||||
TEST_SWITCH_SHORT(FmtHdr.Format);
|
||||
TEST_SWITCH_SHORT(FmtHdr.Channels);
|
||||
TEST_SWITCH_INT(FmtHdr.SamplesPerSec);
|
||||
TEST_SWITCH_INT(FmtHdr.BytesPerSec);
|
||||
TEST_SWITCH_SHORT(FmtHdr.BlockAlign);
|
||||
TEST_SWITCH_SHORT(FmtHdr.BitsPerSample);
|
||||
|
||||
if (FmtHdr.Format==0x0001)
|
||||
{
|
||||
*format=(FmtHdr.Channels==1?
|
||||
(FmtHdr.BitsPerSample==8?AL_FORMAT_MONO8:AL_FORMAT_MONO16):
|
||||
(FmtHdr.BitsPerSample==8?AL_FORMAT_STEREO8:AL_FORMAT_STEREO16));
|
||||
*freq=FmtHdr.SamplesPerSec;
|
||||
}
|
||||
else
|
||||
{
|
||||
stream_read(&FmtExHdr,&Stream,sizeof(WAVFmtExHdr_Struct),&memsize);
|
||||
TEST_SWITCH_SHORT(FmtExHdr.Size);
|
||||
TEST_SWITCH_SHORT(FmtExHdr.SamplesPerBlock);
|
||||
}
|
||||
}
|
||||
else if (!memcmp(ChunkHdr.Id,"data",4))
|
||||
{
|
||||
if (FmtHdr.Format==0x0001)
|
||||
{
|
||||
if((ALsizei)ChunkHdr.Size <= memsize)
|
||||
{
|
||||
*size=ChunkHdr.Size;
|
||||
*data=malloc(ChunkHdr.Size+31);
|
||||
|
||||
if (*data) {
|
||||
stream_read(*data,&Stream,ChunkHdr.Size,&memsize);
|
||||
memset(((char *)*data)+ChunkHdr.Size,0,31);
|
||||
|
||||
if(FmtHdr.BitsPerSample == 16 && big_endian) {
|
||||
int a, len= *size/2;
|
||||
short *samples= (short*)*data;
|
||||
|
||||
for(a=0; a<len; a++) {
|
||||
TEST_SWITCH_SHORT(samples[a])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (FmtHdr.Format==0x0011)
|
||||
{
|
||||
//IMA ADPCM
|
||||
}
|
||||
else if (FmtHdr.Format==0x0055)
|
||||
{
|
||||
//MP3 WAVE
|
||||
}
|
||||
}
|
||||
else if (!memcmp(ChunkHdr.Id,"smpl",4))
|
||||
{
|
||||
stream_read(&SmplHdr,&Stream,sizeof(WAVSmplHdr_Struct),&memsize);
|
||||
|
||||
TEST_SWITCH_INT(SmplHdr.Manufacturer);
|
||||
TEST_SWITCH_INT(SmplHdr.Product);
|
||||
TEST_SWITCH_INT(SmplHdr.SamplePeriod);
|
||||
TEST_SWITCH_INT(SmplHdr.Note);
|
||||
TEST_SWITCH_INT(SmplHdr.FineTune);
|
||||
TEST_SWITCH_INT(SmplHdr.SMPTEFormat);
|
||||
TEST_SWITCH_INT(SmplHdr.SMPTEOffest);
|
||||
TEST_SWITCH_INT(SmplHdr.Loops);
|
||||
TEST_SWITCH_INT(SmplHdr.SamplerData);
|
||||
|
||||
*loop = (SmplHdr.Loops ? AL_TRUE : AL_FALSE);
|
||||
}
|
||||
|
||||
if(!stream_skip(&Stream, ChunkHdr.Size + (ChunkHdr.Size&1), &memsize))
|
||||
break;
|
||||
|
||||
FileHdr.Size-=(((ChunkHdr.Size+1)&~1)+8);
|
||||
}
|
||||
}
|
||||
|
||||
ALvoid SND_alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq)
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
}
|
||||
|
||||
/************************ Device Implementation ****************************/
|
||||
|
||||
SND_OpenALDevice::SND_OpenALDevice()
|
||||
: SND_AudioDevice(),
|
||||
m_context(NULL),
|
||||
m_device(NULL)
|
||||
{
|
||||
/* Removed the functionality for checking if noaudio was provided on */
|
||||
/* the commandline. */
|
||||
m_audio = true;
|
||||
m_context = NULL;
|
||||
m_buffersinitialized = false;
|
||||
m_sourcesinitialized = false;
|
||||
|
||||
// let's check if we can get openal to initialize...
|
||||
if (m_audio)
|
||||
{
|
||||
m_audio = false;
|
||||
|
||||
ALCdevice *dev = alcOpenDevice(NULL);
|
||||
if (dev) {
|
||||
m_context = alcCreateContext(dev, NULL);
|
||||
|
||||
if (m_context) {
|
||||
#ifdef AL_VERSION_1_1
|
||||
alcMakeContextCurrent((ALCcontext*)m_context);
|
||||
#else
|
||||
alcMakeContextCurrent(m_context);
|
||||
#endif
|
||||
m_audio = true;
|
||||
m_device = dev;
|
||||
#ifdef __linux__
|
||||
/*
|
||||
* SIGHUP Hack:
|
||||
*
|
||||
* On Linux, alcDestroyContext generates a SIGHUP (Hangup) when killing the OpenAL
|
||||
* mixer thread, which kills Blender.
|
||||
*
|
||||
* So we set the signal to ignore....
|
||||
*
|
||||
* TODO: check if this applies to other platforms.
|
||||
*
|
||||
*/
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// then try to generate some buffers
|
||||
if (m_audio)
|
||||
{
|
||||
// let openal generate its buffers
|
||||
alGenBuffers(NUM_BUFFERS, m_buffers);
|
||||
m_buffersinitialized = true;
|
||||
|
||||
for (int i = 0; i < NUM_BUFFERS; i++)
|
||||
{
|
||||
if (!alIsBuffer(m_buffers[i]))
|
||||
{
|
||||
//printf("\n\n WARNING: OpenAL returned with an error. Continuing without audio.\n\n");
|
||||
m_audio = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// next: the sources
|
||||
if (m_audio)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
ALenum alc_error = ALC_NO_ERROR; // openal_2.12
|
||||
#elif defined(_WIN32)
|
||||
// alcGetError has no arguments on windows
|
||||
ALenum alc_error = alcGetError(); // openal_2.14+
|
||||
#else
|
||||
ALenum alc_error = alcGetError(NULL); // openal_2.14+
|
||||
#endif
|
||||
|
||||
// let openal generate its sources
|
||||
if (alc_error == ALC_NO_ERROR)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0;i<NUM_SOURCES;i++)
|
||||
m_sources[i] = 0;
|
||||
alGenSources(NUM_SOURCES, m_sources);
|
||||
m_sourcesinitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
// let's get us a wavecache
|
||||
if (m_audio)
|
||||
{
|
||||
m_wavecache = new SND_WaveCache();
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
m_cdrom = new SND_SDLCDDevice();
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_OpenALDevice::UseCD(void) const
|
||||
{
|
||||
// we use SDL for CD, so we create the system
|
||||
SND_CDObject::CreateSystem();
|
||||
|
||||
}
|
||||
|
||||
void SND_OpenALDevice::MakeCurrent() const
|
||||
{
|
||||
#ifdef WIN32
|
||||
alcMakeContextCurrent(m_context);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
SND_OpenALDevice::~SND_OpenALDevice()
|
||||
{
|
||||
MakeCurrent();
|
||||
|
||||
if (m_sourcesinitialized)
|
||||
{
|
||||
for (int i = 0; i < NUM_SOURCES; i++)
|
||||
alSourceStop(m_sources[i]);
|
||||
|
||||
alDeleteSources(NUM_SOURCES, m_sources);
|
||||
m_sourcesinitialized = false;
|
||||
}
|
||||
|
||||
if (m_buffersinitialized)
|
||||
{
|
||||
alDeleteBuffers(NUM_BUFFERS, m_buffers);
|
||||
m_buffersinitialized = false;
|
||||
}
|
||||
|
||||
if (m_context) {
|
||||
MakeCurrent();
|
||||
#ifdef AL_VERSION_1_1
|
||||
alcDestroyContext((ALCcontext*)m_context);
|
||||
#else
|
||||
alcDestroyContext(m_context);
|
||||
#endif
|
||||
m_context = NULL;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
// restore the signal state above.
|
||||
signal(SIGHUP, SIG_DFL);
|
||||
#endif
|
||||
// let's see if we used the cd. if not, just leave it alone
|
||||
SND_CDObject* pCD = SND_CDObject::Instance();
|
||||
|
||||
if (pCD)
|
||||
{
|
||||
this->StopCD();
|
||||
SND_CDObject::DisposeSystem();
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
if (m_cdrom)
|
||||
delete m_cdrom;
|
||||
#endif
|
||||
if (m_device)
|
||||
alcCloseDevice((ALCdevice*) m_device);
|
||||
}
|
||||
|
||||
|
||||
SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
|
||||
void* memlocation,
|
||||
int size)
|
||||
{
|
||||
SND_WaveSlot* waveslot = NULL;
|
||||
STR_String samplename = name;
|
||||
|
||||
if (m_audio)
|
||||
{
|
||||
/* create the waveslot */
|
||||
waveslot = m_wavecache->GetWaveSlot(samplename);
|
||||
|
||||
/* do we support this sample? */
|
||||
if (SND_IsSampleValid(name, memlocation))
|
||||
{
|
||||
if (waveslot)
|
||||
{
|
||||
bool freemem = false;
|
||||
int buffer = waveslot->GetBuffer();
|
||||
void* data = NULL;
|
||||
char loop = 'a';
|
||||
int sampleformat, bitrate, numberofchannels;
|
||||
ALenum al_error = alGetError();
|
||||
ALsizei samplerate, numberofsamples; // openal_2.14+
|
||||
|
||||
/* Give them some safe defaults just incase */
|
||||
bitrate = numberofchannels = 0;
|
||||
|
||||
if (!(size && memlocation)) {
|
||||
memlocation = SND_loadFileIntoMemory(samplename.Ptr(), &size);
|
||||
freemem = true;
|
||||
}
|
||||
|
||||
/* load the sample from memory? */
|
||||
if (size && memlocation)
|
||||
{
|
||||
waveslot->SetFileSize(size);
|
||||
|
||||
/* what was (our) buffer? */
|
||||
int buffer = waveslot->GetBuffer();
|
||||
|
||||
/* get some info out of the sample */
|
||||
SND_GetSampleInfo((signed char*)memlocation, waveslot);
|
||||
numberofchannels = SND_GetNumberOfChannels(memlocation);
|
||||
bitrate = SND_GetBitRate(memlocation);
|
||||
|
||||
/* load the sample into openal */
|
||||
SND_alutLoadWAVMemory((ALbyte*)memlocation, size, &sampleformat, &data, &numberofsamples, &samplerate, &loop);
|
||||
/* put it in the buffer */
|
||||
alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
|
||||
}
|
||||
|
||||
if(freemem)
|
||||
free(memlocation);
|
||||
|
||||
/* fill the waveslot with info */
|
||||
al_error = alGetError();
|
||||
if (al_error == AL_NO_ERROR && m_buffers[buffer])
|
||||
{
|
||||
waveslot->SetData(data);
|
||||
waveslot->SetSampleFormat(sampleformat);
|
||||
waveslot->SetNumberOfChannels(numberofchannels);
|
||||
waveslot->SetSampleRate(samplerate);
|
||||
waveslot->SetBitRate(bitrate);
|
||||
waveslot->SetNumberOfSamples(numberofsamples);
|
||||
|
||||
/* if the loading succeeded, mark the waveslot */
|
||||
waveslot->SetLoaded(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* or when it failed, free the waveslot */
|
||||
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
|
||||
waveslot = NULL;
|
||||
}
|
||||
|
||||
/* and free the original stuff (copy was made in openal) */
|
||||
SND_alutUnloadWAV(sampleformat, data, numberofsamples, samplerate);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* sample not supported, remove waveslot */
|
||||
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
|
||||
waveslot = NULL;
|
||||
}
|
||||
}
|
||||
return waveslot;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// listener's and general stuff //////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
/* sets the global dopplervelocity */
|
||||
void SND_OpenALDevice::SetDopplerVelocity(MT_Scalar dopplervelocity) const
|
||||
{
|
||||
alDopplerVelocity ((float)dopplervelocity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* sets the global dopplerfactor */
|
||||
void SND_OpenALDevice::SetDopplerFactor(MT_Scalar dopplerfactor) const
|
||||
{
|
||||
alDopplerFactor ((float)dopplerfactor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* sets the global rolloff factor */
|
||||
void SND_OpenALDevice::SetListenerRollOffFactor(MT_Scalar rollofffactor) const
|
||||
{
|
||||
// not implemented in openal
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_OpenALDevice::NextFrame() const
|
||||
{
|
||||
// CD
|
||||
#ifndef __APPLE__
|
||||
m_cdrom->NextFrame();
|
||||
#endif
|
||||
// not needed by openal
|
||||
}
|
||||
|
||||
|
||||
|
||||
// set the gain for the listener
|
||||
void SND_OpenALDevice::SetListenerGain(float gain) const
|
||||
{
|
||||
alListenerf (AL_GAIN, gain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_OpenALDevice::InitListener()
|
||||
{
|
||||
// initialize the listener with these values that won't change
|
||||
// (as long as we can have only one listener)
|
||||
// now we can superimpose all listeners on each other (for they
|
||||
// have the same settings)
|
||||
float lispos[3] = {0,0,0};
|
||||
float lisvel[3] = {0,0,0};
|
||||
#ifdef WIN32
|
||||
float lisori[6] = {0,1,0,0,0,1};
|
||||
#else
|
||||
float lisori[6] = {0,0,1,0,-1,0};
|
||||
#endif
|
||||
|
||||
alListenerfv(AL_POSITION, lispos);
|
||||
alListenerfv(AL_VELOCITY, lisvel);
|
||||
alListenerfv(AL_ORIENTATION, lisori);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// source playstate stuff ////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
/* sets the buffer */
|
||||
void SND_OpenALDevice::SetObjectBuffer(int id, unsigned int buffer)
|
||||
{
|
||||
alSourcei (m_sources[id], AL_BUFFER, m_buffers[buffer]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// check if the sound's still playing
|
||||
int SND_OpenALDevice::GetPlayState(int id)
|
||||
{
|
||||
int alstate = 0;
|
||||
int result = 0;
|
||||
|
||||
#ifdef __APPLE__
|
||||
alGetSourcei(m_sources[id], AL_SOURCE_STATE, &alstate);
|
||||
#else
|
||||
alGetSourceiv(m_sources[id], AL_SOURCE_STATE, &alstate);
|
||||
#endif
|
||||
|
||||
switch(alstate)
|
||||
{
|
||||
case AL_INITIAL:
|
||||
{
|
||||
result = SND_INITIAL;
|
||||
break;
|
||||
}
|
||||
case AL_PLAYING:
|
||||
{
|
||||
result = SND_PLAYING;
|
||||
break;
|
||||
}
|
||||
case AL_PAUSED:
|
||||
{
|
||||
result = SND_PAUSED;
|
||||
break;
|
||||
}
|
||||
case AL_STOPPED:
|
||||
{
|
||||
result = SND_STOPPED;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
result = SND_UNKNOWN;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// make the source play
|
||||
void SND_OpenALDevice::PlayObject(int id)
|
||||
{
|
||||
alSourcePlay(m_sources[id]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// make the source stop
|
||||
void SND_OpenALDevice::StopObject(int id) const
|
||||
{
|
||||
float obpos[3] = {0,0,0};
|
||||
float obvel[3] = {0,0,0};
|
||||
|
||||
alSourcefv(m_sources[id], AL_POSITION, obpos);
|
||||
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
|
||||
|
||||
alSourcef(m_sources[id], AL_GAIN, 1.0);
|
||||
alSourcef(m_sources[id], AL_PITCH, 1.0);
|
||||
alSourcei(m_sources[id], AL_LOOPING, AL_FALSE);
|
||||
alSourceStop(m_sources[id]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// stop all sources
|
||||
void SND_OpenALDevice::StopAllObjects()
|
||||
{
|
||||
alSourceStopv(NUM_SOURCES, m_sources);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// pause the source
|
||||
void SND_OpenALDevice::PauseObject(int id) const
|
||||
{
|
||||
alSourcePause(m_sources[id]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// source properties stuff ////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
// give openal the object's pitch
|
||||
void SND_OpenALDevice::SetObjectPitch(int id, MT_Scalar pitch) const
|
||||
{
|
||||
alSourcef (m_sources[id], AL_PITCH, (float)pitch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// give openal the object's gain
|
||||
void SND_OpenALDevice::SetObjectGain(int id, MT_Scalar gain) const
|
||||
{
|
||||
alSourcef (m_sources[id], AL_GAIN, (float)gain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// give openal the object's looping
|
||||
void SND_OpenALDevice::SetObjectLoop(int id, unsigned int loopmode) const
|
||||
{
|
||||
if (loopmode == SND_LOOP_OFF)
|
||||
{
|
||||
//printf("%d - ", id);
|
||||
alSourcei (m_sources[id], AL_LOOPING, AL_FALSE);
|
||||
}
|
||||
else
|
||||
alSourcei (m_sources[id], AL_LOOPING, AL_TRUE);
|
||||
}
|
||||
|
||||
void SND_OpenALDevice::SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SND_OpenALDevice::SetObjectMinGain(int id, MT_Scalar mingain) const
|
||||
{
|
||||
alSourcef (m_sources[id], AL_MIN_GAIN, (float)mingain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_OpenALDevice::SetObjectMaxGain(int id, MT_Scalar maxgain) const
|
||||
{
|
||||
alSourcef (m_sources[id], AL_MAX_GAIN, (float)maxgain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_OpenALDevice::SetObjectRollOffFactor(int id, MT_Scalar rollofffactor) const
|
||||
{
|
||||
alSourcef (m_sources[id], AL_ROLLOFF_FACTOR, (float)rollofffactor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_OpenALDevice::SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const
|
||||
{
|
||||
alSourcef (m_sources[id], AL_REFERENCE_DISTANCE, (float)referencedistance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// give openal the object's position
|
||||
void SND_OpenALDevice::ObjectIs2D(int id) const
|
||||
{
|
||||
float obpos[3] = {0,0,0};
|
||||
float obvel[3] = {0,0,0};
|
||||
|
||||
alSourcefv(m_sources[id], AL_POSITION, obpos);
|
||||
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SND_OpenALDevice::SetObjectTransform(int id,
|
||||
const MT_Vector3& position,
|
||||
const MT_Vector3& velocity,
|
||||
const MT_Matrix3x3& orientation,
|
||||
const MT_Vector3& lisposition,
|
||||
const MT_Scalar& rollofffactor) const
|
||||
{
|
||||
float obpos[3];
|
||||
float obvel[3];
|
||||
|
||||
obpos[0] = (float)position[0] * (float)rollofffactor; //x (l/r)
|
||||
obpos[1] = (float)position[1] * (float)rollofffactor;
|
||||
obpos[2] = (float)position[2] * (float)rollofffactor;
|
||||
|
||||
alSourcefv(m_sources[id], AL_POSITION, obpos);
|
||||
|
||||
velocity.getValue(obvel);
|
||||
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
|
||||
}
|
||||
|
||||
void SND_OpenALDevice::PlayCD(int track) const
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
m_cdrom->PlayCD(track);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void SND_OpenALDevice::PauseCD(bool pause) const
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
m_cdrom->PauseCD(pause);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_OpenALDevice::StopCD() const
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
SND_CDObject* pCD = SND_CDObject::Instance();
|
||||
|
||||
if (pCD && pCD->GetUsed())
|
||||
{
|
||||
m_cdrom->StopCD();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_OpenALDevice::SetCDPlaymode(int playmode) const
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
m_cdrom->SetCDPlaymode(playmode);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_OpenALDevice::SetCDGain(MT_Scalar gain) const
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
m_cdrom->SetCDGain(gain);
|
||||
#endif
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef SND_OPENALDEVICE
|
||||
#define SND_OPENALDEVICE
|
||||
|
||||
#include "SND_AudioDevice.h"
|
||||
#include "SoundDefines.h"
|
||||
|
||||
struct SDL_CD;
|
||||
|
||||
class SND_OpenALDevice : public SND_AudioDevice
|
||||
{
|
||||
public:
|
||||
SND_OpenALDevice();
|
||||
virtual ~SND_OpenALDevice();
|
||||
|
||||
SND_WaveSlot* LoadSample(const STR_String& samplename,
|
||||
void* memlocation,
|
||||
int size);
|
||||
|
||||
void InitListener();
|
||||
void SetListenerGain(float gain) const;
|
||||
void SetDopplerVelocity(MT_Scalar dopplervelocity) const;
|
||||
void SetDopplerFactor(MT_Scalar dopplerfactor) const;
|
||||
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const;
|
||||
|
||||
void MakeCurrent() const;
|
||||
|
||||
void NextFrame() const;
|
||||
void UseCD() const;
|
||||
|
||||
void SetObjectBuffer(int id, unsigned int buffer);
|
||||
|
||||
int GetPlayState(int id);
|
||||
void PlayObject(int id);
|
||||
void StopObject(int id) const;
|
||||
void StopAllObjects();
|
||||
void PauseObject(int id) const;
|
||||
|
||||
void SetObjectLoop(int id, unsigned int loopmode) const;
|
||||
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const;
|
||||
void SetObjectPitch(int id, MT_Scalar pitch) const;
|
||||
void SetObjectGain(int id, MT_Scalar gain) const;
|
||||
void SetObjectMinGain(int id, MT_Scalar mingain) const;
|
||||
void SetObjectMaxGain(int id, MT_Scalar maxgain) const;
|
||||
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const;
|
||||
void SetObjectReferenceDistance(int id, MT_Scalar distance) const;
|
||||
|
||||
void SetObjectTransform(int id,
|
||||
const MT_Vector3& position,
|
||||
const MT_Vector3& velocity,
|
||||
const MT_Matrix3x3& orientation,
|
||||
const MT_Vector3& lisposition,
|
||||
const MT_Scalar& rollofffactor) const;
|
||||
void ObjectIs2D(int id) const;
|
||||
|
||||
void PlayCD(int track) const;
|
||||
void PauseCD(bool pause) const;
|
||||
void StopCD() const;
|
||||
void SetCDPlaymode(int playmode) const;
|
||||
void SetCDGain(MT_Scalar gain) const;
|
||||
|
||||
void StartUsingDSP() {};
|
||||
float* GetSpectrum() { return NULL; }
|
||||
void StopUsingDSP() {};
|
||||
|
||||
private:
|
||||
void* m_context;
|
||||
void* m_device;
|
||||
|
||||
unsigned int m_buffers[NUM_BUFFERS];
|
||||
unsigned int m_sources[NUM_SOURCES];
|
||||
bool m_buffersinitialized;
|
||||
bool m_sourcesinitialized;
|
||||
#ifndef __APPLE__
|
||||
class SND_SDLCDDevice* m_cdrom;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif //SND_OPENALDEVICE
|
||||
|
@ -1,67 +0,0 @@
|
||||
/* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
* FreeBSD 3.4 does not yet have pthread_cancel (3.5 and above do)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
#include <osreldate.h>
|
||||
|
||||
#if (__FreeBSD_version < 350000)
|
||||
#include <pthread.h>
|
||||
|
||||
#define FD_READ 0x1
|
||||
#define _FD_LOCK(_fd,_type,_ts) _thread_fd_lock(_fd, _type, _ts)
|
||||
#define _FD_UNLOCK(_fd,_type) _thread_fd_unlock(_fd, _type)
|
||||
|
||||
int pthread_cancel(pthread_t pthread) {
|
||||
pthread_exit(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
long fpathconf(int fd, int name)
|
||||
{
|
||||
long ret;
|
||||
|
||||
if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
|
||||
ret = _thread_sys_fpathconf(fd, name);
|
||||
_FD_UNLOCK(fd, FD_READ);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int pthread_atfork(void *a, void *b, void *c) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,171 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
* SND_SDLCDDevice
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
|
||||
#endif //WIN32
|
||||
|
||||
#include "MT_Scalar.h"
|
||||
|
||||
#include "SND_SDLCDDevice.h"
|
||||
#include "SoundDefines.h"
|
||||
|
||||
#ifndef DISABLE_SDL
|
||||
#include <SDL.h>
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
SND_SDLCDDevice::SND_SDLCDDevice() :
|
||||
m_cdrom(NULL),
|
||||
m_cdplaying(false),
|
||||
m_cdtrack(0),
|
||||
m_cdplaymode(SND_CD_TRACK),
|
||||
m_frame(0)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
void SND_SDLCDDevice::init()
|
||||
{
|
||||
#ifdef DISABLE_SDL
|
||||
fprintf(stderr, "Blender compiled without SDL, no CDROM support\n");
|
||||
return;
|
||||
#else
|
||||
if (SDL_InitSubSystem(SDL_INIT_CDROM))
|
||||
{
|
||||
fprintf(stderr, "Error initializing CDROM\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for CD drives */
|
||||
if(!SDL_CDNumDrives())
|
||||
{
|
||||
/* None found */
|
||||
fprintf(stderr, "No CDROM devices available\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Open the default drive */
|
||||
m_cdrom = SDL_CDOpen(0);
|
||||
|
||||
/* Did if open? Check if cdrom is NULL */
|
||||
if(!m_cdrom)
|
||||
{
|
||||
fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SND_SDLCDDevice::~SND_SDLCDDevice()
|
||||
{
|
||||
#ifndef DISABLE_SDL
|
||||
StopCD();
|
||||
SDL_CDClose(m_cdrom);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_SDLCDDevice::NextFrame()
|
||||
{
|
||||
#ifndef DISABLE_SDL
|
||||
m_frame++;
|
||||
m_frame &= 127;
|
||||
|
||||
if (!m_frame && m_cdrom && m_cdplaying && SDL_CDStatus(m_cdrom) == CD_STOPPED)
|
||||
{
|
||||
switch (m_cdplaymode)
|
||||
{
|
||||
case SND_CD_ALL:
|
||||
if (m_cdtrack < m_cdrom->numtracks)
|
||||
PlayCD(m_cdtrack + 1);
|
||||
else
|
||||
m_cdplaying = false;
|
||||
break;
|
||||
default:
|
||||
case SND_CD_TRACK:
|
||||
m_cdplaying = false;
|
||||
break;
|
||||
case SND_CD_TRACKLOOP:
|
||||
PlayCD(m_cdtrack);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_SDLCDDevice::PlayCD(int track)
|
||||
{
|
||||
#ifndef DISABLE_SDL
|
||||
if ( m_cdrom && CD_INDRIVE(SDL_CDStatus(m_cdrom)) ) {
|
||||
SDL_CDPlayTracks(m_cdrom, track-1, 0, track, 0);
|
||||
m_cdplaying = true;
|
||||
m_cdtrack = track;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void SND_SDLCDDevice::PauseCD(bool pause)
|
||||
{
|
||||
#ifndef DISABLE_SDL
|
||||
if (!m_cdrom)
|
||||
return;
|
||||
|
||||
if (pause)
|
||||
SDL_CDPause(m_cdrom);
|
||||
else
|
||||
SDL_CDResume(m_cdrom);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_SDLCDDevice::StopCD()
|
||||
{
|
||||
#ifndef DISABLE_SDL
|
||||
if (m_cdrom)
|
||||
SDL_CDStop(m_cdrom);
|
||||
m_cdplaying = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void SND_SDLCDDevice::SetCDPlaymode(int playmode)
|
||||
{
|
||||
m_cdplaymode = playmode;
|
||||
}
|
||||
|
||||
void SND_SDLCDDevice::SetCDGain(MT_Scalar gain)
|
||||
{
|
||||
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef SND_SDLCDDEVICE
|
||||
#define SND_SDLCDDEVICE
|
||||
|
||||
struct SDL_CD;
|
||||
|
||||
class SND_SDLCDDevice
|
||||
{
|
||||
public:
|
||||
SND_SDLCDDevice();
|
||||
~SND_SDLCDDevice();
|
||||
|
||||
void NextFrame();
|
||||
|
||||
void PlayCD(int track);
|
||||
void PauseCD(bool pause);
|
||||
void StopCD();
|
||||
void SetCDPlaymode(int playmode);
|
||||
void SetCDGain(MT_Scalar gain);
|
||||
|
||||
private:
|
||||
void init();
|
||||
/* CD Audio */
|
||||
SDL_CD* m_cdrom;
|
||||
bool m_cdplaying;
|
||||
int m_cdtrack;
|
||||
unsigned char m_cdplaymode;
|
||||
unsigned char m_frame;
|
||||
};
|
||||
|
||||
#endif
|
58
intern/audaspace/CMakeLists.txt
Normal file
58
intern/audaspace/CMakeLists.txt
Normal file
@ -0,0 +1,58 @@
|
||||
# $Id$
|
||||
# ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
#
|
||||
# Copyright 2009 Jörg Hermann Müller
|
||||
#
|
||||
# This file is part of AudaSpace.
|
||||
#
|
||||
# AudaSpace 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# ***** END LGPL LICENSE BLOCK *****
|
||||
|
||||
SET(INC . intern FX SRC ${PTHREADS_INC} ${LIBSAMPLERATE_INC})
|
||||
|
||||
FILE(GLOB SRC intern/*.cpp intern/*.h FX/*.cpp SRC/*.cpp)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(INC ${INC} ffmpeg ${FFMPEG_INC})
|
||||
FILE(GLOB FFMPEGSRC ffmpeg/*.cpp)
|
||||
ADD_DEFINITIONS(-DWITH_FFMPEG)
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
IF(WITH_SDL)
|
||||
SET(INC ${INC} SDL ${SDL_INCLUDE_DIR})
|
||||
FILE(GLOB SDLSRC SDL/*.cpp)
|
||||
ADD_DEFINITIONS(-DWITH_SDL)
|
||||
ENDIF(WITH_SDL)
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
SET(INC ${INC} OpenAL ${OPENAL_INCLUDE_DIR})
|
||||
FILE(GLOB OPENALSRC OpenAL/*.cpp)
|
||||
ADD_DEFINITIONS(-DWITH_OPENAL)
|
||||
|
||||
STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INCLUDE_DIR})
|
||||
IF(FRAMEWORK)
|
||||
ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX)
|
||||
ENDIF(FRAMEWORK)
|
||||
ENDIF(WITH_OPENAL)
|
||||
|
||||
IF(WITH_JACK)
|
||||
SET(INC ${INC} jack ${JACK_INC})
|
||||
FILE(GLOB JACKSRC jack/*.cpp)
|
||||
ADD_DEFINITIONS(-DWITH_JACK)
|
||||
ENDIF(WITH_JACK)
|
||||
|
||||
SET(SRC ${SRC} ${FFMPEGSRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
|
||||
|
||||
BLENDERLIB(bf_audaspace "${SRC}" "${INC}")
|
674
intern/audaspace/COPYING
Normal file
674
intern/audaspace/COPYING
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
165
intern/audaspace/COPYING.LESSER
Normal file
165
intern/audaspace/COPYING.LESSER
Normal file
@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
58
intern/audaspace/FX/AUD_DelayFactory.cpp
Normal file
58
intern/audaspace/FX/AUD_DelayFactory.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_DelayFactory.h"
|
||||
#include "AUD_DelayReader.h"
|
||||
#include "AUD_Space.h"
|
||||
|
||||
AUD_DelayFactory::AUD_DelayFactory(AUD_IFactory* factory, float delay) :
|
||||
AUD_EffectFactory(factory),
|
||||
m_delay(delay) {}
|
||||
|
||||
AUD_DelayFactory::AUD_DelayFactory(float delay) :
|
||||
AUD_EffectFactory(0),
|
||||
m_delay(delay) {}
|
||||
|
||||
float AUD_DelayFactory::getDelay()
|
||||
{
|
||||
return m_delay;
|
||||
}
|
||||
|
||||
void AUD_DelayFactory::setDelay(float delay)
|
||||
{
|
||||
m_delay = delay;
|
||||
}
|
||||
|
||||
AUD_IReader* AUD_DelayFactory::createReader()
|
||||
{
|
||||
AUD_IReader* reader = getReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
reader = new AUD_DelayReader(reader, m_delay); AUD_NEW("reader")
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
70
intern/audaspace/FX/AUD_DelayFactory.h
Normal file
70
intern/audaspace/FX/AUD_DelayFactory.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_DELAYFACTORY
|
||||
#define AUD_DELAYFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory plays another factory delayed.
|
||||
*/
|
||||
class AUD_DelayFactory : public AUD_EffectFactory
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The delay in samples.
|
||||
*/
|
||||
float m_delay;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new delay factory.
|
||||
* \param factory The input factory.
|
||||
* \param delay The desired delay in seconds.
|
||||
*/
|
||||
AUD_DelayFactory(AUD_IFactory* factory = 0, float delay = 0);
|
||||
|
||||
/**
|
||||
* Creates a new delay factory.
|
||||
* \param delay The desired delay in seconds.
|
||||
*/
|
||||
AUD_DelayFactory(float delay);
|
||||
|
||||
/**
|
||||
* Returns the delay in seconds.
|
||||
*/
|
||||
float getDelay();
|
||||
|
||||
/**
|
||||
* Sets the delay.
|
||||
* \param delay The new delay value in seconds.
|
||||
*/
|
||||
void setDelay(float delay);
|
||||
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_DELAYFACTORY
|
111
intern/audaspace/FX/AUD_DelayReader.cpp
Normal file
111
intern/audaspace/FX/AUD_DelayReader.cpp
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_DelayReader.h"
|
||||
#include "AUD_Buffer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
AUD_DelayReader::AUD_DelayReader(AUD_IReader* reader, float delay) :
|
||||
AUD_EffectReader(reader)
|
||||
{
|
||||
m_delay = (int)(delay * reader->getSpecs().rate);
|
||||
m_remdelay = m_delay;
|
||||
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||
}
|
||||
|
||||
AUD_DelayReader::~AUD_DelayReader()
|
||||
{
|
||||
delete m_buffer; AUD_DELETE("buffer")
|
||||
}
|
||||
|
||||
void AUD_DelayReader::seek(int position)
|
||||
{
|
||||
if(position < 0)
|
||||
return;
|
||||
|
||||
if(position < m_delay)
|
||||
{
|
||||
m_remdelay = m_delay - position;
|
||||
m_reader->seek(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_remdelay = 0;
|
||||
m_reader->seek(position - m_delay);
|
||||
}
|
||||
}
|
||||
|
||||
int AUD_DelayReader::getLength()
|
||||
{
|
||||
int len = m_reader->getLength();
|
||||
if(len < 0)
|
||||
return len;
|
||||
return len+m_delay;
|
||||
}
|
||||
|
||||
int AUD_DelayReader::getPosition()
|
||||
{
|
||||
if(m_remdelay > 0)
|
||||
return m_delay-m_remdelay;
|
||||
return m_reader->getPosition() + m_delay;
|
||||
}
|
||||
|
||||
void AUD_DelayReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
if(m_remdelay > 0)
|
||||
{
|
||||
int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
|
||||
|
||||
if(m_buffer->getSize() < length*samplesize)
|
||||
m_buffer->resize(length*samplesize);
|
||||
|
||||
if(length > m_remdelay)
|
||||
{
|
||||
if(getSpecs().format == AUD_FORMAT_U8)
|
||||
memset(m_buffer->getBuffer(), 0x80, m_remdelay*samplesize);
|
||||
else
|
||||
memset(m_buffer->getBuffer(), 0, m_remdelay*samplesize);
|
||||
int len = length - m_remdelay;
|
||||
m_reader->read(len, buffer);
|
||||
memcpy(m_buffer->getBuffer()+m_remdelay*samplesize,
|
||||
buffer, len*samplesize);
|
||||
if(len < length-m_remdelay)
|
||||
length = m_remdelay + len;
|
||||
m_remdelay = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(getSpecs().format == AUD_FORMAT_U8)
|
||||
memset(m_buffer->getBuffer(), 0x80, length*samplesize);
|
||||
else
|
||||
memset(m_buffer->getBuffer(), 0, length*samplesize);
|
||||
m_remdelay -= length;
|
||||
}
|
||||
buffer = m_buffer->getBuffer();
|
||||
}
|
||||
else
|
||||
m_reader->read(length, buffer);
|
||||
}
|
73
intern/audaspace/FX/AUD_DelayReader.h
Normal file
73
intern/audaspace/FX/AUD_DelayReader.h
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_DELAYREADER
|
||||
#define AUD_DELAYREADER
|
||||
|
||||
#include "AUD_EffectReader.h"
|
||||
class AUD_Buffer;
|
||||
|
||||
/**
|
||||
* This class reads another reader and changes it's delay.
|
||||
*/
|
||||
class AUD_DelayReader : public AUD_EffectReader
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The playback buffer.
|
||||
*/
|
||||
AUD_Buffer *m_buffer;
|
||||
|
||||
/**
|
||||
* The delay level.
|
||||
*/
|
||||
int m_delay;
|
||||
|
||||
/**
|
||||
* The remaining delay for playback.
|
||||
*/
|
||||
int m_remdelay;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new delay reader.
|
||||
* \param reader The reader to read from.
|
||||
* \param delay The delay in seconds.
|
||||
* \exception AUD_Exception Thrown if the reader specified is NULL.
|
||||
*/
|
||||
AUD_DelayReader(AUD_IReader* reader, float delay);
|
||||
|
||||
/**
|
||||
* Destroys the reader.
|
||||
*/
|
||||
virtual ~AUD_DelayReader();
|
||||
|
||||
virtual void seek(int position);
|
||||
virtual int getLength();
|
||||
virtual int getPosition();
|
||||
virtual void read(int & length, sample_t* & buffer);
|
||||
};
|
||||
|
||||
#endif //AUD_DELAYREADER
|
158
intern/audaspace/FX/AUD_DoubleReader.cpp
Normal file
158
intern/audaspace/FX/AUD_DoubleReader.cpp
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_DoubleReader.h"
|
||||
#include "AUD_Buffer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
AUD_DoubleReader::AUD_DoubleReader(AUD_IReader* reader1,
|
||||
AUD_IReader* reader2) :
|
||||
m_reader1(reader1), m_reader2(reader2)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!reader1)
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
|
||||
if(!reader2)
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
|
||||
AUD_Specs s1, s2;
|
||||
s1 = reader1->getSpecs();
|
||||
s2 = reader2->getSpecs();
|
||||
if(memcmp(&s1, &s2, sizeof(AUD_Specs)) != 0)
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
}
|
||||
|
||||
catch(AUD_Exception e)
|
||||
{
|
||||
if(reader1)
|
||||
{
|
||||
delete reader1; AUD_DELETE("reader")
|
||||
}
|
||||
if(reader2)
|
||||
{
|
||||
delete reader2; AUD_DELETE("reader")
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||
m_finished1 = false;
|
||||
}
|
||||
|
||||
AUD_DoubleReader::~AUD_DoubleReader()
|
||||
{
|
||||
delete m_reader1; AUD_DELETE("reader")
|
||||
delete m_reader2; AUD_DELETE("reader")
|
||||
delete m_buffer; AUD_DELETE("buffer")
|
||||
}
|
||||
|
||||
bool AUD_DoubleReader::isSeekable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void AUD_DoubleReader::seek(int position)
|
||||
{
|
||||
int length1 = m_reader1->getLength();
|
||||
|
||||
if(position < 0)
|
||||
position = 0;
|
||||
|
||||
if(position < length1)
|
||||
{
|
||||
m_reader1->seek(position);
|
||||
m_reader2->seek(0);
|
||||
m_finished1 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_reader2->seek(position-length1);
|
||||
m_finished1 = true;
|
||||
}
|
||||
}
|
||||
|
||||
int AUD_DoubleReader::getLength()
|
||||
{
|
||||
int len1 = m_reader1->getLength();
|
||||
int len2 = m_reader2->getLength();
|
||||
if(len1 < 0 || len2 < 0)
|
||||
return -1;
|
||||
return len1 + len2;
|
||||
}
|
||||
|
||||
int AUD_DoubleReader::getPosition()
|
||||
{
|
||||
return m_reader1->getPosition() + m_reader2->getPosition();
|
||||
}
|
||||
|
||||
AUD_Specs AUD_DoubleReader::getSpecs()
|
||||
{
|
||||
return m_reader1->getSpecs();
|
||||
}
|
||||
|
||||
AUD_ReaderType AUD_DoubleReader::getType()
|
||||
{
|
||||
if(m_reader1->getType() == AUD_TYPE_BUFFER &&
|
||||
m_reader2->getType() == AUD_TYPE_BUFFER)
|
||||
return AUD_TYPE_BUFFER;
|
||||
return AUD_TYPE_STREAM;
|
||||
}
|
||||
|
||||
bool AUD_DoubleReader::notify(AUD_Message &message)
|
||||
{
|
||||
return m_reader1->notify(message) | m_reader2->notify(message);
|
||||
}
|
||||
|
||||
void AUD_DoubleReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
if(!m_finished1)
|
||||
{
|
||||
int len = length;
|
||||
m_reader1->read(len, buffer);
|
||||
if(len < length)
|
||||
{
|
||||
int samplesize = AUD_SAMPLE_SIZE(m_reader1->getSpecs());
|
||||
if(m_buffer->getSize() < length * samplesize)
|
||||
m_buffer->resize(length * samplesize);
|
||||
memcpy(m_buffer->getBuffer(), buffer, len*samplesize);
|
||||
len = length - len;
|
||||
length -= len;
|
||||
m_reader2->read(len, buffer);
|
||||
memcpy(m_buffer->getBuffer() + length*samplesize,
|
||||
buffer, len*samplesize);
|
||||
length += len;
|
||||
buffer = m_buffer->getBuffer();
|
||||
m_finished1 = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_reader2->read(length, buffer);
|
||||
}
|
||||
}
|
83
intern/audaspace/FX/AUD_DoubleReader.h
Normal file
83
intern/audaspace/FX/AUD_DoubleReader.h
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_DOUBLEREADER
|
||||
#define AUD_DOUBLEREADER
|
||||
|
||||
#include "AUD_IReader.h"
|
||||
class AUD_Buffer;
|
||||
|
||||
/**
|
||||
* This reader plays two readers with the same specs sequently.
|
||||
*/
|
||||
class AUD_DoubleReader : public AUD_IReader
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The first reader.
|
||||
*/
|
||||
AUD_IReader* m_reader1;
|
||||
|
||||
/**
|
||||
* The second reader.
|
||||
*/
|
||||
AUD_IReader* m_reader2;
|
||||
|
||||
/**
|
||||
* Whether we've reached the end of the first reader.
|
||||
*/
|
||||
bool m_finished1;
|
||||
|
||||
/**
|
||||
* The playback buffer for the intersecting part.
|
||||
*/
|
||||
AUD_Buffer* m_buffer;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new ping pong reader.
|
||||
* \param reader1 The first reader to read from.
|
||||
* \param reader2 The second reader to read from.
|
||||
* \exception AUD_Exception Thrown if one of the reader specified is NULL
|
||||
* or the specs from the readers differ.
|
||||
*/
|
||||
AUD_DoubleReader(AUD_IReader* reader1, AUD_IReader* reader2);
|
||||
|
||||
/**
|
||||
* Destroys the reader.
|
||||
*/
|
||||
virtual ~AUD_DoubleReader();
|
||||
|
||||
virtual bool isSeekable();
|
||||
virtual void seek(int position);
|
||||
virtual int getLength();
|
||||
virtual int getPosition();
|
||||
virtual AUD_Specs getSpecs();
|
||||
virtual AUD_ReaderType getType();
|
||||
virtual bool notify(AUD_Message &message);
|
||||
virtual void read(int & length, sample_t* & buffer);
|
||||
};
|
||||
|
||||
#endif //AUD_DOUBLEREADER
|
50
intern/audaspace/FX/AUD_EffectFactory.cpp
Normal file
50
intern/audaspace/FX/AUD_EffectFactory.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
#include "AUD_IReader.h"
|
||||
|
||||
AUD_IReader* AUD_EffectFactory::getReader()
|
||||
{
|
||||
if(m_factory != 0)
|
||||
return m_factory->createReader();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AUD_EffectFactory::AUD_EffectFactory(AUD_IFactory* factory)
|
||||
{
|
||||
m_factory = factory;
|
||||
}
|
||||
|
||||
void AUD_EffectFactory::setFactory(AUD_IFactory* factory)
|
||||
{
|
||||
m_factory = factory;
|
||||
}
|
||||
|
||||
AUD_IFactory* AUD_EffectFactory::getFactory()
|
||||
{
|
||||
return m_factory;
|
||||
}
|
76
intern/audaspace/FX/AUD_EffectFactory.h
Normal file
76
intern/audaspace/FX/AUD_EffectFactory.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_EFFECTFACTORY
|
||||
#define AUD_EFFECTFACTORY
|
||||
|
||||
#include "AUD_IFactory.h"
|
||||
|
||||
/**
|
||||
* This factory is a base class for all effect factories that take one other
|
||||
* factory as input.
|
||||
*/
|
||||
class AUD_EffectFactory : public AUD_IFactory
|
||||
{
|
||||
protected:
|
||||
/**
|
||||
* If there is no reader it is created out of this factory.
|
||||
*/
|
||||
AUD_IFactory* m_factory;
|
||||
|
||||
/**
|
||||
* Returns the reader created out of the factory.
|
||||
* This method can be used for the createReader function of the implementing
|
||||
* classes.
|
||||
* \return The reader created out of the factory or NULL if there is none.
|
||||
*/
|
||||
AUD_IReader* getReader();
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new factory.
|
||||
* \param factory The input factory.
|
||||
*/
|
||||
AUD_EffectFactory(AUD_IFactory* factory);
|
||||
|
||||
/**
|
||||
* Destroys the factory.
|
||||
*/
|
||||
virtual ~AUD_EffectFactory() {}
|
||||
|
||||
/**
|
||||
* Sets the input factory.
|
||||
* \param factory The input factory.
|
||||
*/
|
||||
void setFactory(AUD_IFactory* factory);
|
||||
|
||||
/**
|
||||
* Returns the saved factory.
|
||||
* \return The factory or NULL if there has no factory been saved.
|
||||
*/
|
||||
AUD_IFactory* getFactory();
|
||||
};
|
||||
|
||||
#endif //AUD_EFFECTFACTORY
|
78
intern/audaspace/FX/AUD_EffectReader.cpp
Normal file
78
intern/audaspace/FX/AUD_EffectReader.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_EffectReader.h"
|
||||
|
||||
AUD_EffectReader::AUD_EffectReader(AUD_IReader* reader)
|
||||
{
|
||||
if(!reader)
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
m_reader = reader;
|
||||
}
|
||||
|
||||
AUD_EffectReader::~AUD_EffectReader()
|
||||
{
|
||||
delete m_reader; AUD_DELETE("reader")
|
||||
}
|
||||
|
||||
bool AUD_EffectReader::isSeekable()
|
||||
{
|
||||
return m_reader->isSeekable();
|
||||
}
|
||||
|
||||
void AUD_EffectReader::seek(int position)
|
||||
{
|
||||
m_reader->seek(position);
|
||||
}
|
||||
|
||||
int AUD_EffectReader::getLength()
|
||||
{
|
||||
return m_reader->getLength();
|
||||
}
|
||||
|
||||
int AUD_EffectReader::getPosition()
|
||||
{
|
||||
return m_reader->getPosition();
|
||||
}
|
||||
|
||||
AUD_Specs AUD_EffectReader::getSpecs()
|
||||
{
|
||||
return m_reader->getSpecs();
|
||||
}
|
||||
|
||||
AUD_ReaderType AUD_EffectReader::getType()
|
||||
{
|
||||
return m_reader->getType();
|
||||
}
|
||||
|
||||
bool AUD_EffectReader::notify(AUD_Message &message)
|
||||
{
|
||||
return m_reader->notify(message);
|
||||
}
|
||||
|
||||
void AUD_EffectReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
m_reader->read(length, buffer);
|
||||
}
|
66
intern/audaspace/FX/AUD_EffectReader.h
Normal file
66
intern/audaspace/FX/AUD_EffectReader.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_EFFECTREADER
|
||||
#define AUD_EFFECTREADER
|
||||
|
||||
#include "AUD_IReader.h"
|
||||
|
||||
/**
|
||||
* This reader is a base class for all effect readers that take one other reader
|
||||
* as input.
|
||||
*/
|
||||
class AUD_EffectReader : public AUD_IReader
|
||||
{
|
||||
protected:
|
||||
/**
|
||||
* The reader to read from.
|
||||
*/
|
||||
AUD_IReader* m_reader;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new effect reader.
|
||||
* \param reader The reader to read from.
|
||||
* \exception AUD_Exception Thrown if the reader specified is NULL.
|
||||
*/
|
||||
AUD_EffectReader(AUD_IReader* reader);
|
||||
|
||||
/**
|
||||
* Destroys the reader.
|
||||
*/
|
||||
virtual ~AUD_EffectReader();
|
||||
|
||||
virtual bool isSeekable();
|
||||
virtual void seek(int position);
|
||||
virtual int getLength();
|
||||
virtual int getPosition();
|
||||
virtual AUD_Specs getSpecs();
|
||||
virtual AUD_ReaderType getType();
|
||||
virtual bool notify(AUD_Message &message);
|
||||
virtual void read(int & length, sample_t* & buffer);
|
||||
};
|
||||
|
||||
#endif //AUD_EFFECTREADER
|
84
intern/audaspace/FX/AUD_FaderFactory.cpp
Normal file
84
intern/audaspace/FX/AUD_FaderFactory.cpp
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_FaderFactory.h"
|
||||
#include "AUD_FaderReader.h"
|
||||
|
||||
AUD_FaderFactory::AUD_FaderFactory(AUD_IFactory* factory, AUD_FadeType type,
|
||||
float start, float length) :
|
||||
AUD_EffectFactory(factory),
|
||||
m_type(type),
|
||||
m_start(start),
|
||||
m_length(length) {}
|
||||
|
||||
AUD_FaderFactory::AUD_FaderFactory(AUD_FadeType type,
|
||||
float start, float length) :
|
||||
AUD_EffectFactory(0),
|
||||
m_type(type),
|
||||
m_start(start),
|
||||
m_length(length) {}
|
||||
|
||||
AUD_FadeType AUD_FaderFactory::getType()
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
void AUD_FaderFactory::setType(AUD_FadeType type)
|
||||
{
|
||||
m_type = type;
|
||||
}
|
||||
|
||||
float AUD_FaderFactory::getStart()
|
||||
{
|
||||
return m_start;
|
||||
}
|
||||
|
||||
void AUD_FaderFactory::setStart(float start)
|
||||
{
|
||||
m_start = start;
|
||||
}
|
||||
|
||||
float AUD_FaderFactory::getLength()
|
||||
{
|
||||
return m_length;
|
||||
}
|
||||
|
||||
void AUD_FaderFactory::setLength(float length)
|
||||
{
|
||||
m_length = length;
|
||||
}
|
||||
|
||||
AUD_IReader* AUD_FaderFactory::createReader()
|
||||
{
|
||||
AUD_IReader* reader = getReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
reader = new AUD_FaderReader(reader, m_type, m_start, m_length);
|
||||
AUD_NEW("reader")
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
111
intern/audaspace/FX/AUD_FaderFactory.h
Normal file
111
intern/audaspace/FX/AUD_FaderFactory.h
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_FADERFACTORY
|
||||
#define AUD_FADERFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory fades another factory.
|
||||
* If the fading type is AUD_FADE_IN, everything before the fading start will be
|
||||
* silenced, for AUD_FADE_OUT that's true for everything after fading ends.
|
||||
*/
|
||||
class AUD_FaderFactory : public AUD_EffectFactory
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The fading type.
|
||||
*/
|
||||
AUD_FadeType m_type;
|
||||
|
||||
/**
|
||||
* The fading start.
|
||||
*/
|
||||
float m_start;
|
||||
|
||||
/**
|
||||
* The fading length.
|
||||
*/
|
||||
float m_length;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new fader factory.
|
||||
* \param factory The input factory.
|
||||
* \param type The fading type.
|
||||
* \param start The time where fading should start in seconds.
|
||||
* \param length How long fading should last in seconds.
|
||||
*/
|
||||
AUD_FaderFactory(AUD_IFactory* factory = 0,
|
||||
AUD_FadeType type = AUD_FADE_IN,
|
||||
float start = 0.0f, float length = 1.0f);
|
||||
|
||||
/**
|
||||
* Creates a new fader factory.
|
||||
* \param type The fading type.
|
||||
* \param start The time where fading should start in seconds.
|
||||
* \param length How long fading should last in seconds.
|
||||
*/
|
||||
AUD_FaderFactory(AUD_FadeType type = AUD_FADE_IN,
|
||||
float start = 0.0f, float length = 1.0f);
|
||||
|
||||
/**
|
||||
* Returns the fading type.
|
||||
*/
|
||||
AUD_FadeType getType();
|
||||
|
||||
/**
|
||||
* Sets the fading type.
|
||||
* \param type The new fading type: AUD_FADE_IN or AUD_FADE_OUT.
|
||||
*/
|
||||
void setType(AUD_FadeType type);
|
||||
|
||||
/**
|
||||
* Returns the fading start.
|
||||
*/
|
||||
float getStart();
|
||||
|
||||
/**
|
||||
* Sets the fading start.
|
||||
* \param start The new fading start.
|
||||
*/
|
||||
void setStart(float start);
|
||||
|
||||
/**
|
||||
* Returns the fading length.
|
||||
*/
|
||||
float getLength();
|
||||
|
||||
/**
|
||||
* Sets the fading length.
|
||||
* \param start The new fading length.
|
||||
*/
|
||||
void setLength(float length);
|
||||
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_FADERFACTORY
|
133
intern/audaspace/FX/AUD_FaderReader.cpp
Normal file
133
intern/audaspace/FX/AUD_FaderReader.cpp
Normal file
@ -0,0 +1,133 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_FaderReader.h"
|
||||
#include "AUD_Buffer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
AUD_FaderReader::AUD_FaderReader(AUD_IReader* reader, AUD_FadeType type,
|
||||
float start,float length) :
|
||||
AUD_EffectReader(reader),
|
||||
m_type(type),
|
||||
m_start(start),
|
||||
m_length(length)
|
||||
{
|
||||
int bigendian = 1;
|
||||
bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
|
||||
|
||||
switch(m_reader->getSpecs().format)
|
||||
{
|
||||
case AUD_FORMAT_S16:
|
||||
m_adjust = AUD_volume_adjust<int16_t>;
|
||||
break;
|
||||
case AUD_FORMAT_S32:
|
||||
m_adjust = AUD_volume_adjust<int32_t>;
|
||||
break;
|
||||
case AUD_FORMAT_FLOAT32:
|
||||
m_adjust = AUD_volume_adjust<float>;
|
||||
break;
|
||||
case AUD_FORMAT_FLOAT64:
|
||||
m_adjust = AUD_volume_adjust<double>;
|
||||
break;
|
||||
case AUD_FORMAT_U8:
|
||||
m_adjust = AUD_volume_adjust_u8;
|
||||
break;
|
||||
case AUD_FORMAT_S24:
|
||||
m_adjust = bigendian ? AUD_volume_adjust_s24_be :
|
||||
AUD_volume_adjust_s24_le;
|
||||
break;
|
||||
default:
|
||||
delete m_reader;
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
}
|
||||
|
||||
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||
}
|
||||
|
||||
AUD_FaderReader::~AUD_FaderReader()
|
||||
{
|
||||
delete m_buffer; AUD_DELETE("buffer")
|
||||
}
|
||||
|
||||
bool AUD_FaderReader::notify(AUD_Message &message)
|
||||
{
|
||||
return m_reader->notify(message);
|
||||
}
|
||||
|
||||
void AUD_FaderReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
int position = m_reader->getPosition();
|
||||
AUD_Specs specs = m_reader->getSpecs();
|
||||
int samplesize = AUD_SAMPLE_SIZE(specs);
|
||||
|
||||
m_reader->read(length, buffer);
|
||||
|
||||
if(m_buffer->getSize() < length * samplesize)
|
||||
m_buffer->resize(length * samplesize);
|
||||
|
||||
if((position + length) / (float)specs.rate <= m_start)
|
||||
{
|
||||
if(m_type != AUD_FADE_OUT)
|
||||
{
|
||||
buffer = m_buffer->getBuffer();
|
||||
memset(buffer,
|
||||
specs.format == AUD_FORMAT_U8 ? 0x80 : 0,
|
||||
length * samplesize);
|
||||
}
|
||||
}
|
||||
else if(position / (float)specs.rate >= m_start+m_length)
|
||||
{
|
||||
if(m_type == AUD_FADE_OUT)
|
||||
{
|
||||
buffer = m_buffer->getBuffer();
|
||||
memset(buffer,
|
||||
specs.format == AUD_FORMAT_U8 ? 0x80 : 0,
|
||||
length * samplesize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sample_t* buf = m_buffer->getBuffer();
|
||||
float volume;
|
||||
|
||||
for(int i = 0; i < length; i++)
|
||||
{
|
||||
volume = (((position+i)/(float)specs.rate)-m_start) / m_length;
|
||||
if(volume > 1.0f)
|
||||
volume = 1.0f;
|
||||
else if(volume < 0.0f)
|
||||
volume = 0.0f;
|
||||
|
||||
if(m_type == AUD_FADE_OUT)
|
||||
volume = 1.0f - volume;
|
||||
|
||||
m_adjust(buf + i * samplesize, buffer + i * samplesize,
|
||||
specs.channels, volume);
|
||||
}
|
||||
|
||||
buffer = buf;
|
||||
}
|
||||
}
|
86
intern/audaspace/FX/AUD_FaderReader.h
Normal file
86
intern/audaspace/FX/AUD_FaderReader.h
Normal file
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_FADERREADER
|
||||
#define AUD_FADERREADER
|
||||
|
||||
#include "AUD_EffectReader.h"
|
||||
#include "AUD_ConverterFunctions.h"
|
||||
class AUD_Buffer;
|
||||
|
||||
/**
|
||||
* This class fades another reader.
|
||||
* If the fading type is AUD_FADE_IN, everything before the fading start will be
|
||||
* silenced, for AUD_FADE_OUT that's true for everything after fading ends.
|
||||
*/
|
||||
class AUD_FaderReader : public AUD_EffectReader
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The playback buffer.
|
||||
*/
|
||||
AUD_Buffer *m_buffer;
|
||||
|
||||
/**
|
||||
* The fading type.
|
||||
*/
|
||||
AUD_FadeType m_type;
|
||||
|
||||
/**
|
||||
* The fading start.
|
||||
*/
|
||||
float m_start;
|
||||
|
||||
/**
|
||||
* The fading length.
|
||||
*/
|
||||
float m_length;
|
||||
|
||||
/**
|
||||
* Volume adjustment function.
|
||||
*/
|
||||
AUD_volume_adjust_f m_adjust;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new fader reader.
|
||||
* \param type The fading type.
|
||||
* \param start The time where fading should start in seconds.
|
||||
* \param length How long fading should last in seconds.
|
||||
* \exception AUD_Exception Thrown if the reader specified is NULL.
|
||||
*/
|
||||
AUD_FaderReader(AUD_IReader* reader, AUD_FadeType type,
|
||||
float start,float length);
|
||||
|
||||
/**
|
||||
* Destroys the reader.
|
||||
*/
|
||||
virtual ~AUD_FaderReader();
|
||||
|
||||
virtual bool notify(AUD_Message &message);
|
||||
virtual void read(int & length, sample_t* & buffer);
|
||||
};
|
||||
|
||||
#endif //AUD_FADERREADER
|
67
intern/audaspace/FX/AUD_LimiterFactory.cpp
Normal file
67
intern/audaspace/FX/AUD_LimiterFactory.cpp
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_LimiterFactory.h"
|
||||
#include "AUD_LimiterReader.h"
|
||||
#include "AUD_Space.h"
|
||||
|
||||
AUD_LimiterFactory::AUD_LimiterFactory(AUD_IFactory* factory,
|
||||
float start, float end) :
|
||||
AUD_EffectFactory(factory),
|
||||
m_start(start),
|
||||
m_end(end) {}
|
||||
|
||||
float AUD_LimiterFactory::getStart()
|
||||
{
|
||||
return m_start;
|
||||
}
|
||||
|
||||
void AUD_LimiterFactory::setStart(float start)
|
||||
{
|
||||
m_start = start;
|
||||
}
|
||||
|
||||
float AUD_LimiterFactory::getEnd()
|
||||
{
|
||||
return m_end;
|
||||
}
|
||||
|
||||
void AUD_LimiterFactory::setEnd(float end)
|
||||
{
|
||||
m_end = end;
|
||||
}
|
||||
|
||||
AUD_IReader* AUD_LimiterFactory::createReader()
|
||||
{
|
||||
AUD_IReader* reader = getReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
reader = new AUD_LimiterReader(reader, m_start, m_end);
|
||||
AUD_NEW("reader")
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
84
intern/audaspace/FX/AUD_LimiterFactory.h
Normal file
84
intern/audaspace/FX/AUD_LimiterFactory.h
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_LIMITERFACTORY
|
||||
#define AUD_LIMITERFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory limits another factory in start and end time.
|
||||
*/
|
||||
class AUD_LimiterFactory : public AUD_EffectFactory
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The start time.
|
||||
*/
|
||||
float m_start;
|
||||
|
||||
/**
|
||||
* The end time.
|
||||
*/
|
||||
float m_end;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new limiter factory.
|
||||
* \param factory The input factory.
|
||||
* \param start The desired start time.
|
||||
* \param end The desired end time, a negative value signals that it should
|
||||
* play to the end.
|
||||
*/
|
||||
AUD_LimiterFactory(AUD_IFactory* factory = 0,
|
||||
float start = 0, float end = -1);
|
||||
|
||||
/**
|
||||
* Returns the start time.
|
||||
*/
|
||||
float getStart();
|
||||
|
||||
/**
|
||||
* Sets the start time.
|
||||
* \param start The new start time.
|
||||
*/
|
||||
void setStart(float start);
|
||||
|
||||
/**
|
||||
* Returns the end time.
|
||||
*/
|
||||
float getEnd();
|
||||
|
||||
/**
|
||||
* Sets the end time.
|
||||
* \param end The new end time, a negative value signals that it should play
|
||||
* to the end.
|
||||
*/
|
||||
void setEnd(float end);
|
||||
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_LIMITERFACTORY
|
95
intern/audaspace/FX/AUD_LimiterReader.cpp
Normal file
95
intern/audaspace/FX/AUD_LimiterReader.cpp
Normal file
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_LimiterReader.h"
|
||||
#include "AUD_Buffer.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
AUD_LimiterReader::AUD_LimiterReader(AUD_IReader* reader,
|
||||
float start, float end) :
|
||||
AUD_EffectReader(reader)
|
||||
{
|
||||
m_end = (int)(end * reader->getSpecs().rate);
|
||||
|
||||
if(start <= 0)
|
||||
m_start = 0;
|
||||
else
|
||||
{
|
||||
m_start = (int)(start * reader->getSpecs().rate);
|
||||
if(m_reader->isSeekable())
|
||||
m_reader->seek(m_start);
|
||||
else
|
||||
{
|
||||
// skip first m_start samples by reading them
|
||||
int length;
|
||||
sample_t* buffer;
|
||||
for(int i = m_start;
|
||||
i >= AUD_DEFAULT_BUFFER_SIZE;
|
||||
i -= AUD_DEFAULT_BUFFER_SIZE)
|
||||
{
|
||||
length = AUD_DEFAULT_BUFFER_SIZE;
|
||||
m_reader->read(length, buffer);
|
||||
length = i;
|
||||
}
|
||||
m_reader->read(length, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AUD_LimiterReader::seek(int position)
|
||||
{
|
||||
m_reader->seek(position + m_start);
|
||||
}
|
||||
|
||||
int AUD_LimiterReader::getLength()
|
||||
{
|
||||
int len = m_reader->getLength();
|
||||
if(m_reader->getType() != AUD_TYPE_BUFFER || len < 0 ||
|
||||
(len > m_end && m_end >= 0))
|
||||
len = m_end;
|
||||
return len - m_start;
|
||||
}
|
||||
|
||||
int AUD_LimiterReader::getPosition()
|
||||
{
|
||||
return m_reader->getPosition() - m_start;
|
||||
}
|
||||
|
||||
void AUD_LimiterReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
if(m_end >= 0)
|
||||
{
|
||||
int position = m_reader->getPosition();
|
||||
if(position+length > m_end)
|
||||
length = m_end - position;
|
||||
if(length < 0)
|
||||
{
|
||||
length = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_reader->read(length, buffer);
|
||||
}
|
64
intern/audaspace/FX/AUD_LimiterReader.h
Normal file
64
intern/audaspace/FX/AUD_LimiterReader.h
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_LIMITERREADER
|
||||
#define AUD_LIMITERREADER
|
||||
|
||||
#include "AUD_EffectReader.h"
|
||||
|
||||
/**
|
||||
* This reader limits another reader in start and end sample.
|
||||
*/
|
||||
class AUD_LimiterReader : public AUD_EffectReader
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The start sample: inclusive.
|
||||
*/
|
||||
int m_start;
|
||||
|
||||
/**
|
||||
* The end sample: exlusive.
|
||||
*/
|
||||
int m_end;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new limiter reader.
|
||||
* \param reader The reader to read from.
|
||||
* \param start The desired start sample (inclusive).
|
||||
* \param end The desired end sample (exklusive), a negative value signals
|
||||
* that it should play to the end.
|
||||
* \exception AUD_Exception Thrown if the reader specified is NULL.
|
||||
*/
|
||||
AUD_LimiterReader(AUD_IReader* reader, float start = 0, float end = -1);
|
||||
|
||||
virtual void seek(int position);
|
||||
virtual int getLength();
|
||||
virtual int getPosition();
|
||||
virtual void read(int & length, sample_t* & buffer);
|
||||
};
|
||||
|
||||
#endif //AUD_LIMITERREADER
|
57
intern/audaspace/FX/AUD_LoopFactory.cpp
Normal file
57
intern/audaspace/FX/AUD_LoopFactory.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_LoopFactory.h"
|
||||
#include "AUD_LoopReader.h"
|
||||
|
||||
AUD_LoopFactory::AUD_LoopFactory(AUD_IFactory* factory, int loop) :
|
||||
AUD_EffectFactory(factory),
|
||||
m_loop(loop) {}
|
||||
|
||||
AUD_LoopFactory::AUD_LoopFactory(int loop) :
|
||||
AUD_EffectFactory(0),
|
||||
m_loop(loop) {}
|
||||
|
||||
int AUD_LoopFactory::getLoop()
|
||||
{
|
||||
return m_loop;
|
||||
}
|
||||
|
||||
void AUD_LoopFactory::setLoop(int loop)
|
||||
{
|
||||
m_loop = loop;
|
||||
}
|
||||
|
||||
AUD_IReader* AUD_LoopFactory::createReader()
|
||||
{
|
||||
AUD_IReader* reader = getReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
reader = new AUD_LoopReader(reader, m_loop); AUD_NEW("reader")
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
74
intern/audaspace/FX/AUD_LoopFactory.h
Normal file
74
intern/audaspace/FX/AUD_LoopFactory.h
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_LOOPFACTORY
|
||||
#define AUD_LOOPFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory loops another factory.
|
||||
* \note The reader has to be seekable.
|
||||
*/
|
||||
class AUD_LoopFactory : public AUD_EffectFactory
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The loop count.
|
||||
*/
|
||||
float m_loop;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new loop factory.
|
||||
* \param factory The input factory.
|
||||
* \param loop The desired loop count, negative values result in endless
|
||||
* looping.
|
||||
*/
|
||||
AUD_LoopFactory(AUD_IFactory* factory = 0, int loop = -1);
|
||||
|
||||
/**
|
||||
* Creates a new loop factory.
|
||||
* \param loop The desired loop count, negative values result in endless
|
||||
* looping.
|
||||
*/
|
||||
AUD_LoopFactory(int loop);
|
||||
|
||||
/**
|
||||
* Returns the loop count.
|
||||
*/
|
||||
int getLoop();
|
||||
|
||||
/**
|
||||
* Sets the loop count.
|
||||
* \param loop The desired loop count, negative values result in endless
|
||||
* looping.
|
||||
*/
|
||||
void setLoop(int loop);
|
||||
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_LOOPFACTORY
|
107
intern/audaspace/FX/AUD_LoopReader.cpp
Normal file
107
intern/audaspace/FX/AUD_LoopReader.cpp
Normal file
@ -0,0 +1,107 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_LoopReader.h"
|
||||
#include "AUD_Buffer.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <stdio.h>
|
||||
|
||||
AUD_LoopReader::AUD_LoopReader(AUD_IReader* reader, int loop) :
|
||||
AUD_EffectReader(reader), m_loop(loop)
|
||||
{
|
||||
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||
}
|
||||
|
||||
AUD_LoopReader::~AUD_LoopReader()
|
||||
{
|
||||
delete m_buffer; AUD_DELETE("buffer")
|
||||
}
|
||||
|
||||
AUD_ReaderType AUD_LoopReader::getType()
|
||||
{
|
||||
if(m_loop < 0)
|
||||
return AUD_TYPE_STREAM;
|
||||
return m_reader->getType();
|
||||
}
|
||||
|
||||
bool AUD_LoopReader::notify(AUD_Message &message)
|
||||
{
|
||||
if(message.type == AUD_MSG_LOOP)
|
||||
{
|
||||
m_loop = message.loopcount;
|
||||
|
||||
m_reader->notify(message);
|
||||
|
||||
return true;
|
||||
}
|
||||
return m_reader->notify(message);
|
||||
}
|
||||
|
||||
void AUD_LoopReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
|
||||
|
||||
int len = length;
|
||||
|
||||
m_reader->read(len, buffer);
|
||||
|
||||
if(len < length && m_loop != 0)
|
||||
{
|
||||
int pos = 0;
|
||||
|
||||
if(m_buffer->getSize() < length*samplesize)
|
||||
m_buffer->resize(length*samplesize);
|
||||
|
||||
memcpy(m_buffer->getBuffer() + pos * samplesize,
|
||||
buffer, len * samplesize);
|
||||
|
||||
pos += len;
|
||||
|
||||
while(pos < length && m_loop != 0)
|
||||
{
|
||||
if(m_loop > 0)
|
||||
m_loop--;
|
||||
|
||||
m_reader->seek(0);
|
||||
|
||||
len = length - pos;
|
||||
m_reader->read(len, buffer);
|
||||
// prevent endless loop
|
||||
if(!len)
|
||||
break;
|
||||
|
||||
memcpy(m_buffer->getBuffer() + pos * samplesize,
|
||||
buffer, len * samplesize);
|
||||
|
||||
pos += len;
|
||||
}
|
||||
|
||||
length = pos;
|
||||
buffer = m_buffer->getBuffer();
|
||||
}
|
||||
else
|
||||
length = len;
|
||||
}
|
69
intern/audaspace/FX/AUD_LoopReader.h
Normal file
69
intern/audaspace/FX/AUD_LoopReader.h
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_LOOPREADER
|
||||
#define AUD_LOOPREADER
|
||||
|
||||
#include "AUD_EffectReader.h"
|
||||
class AUD_Buffer;
|
||||
|
||||
/**
|
||||
* This class reads another reader and loops it.
|
||||
* \note The other reader must be seekable.
|
||||
*/
|
||||
class AUD_LoopReader : public AUD_EffectReader
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The playback buffer.
|
||||
*/
|
||||
AUD_Buffer *m_buffer;
|
||||
|
||||
/**
|
||||
* The left loop count.
|
||||
*/
|
||||
int m_loop;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new loop reader.
|
||||
* \param reader The reader to read from.
|
||||
* \param loop The desired loop count, negative values result in endless
|
||||
* looping.
|
||||
* \exception AUD_Exception Thrown if the reader specified is NULL.
|
||||
*/
|
||||
AUD_LoopReader(AUD_IReader* reader, int loop);
|
||||
|
||||
/**
|
||||
* Destroys the reader.
|
||||
*/
|
||||
virtual ~AUD_LoopReader();
|
||||
|
||||
virtual AUD_ReaderType getType();
|
||||
virtual bool notify(AUD_Message &message);
|
||||
virtual void read(int & length, sample_t* & buffer);
|
||||
};
|
||||
|
||||
#endif //AUD_LOOPREADER
|
67
intern/audaspace/FX/AUD_PingPongFactory.cpp
Normal file
67
intern/audaspace/FX/AUD_PingPongFactory.cpp
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_PingPongFactory.h"
|
||||
#include "AUD_DoubleReader.h"
|
||||
#include "AUD_ReverseFactory.h"
|
||||
|
||||
AUD_PingPongFactory::AUD_PingPongFactory(AUD_IFactory* factory) :
|
||||
AUD_EffectFactory(factory) {}
|
||||
|
||||
AUD_IReader* AUD_PingPongFactory::createReader()
|
||||
{
|
||||
if(m_factory == 0)
|
||||
return 0;
|
||||
|
||||
AUD_IReader* reader = m_factory->createReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
AUD_IReader* reader2;
|
||||
AUD_ReverseFactory factory(m_factory);
|
||||
|
||||
try
|
||||
{
|
||||
reader2 = factory.createReader();
|
||||
}
|
||||
catch(AUD_Exception e)
|
||||
{
|
||||
reader2 = 0;
|
||||
}
|
||||
|
||||
if(reader2 != 0)
|
||||
{
|
||||
reader = new AUD_DoubleReader(reader, reader2);
|
||||
AUD_NEW("reader")
|
||||
}
|
||||
else
|
||||
{
|
||||
delete reader; AUD_DELETE("reader")
|
||||
reader = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
51
intern/audaspace/FX/AUD_PingPongFactory.h
Normal file
51
intern/audaspace/FX/AUD_PingPongFactory.h
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_PINGPONGFACTORY
|
||||
#define AUD_PINGPONGFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory plays another factory first normal, then reversed.
|
||||
* \note Readers from the underlying factory must be from the buffer type.
|
||||
*/
|
||||
class AUD_PingPongFactory : public AUD_EffectFactory
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Creates a new ping pong factory.
|
||||
* \param factory The input factory.
|
||||
*/
|
||||
AUD_PingPongFactory(AUD_IFactory* factory = 0);
|
||||
|
||||
/**
|
||||
* Destroys the factory.
|
||||
*/
|
||||
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_PINGPONGFACTORY
|
48
intern/audaspace/FX/AUD_PitchFactory.cpp
Normal file
48
intern/audaspace/FX/AUD_PitchFactory.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_PitchFactory.h"
|
||||
#include "AUD_PitchReader.h"
|
||||
#include "AUD_Space.h"
|
||||
|
||||
AUD_PitchFactory::AUD_PitchFactory(AUD_IFactory* factory, float pitch) :
|
||||
AUD_EffectFactory(factory),
|
||||
m_pitch(pitch) {}
|
||||
|
||||
AUD_PitchFactory::AUD_PitchFactory(float pitch) :
|
||||
AUD_EffectFactory(0),
|
||||
m_pitch(pitch) {}
|
||||
|
||||
AUD_IReader* AUD_PitchFactory::createReader()
|
||||
{
|
||||
AUD_IReader* reader = getReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
reader = new AUD_PitchReader(reader, m_pitch); AUD_NEW("reader")
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
70
intern/audaspace/FX/AUD_PitchFactory.h
Normal file
70
intern/audaspace/FX/AUD_PitchFactory.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_PITCHFACTORY
|
||||
#define AUD_PITCHFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory changes the pitch of another factory.
|
||||
*/
|
||||
class AUD_PitchFactory : public AUD_EffectFactory
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The pitch.
|
||||
*/
|
||||
float m_pitch;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new pitch factory.
|
||||
* \param factory The input factory.
|
||||
* \param pitch The desired pitch.
|
||||
*/
|
||||
AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0);
|
||||
|
||||
/**
|
||||
* Creates a new pitch factory.
|
||||
* \param pitch The desired pitch.
|
||||
*/
|
||||
AUD_PitchFactory(float pitch);
|
||||
|
||||
/**
|
||||
* Returns the pitch.
|
||||
*/
|
||||
float getPitch();
|
||||
|
||||
/**
|
||||
* Sets the pitch.
|
||||
* \param pitch The new pitch value. Should be between 0.0 and 1.0.
|
||||
*/
|
||||
void setPitch(float pitch);
|
||||
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_PITCHFACTORY
|
39
intern/audaspace/FX/AUD_PitchReader.cpp
Normal file
39
intern/audaspace/FX/AUD_PitchReader.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_PitchReader.h"
|
||||
|
||||
AUD_PitchReader::AUD_PitchReader(AUD_IReader* reader, float pitch) :
|
||||
AUD_EffectReader(reader)
|
||||
{
|
||||
m_pitch = pitch;
|
||||
}
|
||||
|
||||
AUD_Specs AUD_PitchReader::getSpecs()
|
||||
{
|
||||
AUD_Specs specs = m_reader->getSpecs();
|
||||
specs.rate = (AUD_SampleRate)((int)(specs.rate * m_pitch));
|
||||
return specs;
|
||||
}
|
54
intern/audaspace/FX/AUD_PitchReader.h
Normal file
54
intern/audaspace/FX/AUD_PitchReader.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_PITCHREADER
|
||||
#define AUD_PITCHREADER
|
||||
|
||||
#include "AUD_EffectReader.h"
|
||||
|
||||
/**
|
||||
* This class reads another reader and changes it's pitch.
|
||||
*/
|
||||
class AUD_PitchReader : public AUD_EffectReader
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The pitch level.
|
||||
*/
|
||||
float m_pitch;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new pitch reader.
|
||||
* \param reader The reader to read from.
|
||||
* \param pitch The size of the buffer.
|
||||
* \exception AUD_Exception Thrown if the reader specified is NULL.
|
||||
*/
|
||||
AUD_PitchReader(AUD_IReader* reader, float pitch);
|
||||
|
||||
virtual AUD_Specs getSpecs();
|
||||
};
|
||||
|
||||
#endif //AUD_PITCHREADER
|
43
intern/audaspace/FX/AUD_ReverseFactory.cpp
Normal file
43
intern/audaspace/FX/AUD_ReverseFactory.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_ReverseFactory.h"
|
||||
#include "AUD_ReverseReader.h"
|
||||
#include "AUD_Space.h"
|
||||
|
||||
AUD_ReverseFactory::AUD_ReverseFactory(AUD_IFactory* factory) :
|
||||
AUD_EffectFactory(factory) {}
|
||||
|
||||
AUD_IReader* AUD_ReverseFactory::createReader()
|
||||
{
|
||||
AUD_IReader* reader = getReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
reader = new AUD_ReverseReader(reader); AUD_NEW("reader")
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
50
intern/audaspace/FX/AUD_ReverseFactory.h
Normal file
50
intern/audaspace/FX/AUD_ReverseFactory.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_REVERSEFACTORY
|
||||
#define AUD_REVERSEFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory reads another factory reverted.
|
||||
* \note Readers from the underlying factory must be from the buffer type.
|
||||
*/
|
||||
class AUD_ReverseFactory : public AUD_EffectFactory
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Creates a new reverse factory.
|
||||
* \param factory The input factory.
|
||||
*/
|
||||
AUD_ReverseFactory(AUD_IFactory* factory = 0);
|
||||
|
||||
/**
|
||||
* Destroys the factory.
|
||||
*/
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_REVERSEFACTORY
|
111
intern/audaspace/FX/AUD_ReverseReader.cpp
Normal file
111
intern/audaspace/FX/AUD_ReverseReader.cpp
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_ReverseReader.h"
|
||||
#include "AUD_Buffer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
AUD_ReverseReader::AUD_ReverseReader(AUD_IReader* reader) :
|
||||
AUD_EffectReader(reader)
|
||||
{
|
||||
if(reader->getType() != AUD_TYPE_BUFFER)
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
|
||||
m_length = reader->getLength();
|
||||
if(m_length < 0)
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
|
||||
m_position = 0;
|
||||
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||
}
|
||||
|
||||
AUD_ReverseReader::~AUD_ReverseReader()
|
||||
{
|
||||
delete m_buffer; AUD_DELETE("buffer")
|
||||
}
|
||||
|
||||
void AUD_ReverseReader::seek(int position)
|
||||
{
|
||||
m_position = position;
|
||||
}
|
||||
|
||||
int AUD_ReverseReader::getLength()
|
||||
{
|
||||
return m_length;
|
||||
}
|
||||
|
||||
int AUD_ReverseReader::getPosition()
|
||||
{
|
||||
return m_position;
|
||||
}
|
||||
|
||||
void AUD_ReverseReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
// first correct the length
|
||||
if(m_position+length > m_length)
|
||||
length = m_length-m_position;
|
||||
|
||||
if(length <= 0)
|
||||
{
|
||||
length = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int samplesize = AUD_SAMPLE_SIZE(getSpecs());
|
||||
|
||||
// resize buffer if needed
|
||||
if(m_buffer->getSize() < length * samplesize)
|
||||
m_buffer->resize(length * samplesize);
|
||||
|
||||
buffer = m_buffer->getBuffer();
|
||||
|
||||
sample_t* buf;
|
||||
int len = length;
|
||||
|
||||
// read from reader
|
||||
m_reader->seek(m_length-m_position-len);
|
||||
m_reader->read(len, buf);
|
||||
|
||||
// set null if reader didn't give enough data
|
||||
if(len < length)
|
||||
{
|
||||
if(getSpecs().format == AUD_FORMAT_U8)
|
||||
memset(buffer, 0x80, (length-len)*samplesize);
|
||||
else
|
||||
memset(buffer, 0, (length-len)*samplesize);
|
||||
buffer += length-len;
|
||||
}
|
||||
|
||||
// copy the samples reverted
|
||||
for(int i = 0; i < len; i++)
|
||||
memcpy(buffer + i * samplesize,
|
||||
buf + (len - 1 - i) * samplesize,
|
||||
samplesize);
|
||||
|
||||
m_position += length;
|
||||
|
||||
buffer = m_buffer->getBuffer();
|
||||
}
|
74
intern/audaspace/FX/AUD_ReverseReader.h
Normal file
74
intern/audaspace/FX/AUD_ReverseReader.h
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_REVERSEREADER
|
||||
#define AUD_REVERSEREADER
|
||||
|
||||
#include "AUD_EffectReader.h"
|
||||
class AUD_Buffer;
|
||||
|
||||
/**
|
||||
* This class reads another reader from back to front.
|
||||
* \note The underlying reader must be a buffer.
|
||||
*/
|
||||
class AUD_ReverseReader : public AUD_EffectReader
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The current position.
|
||||
*/
|
||||
int m_position;
|
||||
|
||||
/**
|
||||
* The sample count.
|
||||
*/
|
||||
int m_length;
|
||||
|
||||
/**
|
||||
* The playback buffer.
|
||||
*/
|
||||
AUD_Buffer* m_buffer;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new reverse reader.
|
||||
* \param reader The reader to read from.
|
||||
* \exception AUD_Exception Thrown if the reader specified is NULL or not
|
||||
* a buffer.
|
||||
*/
|
||||
AUD_ReverseReader(AUD_IReader* reader);
|
||||
|
||||
/**
|
||||
* Destroys the reader.
|
||||
*/
|
||||
virtual ~AUD_ReverseReader();
|
||||
|
||||
virtual void seek(int position);
|
||||
virtual int getLength();
|
||||
virtual int getPosition();
|
||||
virtual void read(int & length, sample_t* & buffer);
|
||||
};
|
||||
|
||||
#endif //AUD_REVERSEREADER
|
57
intern/audaspace/FX/AUD_VolumeFactory.cpp
Normal file
57
intern/audaspace/FX/AUD_VolumeFactory.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_VolumeFactory.h"
|
||||
#include "AUD_VolumeReader.h"
|
||||
|
||||
AUD_VolumeFactory::AUD_VolumeFactory(AUD_IFactory* factory, float volume) :
|
||||
AUD_EffectFactory(factory),
|
||||
m_volume(volume) {}
|
||||
|
||||
AUD_VolumeFactory::AUD_VolumeFactory(float volume) :
|
||||
AUD_EffectFactory(0),
|
||||
m_volume(volume) {}
|
||||
|
||||
float AUD_VolumeFactory::getVolume()
|
||||
{
|
||||
return m_volume;
|
||||
}
|
||||
|
||||
void AUD_VolumeFactory::setVolume(float volume)
|
||||
{
|
||||
m_volume = volume;
|
||||
}
|
||||
|
||||
AUD_IReader* AUD_VolumeFactory::createReader()
|
||||
{
|
||||
AUD_IReader* reader = getReader();
|
||||
|
||||
if(reader != 0)
|
||||
{
|
||||
reader = new AUD_VolumeReader(reader, m_volume); AUD_NEW("reader")
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
72
intern/audaspace/FX/AUD_VolumeFactory.h
Normal file
72
intern/audaspace/FX/AUD_VolumeFactory.h
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef AUD_VOLUMEFACTORY
|
||||
#define AUD_VOLUMEFACTORY
|
||||
|
||||
#include "AUD_EffectFactory.h"
|
||||
|
||||
/**
|
||||
* This factory changes the volume of another factory.
|
||||
* The set volume should be a value between 0.0 and 1.0, higher values at your
|
||||
* own risk!
|
||||
*/
|
||||
class AUD_VolumeFactory : public AUD_EffectFactory
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The volume.
|
||||
*/
|
||||
float m_volume;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new volume factory.
|
||||
* \param factory The input factory.
|
||||
* \param volume The desired volume.
|
||||
*/
|
||||
AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0);
|
||||
|
||||
/**
|
||||
* Creates a new volume factory.
|
||||
* \param volume The desired volume.
|
||||
*/
|
||||
AUD_VolumeFactory(float volume);
|
||||
|
||||
/**
|
||||
* Returns the volume.
|
||||
*/
|
||||
float getVolume();
|
||||
|
||||
/**
|
||||
* Sets the volume.
|
||||
* \param volume The new volume value. Should be between 0.0 and 1.0.
|
||||
*/
|
||||
void setVolume(float volume);
|
||||
|
||||
virtual AUD_IReader* createReader();
|
||||
};
|
||||
|
||||
#endif //AUD_VOLUMEFACTORY
|
97
intern/audaspace/FX/AUD_VolumeReader.cpp
Normal file
97
intern/audaspace/FX/AUD_VolumeReader.cpp
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
*
|
||||
* Copyright 2009 Jörg Hermann Müller
|
||||
*
|
||||
* This file is part of AudaSpace.
|
||||
*
|
||||
* AudaSpace 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AudaSpace 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 AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ***** END LGPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "AUD_VolumeReader.h"
|
||||
#include "AUD_Buffer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
AUD_VolumeReader::AUD_VolumeReader(AUD_IReader* reader, float volume) :
|
||||
AUD_EffectReader(reader),
|
||||
m_volume(volume)
|
||||
{
|
||||
int bigendian = 1;
|
||||
bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
|
||||
|
||||
switch(m_reader->getSpecs().format)
|
||||
{
|
||||
case AUD_FORMAT_S16:
|
||||
m_adjust = AUD_volume_adjust<int16_t>;
|
||||
break;
|
||||
case AUD_FORMAT_S32:
|
||||
m_adjust = AUD_volume_adjust<int32_t>;
|
||||
break;
|
||||
case AUD_FORMAT_FLOAT32:
|
||||
m_adjust = AUD_volume_adjust<float>;
|
||||
break;
|
||||
case AUD_FORMAT_FLOAT64:
|
||||
m_adjust = AUD_volume_adjust<double>;
|
||||
break;
|
||||
case AUD_FORMAT_U8:
|
||||
m_adjust = AUD_volume_adjust_u8;
|
||||
break;
|
||||
case AUD_FORMAT_S24:
|
||||
m_adjust = bigendian ? AUD_volume_adjust_s24_be :
|
||||
AUD_volume_adjust_s24_le;
|
||||
break;
|
||||
default:
|
||||
delete m_reader;
|
||||
AUD_THROW(AUD_ERROR_READER);
|
||||
}
|
||||
|
||||
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||
}
|
||||
|
||||
AUD_VolumeReader::~AUD_VolumeReader()
|
||||
{
|
||||
delete m_buffer; AUD_DELETE("buffer")
|
||||
}
|
||||
|
||||
bool AUD_VolumeReader::notify(AUD_Message &message)
|
||||
{
|
||||
if(message.type == AUD_MSG_VOLUME)
|
||||
{
|
||||
m_volume = message.volume;
|
||||
|
||||
m_reader->notify(message);
|
||||
|
||||
return true;
|
||||
}
|
||||
return m_reader->notify(message);
|
||||
}
|
||||
|
||||
void AUD_VolumeReader::read(int & length, sample_t* & buffer)
|
||||
{
|
||||
sample_t* buf;
|
||||
AUD_Specs specs = m_reader->getSpecs();
|
||||
|
||||
m_reader->read(length, buf);
|
||||
if(m_buffer->getSize() < length*AUD_SAMPLE_SIZE(specs))
|
||||
m_buffer->resize(length*AUD_SAMPLE_SIZE(specs));
|
||||
|
||||
buffer = m_buffer->getBuffer();
|
||||
|
||||
m_adjust(buffer, buf, length * specs.channels, m_volume);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user