option(WITH_GAMEENGINE "Enable Game Engine" ON)
option(WITH_PLAYER "Build Player" OFF)
+option(WITH_AUDASPACE "Build with blenders audio library" ON)
+mark_as_advanced(WITH_AUDASPACE)
+
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
mark_as_advanced(WITH_HEADLESS)
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
endif()
+if(WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
+ message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK require WITH_AUDASPACE")
+endif()
+
if(NOT WITH_SAMPLERATE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK require WITH_SAMPLERATE")
endif()
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
+# TODO, make optional
+env['CPPFLAGS'].append('-DWITH_AUDASPACE')
+env['CXXFLAGS'].append('-DWITH_AUDASPACE')
+env['CCFLAGS'].append('-DWITH_AUDASPACE')
+
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
B.root_build_dir = env['BF_BUILDDIR']
B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
#
# ***** END GPL LICENSE BLOCK *****
-add_subdirectory(audaspace)
add_subdirectory(string)
add_subdirectory(ghost)
add_subdirectory(guardedalloc)
add_subdirectory(smoke)
add_subdirectory(mikktspace)
+if(WITH_AUDASPACE)
+ add_subdirectory(audaspace)
+endif()
+
if(WITH_MOD_FLUID)
add_subdirectory(elbeem)
endif()
../nodes
../editors/include
../render/extern/include
- ../../../intern/audaspace/intern
../../../intern/ffmpeg
../../../intern/bsp/extern ../blenfont
../../../intern/decimation/extern
add_definitions(-DGLEW_STATIC)
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
if(WITH_BULLET)
list(APPEND INC ../../../extern/bullet2/src)
add_definitions(-DUSE_BULLET)
#include "BKE_context.h"
#include "BKE_sound.h"
-#include "AUD_C-API.h"
+
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#ifdef WIN32
#define snprintf _snprintf
}
seq->strip->len = seq->len;
case SEQ_SOUND:
+#ifdef WITH_AUDASPACE
if(!seq->sound)
return;
seq->len = ceil(AUD_getInfo(seq->sound->playback_handle).length * FPS);
seq->len = 0;
}
seq->strip->len = seq->len;
+#else
+ return;
+#endif
break;
case SEQ_SCENE:
{
return seq;
}
+#ifdef WITH_AUDASPACE
Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
Scene *scene= CTX_data_scene(C); /* only for sound */
return seq;
}
+#else // WITH_AUDASPACE
+Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
+{
+ (void)C;
+ (void)seqbasep;
+ (void)seq_load;
+ return NULL;
+}
+#endif // WITH_AUDASPACE
Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
#include "DNA_screen_types.h"
#include "DNA_sound_types.h"
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "BKE_utildefines.h"
#include "BKE_global.h"
static int force_device = -1;
+
+struct bSound* sound_new_file(struct Main *bmain, const char *filename)
+{
+ bSound* sound = NULL;
+
+ char str[FILE_MAX];
+ char *path;
+
+ int len;
+
+ strcpy(str, filename);
+
+ path = /*bmain ? bmain->name :*/ G.main->name;
+
+ BLI_path_abs(str, path);
+
+ len = strlen(filename);
+ while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
+ len--;
+
+ sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
+ BLI_strncpy(sound->name, filename, FILE_MAX);
+// XXX unused currently sound->type = SOUND_TYPE_FILE;
+
+ sound_load(bmain, sound);
+
+ if(!sound->playback_handle)
+ {
+ free_libblock(&bmain->sound, sound);
+ sound = NULL;
+ }
+
+ return sound;
+}
+
+void sound_free(struct bSound* sound)
+{
+ if (sound->packedfile)
+ {
+ freePackedFile(sound->packedfile);
+ sound->packedfile = NULL;
+ }
+
+#ifdef WITH_AUDASPACE
+ if(sound->handle)
+ {
+ AUD_unload(sound->handle);
+ sound->handle = NULL;
+ sound->playback_handle = NULL;
+ }
+#endif // WITH_AUDASPACE
+}
+
+
+#ifdef WITH_AUDASPACE
+
#ifdef WITH_JACK
static void sound_sync_callback(void* data, int mode, float time)
{
AUD_exit();
}
-struct bSound* sound_new_file(struct Main *bmain, const char *filename)
-{
- bSound* sound = NULL;
-
- char str[FILE_MAX];
- char *path;
-
- int len;
-
- strcpy(str, filename);
-
- path = /*bmain ? bmain->name :*/ G.main->name;
-
- BLI_path_abs(str, path);
-
- len = strlen(filename);
- while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
- len--;
-
- sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
- BLI_strncpy(sound->name, filename, FILE_MAX);
-// XXX unused currently sound->type = SOUND_TYPE_FILE;
-
- sound_load(bmain, sound);
-
- if(!sound->playback_handle)
- {
- free_libblock(&bmain->sound, sound);
- sound = NULL;
- }
-
- return sound;
-}
-
// XXX unused currently
#if 0
struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
}
}
-void sound_free(struct bSound* sound)
-{
- if (sound->packedfile)
- {
- freePackedFile(sound->packedfile);
- sound->packedfile = NULL;
- }
-
- if(sound->handle)
- {
- AUD_unload(sound->handle);
- sound->handle = NULL;
- sound->playback_handle = NULL;
- }
-}
-
static float sound_get_volume(Scene* scene, Sequence* sequence, float time)
{
AnimData *adt= BKE_animdata_from_id(&scene->id);
return info.specs.channels;
}
+
+#else // WITH_AUDASPACE
+
+#include "BLI_utildefines.h"
+
+int sound_define_from_str(const char *UNUSED(str)) { return -1;}
+void sound_force_device(int UNUSED(device)) {}
+void sound_init_once(void) {}
+void sound_init(struct Main *UNUSED(bmain)) {}
+void sound_exit(void) {}
+void sound_cache(struct bSound* UNUSED(sound), int UNUSED(ignore)) { }
+void sound_delete_cache(struct bSound* UNUSED(sound)) {}
+void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {}
+void sound_create_scene(struct Scene *UNUSED(scene)) {}
+void sound_destroy_scene(struct Scene *UNUSED(scene)) {}
+void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
+void* sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
+void sound_mute_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), char UNUSED(mute)) {}
+void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
+static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
+void sound_play_scene(struct Scene *UNUSED(scene)) {}
+void sound_stop_scene(struct Scene *UNUSED(scene)) {}
+void sound_seek_scene(struct bContext *UNUSED(C)) {}
+float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
+int sound_scene_playing(struct Scene *UNUSED(scene)) { return 0; }
+int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
+int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; }
+
+#endif // WITH_AUDASPACE
#include "BLI_blenlib.h"
-#include "AUD_C-API.h" /* must be before BKE_sound.h for define */
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "BKE_global.h"
#include "BKE_idprop.h"
../../makesrna
../../windowmanager
../../../../intern/guardedalloc
- ../../../../intern/audaspace/intern
)
set(INC_SYS
sound_intern.h
)
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
blender_add_lib(bf_editor_sound "${SRC}" "${INC}" "${INC_SYS}")
#include "WM_api.h"
#include "WM_types.h"
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "ED_sound.h"
#include "ED_util.h"
uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
}
+#ifdef WITH_AUDASPACE
static int open_exec(bContext *C, wmOperator *op)
{
char path[FILE_MAX];
return OPERATOR_FINISHED;
}
+#else //WITH_AUDASPACE
+
+static int open_exec(bContext *UNUSED(C), wmOperator *op)
+{
+ BKE_report(op->reports, RPT_ERROR, "Compiled without sound support");
+
+ return OPERATOR_CANCELLED;
+}
+
+#endif
+
static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if(!RNA_property_is_set(op->ptr, "relative_path"))
../../makesrna
../../windowmanager
../../../../intern/guardedalloc
- ../../../../intern/audaspace/intern
)
set(INC_SYS
graph_intern.h
)
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
blender_add_lib(bf_editor_space_graph "${SRC}" "${INC}" "${INC_SYS}")
#include <string.h>
#include <float.h>
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "MEM_guardedalloc.h"
/* ------------------- */
+#ifdef WITH_AUDASPACE
static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op)
{
bAnimContext ac;
return OPERATOR_FINISHED;
}
+#else //WITH_AUDASPACE
+
+static int graphkeys_sound_bake_exec(bContext *UNUSED(C), wmOperator *op)
+{
+ BKE_report(op->reports, RPT_ERROR, "Compiled without sound support");
+
+ return OPERATOR_CANCELLED;
+}
+
+#endif //WITH_AUDASPACE
+
static int graphkeys_sound_bake_invoke (bContext *C, wmOperator *op, wmEvent *event)
{
bAnimContext ac;
../../makesrna
../../windowmanager
../../../../intern/guardedalloc
- ../../../../intern/audaspace/intern
)
set(INC_SYS
sequencer_intern.h
)
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
blender_add_lib(bf_editor_space_sequencer "${SRC}" "${INC}" "${INC_SYS}")
#include "UI_view2d.h"
#include "BKE_sound.h"
-#include "AUD_C-API.h"
+
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
/* own include */
#include "sequencer_intern.h"
add_definitions(-DWITH_HDR)
endif()
+if(WITH_AUDASPACE)
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
if(WITH_CODEC_QUICKTIME)
list(APPEND INC ../../quicktime)
add_definitions(-DWITH_QUICKTIME)
#ifdef WITH_QUICKTIME
#include "quicktime_export.h"
-#include "AUD_C-API.h"
+# ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+# endif
#endif
#ifdef WITH_FFMPEG
../../windowmanager
../../editors/include
../../../../intern/guardedalloc
- ../../../../intern/audaspace/intern
)
set(INC_SYS
add_definitions(-DWITH_PYTHON_SAFETY)
endif()
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}")
#include "../generic/blf_py_api.h"
#include "../generic/IDProp.h"
-#include "AUD_PyInit.h"
-
PyObject *bpy_package_py= NULL;
PyDoc_STRVAR(bpy_script_paths_doc,
// {(char *)"mathutils.geometry", BPyInit_mathutils_geometry},
{(char *)"bgl", BPyInit_bgl},
{(char *)"blf", BPyInit_blf},
+#ifdef WITH_AUDASPACE
{(char *)"aud", AUD_initPython},
+#endif
{NULL, NULL}
};
../render/extern/include
../include
../windowmanager
- ../../../intern/audaspace/intern
../../../intern/guardedalloc
)
add_definitions(-DWITH_QUICKTIME)
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
blender_add_lib(bf_quicktime "${SRC}" "${INC}" "${INC_SYS}")
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_ipo.h"
/***/
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
//XXX #include "BSE_headerbuttons.h"
#include "BKE_context.h"
../../../intern/string
../../../intern/container
../../../intern/guardedalloc
- ../../../intern/audaspace/intern
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
../../../source/gameengine/Converter
../../../source/blender/imbuf
add_definitions(-DGLEW_STATIC)
+if(WITH_AUDASPACE)
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
if(WITH_CODEC_FFMPEG)
+ list(APPEND INC
+ ../../../intern/audaspace/intern
+ )
add_definitions(-DWITH_FFMPEG)
endif()
../../../intern/guardedalloc
../../../intern/container
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
- ../../../intern/audaspace/intern
../../../source/gameengine/Converter
../../../source/gameengine/BlenderRoutines
../../../source/blender/imbuf
add_definitions(-DUSE_BULLET)
endif()
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
blender_add_lib(ge_converter "${SRC}" "${INC}" "${INC_SYS}")
#include "KX_BlenderSceneConverter.h"
#include "KX_ConvertActuators.h"
-#include "AUD_C-API.h"
+
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
+
// Actuators
//SCA logiclibrary native logicbricks
#include "SCA_PropertyActuator.h"
../../../source/gameengine/SceneGraph
../../../source/gameengine/Physics/common
../../../source/gameengine/Network/LoopBackNetwork
- ../../../intern/audaspace/intern
../../../source/blender/blenloader
../../../source/blender/gpu
)
add_definitions(-DWITH_FFMPEG)
endif()
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
if(WITH_BULLET)
list(APPEND INC
../../../extern/bullet2/src
#include "KX_PyConstraintBinding.h"
#include "PHY_IPhysicsEnvironment.h"
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "NG_NetworkScene.h"
#include "NG_NetworkDeviceInterface.h"
#include "KX_SoundActuator.h"
-#include "AUD_C-API.h"
+
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
+
#include "KX_GameObject.h"
#include "KX_PyMath.h" // needed for PyObjectFrom()
#include <iostream>
#include "SCA_IActuator.h"
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
+
#include "BKE_sound.h"
typedef struct KX_3DSoundSettings