Audaspace: use standalone library.
authorJörg Müller <nexyon@gmail.com>
Tue, 4 Mar 2014 12:44:15 +0000 (13:44 +0100)
committerJörg Müller <nexyon@gmail.com>
Tue, 28 Jul 2015 12:01:52 +0000 (14:01 +0200)
- Added the cmake configuration option WITH_EXTERNAL_AUDASPACE.
- Fixes to build without standalone library as well.

32 files changed:
CMakeLists.txt
build_files/cmake/Modules/FindAudaspace.cmake [new file with mode: 0644]
build_files/cmake/macros.cmake
intern/audaspace/CMakeLists.txt
intern/audaspace/intern/AUD_PyInit.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_Set.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_Set.h [new file with mode: 0644]
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/editors/sound/CMakeLists.txt
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_graph/CMakeLists.txt
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_sequencer/CMakeLists.txt
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/rna_scene.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/CMakeLists.txt
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.h

index dd19d80..cac75d3 100644 (file)
@@ -247,6 +247,7 @@ option(WITH_HEADLESS      "Build without graphical support (renderfarm, server m
 mark_as_advanced(WITH_HEADLESS)
 
 option(WITH_AUDASPACE    "Build with blenders audio library (only disable if you know what you're doing!)" ON)
+option(WITH_EXTERNAL_AUDASPACE "Build with external audaspace library installed on the system (only enable if you know what you're doing!)" OFF)
 mark_as_advanced(WITH_AUDASPACE)
 
 option(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" ON)
@@ -883,6 +884,13 @@ if(UNIX AND NOT APPLE)
        endif()
 
        # Audio IO
+       if(WITH_EXTERNAL_AUDASPACE)
+               find_package_wrapper(Audaspace)
+               if(NOT AUDASPACE_FOUND OR NOT CAUDASPACE_FOUND)
+                       message(FATAL_ERROR "Audaspace external library not found!")
+               endif()
+       endif()
+
        if(WITH_OPENAL)
                find_package_wrapper(OpenAL)
                if(NOT OPENAL_FOUND)
diff --git a/build_files/cmake/Modules/FindAudaspace.cmake b/build_files/cmake/Modules/FindAudaspace.cmake
new file mode 100644 (file)
index 0000000..361c1bf
--- /dev/null
@@ -0,0 +1,76 @@
+# - Try to find audaspace
+# Once done, this will define
+#
+#  AUDASPACE_FOUND - system has audaspace
+#  AUDASPACE_INCLUDE_DIRS - the audaspace include directories
+#  AUDASPACE_LIBRARIES - link these to use audaspace
+#  CAUDASPACE_FOUND - system has audaspace's C binding
+#  CAUDASPACE_INCLUDE_DIRS - the audaspace's C binding include directories
+#  CAUDASPACE_LIBRARIES - link these to use audaspace's C binding
+#  PYAUDASPACE_FOUND - system has audaspace's python binding
+#  PYAUDASPACE_INCLUDE_DIRS - the audaspace's python binding include directories
+#  PYAUDASPACE_LIBRARIES - link these to use audaspace's python binding
+
+# Use pkg-config to get hints about paths
+find_package(PkgConfig)
+if(PKG_CONFIG_FOUND)
+       pkg_check_modules(AUDASPACE_PKGCONF audaspace)
+endif(PKG_CONFIG_FOUND)
+
+# Include dir
+find_path(AUDASPACE_INCLUDE_DIR
+       NAMES audaspace/ISound.h
+       PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
+)
+
+# Library
+find_library(AUDASPACE_LIBRARY
+       NAMES audaspace
+       PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
+)
+
+# Include dir
+find_path(CAUDASPACE_INCLUDE_DIR
+       NAMES audaspace/AUD_Sound.h
+       PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
+)
+
+# Library
+find_library(CAUDASPACE_LIBRARY
+       NAMES caudaspace
+       PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
+)
+
+# Include dir
+find_path(PYAUDASPACE_INCLUDE_DIR
+       NAMES audaspace/python/PyAPI.h
+       PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
+)
+
+# Library
+find_library(PYAUDASPACE_LIBRARY
+       NAMES pyaudaspace
+       PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
+)
+
+find_package(PackageHandleStandardArgs)
+find_package_handle_standard_args(Audaspace  DEFAULT_MSG  AUDASPACE_LIBRARY AUDASPACE_INCLUDE_DIR)
+find_package_handle_standard_args(CAudaspace  DEFAULT_MSG  CAUDASPACE_LIBRARY CAUDASPACE_INCLUDE_DIR)
+find_package_handle_standard_args(PyAudaspace  DEFAULT_MSG  PYAUDASPACE_LIBRARY PYAUDASPACE_INCLUDE_DIR)
+
+if(AUDASPACE_FOUND)
+  set(AUDASPACE_LIBRARIES ${AUDASPACE_LIBRARY})
+  set(AUDASPACE_INCLUDE_DIRS ${AUDASPACE_INCLUDE_DIR})
+endif(AUDASPACE_FOUND)
+
+if(CAUDASPACE_FOUND)
+  set(CAUDASPACE_LIBRARIES ${CAUDASPACE_LIBRARY})
+  set(CAUDASPACE_INCLUDE_DIRS ${CAUDASPACE_INCLUDE_DIR})
+endif(CAUDASPACE_FOUND)
+
+if(PYAUDASPACE_FOUND)
+  set(PYAUDASPACE_LIBRARIES ${PYAUDASPACE_LIBRARY})
+  set(PYAUDASPACE_INCLUDE_DIRS ${PYAUDASPACE_INCLUDE_DIR})
+endif(PYAUDASPACE_FOUND)
+
+mark_as_advanced(AUDASPACE_LIBRARY AUDASPACE_LIBRARIES AUDASPACE_INCLUDE_DIR AUDASPACE_INCLUDE_DIRS CAUDASPACE_LIBRARY CAUDASPACE_LIBRARIES CAUDASPACE_INCLUDE_DIR CAUDASPACE_INCLUDE_DIRS PYAUDASPACE_LIBRARY PYAUDASPACE_LIBRARIES PYAUDASPACE_INCLUDE_DIR PYAUDASPACE_INCLUDE_DIRS)
index 34f6a36..de2109b 100644 (file)
@@ -343,6 +343,9 @@ function(setup_liblinks
        if(WITH_BULLET AND WITH_SYSTEM_BULLET)
                target_link_libraries(${target} ${BULLET_LIBRARIES})
        endif()
+       if(WITH_EXTERNAL_AUDASPACE)
+               target_link_libraries(${target} ${CAUDASPACE_LIBRARIES} ${PYAUDASPACE_LIBRARIES})
+       endif()
        if(WITH_OPENAL)
                target_link_libraries(${target} ${OPENAL_LIBRARY})
        endif()
index 5b81049..7c63351 100644 (file)
 
 remove_extra_strict_flags()
 
+if(WITH_EXTERNAL_AUDASPACE)
+
+       set(INC
+               .
+       )
+
+       set(INC_SYS
+               ${CAUDASPACE_INCLUDE_DIRS}
+               ${PYAUDASPACE_INCLUDE_DIRS}
+       )
+
+       set(SRC
+               intern/AUD_Set.cpp
+               intern/AUD_Set.h
+       )
+
+if(WITH_PYTHON)
+       list(APPEND INC_SYS
+               ${PYTHON_INCLUDE_DIRS}
+       )
+       list(APPEND SRC
+               intern/AUD_PyInit.cpp
+               intern/AUD_PyInit.h
+       )
+       add_definitions(-DWITH_PYTHON)
+endif()
+
+else()
+
 set(INC
        .
        FX
@@ -316,5 +345,6 @@ if(WITH_PYTHON)
        )
        add_definitions(-DWITH_PYTHON)
 endif()
+endif()
 
 blender_add_lib(bf_intern_audaspace "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/intern/audaspace/intern/AUD_PyInit.cpp b/intern/audaspace/intern/AUD_PyInit.cpp
new file mode 100644 (file)
index 0000000..8802f39
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 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 General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file audaspace/intern/AUD_PyInit.cpp
+ *  \ingroup audaspaceintern
+ */
+
+#include "AUD_PyInit.h"
+
+#include <audaspace/AUD_Sound.h>
+#include <audaspace/python/PySound.h>
+#include <audaspace/python/PyAPI.h>
+
+extern "C" {
+extern void *sound_get_factory(void *sound);
+}
+
+static PyObject *AUD_getSoundFromPointer(PyObject *self, PyObject *args)
+{
+       long int lptr;
+
+       if (PyArg_Parse(args, "l:_sound_from_pointer", &lptr)) {
+               if (lptr) {
+                       AUD_Sound* sound = sound_get_factory((void *) lptr);
+
+                       if (sound) {
+                               Sound *obj = (Sound *)Sound_empty();
+                               if (obj) {
+                                       obj->sound = AUD_copy(sound);
+                                       return (PyObject *) obj;
+                               }
+                       }
+               }
+       }
+
+       Py_RETURN_NONE;
+}
+
+static PyMethodDef meth_sound_from_pointer[] = {
+    {"_sound_from_pointer", (PyCFunction)AUD_getSoundFromPointer, METH_O,
+     "_sound_from_pointer(pointer)\n\n"
+     "Returns the corresponding :class:`Factory` object.\n\n"
+     ":arg pointer: The pointer to the bSound object as long.\n"
+     ":type pointer: long\n"
+     ":return: The corresponding :class:`Factory` object.\n"
+     ":rtype: :class:`Factory`"}
+};
+
+PyObject *AUD_initPython(void)
+{
+       PyObject *module = PyInit_aud();
+       PyModule_AddObject(module, "_sound_from_pointer", (PyObject *)PyCFunction_New(meth_sound_from_pointer, NULL));
+       PyDict_SetItemString(PyImport_GetModuleDict(), "aud", module);
+
+       return module;
+}
+
diff --git a/intern/audaspace/intern/AUD_Set.cpp b/intern/audaspace/intern/AUD_Set.cpp
new file mode 100644 (file)
index 0000000..eb04e37
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 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 General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file audaspace/intern/AUD_Set.cpp
+ *  \ingroup audaspaceintern
+ */
+
+#include <set>
+
+#include "AUD_Set.h"
+
+void *AUD_createSet()
+{
+       return new std::set<void *>();
+}
+
+void AUD_destroySet(void *set)
+{
+       delete reinterpret_cast<std::set<void *>*>(set);
+}
+
+char AUD_removeSet(void *set, void *entry)
+{
+       if (set)
+               return reinterpret_cast<std::set<void *>*>(set)->erase(entry);
+       return 0;
+}
+
+void AUD_addSet(void *set, void *entry)
+{
+       if (entry)
+               reinterpret_cast<std::set<void *>*>(set)->insert(entry);
+}
+
+void *AUD_getSet(void *set)
+{
+       if (set) {
+               std::set<void *>* rset = reinterpret_cast<std::set<void *>*>(set);
+               if (!rset->empty()) {
+                       std::set<void *>::iterator it = rset->begin();
+                       void *result = *it;
+                       rset->erase(it);
+                       return result;
+               }
+       }
+
+       return (void*) 0;
+}
diff --git a/intern/audaspace/intern/AUD_Set.h b/intern/audaspace/intern/AUD_Set.h
new file mode 100644 (file)
index 0000000..ca14192
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 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 General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file AUD_Set.h
+ *  \ingroup audaspace
+ */
+#ifndef __AUD_SET_H__
+#define __AUD_SET_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Creates a new set.
+ * \return The new set.
+ */
+extern void *AUD_createSet(void);
+
+/**
+ * Deletes a set.
+ * \param set The set to delete.
+ */
+extern void AUD_destroySet(void *set);
+
+/**
+ * Removes an entry from a set.
+ * \param set The set work on.
+ * \param entry The entry to remove.
+ * \return Whether the entry was in the set or not.
+ */
+extern char AUD_removeSet(void *set, void *entry);
+
+/**
+ * Adds a new entry to a set.
+ * \param set The set work on.
+ * \param entry The entry to add.
+ */
+extern void AUD_addSet(void *set, void *entry);
+
+/**
+ * Removes one entry from a set and returns it.
+ * \param set The set work on.
+ * \return The entry or NULL if the set is empty.
+ */
+extern void *AUD_getSet(void *set);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__AUD_SET_H__
index 819b49d..7d2d23e 100644 (file)
 
 #define SOUND_WAVE_SAMPLES_PER_SECOND 250
 
+#ifdef WITH_AUDASPACE
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Device.h>
+#  endif
+#endif
+
 struct bSound;
 struct Main;
 struct Sequence;
@@ -75,7 +81,7 @@ void BKE_sound_load(struct Main *main, struct bSound *sound);
 
 void BKE_sound_free(struct bSound *sound);
 
-#ifdef __AUD_C_API_H__
+#if defined(__AUD_C_API_H__) || defined(WITH_EXTERNAL_AUDASPACE)
 AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume);
 #endif
 
index 349d130..dd5fcaf 100644 (file)
@@ -315,6 +315,13 @@ if(WITH_AUDASPACE)
                ../../../intern/audaspace/intern
        )
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS
+                       ${CAUDASPACE_INCLUDE_DIRS}
+               )
+       endif()
 endif()
 
 if(WITH_BULLET)
index 37bd9c5..0923ac7 100644 (file)
@@ -309,8 +309,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
 
        CTX_data_main_set(C, G.main);
 
-       BKE_sound_init_main(G.main);
-       
        if (bfd->user) {
                
                /* only here free userdef themes... */
index 1ad6446..25629e7 100644 (file)
 #include "BKE_library.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Special.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 #include "RNA_access.h"
index db07344..b087d80 100644 (file)
 #include "BKE_sound.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Special.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 static ImBuf *seq_render_strip_stack(const SeqRenderData *context, ListBase *seqbasep, float cfra, int chanshown);
index 3accf21..0eaae45 100644 (file)
 #include "DNA_speaker_types.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Sound.h>
+#    include <audaspace/AUD_Sequence.h>
+#    include <audaspace/AUD_Handle.h>
+#    include <audaspace/AUD_Special.h>
+#    include "AUD_Set.h"
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 #include "BKE_global.h"
@@ -150,13 +158,13 @@ static void sound_sync_callback(void *data, int mode, float time)
 int BKE_sound_define_from_str(const char *str)
 {
        if (BLI_strcaseeq(str, "NULL"))
-               return AUD_NULL_DEVICE;
+               return 0;
        if (BLI_strcaseeq(str, "SDL"))
-               return AUD_SDL_DEVICE;
+               return 1;
        if (BLI_strcaseeq(str, "OPENAL"))
-               return AUD_OPENAL_DEVICE;
+               return 2;
        if (BLI_strcaseeq(str, "JACK"))
-               return AUD_JACK_DEVICE;
+               return 3;
 
        return -1;
 }
@@ -189,13 +197,13 @@ void BKE_sound_init(struct Main *bmain)
 
        switch(device)
        {
-       case AUD_SDL_DEVICE:
+       case 1:
                device_name = "SDL";
                break;
-       case AUD_OPENAL_DEVICE:
+       case 2:
                device_name = "OpenAL";
                break;
-       case AUD_JACK_DEVICE:
+       case 3:
                device_name = "Jack";
                break;
        default:
@@ -204,7 +212,7 @@ void BKE_sound_init(struct Main *bmain)
        }
 
        if (buffersize < 128)
-               buffersize = AUD_DEFAULT_BUFFER_SIZE;
+               buffersize = 1024;
 
        if (specs.rate < AUD_RATE_8000)
                specs.rate = AUD_RATE_44100;
@@ -821,7 +829,11 @@ float BKE_sound_get_length(bSound *sound)
 
 bool BKE_sound_is_jack_supported(void)
 {
+#ifdef WITH_EXTERNAL_AUDASPACE
+       return 1;
+#else
        return (bool)AUD_isJackSupported();
+#endif
 }
 
 #else  /* WITH_AUDASPACE */
index af71f19..af33e68 100644 (file)
 #include "BLI_blenlib.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Device.h>
+#    include <audaspace/AUD_Special.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 #include "BLI_utildefines.h"
index 245ee65..c3ef0f8 100644 (file)
@@ -39,10 +39,14 @@ set(SRC
 )
 
 if(WITH_AUDASPACE)
-       list(APPEND INC
-               ../../../../intern/audaspace/intern
-       )
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS ${CAUDASPACE_INCLUDE_DIRS})
+       else()
+               list(APPEND INC ../../../../intern/audaspace/intern)
+       endif()
 endif()
 
 if(WITH_CODEC_FFMPEG)
index 8a3b481..1fd48dd 100644 (file)
 #include "WM_types.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Special.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 #include "ED_sound.h"
index 0a29810..b911f9e 100644 (file)
@@ -48,10 +48,14 @@ set(SRC
 )
 
 if(WITH_AUDASPACE)
-       list(APPEND INC
-               ../../../../intern/audaspace/intern
-       )
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS ${CAUDASPACE_INCLUDE_DIRS})
+       else()
+               list(APPEND INC ../../../../intern/audaspace/intern)
+       endif()
 endif()
 
 if(WITH_INTERNATIONAL)
index 3de3ece..1f2b02d 100644 (file)
 #include <float.h>
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Special.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 #include "MEM_guardedalloc.h"
index d9aff27..ea12ee3 100644 (file)
@@ -53,10 +53,14 @@ set(SRC
 )
 
 if(WITH_AUDASPACE)
-       list(APPEND INC
-               ../../../../intern/audaspace/intern
-       )
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS ${CAUDASPACE_INCLUDE_DIRS})
+       else()
+               list(APPEND INC ../../../../intern/audaspace/intern)
+       endif()
 endif()
 
 if(WITH_INTERNATIONAL)
index edf8a41..7ffed70 100644 (file)
 #include "BKE_sound.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Sequence.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 /* own include */
index bef2fa3..967ec3a 100644 (file)
@@ -225,6 +225,13 @@ endif()
 
 if(WITH_AUDASPACE)
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS ${CAUDASPACE_INCLUDE_DIRS})
+       else()
+               list(APPEND INC ../../../intern/audaspace/intern)
+       endif()
 endif()
 
 if(WITH_CODEC_QUICKTIME)
index e990ff1..9c4fcd9 100644 (file)
 #ifdef WITH_QUICKTIME
 #  include "quicktime_export.h"
 #  ifdef WITH_AUDASPACE
-#    include "AUD_Space.h"
+#    ifdef WITH_EXTERNAL_AUDASPACE
+#      include <audaspace/AUD_Types.h>
+#    else
+#      include "AUD_Space.h"
+#    endif
 #  endif
 #endif
 
index f275d0a..4d30bc5 100644 (file)
@@ -101,7 +101,11 @@ typedef void * wmUIHandlerRemoveFunc;
 }
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Device.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 static BlendFileData *load_game_data(char *filename)
index 1a2809c..324babf 100644 (file)
@@ -56,10 +56,14 @@ set(SRC
 add_definitions(${GL_DEFINITIONS})
 
 if(WITH_AUDASPACE)
-       list(APPEND INC
-               ../../../intern/audaspace/intern
-       )
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS ${CAUDASPACE_INCLUDE_DIRS})
+       else()
+               list(APPEND INC ../../../intern/audaspace/intern)
+       endif()
 endif()
 
 if(WITH_CODEC_FFMPEG)
index 6d681dd..dba3f4d 100644 (file)
@@ -113,10 +113,14 @@ if(WITH_BULLET)
 endif()
 
 if(WITH_AUDASPACE)
-       list(APPEND INC
-               ../../../intern/audaspace/intern
-       )
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS ${CAUDASPACE_INCLUDE_DIRS})
+       else()
+               list(APPEND INC ../../../intern/audaspace/intern)
+       endif()
 endif()
 
 blender_add_lib(ge_converter "${SRC}" "${INC}" "${INC_SYS}")
index 1acbd0b..e5e86cd 100644 (file)
 #include "KX_ConvertActuators.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Sound.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 // Actuators
index a1bc7e8..58e47bc 100644 (file)
@@ -85,10 +85,14 @@ if(WITH_INTERNATIONAL)
 endif()
 
 if(WITH_AUDASPACE)
-       list(APPEND INC
-               ../../../../intern/audaspace/intern
-       )
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS ${CAUDASPACE_INCLUDE_DIRS})
+       else()
+               list(APPEND INC ../../../../intern/audaspace/intern)
+       endif()
 endif()
 
 if(WITH_SDL AND WITH_SDL_DYNLOAD)
index f06a153..75a3012 100644 (file)
@@ -100,7 +100,11 @@ extern "C"
 #include "GHOST_Rect.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Device.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 static void frameTimerProc(GHOST_ITimerTask* task, GHOST_TUns64 time);
index 44532e5..f938994 100644 (file)
@@ -248,11 +248,17 @@ if(WITH_CODEC_FFMPEG)
 endif()
 
 if(WITH_AUDASPACE)
-       list(APPEND INC
-               ../../../intern/audaspace/intern
-               ../../../intern/audaspace/FX
-       )
+       list(APPEND INC ../../../intern/audaspace/intern)
+
        add_definitions(-DWITH_AUDASPACE)
+
+       if(WITH_EXTERNAL_AUDASPACE)
+               add_definitions(-DWITH_EXTERNAL_AUDASPACE)
+               list(APPEND INC_SYS
+                       ${CAUDASPACE_INCLUDE_DIRS}
+                       ${PYAUDASPACE_INCLUDE_DIRS}
+               )
+       endif()
 endif()
 
 if(WITH_BULLET)
index acf6581..c7cf556 100644 (file)
 #include "KX_PyConstraintBinding.h"
 #include "PHY_IPhysicsEnvironment.h"
 
-#ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
-#endif
-
 #include "NG_NetworkScene.h"
 #include "NG_NetworkDeviceInterface.h"
 
index 611467d..a14cb9a 100644 (file)
 #include "KX_SoundActuator.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+typedef float sample_t;
+#    include <audaspace/AUD_Sound.h>
+#    include <audaspace/AUD_Special.h>
+#    include <audaspace/AUD_Device.h>
+#    include <audaspace/AUD_Handle.h>
+#    include <audaspace/python/PyAPI.h>
+#  endif
 #endif
 
 #include "KX_GameObject.h"
@@ -554,7 +561,7 @@ int KX_SoundActuator::pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_D
        if (!PyArg_Parse(value, "O", &sound))
                return PY_SET_ATTR_FAIL;
 
-       AUD_Sound *snd = AUD_getSoundFromPython((void *)sound);
+       AUD_Sound *snd = AUD_getSoundFromPython(sound);
 
        if (snd)
        {
index bd7b286..83d2214 100644 (file)
 #include "SCA_IActuator.h"
 
 #ifdef WITH_AUDASPACE
-#  include "AUD_C-API.h"
+#  ifdef WITH_EXTERNAL_AUDASPACE
+#    include <audaspace/AUD_Sound.h>
+#    include <audaspace/AUD_Handle.h>
+#  else
+#    include "AUD_C-API.h"
+#  endif
 #endif
 
 #include "BKE_sound.h"