diff options
author | Jörg Müller <nexyon@gmail.com> | 2017-08-18 09:24:12 +0300 |
---|---|---|
committer | Jörg Müller <nexyon@gmail.com> | 2017-08-18 09:24:12 +0300 |
commit | 986267300ba42a5c99d2802cd701803dd558e389 (patch) | |
tree | 9bf6a84f8e3ebb8d01e5617b1cccfd2693cc1345 /source | |
parent | d0dad0260434c4420fa9756264c1cc5e745e5ec9 (diff) |
Audaspace: Moving audaspace 1.3 into extern.
Deleting the old internal audaspace.
Major changes from there are:
- The whole library was refactored to use C++11.
- Many stability and performance improvements.
- Major Python API refactor:
- Most requested: Play self generated sounds using numpy arrays.
- For games: Sound list, random sounds and dynamic music.
- Writing sounds to files.
- Sequencing API.
- Opening sound devices, eg. Jack.
- Ability to choose different OpenAL devices in the user settings.
Diffstat (limited to 'source')
30 files changed, 50 insertions, 96 deletions
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 6f8274fabc8..98fb4f47339 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -35,8 +35,8 @@ #define SOUND_WAVE_SAMPLES_PER_SECOND 250 -#ifdef WITH_SYSTEM_AUDASPACE -# include AUD_DEVICE_H +#if defined(WITH_AUDASPACE) +# include <AUD_Device.h> #endif struct bSound; @@ -84,7 +84,7 @@ void BKE_sound_copy_data(struct Main *bmain, struct bSound *sound_dst, const str void BKE_sound_make_local(struct Main *bmain, struct bSound *sound, const bool lib_local); -#if defined(__AUD_C_API_H__) || defined(WITH_SYSTEM_AUDASPACE) +#if defined(WITH_AUDASPACE) AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume); #endif @@ -149,6 +149,4 @@ float BKE_sound_get_length(struct bSound *sound); char **BKE_sound_get_device_names(void); -bool BKE_sound_is_jack_supported(void); - #endif /* __BKE_SOUND_H__ */ diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 2a3d4c9fed7..db4c44a586e 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -333,7 +333,7 @@ if(WIN32) endif() if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 148fc3827e0..478b854c4df 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -59,7 +59,7 @@ #include "BKE_library.h" #ifdef WITH_AUDASPACE -# include AUD_SPECIAL_H +# include <AUD_Special.h> #endif #include "RNA_access.h" diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index eab80f06c09..18c721c8e3f 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -91,7 +91,7 @@ #include "BKE_sound.h" #ifdef WITH_AUDASPACE -# include AUD_SPECIAL_H +# include <AUD_Special.h> #endif /* mutable state for sequencer */ diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 45d1f969d64..a617d5aa9ac 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -48,13 +48,11 @@ #include "DNA_speaker_types.h" #ifdef WITH_AUDASPACE -# include AUD_SOUND_H -# include AUD_SEQUENCE_H -# include AUD_HANDLE_H -# include AUD_SPECIAL_H -# ifdef WITH_SYSTEM_AUDASPACE -# include "../../../intern/audaspace/intern/AUD_Set.h" -# endif +# include <AUD_Sound.h> +# include <AUD_Sequence.h> +# include <AUD_Handle.h> +# include <AUD_Special.h> +# include "../../../intern/audaspace/intern/AUD_Set.h" #endif #include "BKE_global.h" @@ -302,7 +300,6 @@ void BKE_sound_exit_once(void) sound_device = NULL; AUD_exitOnce(); -#ifdef WITH_SYSTEM_AUDASPACE if (audio_device_names != NULL) { int i; for (i = 0; audio_device_names[i]; i++) { @@ -311,7 +308,6 @@ void BKE_sound_exit_once(void) free(audio_device_names); audio_device_names = NULL; } -#endif } /* XXX unused currently */ @@ -907,28 +903,12 @@ float BKE_sound_get_length(bSound *sound) char **BKE_sound_get_device_names(void) { if (audio_device_names == NULL) { -#ifdef WITH_SYSTEM_AUDASPACE audio_device_names = AUD_getDeviceNames(); -#else - static const char *names[] = { - "Null", "SDL", "OpenAL", "JACK", NULL - }; - audio_device_names = (char **)names; -#endif } return audio_device_names; } -bool BKE_sound_is_jack_supported(void) -{ -#ifdef WITH_SYSTEM_AUDASPACE - return 1; -#else - return (bool)AUD_isJackSupported(); -#endif -} - #else /* WITH_AUDASPACE */ #include "BLI_utildefines.h" @@ -975,5 +955,4 @@ void BKE_sound_set_scene_sound_pan(void *UNUSED(handle), float UNUSED(pan), char void BKE_sound_set_scene_volume(struct Scene *UNUSED(scene), float UNUSED(volume)) {} void BKE_sound_set_scene_sound_pitch(void *UNUSED(handle), float UNUSED(pitch), char UNUSED(animated)) {} float BKE_sound_get_length(struct bSound *UNUSED(sound)) { return 0; } -bool BKE_sound_is_jack_supported(void) { return false; } #endif /* WITH_AUDASPACE */ diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 156b74f5c3d..4a226dbda11 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -45,8 +45,8 @@ #include "BLI_blenlib.h" #ifdef WITH_AUDASPACE -# include AUD_DEVICE_H -# include AUD_SPECIAL_H +# include <AUD_Device.h> +# include <AUD_Special.h> #endif #include "BLI_utildefines.h" diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1e1d08a3a9c..bf42316289f 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -2971,11 +2971,8 @@ void init_userdef_do_versions(void) if (U.image_draw_method == 0) U.image_draw_method = IMAGE_DRAW_METHOD_2DTEXTURE; - // keep the following until the new audaspace is default to be built with -#ifdef WITH_SYSTEM_AUDASPACE // we default to the first audio device U.audiodevice = 0; -#endif /* funny name, but it is GE stuff, moves userdef stuff to engine */ // XXX space_set_commmandline_options(); diff --git a/source/blender/editors/sound/CMakeLists.txt b/source/blender/editors/sound/CMakeLists.txt index 535cd579030..9efdf11e8d7 100644 --- a/source/blender/editors/sound/CMakeLists.txt +++ b/source/blender/editors/sound/CMakeLists.txt @@ -39,7 +39,7 @@ set(SRC ) if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index d103530fa81..ecc00f4b7e5 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -67,7 +67,7 @@ #include "WM_types.h" #ifdef WITH_AUDASPACE -# include AUD_SPECIAL_H +# include <AUD_Special.h> #endif #include "ED_sound.h" diff --git a/source/blender/editors/space_graph/CMakeLists.txt b/source/blender/editors/space_graph/CMakeLists.txt index 64ce1704b07..2840324e65e 100644 --- a/source/blender/editors/space_graph/CMakeLists.txt +++ b/source/blender/editors/space_graph/CMakeLists.txt @@ -49,7 +49,7 @@ set(SRC ) if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 09e38579c21..56b67f921fc 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -36,7 +36,7 @@ #include <float.h> #ifdef WITH_AUDASPACE -# include AUD_SPECIAL_H +# include <AUD_Special.h> #endif #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/space_sequencer/CMakeLists.txt b/source/blender/editors/space_sequencer/CMakeLists.txt index 6dce962ee02..6b8108a1265 100644 --- a/source/blender/editors/space_sequencer/CMakeLists.txt +++ b/source/blender/editors/space_sequencer/CMakeLists.txt @@ -54,7 +54,7 @@ set(SRC ) if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 46f212e3679..49c687632f8 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -69,7 +69,7 @@ #include "BKE_sound.h" #ifdef WITH_AUDASPACE -# include AUD_SEQUENCE_H +# include <AUD_Sequence.h> #endif /* own include */ diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 7c9d10a4e2c..fa01df2cbda 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -233,7 +233,7 @@ if(WITH_IMAGE_FRAMESERVER) endif() if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index ab94c8e303b..23f858f129b 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -65,7 +65,7 @@ #ifdef WITH_QUICKTIME # include "quicktime_export.h" -# include AUD_TYPES_H +# include <AUD_Types.h> #endif #ifdef WITH_FFMPEG diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 438735d371d..628adbddd36 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -519,7 +519,6 @@ static EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C), Poi int totitem = 0; EnumPropertyItem *item = NULL; -#ifdef WITH_SYSTEM_AUDASPACE int i; char **names = BKE_sound_get_device_names(); @@ -528,31 +527,6 @@ static EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C), Poi EnumPropertyItem new_item = {i, names[i], 0, names[i], names[i]}; RNA_enum_item_add(&item, &totitem, &new_item); } -#else - /* NONE */ - RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]); - -#ifdef WITH_SDL -# ifdef WITH_SDL_DYNLOAD - if (sdlewInit() == SDLEW_SUCCESS) -# endif - { - RNA_enum_item_add(&item, &totitem, &audio_device_items[index]); - } - index++; -#endif - -#ifdef WITH_OPENAL - RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]); -#endif - -#ifdef WITH_JACK - if (BKE_sound_is_jack_supported()) { - RNA_enum_item_add(&item, &totitem, &audio_device_items[index]); - } - index++; -#endif -#endif /* may be unused */ UNUSED_VARS(index, audio_device_items); diff --git a/source/blender/quicktime/CMakeLists.txt b/source/blender/quicktime/CMakeLists.txt index f853c35457f..cee2cea99fb 100644 --- a/source/blender/quicktime/CMakeLists.txt +++ b/source/blender/quicktime/CMakeLists.txt @@ -52,7 +52,7 @@ set(SRC add_definitions(-DWITH_QUICKTIME) if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 1ac3c58f888..d2508fe108a 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -35,7 +35,7 @@ #include "DNA_userdef_types.h" #ifdef WITH_AUDASPACE -# include AUD_DEVICE_H +# include <AUD_Device.h> #endif #include "BLI_utildefines.h" diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index cfa97a9e177..0894f246445 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -97,7 +97,7 @@ set(SRC ) if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index fdcded8e50a..2c766efc6a2 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -77,10 +77,10 @@ #include "WM_api.h" /* only for WM_main_playanim */ #ifdef WITH_AUDASPACE -# include AUD_DEVICE_H -# include AUD_HANDLE_H -# include AUD_SOUND_H -# include AUD_SPECIAL_H +# include <AUD_Device.h> +# include <AUD_Handle.h> +# include <AUD_Sound.h> +# include <AUD_Special.h> static AUD_Sound *source = NULL; static AUD_Handle *playback_handle = NULL; diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 4f0e64b0955..bd07961c556 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -91,6 +91,12 @@ list(APPEND BLENDER_LINK_LIBS blenkernel_blc ) +if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE) + list(APPEND BLENDER_LINK_LIBS + audaspace + audaspace-py) +endif() + if(CMAKE_SYSTEM_NAME MATCHES "Linux") list(APPEND BLENDER_LINK_LIBS extern_binreloc) endif() @@ -150,6 +156,8 @@ endif() bf_blenfont bf_blentranslation bf_intern_audaspace + audaspace + audaspace-py blenkernel_blc bf_bmesh bf_blenlib diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 99f3d0639f3..4e8f0eba9b7 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -101,7 +101,7 @@ typedef void * wmUIHandlerRemoveFunc; } #ifdef WITH_AUDASPACE -# include AUD_DEVICE_H +# include <AUD_Device.h> #endif static BlendFileData *load_game_data(const char *filename) diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index aaeb2e10462..42293050753 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -56,7 +56,7 @@ set(SRC add_definitions(${GL_DEFINITIONS}) if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index 4db9fcebd06..7d6195e3c38 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -113,7 +113,7 @@ if(WITH_BULLET) endif() if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 974dcbca95b..d78ea4eed54 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -42,7 +42,7 @@ #include "KX_ConvertActuators.h" #ifdef WITH_AUDASPACE -# include AUD_SOUND_H +# include <AUD_Sound.h> #endif // Actuators diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index 6d6d53b1e17..5bce9fcd248 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -95,7 +95,7 @@ if(WITH_INTERNATIONAL) endif() if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index ddb04e9f84d..1b6b6defdf9 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -99,7 +99,7 @@ extern "C" #include "GHOST_Rect.h" #ifdef WITH_AUDASPACE -# include AUD_DEVICE_H +# include <AUD_Device.h> #endif static void frameTimerProc(GHOST_ITimerTask* task, GHOST_TUns64 time); diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index 417f54cc8b9..cb7c0180f30 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -244,7 +244,7 @@ if(WITH_CODEC_FFMPEG) endif() if(WITH_AUDASPACE) - add_definitions(${AUDASPACE_DEFINITIONS}) + add_definitions(-DWITH_AUDASPACE) list(APPEND INC_SYS ${AUDASPACE_C_INCLUDE_DIRS} diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index d858097abef..04ec3f9cd04 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -37,14 +37,12 @@ #include "KX_SoundActuator.h" #ifdef WITH_AUDASPACE -# ifdef WITH_SYSTEM_AUDASPACE typedef float sample_t; -# include AUD_PYTHON_H -# endif -# include AUD_SOUND_H -# include AUD_SPECIAL_H -# include AUD_DEVICE_H -# include AUD_HANDLE_H +# include <python/PyAPI.h> +# include <AUD_Sound.h> +# include <AUD_Special.h> +# include <AUD_Device.h> +# include <AUD_Handle.h> #endif #include "KX_GameObject.h" diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index 5ec2fda722f..4f3e6f707e0 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -35,8 +35,8 @@ #include "SCA_IActuator.h" #ifdef WITH_AUDASPACE -# include AUD_SOUND_H -# include AUD_HANDLE_H +# include <AUD_Sound.h> +# include <AUD_Handle.h> #endif #include "BKE_sound.h" |