Merge from trunk -r 25003:25745.
authorArystanbek Dyussenov <arystan.d@gmail.com>
Tue, 5 Jan 2010 19:21:59 +0000 (19:21 +0000)
committerArystanbek Dyussenov <arystan.d@gmail.com>
Tue, 5 Jan 2010 19:21:59 +0000 (19:21 +0000)
780 files changed:
CMakeLists.txt
SConstruct
config/darwin-config.py
config/linux2-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
config/win64-vc-config.py
extern/Eigen2/Eigen/src/Core/util/Macros.h
extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp
extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.h
extern/bullet2/src/SConscript
intern/audaspace/CMakeLists.txt
intern/audaspace/FX/AUD_AccumulatorFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_AccumulatorFactory.h [new file with mode: 0644]
intern/audaspace/FX/AUD_AccumulatorReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_AccumulatorReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_ButterworthFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_ButterworthFactory.h [new file with mode: 0644]
intern/audaspace/FX/AUD_ButterworthReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_ButterworthReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_DelayReader.cpp
intern/audaspace/FX/AUD_DoubleReader.cpp
intern/audaspace/FX/AUD_EnvelopeFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_EnvelopeFactory.h [new file with mode: 0644]
intern/audaspace/FX/AUD_EnvelopeReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_EnvelopeReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_FaderReader.cpp
intern/audaspace/FX/AUD_FaderReader.h
intern/audaspace/FX/AUD_HighpassFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_HighpassFactory.h [new file with mode: 0644]
intern/audaspace/FX/AUD_HighpassReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_HighpassReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_LoopFactory.h
intern/audaspace/FX/AUD_LoopReader.cpp
intern/audaspace/FX/AUD_LowpassFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_LowpassFactory.h [new file with mode: 0644]
intern/audaspace/FX/AUD_LowpassReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_LowpassReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_PitchFactory.h
intern/audaspace/FX/AUD_RectifyFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_RectifyFactory.h [moved from intern/audaspace/SDL/AUD_SDLMixerFactory.h with 66% similarity]
intern/audaspace/FX/AUD_RectifyReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_RectifyReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_ReverseReader.cpp
intern/audaspace/FX/AUD_SquareFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_SquareFactory.h [moved from intern/audaspace/SDL/AUD_SDLMixer.h with 51% similarity]
intern/audaspace/FX/AUD_SquareReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_SquareReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_SumFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_SumFactory.h [new file with mode: 0644]
intern/audaspace/FX/AUD_SumReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_SumReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_VolumeFactory.h
intern/audaspace/FX/AUD_VolumeReader.cpp
intern/audaspace/FX/AUD_VolumeReader.h
intern/audaspace/Makefile
intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
intern/audaspace/OpenAL/AUD_OpenALDevice.h
intern/audaspace/SConscript
intern/audaspace/SDL/AUD_SDLDevice.cpp
intern/audaspace/SDL/AUD_SDLDevice.h
intern/audaspace/SDL/AUD_SDLMixer.cpp [deleted file]
intern/audaspace/SDL/AUD_SDLMixerReader.cpp [deleted file]
intern/audaspace/SDL/AUD_SDLMixerReader.h [deleted file]
intern/audaspace/SRC/AUD_SRCResampleFactory.cpp
intern/audaspace/SRC/AUD_SRCResampleFactory.h
intern/audaspace/SRC/AUD_SRCResampleReader.cpp
intern/audaspace/SRC/AUD_SRCResampleReader.h
intern/audaspace/SRC/Makefile
intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
intern/audaspace/ffmpeg/AUD_FFMPEGReader.h
intern/audaspace/fftw/AUD_BandPassFactory.cpp [new file with mode: 0644]
intern/audaspace/fftw/AUD_BandPassFactory.h [new file with mode: 0644]
intern/audaspace/fftw/AUD_BandPassReader.cpp [new file with mode: 0644]
intern/audaspace/fftw/AUD_BandPassReader.h [new file with mode: 0644]
intern/audaspace/fftw/Makefile [new file with mode: 0644]
intern/audaspace/intern/AUD_Buffer.cpp
intern/audaspace/intern/AUD_Buffer.h
intern/audaspace/intern/AUD_BufferReader.cpp
intern/audaspace/intern/AUD_C-API.cpp
intern/audaspace/intern/AUD_C-API.h
intern/audaspace/intern/AUD_ChannelMapperFactory.cpp
intern/audaspace/intern/AUD_ChannelMapperFactory.h
intern/audaspace/intern/AUD_ChannelMapperReader.cpp
intern/audaspace/intern/AUD_ConverterFactory.cpp
intern/audaspace/intern/AUD_ConverterFactory.h
intern/audaspace/intern/AUD_ConverterFunctions.cpp
intern/audaspace/intern/AUD_ConverterFunctions.h
intern/audaspace/intern/AUD_ConverterReader.cpp
intern/audaspace/intern/AUD_ConverterReader.h
intern/audaspace/intern/AUD_FloatMixer.h [deleted file]
intern/audaspace/intern/AUD_IDevice.h
intern/audaspace/intern/AUD_LinearResampleFactory.cpp [moved from intern/audaspace/SDL/AUD_SDLMixerFactory.cpp with 53% similarity]
intern/audaspace/intern/AUD_LinearResampleFactory.h [new file with mode: 0644]
intern/audaspace/intern/AUD_LinearResampleReader.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_LinearResampleReader.h [new file with mode: 0644]
intern/audaspace/intern/AUD_Mixer.cpp [moved from intern/audaspace/intern/AUD_FloatMixer.cpp with 75% similarity]
intern/audaspace/intern/AUD_Mixer.h [moved from intern/audaspace/intern/AUD_IMixer.h with 56% similarity]
intern/audaspace/intern/AUD_MixerFactory.cpp
intern/audaspace/intern/AUD_MixerFactory.h
intern/audaspace/intern/AUD_NULLDevice.cpp
intern/audaspace/intern/AUD_NULLDevice.h
intern/audaspace/intern/AUD_ReadDevice.cpp
intern/audaspace/intern/AUD_ReadDevice.h
intern/audaspace/intern/AUD_SinusReader.cpp
intern/audaspace/intern/AUD_SoftwareDevice.cpp
intern/audaspace/intern/AUD_SoftwareDevice.h
intern/audaspace/intern/AUD_Space.h
intern/audaspace/intern/AUD_StreamBufferFactory.cpp
intern/audaspace/intern/Makefile
intern/audaspace/jack/AUD_JackDevice.cpp
intern/audaspace/jack/AUD_JackDevice.h
intern/audaspace/make/msvc_9_0/audaspace.vcproj
intern/audaspace/sndfile/AUD_SndFileReader.cpp
intern/audaspace/sndfile/AUD_SndFileReader.h
intern/audaspace/sndfile/Makefile
intern/boolop/intern/BOP_Face2Face.cpp
intern/ghost/CMakeLists.txt
intern/ghost/SConscript
intern/ghost/intern/GHOST_Debug.h
intern/ghost/intern/GHOST_DropTargetWin32.cpp [new file with mode: 0644]
intern/ghost/intern/GHOST_DropTargetWin32.h [new file with mode: 0644]
intern/ghost/intern/GHOST_EventPrinter.cpp
intern/ghost/intern/GHOST_SystemCocoa.h
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemWin32.h
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.h
intern/ghost/intern/GHOST_WindowX11.cpp
intern/ghost/intern/Makefile
intern/ghost/make/msvc_9_0/ghost.vcproj
intern/opennl/superlu/sgstrf.c
projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
projectfiles_vc9/blender/blender.vcproj
projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
projectfiles_vc9/blender/editors/ED_editors.vcproj
projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
projectfiles_vc9/blender/loader/BLO_loader.vcproj
projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
release/datafiles/blenderbuttons
release/datafiles/datatoc.py
release/getversion.py
release/scripts/io/engine_render_pov.py
release/scripts/io/export_3ds.py
release/scripts/io/export_fbx.py
release/scripts/io/export_mdd.py
release/scripts/io/export_obj.py
release/scripts/io/export_ply.py
release/scripts/io/export_x3d.py
release/scripts/io/import_anim_bvh.py
release/scripts/io/import_scene_3ds.py
release/scripts/io/import_scene_obj.py
release/scripts/io/netrender/__init__.py
release/scripts/io/netrender/balancing.py
release/scripts/io/netrender/client.py
release/scripts/io/netrender/master.py
release/scripts/io/netrender/master_html.py
release/scripts/io/netrender/model.py
release/scripts/io/netrender/netrender.css [new file with mode: 0644]
release/scripts/io/netrender/netrender.js [new file with mode: 0644]
release/scripts/io/netrender/operators.py
release/scripts/io/netrender/slave.py
release/scripts/io/netrender/ui.py
release/scripts/io/netrender/utils.py
release/scripts/modules/bpy/__init__.py
release/scripts/modules/bpy/app.py [new file with mode: 0644]
release/scripts/modules/bpy/ops.py
release/scripts/modules/bpy/utils.py
release/scripts/modules/bpy_types.py
release/scripts/modules/console/__init__.py
release/scripts/modules/console/complete_calltip.py
release/scripts/modules/console/complete_import.py
release/scripts/modules/console/complete_namespace.py
release/scripts/modules/console/intellisense.py
release/scripts/modules/dynamic_menu.py [deleted file]
release/scripts/modules/graphviz_export.py [new file with mode: 0644]
release/scripts/modules/retopo.py [new file with mode: 0644]
release/scripts/modules/rigify.py [deleted file]
release/scripts/modules/rigify/__init__.py [new file with mode: 0644]
release/scripts/modules/rigify/arm_biped_generic.py [new file with mode: 0644]
release/scripts/modules/rigify/copy.py [new file with mode: 0644]
release/scripts/modules/rigify/delta.py [new file with mode: 0644]
release/scripts/modules/rigify/finger_curl.py [new file with mode: 0644]
release/scripts/modules/rigify/leg_biped_generic.py [new file with mode: 0644]
release/scripts/modules/rigify/leg_quadruped_generic.py [new file with mode: 0644]
release/scripts/modules/rigify/neck_flex.py [new file with mode: 0644]
release/scripts/modules/rigify/palm_curl.py [new file with mode: 0644]
release/scripts/modules/rigify/spine_pivot_flex.py [new file with mode: 0644]
release/scripts/modules/rigify_utils.py [new file with mode: 0644]
release/scripts/modules/rna_info.py [new file with mode: 0644]
release/scripts/modules/rna_prop_ui.py
release/scripts/op/add_armature_human.py [new file with mode: 0644]
release/scripts/op/add_mesh_torus.py
release/scripts/op/console_python.py
release/scripts/op/console_shell.py
release/scripts/op/mesh.py
release/scripts/op/mesh_skin.py
release/scripts/op/object.py
release/scripts/op/presets.py
release/scripts/op/screen_play_rendered_anim.py [new file with mode: 0644]
release/scripts/op/uvcalc_follow_active.py [new file with mode: 0644]
release/scripts/op/uvcalc_smart_project.py
release/scripts/op/vertexpaint_dirt.py
release/scripts/op/wm.py
release/scripts/presets/render/HDTV_1080p.py
release/scripts/presets/render/HDTV_720p.py
release/scripts/presets/render/TV_PAL.py
release/scripts/presets/render/TV_PAL_16_colon_9.py
release/scripts/templates/operator.py
release/scripts/templates/operator_simple.py
release/scripts/ui/properties_data_armature.py
release/scripts/ui/properties_data_armature_rigify.py [new file with mode: 0644]
release/scripts/ui/properties_data_bone.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/properties_data_mesh.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_game.py
release/scripts/ui/properties_material.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_object_constraint.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_physics_cloth.py
release/scripts/ui/properties_physics_common.py
release/scripts/ui/properties_physics_field.py
release/scripts/ui/properties_physics_fluid.py
release/scripts/ui/properties_physics_softbody.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_texture.py
release/scripts/ui/properties_world.py
release/scripts/ui/space_console.py
release/scripts/ui/space_dopesheet.py [new file with mode: 0644]
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_graph.py [new file with mode: 0644]
release/scripts/ui/space_image.py
release/scripts/ui/space_info.py
release/scripts/ui/space_logic.py
release/scripts/ui/space_nla.py [new file with mode: 0644]
release/scripts/ui/space_node.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_text.py
release/scripts/ui/space_time.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
release/test/pep8.py [new file with mode: 0644]
release/test/rna_array.py
source/Makefile
source/blender/avi/intern/avi.c
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_anim.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/BKE_customdata_file.h [new file with mode: 0644]
source/blender/blenkernel/BKE_fcurve.h
source/blender/blenkernel/BKE_idprop.h
source/blender/blenkernel/BKE_key.h
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_pointcache.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/BKE_sequencer.h [moved from source/blender/blenkernel/BKE_sequence.h with 86% similarity]
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/BKE_subsurf.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/BKE_writeavi.h
source/blender/blenkernel/BKE_writeffmpeg.h
source/blender/blenkernel/BKE_writeframeserver.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/CCGSubSurf.c
source/blender/blenkernel/intern/CCGSubSurf.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/Makefile
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/customdata_file.c [new file with mode: 0644]
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenkernel/intern/script.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c [moved from source/blender/blenkernel/intern/sequence.c with 92% similarity]
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenkernel/intern/writeframeserver.c
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/BLI_listbase.h
source/blender/blenlib/BLI_math_base.h
source/blender/blenlib/BLI_math_color.h
source/blender/blenlib/BLI_math_geom.h
source/blender/blenlib/BLI_math_rotation.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_path_util.h [moved from source/blender/blenlib/BLI_util.h with 100% similarity]
source/blender/blenlib/BLI_pbvh.h [new file with mode: 0644]
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/SConscript
source/blender/blenlib/intern/BLI_bfile.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/Makefile
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/listbase.c
source/blender/blenlib/intern/math_base.c
source/blender/blenlib/intern/math_color.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/math_vector.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/path_util.c [moved from source/blender/blenlib/intern/util.c with 99% similarity]
source/blender/blenlib/intern/pbvh.c [new file with mode: 0644]
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/DocumentExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/editors/CMakeLists.txt
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_intern.h
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/animation/keyframes_general.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/curve_intern.h
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/datafiles/B.blend.c
source/blender/editors/datafiles/blenderbuttons.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_curve.h
source/blender/editors/include/ED_keyframes_edit.h
source/blender/editors/include/ED_keyframing.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_particle.h
source/blender/editors/include/ED_screen.h
source/blender/editors/include/ED_sculpt.h
source/blender/editors/include/ED_sequencer.h
source/blender/editors/include/ED_transform.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_icons.h
source/blender/editors/include/UI_interface.h
source/blender/editors/include/UI_interface_icons.h
source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_ops.c [new file with mode: 0644]
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_lib.c
source/blender/editors/mesh/editmesh_loop.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/metaball/mball_intern.h
source/blender/editors/metaball/mball_ops.c
source/blender/editors/object/Makefile
source/blender/editors/object/SConscript
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c [new file with mode: 0644]
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/Makefile
source/blender/editors/physics/SConscript
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_intern.h
source/blender/editors/physics/physics_ops.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/render/SConscript
source/blender/editors/render/render_ops.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/Makefile
source/blender/editors/screen/SConscript
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_undo.c [new file with mode: 0644]
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_header.c [deleted file]
source/blender/editors/space_action/action_intern.h
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_console/console_intern.h
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/fsmenu.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/Makefile
source/blender/editors/space_graph/SConscript
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/graph_header.c [deleted file]
source/blender/editors/space_graph/graph_intern.h
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_header.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_nla/nla_header.c [deleted file]
source/blender/editors/space_nla/nla_ops.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/space_script.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_sound/space_sound.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_header.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_ops.c
source/blender/editors/space_userpref/space_userpref.c
source/blender/editors/space_view3d/drawanimviz.c [new file with mode: 0644]
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/ed_util.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/GPU_draw.h
source/blender/gpu/gpu_buffers.h
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_draw.c
source/blender/imbuf/intern/divers.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/targa.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_anim_types.h
source/blender/makesdna/DNA_armature_types.h
source/blender/makesdna/DNA_brush_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_customdata_types.h
source/blender/makesdna/DNA_gpencil_types.h
source/blender/makesdna/DNA_ipo_types.h
source/blender/makesdna/DNA_lamp_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_object_force.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_particle_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesdna/DNA_world_types.h
source/blender/makesdna/intern/Makefile
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/Makefile
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_animation_api.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_armature_api.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_camera.c
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_gpencil.c
source/blender/makesrna/intern/rna_group.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_lamp.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_mesh_api.c
source/blender/makesrna/intern/rna_meta.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_sequencer.c [moved from source/blender/makesrna/intern/rna_sequence.c with 72% similarity]
source/blender/makesrna/intern/rna_smoke.c
source/blender/makesrna/intern/rna_sound.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/makesrna/intern/rna_world.c
source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c
source/blender/python/BPY_extern.h
source/blender/python/epy_doc_gen.py [deleted file]
source/blender/python/generic/Geometry.c
source/blender/python/generic/bpy_internal_import.c
source/blender/python/generic/euler.c
source/blender/python/generic/matrix.c
source/blender/python/generic/quat.c
source/blender/python/generic/vector.c
source/blender/python/intern/bpy_array.c
source/blender/python/intern/bpy_driver.c [new file with mode: 0644]
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_operator_wrap.h
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h
source/blender/python/intern/bpy_util.c
source/blender/python/intern/bpy_util.h
source/blender/python/intern/stubs.c
source/blender/python/sphinx_doc_gen.py [new file with mode: 0644]
source/blender/quicktime/CMakeLists.txt
source/blender/quicktime/SConscript
source/blender/quicktime/apple/Makefile
source/blender/quicktime/apple/qtkit_export.m
source/blender/quicktime/apple/qtkit_import.m
source/blender/quicktime/apple/quicktime_export.c
source/blender/quicktime/apple/quicktime_import.c
source/blender/quicktime/quicktime_export.h
source/blender/render/SConscript
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/raytrace/reorganize.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/texture.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_subwindow.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_event_types.h
source/blender/windowmanager/wm_window.h
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c
source/darwin/Makefile
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/GamePlayer/common/CMakeLists.txt
source/gameengine/GamePlayer/common/SConscript
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.h
source/gameengine/Ketsji/KX_PyMath.cpp
source/gameengine/Ketsji/KX_PyMath.h
source/gameengine/Ketsji/KX_RayCast.cpp
source/gameengine/Ketsji/KX_RayCast.h
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.h
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Physics/common/PHY_DynamicTypes.h
source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
source/gameengine/PyDoc/GameTypes.py
source/gameengine/Rasterizer/RAS_CameraData.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
source/gameengine/VideoTexture/ImageBuff.cpp
source/gameengine/VideoTexture/ImageBuff.h
source/nan_compile.mk
source/nan_definitions.mk
source/nan_link.mk
tools/bcolors.py [changed mode: 0755->0644]
tools/btools.py [changed mode: 0755->0644]
tools/crossmingw.py [changed mode: 0755->0644]

index 184b106..c5bce89 100644 (file)
@@ -437,7 +437,7 @@ IF(APPLE)
                IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
                        SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
                ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
-                       SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
+                       SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
                ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
        ENDIF(WITH_LIBS10.5)
        
index 369a180..8a026a0 100644 (file)
@@ -378,7 +378,7 @@ if not os.path.isdir ( B.root_build_dir):
        os.makedirs ( B.root_build_dir + 'extern' )
        os.makedirs ( B.root_build_dir + 'lib' )
        os.makedirs ( B.root_build_dir + 'bin' )
-if not os.path.isdir(B.doc_build_dir):
+if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
        os.makedirs ( B.doc_build_dir )
 
 Help(opts.GenerateHelpText(env))
@@ -533,9 +533,10 @@ plugtargetlist = []
 for tp, tn, tf in os.walk('release/plugins'):
        if '.svn' in tn:
                tn.remove('.svn')
+       df = tp[8:] # remove 'release/'
        for f in tf:
                pluglist.append(os.path.join(tp, f))
-               plugtargetlist.append( os.path.join(*([BLENDERPATH] + tp.split(os.sep)[1:] + [f])) )
+               plugtargetlist.append( os.path.join(BLENDERPATH, df, f) )
 
 
 # header files for plugins
@@ -648,12 +649,14 @@ if not env['WITHOUT_BF_INSTALL']:
 
 #------------ EPYDOC
 if env['WITH_BF_DOCS']:
-       try:            import epydoc
-       except: epydoc = None
-       
-       if epydoc:
-               SConscript('source/gameengine/PyDoc/SConscript')
-       else:
-               print "No epydoc install detected, Python API and Gameengine API Docs will not be generated "
-       
+    try:
+        import epydoc
+    except ImportError:
+        epydoc = None
+
+    if epydoc:
+        SConscript('source/gameengine/PyDoc/SConscript')
+    else:
+        print "No epydoc install detected, Python API and Gameengine API Docs will not be generated "
+
 
index 825d00f..a2ce9c3 100644 (file)
@@ -40,19 +40,28 @@ if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
 # Can be customized
 
 if MACOSX_ARCHITECTURE == 'ppc':
-       MAC_MIN_VERS = '10.3'
-       MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
-       LCGDIR = '#../lib/darwin-6.1-powerpc'
-       CC = 'gcc-3.3'
-       CXX = 'g++-3.3'
+# ppc release are now made for 10.4
+#      MAC_MIN_VERS = '10.3'
+#      MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
+#      LCGDIR = '#../lib/darwin-6.1-powerpc'
+#      CC = 'gcc-3.3'
+#      CXX = 'g++-3.3'
+       MAC_MIN_VERS = '10.4'
+       MACOSX_DEPLOYMENT_TARGET = '10.4'
+       MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
+       LCGDIR = '#../lib/darwin-8.0.0-powerpc'
+       CC = 'gcc-4.0'
+       CXX = 'g++-4.0'
 elif MACOSX_ARCHITECTURE == 'i386':
        MAC_MIN_VERS = '10.4'
+       MACOSX_DEPLOYMENT_TARGET = '10.4'
        MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
        LCGDIR = '#../lib/darwin-8.x.i386'
        CC = 'gcc-4.0'
        CXX = 'g++-4.0'
 else :
        MAC_MIN_VERS = '10.5'
+       MACOSX_DEPLOYMENT_TARGET = '10.5'
        MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
        LCGDIR = '#../lib/darwin-9.x.universal'
        CC = 'gcc-4.2'
@@ -147,7 +156,7 @@ BF_JACK_INC = '${BF_JACK}/include/jack'
 BF_JACK_LIB = 'jack'
 BF_JACK_LIBPATH = '${BF_JACK}/lib'
 
-WITH_BF_SNDFILE = False
+WITH_BF_SNDFILE = True
 BF_SNDFILE = LIBDIR + '/sndfile'
 BF_SNDFILE_INC = '${BF_SNDFILE}/include'
 BF_SNDFILE_LIB = 'sndfile'
@@ -205,7 +214,7 @@ BF_BULLET = '#extern/bullet2/src'
 BF_BULLET_INC = '${BF_BULLET}'
 BF_BULLET_LIB = 'extern_bullet'
 
-WITH_BF_FFTW3 = False
+WITH_BF_FFTW3 = True
 BF_FFTW3 = LIBDIR + '/fftw3'
 BF_FFTW3_INC = '${BF_FFTW3}/include'
 BF_FFTW3_LIB = 'libfftw3'
@@ -249,7 +258,7 @@ BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
 BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
 
 #OpenCollada flags
-WITH_BF_COLLADA = True
+WITH_BF_COLLADA = False
 BF_COLLADA = '#source/blender/collada'
 BF_COLLADA_INC = '${BF_COLLADA}'
 BF_COLLADA_LIB = 'bf_collada'
@@ -264,6 +273,14 @@ BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
 #BF_EXPAT_LIB = 'expat'
 #BF_EXPAT_LIBPATH = '/usr/lib'
 
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = False
+if MACOSX_ARCHITECTURE == 'i386':
+    BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
+elif MACOSX_ARCHITECTURE == 'x86_64':
+    BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-msse2']
+    
+
 #############################################################################
 ###################  various compile settings and flags    ##################
 #############################################################################
@@ -303,8 +320,8 @@ if MAC_MIN_VERS == '10.3':
        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
+       SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS,'-arch',MACOSX_ARCHITECTURE]    
+       PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS,'-Wl','-syslibroot '+MACOSX_SDK,'-arch',MACOSX_ARCHITECTURE]+PLATFORM_LINKFLAGS
        CCFLAGS=SDK_FLAGS+CCFLAGS
        CXXFLAGS=SDK_FLAGS+CXXFLAGS
        
index f03daac..fe07d6d 100644 (file)
@@ -167,6 +167,10 @@ BF_EXPAT_LIBPATH = '/usr/lib'
 
 WITH_BF_OPENMP = True
 
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = False
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
+
 ##
 CC = 'gcc'
 CXX = 'g++'
index 709261e..00c70aa 100644 (file)
@@ -127,8 +127,19 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
              '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
              '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
 
-# Disable Collada by default
-WITH_BF_COLLADA = False
+WITH_BF_COLLADA = True
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+
+BF_OPENCOLLADA = LIBDIR + '/opencollada'
+BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre'
+BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
+
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = False
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
 
 ##
 CC = 'gcc'
@@ -145,7 +156,7 @@ C_WARN = [ '-Wno-char-subscripts', '-Wdeclaration-after-statement' ]
 
 CC_WARN = [ '-Wall' ]
 
-LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++']
+LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid']
 
 BF_DEBUG = False
 BF_DEBUG_CCFLAGS= ['-g']
index d16575b..a93145d 100644 (file)
@@ -148,6 +148,10 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre'
 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
 
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = False
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
+
 WITH_BF_STATICOPENGL = False
 BF_OPENGL_INC = '${BF_OPENGL}/include'
 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
@@ -155,6 +159,7 @@ BF_OPENGL_LIB = 'opengl32 glu32'
 BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
                          '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
                          '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
+                         
 CC = 'cl.exe'
 CXX = 'cl.exe'
 
index caad70c..ee70b62 100644 (file)
@@ -161,6 +161,10 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre'
 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
 
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = False
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
+
 WITH_BF_STATICOPENGL = False
 BF_OPENGL_INC = '${BF_OPENGL}/include'
 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
index 6be6f09..89b2031 100644 (file)
@@ -39,7 +39,7 @@
 // 16 byte alignment is only useful for vectorization. Since it affects the ABI, we need to enable 16 byte alignment on all
 // platforms where vectorization might be enabled. In theory we could always enable alignment, but it can be a cause of problems
 // on some platforms, so we just disable it in certain common platform (compiler+architecture combinations) to avoid these problems.
-#if defined(__GNUC__) && !(defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__ia64__))
+#if defined(__GNUC__) && !(defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__ia64__) || defined(__ppc__))
 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_ALIGNMENT 1
 #else
 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_ALIGNMENT 0
index 6ab93c1..61aac5b 100644 (file)
@@ -793,7 +793,7 @@ btSoftBody*         btSoftBodyHelpers::CreateEllipsoid(btSoftBodyWorldInfo& worldInfo,c
 //
 btSoftBody*            btSoftBodyHelpers::CreateFromTriMesh(btSoftBodyWorldInfo& worldInfo,const btScalar*     vertices,
                                                                                                         const int* triangles,
-                                                                                                        int ntriangles)
+                                                                                                        int ntriangles, bool randomizeConstraints)
 {
        int             maxidx=0;
        int i,j,ni;
@@ -828,13 +828,16 @@ btSoftBody*               btSoftBodyHelpers::CreateFromTriMesh(btSoftBodyWorldInfo& worldInfo
 #undef IDX
                psb->appendFace(idx[0],idx[1],idx[2]);
        }
-       psb->randomizeConstraints();
+       if (randomizeConstraints)
+       {
+               psb->randomizeConstraints();
+       }
        return(psb);
 }
 
 //
 btSoftBody*            btSoftBodyHelpers::CreateFromConvexHull(btSoftBodyWorldInfo& worldInfo, const btVector3* vertices,
-                                                                                                               int nvertices)
+                                                                                                               int nvertices, bool randomizeConstraints)
 {
        HullDesc                hdsc(QF_TRIANGLES,nvertices,vertices);
        HullResult              hres;
@@ -854,6 +857,9 @@ btSoftBody*         btSoftBodyHelpers::CreateFromConvexHull(btSoftBodyWorldInfo& worldI
                psb->appendFace(idx[0],idx[1],idx[2]);
        }
        hlib.ReleaseResult(hres);
-       psb->randomizeConstraints();
+       if (randomizeConstraints)
+       {
+               psb->randomizeConstraints();
+       }
        return(psb);
 }
index 0e3b503..5eb2ebc 100644 (file)
@@ -109,11 +109,13 @@ struct    btSoftBodyHelpers
        static  btSoftBody*             CreateFromTriMesh(      btSoftBodyWorldInfo& worldInfo,
                const btScalar* vertices,
                const int* triangles,
-               int ntriangles);
+               int ntriangles,
+               bool randomizeConstraints = true);
        /* Create from convex-hull                                                                                              */ 
        static  btSoftBody*             CreateFromConvexHull(   btSoftBodyWorldInfo& worldInfo,
                const btVector3* vertices,
-               int nvertices);
+               int nvertices,
+               bool randomizeConstraints = true);
 };
 
 #endif //SOFT_BODY_HELPERS_H
index c0ee560..5cb9185 100644 (file)
@@ -42,4 +42,4 @@ env.BlenderLib ( libname = 'extern_bullet2collision_dispatch', sources=collision
 env.BlenderLib ( libname = 'extern_bullet2collision_gimpact', sources=collision_gimpact_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags )
 env.BlenderLib ( libname = 'extern_bullet2collision_shapes', sources=collision_shapes_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags )
 env.BlenderLib ( libname = 'extern_bullet2collision_narrowphase', sources=collision_narrowphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags )
-env.BlenderLib ( libname = 'extern_bullet2softbody', sources=softbody_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[18,135], compileflags=cflags )
+env.BlenderLib ( libname = 'extern_bullet2softbody', sources=softbody_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[30,135], compileflags=cflags )
index 587ef30..0965a46 100644 (file)
@@ -40,11 +40,6 @@ 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)
@@ -59,6 +54,12 @@ IF(WITH_SNDFILE)
        ADD_DEFINITIONS(-DWITH_SNDFILE)
 ENDIF(WITH_SNDFILE)
 
-SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
+IF(WITH_FFTW3)
+       SET(INC ${INC} fftw ${FFTW3_INC})
+       FILE(GLOB FFTW3SRC fftw/*.cpp)
+       ADD_DEFINITIONS(-DWITH_FFTW3)
+ENDIF(WITH_FFTW3)
+
+SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${FFTW3SRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
 
 BLENDERLIB(bf_audaspace "${SRC}" "${INC}")
diff --git a/intern/audaspace/FX/AUD_AccumulatorFactory.cpp b/intern/audaspace/FX/AUD_AccumulatorFactory.cpp
new file mode 100644 (file)
index 0000000..20709c5
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * $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_AccumulatorFactory.h"
+#include "AUD_AccumulatorReader.h"
+
+AUD_AccumulatorFactory::AUD_AccumulatorFactory(AUD_IFactory* factory,
+                                                                                          bool additive) :
+               AUD_EffectFactory(factory),
+               m_additive(additive) {}
+
+AUD_AccumulatorFactory::AUD_AccumulatorFactory(bool additive) :
+               AUD_EffectFactory(0),
+               m_additive(additive) {}
+
+AUD_IReader* AUD_AccumulatorFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_AccumulatorReader(reader, m_additive);
+               AUD_NEW("reader")
+       }
+
+       return reader;
+}
diff --git a/intern/audaspace/FX/AUD_AccumulatorFactory.h b/intern/audaspace/FX/AUD_AccumulatorFactory.h
new file mode 100644 (file)
index 0000000..e475a19
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * $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_ACCUMULATORFACTORY
+#define AUD_ACCUMULATORFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory creates an accumulator reader.
+ */
+class AUD_AccumulatorFactory : public AUD_EffectFactory
+{
+private:
+       /**
+        * Whether the accumulator is additive.
+        */
+       bool m_additive;
+
+public:
+       /**
+        * Creates a new accumulator factory.
+        * \param factory The input factory.
+        * \param additive Whether the accumulator is additive.
+        */
+       AUD_AccumulatorFactory(AUD_IFactory* factory, bool additive = false);
+
+       /**
+        * Creates a new accumulator factory.
+        * \param additive Whether the accumulator is additive.
+        */
+       AUD_AccumulatorFactory(bool additive = false);
+
+       virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_ACCUMULATORFACTORY
diff --git a/intern/audaspace/FX/AUD_AccumulatorReader.cpp b/intern/audaspace/FX/AUD_AccumulatorReader.cpp
new file mode 100644 (file)
index 0000000..67ab415
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * $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_AccumulatorReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+#define CC specs.channels + channel
+
+AUD_AccumulatorReader::AUD_AccumulatorReader(AUD_IReader* reader,
+                                                                                        bool additive) :
+               AUD_EffectReader(reader),
+               m_additive(additive)
+{
+       AUD_Specs specs = reader->getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
+
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+
+       m_sums = new AUD_Buffer(samplesize); AUD_NEW("buffer")
+       memset(m_sums->getBuffer(), 0, samplesize);
+
+       m_prevs = new AUD_Buffer(samplesize); AUD_NEW("buffer")
+       memset(m_prevs->getBuffer(), 0, samplesize);
+}
+
+AUD_AccumulatorReader::~AUD_AccumulatorReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+       delete m_sums; AUD_DELETE("buffer")
+       delete m_prevs; AUD_DELETE("buffer")
+}
+
+void AUD_AccumulatorReader::read(int & length, sample_t* & buffer)
+{
+       sample_t* buf;
+       sample_t* sums;
+       sample_t* prevs;
+       sums = m_sums->getBuffer();
+       prevs = m_prevs->getBuffer();
+
+       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();
+
+       if(m_additive)
+       {
+               for(int channel = 0; channel < specs.channels; channel++)
+               {
+                       for(int i = 0; i < length; i++)
+                       {
+                               if(buf[i * CC] > prevs[channel])
+                                       sums[channel] += buf[i * CC] - prevs[channel];
+                               buffer[i * CC] = sums[channel] + buf[i * CC];
+                               prevs[channel] = buf[i * CC];
+                       }
+               }
+       }
+       else
+       {
+               for(int channel = 0; channel < specs.channels; channel++)
+               {
+                       for(int i = 0; i < length * specs.channels; i++)
+                       {
+                               if(buf[i * CC] > prevs[channel])
+                                       sums[channel] += buf[i * CC] - prevs[channel];
+                               buffer[i * CC] = sums[channel];
+                               prevs[channel] = buf[i * CC];
+                       }
+               }
+       }
+}
diff --git a/intern/audaspace/FX/AUD_AccumulatorReader.h b/intern/audaspace/FX/AUD_AccumulatorReader.h
new file mode 100644 (file)
index 0000000..8ad1dda
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * $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_ACCUMULATORREADER
+#define AUD_ACCUMULATORREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class represents an accumulator.
+ */
+class AUD_AccumulatorReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+       /**
+        * The sums of the specific channels.
+        */
+       AUD_Buffer *m_sums;
+
+       /**
+        * The previous results of the specific channels.
+        */
+       AUD_Buffer *m_prevs;
+
+       /**
+        * Whether the accumulator is additive.
+        */
+       bool m_additive;
+
+public:
+       /**
+        * Creates a new accumulator reader.
+        * \param reader The reader to read from.
+        * \param additive Whether the accumulator is additive.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_AccumulatorReader(AUD_IReader* reader, bool additive);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_AccumulatorReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_ACCUMULATORREADER
diff --git a/intern/audaspace/FX/AUD_ButterworthFactory.cpp b/intern/audaspace/FX/AUD_ButterworthFactory.cpp
new file mode 100644 (file)
index 0000000..fd0a53d
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * $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_ButterworthFactory.h"
+#include "AUD_ButterworthReader.h"
+
+AUD_ButterworthFactory::AUD_ButterworthFactory(AUD_IFactory* factory,
+                                                                                          float frequency) :
+               AUD_EffectFactory(factory),
+               m_frequency(frequency) {}
+
+AUD_ButterworthFactory::AUD_ButterworthFactory(float frequency) :
+               AUD_EffectFactory(0),
+               m_frequency(frequency) {}
+
+AUD_IReader* AUD_ButterworthFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_ButterworthReader(reader, m_frequency);
+               AUD_NEW("reader")
+       }
+
+       return reader;
+}
diff --git a/intern/audaspace/FX/AUD_ButterworthFactory.h b/intern/audaspace/FX/AUD_ButterworthFactory.h
new file mode 100644 (file)
index 0000000..6916953
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * $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_BUTTERWORTHFACTORY
+#define AUD_BUTTERWORTHFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory creates a butterworth filter reader.
+ */
+class AUD_ButterworthFactory : public AUD_EffectFactory
+{
+private:
+       /**
+        * The attack value in seconds.
+        */
+       float m_frequency;
+
+public:
+       /**
+        * Creates a new butterworth factory.
+        * \param factory The input factory.
+        * \param frequency The cutoff frequency.
+        */
+       AUD_ButterworthFactory(AUD_IFactory* factory, float frequency);
+
+       /**
+        * Creates a new butterworth factory.
+        * \param frequency The cutoff frequency.
+        */
+       AUD_ButterworthFactory(float frequency);
+
+       virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_BUTTERWORTHFACTORY
diff --git a/intern/audaspace/FX/AUD_ButterworthReader.cpp b/intern/audaspace/FX/AUD_ButterworthReader.cpp
new file mode 100644 (file)
index 0000000..2129dfe
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * $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_ButterworthReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+#include <cmath>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#define BWPB41 0.76536686473
+#define BWPB42 1.84775906502
+#define CC channels + channel
+
+AUD_ButterworthReader::AUD_ButterworthReader(AUD_IReader* reader,
+                                                                                        float frequency) :
+               AUD_EffectReader(reader)
+{
+       AUD_Specs specs = reader->getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
+
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+
+       m_outvalues = new AUD_Buffer(samplesize * 5); AUD_NEW("buffer")
+       memset(m_outvalues->getBuffer(), 0, samplesize * 5);
+
+       m_invalues = new AUD_Buffer(samplesize * 5); AUD_NEW("buffer")
+       memset(m_invalues->getBuffer(), 0, samplesize * 5);
+
+       m_position = 0;
+
+       // calculate coefficients
+       float omega = 2 * tan(frequency * M_PI / specs.rate);
+       float o2 = omega * omega;
+       float o4 = o2 * o2;
+       float x1 = o2 + 2 * BWPB41 * omega + 4;
+       float x2 = o2 + 2 * BWPB42 * omega + 4;
+       float y1 = o2 - 2 * BWPB41 * omega + 4;
+       float y2 = o2 - 2 * BWPB42 * omega + 4;
+       float o228 = 2 * o2 - 8;
+       float norm = x1 * x2;
+       m_coeff[0][0] = 0;
+       m_coeff[0][1] = (x1 + x2) * o228 / norm;
+       m_coeff[0][2] = (x1 * y2 + x2 * y1 + o228 * o228) / norm;
+       m_coeff[0][3] = (y1 + y2) * o228 / norm;
+       m_coeff[0][4] = y1 * y2 / norm;
+       m_coeff[1][4] = m_coeff[1][0] = o4 / norm;
+       m_coeff[1][3] = m_coeff[1][1] = 4 * o4 / norm;
+       m_coeff[1][2] = 6 * o4 / norm;
+}
+
+AUD_ButterworthReader::~AUD_ButterworthReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+
+       delete m_outvalues; AUD_DELETE("buffer")
+       delete m_invalues; AUD_DELETE("buffer");
+}
+
+void AUD_ButterworthReader::read(int & length, sample_t* & buffer)
+{
+       sample_t* buf;
+       sample_t* outvalues;
+       sample_t* invalues;
+
+       outvalues = m_outvalues->getBuffer();
+       invalues = m_invalues->getBuffer();
+
+       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();
+       int channels = specs.channels;
+
+       for(int channel = 0; channel < channels; channel++)
+       {
+               for(int i = 0; i < length; i++)
+               {
+                       invalues[m_position * CC] = buf[i * CC];
+                       outvalues[m_position * CC] = 0;
+
+                       for(int j = 0; j < 4; j++)
+                       {
+                               outvalues[m_position * CC] += m_coeff[1][j] *
+                                                                       invalues[((m_position + j) % 5) * CC] -
+                                                                       m_coeff[0][j] *
+                                                                       outvalues[((m_position + j) % 5) * CC];
+                       }
+
+                       buffer[i * CC] = outvalues[m_position * CC];
+
+                       m_position = (m_position + 4) % 5;
+               }
+       }
+}
diff --git a/intern/audaspace/FX/AUD_ButterworthReader.h b/intern/audaspace/FX/AUD_ButterworthReader.h
new file mode 100644 (file)
index 0000000..b1cbd4e
--- /dev/null
@@ -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_BUTTERWORTHREADER
+#define AUD_BUTTERWORTHREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class represents a butterworth filter.
+ */
+class AUD_ButterworthReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+       /**
+        * The last out values buffer.
+        */
+       AUD_Buffer *m_outvalues;
+
+       /**
+        * The last in values buffer.
+        */
+       AUD_Buffer *m_invalues;
+
+       /**
+        * The position for buffer cycling.
+        */
+       int m_position;
+
+       /**
+        * Filter coefficients.
+        */
+       float m_coeff[2][5];
+
+public:
+       /**
+        * Creates a new butterworth reader.
+        * \param reader The reader to read from.
+        * \param attack The attack value in seconds.
+        * \param release The release value in seconds.
+        * \param threshold The threshold value.
+        * \param arthreshold The attack/release threshold value.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_ButterworthReader(AUD_IReader* reader, float frequency);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_ButterworthReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_BUTTERWORTHREADER
index 38d3b89..f2521f6 100644 (file)
@@ -77,31 +77,26 @@ void AUD_DelayReader::read(int & length, sample_t* & buffer)
 {
        if(m_remdelay > 0)
        {
-               int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
+               AUD_Specs specs = m_reader->getSpecs();
+               int samplesize = AUD_SAMPLE_SIZE(specs);
 
-               if(m_buffer->getSize() < length*samplesize)
-                       m_buffer->resize(length*samplesize);
+               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);
+                       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);
+                       memcpy(m_buffer->getBuffer() + m_remdelay * specs.channels,
+                                  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);
+                       memset(m_buffer->getBuffer(), 0, length * samplesize);
                        m_remdelay -= length;
                }
                buffer = m_buffer->getBuffer();
index 8d3afbf..1e51a09 100644 (file)
@@ -137,15 +137,16 @@ void AUD_DoubleReader::read(int & length, sample_t* & buffer)
                m_reader1->read(len, buffer);
                if(len < length)
                {
-                       int samplesize = AUD_SAMPLE_SIZE(m_reader1->getSpecs());
+                       AUD_Specs specs = m_reader1->getSpecs();
+                       int samplesize = AUD_SAMPLE_SIZE(specs);
                        if(m_buffer->getSize() < length * samplesize)
                                m_buffer->resize(length * samplesize);
-                       memcpy(m_buffer->getBuffer(), buffer, len*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);
+                       memcpy(m_buffer->getBuffer() + length * specs.channels, buffer,
+                                  len * samplesize);
                        length += len;
                        buffer = m_buffer->getBuffer();
                        m_finished1 = true;
diff --git a/intern/audaspace/FX/AUD_EnvelopeFactory.cpp b/intern/audaspace/FX/AUD_EnvelopeFactory.cpp
new file mode 100644 (file)
index 0000000..c3b2c3f
--- /dev/null
@@ -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_EnvelopeFactory.h"
+#include "AUD_EnvelopeReader.h"
+
+AUD_EnvelopeFactory::AUD_EnvelopeFactory(AUD_IFactory* factory, float attack,
+                                                                                float release, float threshold,
+                                                                                float arthreshold) :
+               AUD_EffectFactory(factory),
+               m_attack(attack),
+               m_release(release),
+               m_threshold(threshold),
+               m_arthreshold(arthreshold) {}
+
+AUD_EnvelopeFactory::AUD_EnvelopeFactory(float attack, float release,
+                                                                                float threshold, float arthreshold) :
+               AUD_EffectFactory(0),
+               m_attack(attack),
+               m_release(release),
+               m_threshold(threshold),
+               m_arthreshold(arthreshold) {}
+
+AUD_IReader* AUD_EnvelopeFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_EnvelopeReader(reader, m_attack, m_release,
+                                                                               m_threshold, m_arthreshold);
+               AUD_NEW("reader")
+       }
+
+       return reader;
+}
diff --git a/intern/audaspace/FX/AUD_EnvelopeFactory.h b/intern/audaspace/FX/AUD_EnvelopeFactory.h
new file mode 100644 (file)
index 0000000..c79e547
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * $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_ENVELOPEFACTORY
+#define AUD_ENVELOPEFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory creates an envelope follower reader.
+ */
+class AUD_EnvelopeFactory : public AUD_EffectFactory
+{
+private:
+       /**
+        * The attack value in seconds.
+        */
+       float m_attack;
+
+       /**
+        * The release value in seconds.
+        */
+       float m_release;
+
+       /**
+        * The threshold value.
+        */
+       float m_threshold;
+
+       /**
+        * The attack/release threshold value.
+        */
+       float m_arthreshold;
+
+public:
+       /**
+        * Creates a new envelope factory.
+        * \param factory The input factory.
+        * \param attack The attack value in seconds.
+        * \param release The release value in seconds.
+        * \param threshold The threshold value.
+        * \param arthreshold The attack/release threshold value.
+        */
+       AUD_EnvelopeFactory(AUD_IFactory* factory, float attack, float release,
+                                               float threshold, float arthreshold);
+
+       /**
+        * Creates a new envelope factory.
+        * \param attack The attack value in seconds.
+        * \param release The release value in seconds.
+        * \param threshold The threshold value.
+        * \param arthreshold The attack/release threshold value.
+        */
+       AUD_EnvelopeFactory(float attack, float release, float threshold,
+                                               float arthreshold);
+
+       virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_ENVELOPEFACTORY
diff --git a/intern/audaspace/FX/AUD_EnvelopeReader.cpp b/intern/audaspace/FX/AUD_EnvelopeReader.cpp
new file mode 100644 (file)
index 0000000..71ccbfd
--- /dev/null
@@ -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 *****
+ */
+
+#include "AUD_EnvelopeReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+#include <cmath>
+
+AUD_EnvelopeReader::AUD_EnvelopeReader(AUD_IReader* reader, float attack,
+                                                                          float release, float threshold,
+                                                                          float arthreshold) :
+               AUD_EffectReader(reader),
+               m_threshold(threshold)
+{
+       AUD_Specs specs = reader->getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
+
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+
+       m_envelopes = new AUD_Buffer(samplesize);
+       AUD_NEW("buffer")
+       memset(m_envelopes->getBuffer(), 0, samplesize);
+
+       m_bAttack = pow(arthreshold, 1.0f/(specs.rate * attack));
+       m_bRelease = pow(arthreshold, 1.0f/(specs.rate * release));
+}
+
+AUD_EnvelopeReader::~AUD_EnvelopeReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+       delete m_envelopes; AUD_DELETE("buffer")
+}
+
+void AUD_EnvelopeReader::read(int & length, sample_t* & buffer)
+{
+       sample_t* buf;
+       sample_t* envelopes;
+       envelopes = m_envelopes->getBuffer();
+
+       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();
+
+       sample_t value;
+
+       for(int channel = 0; channel < specs.channels; channel++)
+       {
+               for(int i = 0; i < length; i++)
+               {
+                       value = fabs(buf[i * specs.channels + channel]);
+                       if(value < m_threshold)
+                               value = 0.0f;
+
+                       buffer[i * specs.channels + channel] = envelopes[channel] =
+                               ((value > envelopes[channel]) ? m_bAttack : m_bRelease) *
+                                (envelopes[channel] - value) + value;
+               }
+       }
+}
diff --git a/intern/audaspace/FX/AUD_EnvelopeReader.h b/intern/audaspace/FX/AUD_EnvelopeReader.h
new file mode 100644 (file)
index 0000000..ff9dd23
--- /dev/null
@@ -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_ENVELOPEREADER
+#define AUD_ENVELOPEREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class represents an envelope follower.
+ */
+class AUD_EnvelopeReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+       /**
+        * The last envelopes buffer.
+        */
+       AUD_Buffer *m_envelopes;
+
+       /**
+        * Attack b value.
+        */
+       float m_bAttack;
+
+       /**
+        * Release b value.
+        */
+       float m_bRelease;
+
+       /**
+        * Threshold value.
+        */
+       float m_threshold;
+
+public:
+       /**
+        * Creates a new envelope reader.
+        * \param reader The reader to read from.
+        * \param attack The attack value in seconds.
+        * \param release The release value in seconds.
+        * \param threshold The threshold value.
+        * \param arthreshold The attack/release threshold value.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_EnvelopeReader(AUD_IReader* reader, float attack, float release,
+                                          float threshold, float arthreshold);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_EnvelopeReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_ENVELOPEREADER
index d5096e7..6c7ea6e 100644 (file)
@@ -35,35 +35,6 @@ AUD_FaderReader::AUD_FaderReader(AUD_IReader* reader, AUD_FadeType 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")
 }
 
@@ -93,9 +64,7 @@ void AUD_FaderReader::read(int & length, sample_t* & buffer)
                if(m_type != AUD_FADE_OUT)
                {
                        buffer = m_buffer->getBuffer();
-                       memset(buffer,
-                                  specs.format == AUD_FORMAT_U8 ? 0x80 : 0,
-                                  length * samplesize);
+                       memset(buffer, 0, length * samplesize);
                }
        }
        else if(position / (float)specs.rate >= m_start+m_length)
@@ -103,9 +72,7 @@ void AUD_FaderReader::read(int & length, sample_t* & buffer)
                if(m_type == AUD_FADE_OUT)
                {
                        buffer = m_buffer->getBuffer();
-                       memset(buffer,
-                                  specs.format == AUD_FORMAT_U8 ? 0x80 : 0,
-                                  length * samplesize);
+                       memset(buffer, 0, length * samplesize);
                }
        }
        else
@@ -113,19 +80,21 @@ void AUD_FaderReader::read(int & length, sample_t* & buffer)
                sample_t* buf = m_buffer->getBuffer();
                float volume;
 
-               for(int i = 0; i < length; i++)
+               for(int i = 0; i < length * specs.channels; 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(i % specs.channels == 0)
+                       {
+                               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;
+                               if(m_type == AUD_FADE_OUT)
+                                       volume = 1.0f - volume;
+                       }
 
-                       m_adjust(buf + i * samplesize, buffer + i * samplesize,
-                                        specs.channels, volume);
+                       buf[i] = buffer[i] * volume;
                }
 
                buffer = buf;
index 773643b..a75ac6e 100644 (file)
@@ -27,7 +27,6 @@
 #define AUD_FADERREADER
 
 #include "AUD_EffectReader.h"
-#include "AUD_ConverterFunctions.h"
 class AUD_Buffer;
 
 /**
@@ -58,11 +57,6 @@ private:
         */
        float m_length;
 
-       /**
-        * Volume adjustment function.
-        */
-       AUD_volume_adjust_f m_adjust;
-
 public:
        /**
         * Creates a new fader reader.
diff --git a/intern/audaspace/FX/AUD_HighpassFactory.cpp b/intern/audaspace/FX/AUD_HighpassFactory.cpp
new file mode 100644 (file)
index 0000000..384d36b
--- /dev/null
@@ -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 *****
+ */
+
+#include "AUD_HighpassFactory.h"
+#include "AUD_HighpassReader.h"
+
+AUD_HighpassFactory::AUD_HighpassFactory(AUD_IFactory* factory, float frequency,
+                                                                                float Q) :
+               AUD_EffectFactory(factory),
+               m_frequency(frequency),
+               m_Q(Q) {}
+
+AUD_HighpassFactory::AUD_HighpassFactory(float frequency, float Q) :
+               AUD_EffectFactory(0),
+               m_frequency(frequency),
+               m_Q(Q) {}
+
+AUD_IReader* AUD_HighpassFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_HighpassReader(reader, m_frequency, m_Q);
+               AUD_NEW("reader")
+       }
+
+       return reader;
+}
diff --git a/intern/audaspace/FX/AUD_HighpassFactory.h b/intern/audaspace/FX/AUD_HighpassFactory.h
new file mode 100644 (file)
index 0000000..5e31053
--- /dev/null
@@ -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_HIGHPASSFACTORY
+#define AUD_HIGHPASSFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory creates a highpass filter reader.
+ */
+class AUD_HighpassFactory : public AUD_EffectFactory
+{
+private:
+       /**
+        * The attack value in seconds.
+        */
+       float m_frequency;
+
+       /**
+        * The Q factor.
+        */
+       float m_Q;
+
+public:
+       /**
+        * Creates a new highpass factory.
+        * \param factory The input factory.
+        * \param frequency The cutoff frequency.
+        * \param Q The Q factor.
+        */
+       AUD_HighpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0f);
+
+       /**
+        * Creates a new highpass factory.
+        * \param frequency The cutoff frequency.
+        * \param Q The Q factor.
+        */
+       AUD_HighpassFactory(float frequency, float Q = 1.0f);
+
+       virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_HIGHPASSFACTORY
diff --git a/intern/audaspace/FX/AUD_HighpassReader.cpp b/intern/audaspace/FX/AUD_HighpassReader.cpp
new file mode 100644 (file)
index 0000000..36b1bb8
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * $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_HighpassReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+#include <cmath>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#define CC channels + channel
+
+AUD_HighpassReader::AUD_HighpassReader(AUD_IReader* reader, float frequency,
+                                                                          float Q) :
+               AUD_EffectReader(reader)
+{
+       AUD_Specs specs = reader->getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
+
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+
+       m_outvalues = new AUD_Buffer(samplesize * AUD_HIGHPASS_ORDER);
+       AUD_NEW("buffer")
+       memset(m_outvalues->getBuffer(), 0, samplesize * AUD_HIGHPASS_ORDER);
+
+       m_invalues = new AUD_Buffer(samplesize * AUD_HIGHPASS_ORDER);
+       AUD_NEW("buffer")
+       memset(m_invalues->getBuffer(), 0, samplesize * AUD_HIGHPASS_ORDER);
+
+       m_position = 0;
+
+       // calculate coefficients
+       float w0 = 2 * M_PI * frequency / specs.rate;
+       float alpha = sin(w0) / (2 * Q);
+       float norm = 1 + alpha;
+       m_coeff[0][0] = 0;
+       m_coeff[0][1] = -2 * cos(w0) / norm;
+       m_coeff[0][2] = (1 - alpha) / norm;
+       m_coeff[1][2] = m_coeff[1][0] = (1 + cos(w0)) / (2 * norm);
+       m_coeff[1][1] = (-1 - cos(w0)) / norm;
+}
+
+AUD_HighpassReader::~AUD_HighpassReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+
+       delete m_outvalues; AUD_DELETE("buffer")
+       delete m_invalues; AUD_DELETE("buffer");
+}
+
+void AUD_HighpassReader::read(int & length, sample_t* & buffer)
+{
+       sample_t* buf;
+       sample_t* outvalues;
+       sample_t* invalues;
+
+       outvalues = m_outvalues->getBuffer();
+       invalues = m_invalues->getBuffer();
+
+       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();
+       int channels = specs.channels;
+
+       for(int channel = 0; channel < channels; channel++)
+       {
+               for(int i = 0; i < length; i++)
+               {
+                       invalues[m_position * CC] = buf[i * CC];
+                       outvalues[m_position * CC] = 0;
+
+                       for(int j = 0; j < AUD_HIGHPASS_ORDER; j++)
+                       {
+                               outvalues[m_position * CC] += m_coeff[1][j] *
+                                               invalues[((m_position + j) % AUD_HIGHPASS_ORDER) * CC] -
+                                               m_coeff[0][j] *
+                                               outvalues[((m_position + j) % AUD_HIGHPASS_ORDER) * CC];
+                       }
+
+                       buffer[i * CC] = outvalues[m_position * CC];
+
+                       m_position = (m_position + AUD_HIGHPASS_ORDER-1) %
+                                                AUD_HIGHPASS_ORDER;
+               }
+       }
+}
diff --git a/intern/audaspace/FX/AUD_HighpassReader.h b/intern/audaspace/FX/AUD_HighpassReader.h
new file mode 100644 (file)
index 0000000..dc28a62
--- /dev/null
@@ -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_HIGHPASSREADER
+#define AUD_HIGHPASSREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+#define AUD_HIGHPASS_ORDER 3
+
+/**
+ * This class represents a highpass filter.
+ */
+class AUD_HighpassReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+       /**
+        * The last out values buffer.
+        */
+       AUD_Buffer *m_outvalues;
+
+       /**
+        * The last in values buffer.
+        */
+       AUD_Buffer *m_invalues;
+
+       /**
+        * The position for buffer cycling.
+        */
+       int m_position;
+
+       /**
+        * Filter coefficients.
+        */
+       float m_coeff[2][AUD_HIGHPASS_ORDER];
+
+public:
+       /**
+        * Creates a new highpass reader.
+        * \param reader The reader to read from.
+        * \param frequency The cutoff frequency.
+        * \param Q The Q factor.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_HighpassReader(AUD_IReader* reader, float frequency, float Q);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_HighpassReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_HIGHPASSREADER
index 461d8c9..c81d906 100644 (file)
@@ -38,7 +38,7 @@ private:
        /**
         * The loop count.
         */
-       float m_loop;
+       int m_loop;
 
 public:
        /**
index 9e27032..7d70fc2 100644 (file)
@@ -27,7 +27,6 @@
 #include "AUD_Buffer.h"
 
 #include <cstring>
-#include <stdio.h>
 
 AUD_LoopReader::AUD_LoopReader(AUD_IReader* reader, int loop) :
                AUD_EffectReader(reader), m_loop(loop)
@@ -62,7 +61,8 @@ bool AUD_LoopReader::notify(AUD_Message &message)
 
 void AUD_LoopReader::read(int & length, sample_t* & buffer)
 {
-       int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
+       AUD_Specs specs = m_reader->getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
 
        int len = length;
 
@@ -72,10 +72,10 @@ void AUD_LoopReader::read(int & length, sample_t* & buffer)
        {
                int pos = 0;
 
-               if(m_buffer->getSize() < length*samplesize)
-                       m_buffer->resize(length*samplesize);
+               if(m_buffer->getSize() < length * samplesize)
+                       m_buffer->resize(length * samplesize);
 
-               memcpy(m_buffer->getBuffer() + pos * samplesize,
+               memcpy(m_buffer->getBuffer() + pos * specs.channels,
                           buffer, len * samplesize);
 
                pos += len;
@@ -93,7 +93,7 @@ void AUD_LoopReader::read(int & length, sample_t* & buffer)
                        if(!len)
                                break;
 
-                       memcpy(m_buffer->getBuffer() + pos * samplesize,
+                       memcpy(m_buffer->getBuffer() + pos * specs.channels,
                                   buffer, len * samplesize);
 
                        pos += len;
diff --git a/intern/audaspace/FX/AUD_LowpassFactory.cpp b/intern/audaspace/FX/AUD_LowpassFactory.cpp
new file mode 100644 (file)
index 0000000..05dc5ff
--- /dev/null
@@ -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 *****
+ */
+
+#include "AUD_LowpassFactory.h"
+#include "AUD_LowpassReader.h"
+
+AUD_LowpassFactory::AUD_LowpassFactory(AUD_IFactory* factory, float frequency,
+                                                                          float Q) :
+               AUD_EffectFactory(factory),
+               m_frequency(frequency),
+               m_Q(Q) {}
+
+AUD_LowpassFactory::AUD_LowpassFactory(float frequency, float Q) :
+               AUD_EffectFactory(0),
+               m_frequency(frequency),
+               m_Q(Q) {}
+
+AUD_IReader* AUD_LowpassFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_LowpassReader(reader, m_frequency, m_Q);
+               AUD_NEW("reader")
+       }
+
+       return reader;
+}
diff --git a/intern/audaspace/FX/AUD_LowpassFactory.h b/intern/audaspace/FX/AUD_LowpassFactory.h
new file mode 100644 (file)
index 0000000..8a41982
--- /dev/null
@@ -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_LOWPASSFACTORY
+#define AUD_LOWPASSFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory creates a lowpass filter reader.
+ */
+class AUD_LowpassFactory : public AUD_EffectFactory
+{
+private:
+       /**
+        * The attack value in seconds.
+        */
+       float m_frequency;
+
+       /**
+        * The Q factor.
+        */
+       float m_Q;
+
+public:
+       /**
+        * Creates a new lowpass factory.
+        * \param factory The input factory.
+        * \param frequency The cutoff frequency.
+        * \param Q The Q factor.
+        */
+       AUD_LowpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0f);
+
+       /**
+        * Creates a new lowpass factory.
+        * \param frequency The cutoff frequency.
+        * \param Q The Q factor.
+        */
+       AUD_LowpassFactory(float frequency, float Q = 1.0f);
+
+       virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_LOWPASSFACTORY
diff --git a/intern/audaspace/FX/AUD_LowpassReader.cpp b/intern/audaspace/FX/AUD_LowpassReader.cpp
new file mode 100644 (file)
index 0000000..6dc0bf6
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * $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_LowpassReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+#include <cmath>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#define CC channels + channel
+
+AUD_LowpassReader::AUD_LowpassReader(AUD_IReader* reader, float frequency,
+                                                                        float Q) :
+               AUD_EffectReader(reader)
+{
+       AUD_Specs specs = reader->getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
+
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+
+       m_outvalues = new AUD_Buffer(samplesize * AUD_LOWPASS_ORDER);
+       AUD_NEW("buffer")
+       memset(m_outvalues->getBuffer(), 0, samplesize * AUD_LOWPASS_ORDER);
+
+       m_invalues = new AUD_Buffer(samplesize * AUD_LOWPASS_ORDER);
+       AUD_NEW("buffer")
+       memset(m_invalues->getBuffer(), 0, samplesize * AUD_LOWPASS_ORDER);
+
+       m_position = 0;
+
+       // calculate coefficients
+       float w0 = 2 * M_PI * frequency / specs.rate;
+       float alpha = sin(w0) / (2 * Q);
+       float norm = 1 + alpha;
+       m_coeff[0][0] = 0;
+       m_coeff[0][1] = -2 * cos(w0) / norm;
+       m_coeff[0][2] = (1 - alpha) / norm;
+       m_coeff[1][2] = m_coeff[1][0] = (1 - cos(w0)) / (2 * norm);
+       m_coeff[1][1] = (1 - cos(w0)) / norm;
+}
+
+AUD_LowpassReader::~AUD_LowpassReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+
+       delete m_outvalues; AUD_DELETE("buffer")
+       delete m_invalues; AUD_DELETE("buffer");
+}
+
+void AUD_LowpassReader::read(int & length, sample_t* & buffer)
+{
+       sample_t* buf;
+       sample_t* outvalues;
+       sample_t* invalues;
+
+       outvalues = m_outvalues->getBuffer();
+       invalues = m_invalues->getBuffer();
+
+       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();
+       int channels = specs.channels;
+
+       for(int channel = 0; channel < channels; channel++)
+       {
+               for(int i = 0; i < length; i++)
+               {
+                       invalues[m_position * CC] = buf[i * CC];
+                       outvalues[m_position * CC] = 0;
+
+                       for(int j = 0; j < AUD_LOWPASS_ORDER; j++)
+                       {
+                               outvalues[m_position * CC] += m_coeff[1][j] *
+                                               invalues[((m_position + j) % AUD_LOWPASS_ORDER) * CC] -
+                                               m_coeff[0][j] *
+                                               outvalues[((m_position + j) % AUD_LOWPASS_ORDER) * CC];
+                       }
+
+                       buffer[i * CC] = outvalues[m_position * CC];
+
+                       m_position = (m_position + AUD_LOWPASS_ORDER-1) % AUD_LOWPASS_ORDER;
+               }
+       }
+}
diff --git a/intern/audaspace/FX/AUD_LowpassReader.h b/intern/audaspace/FX/AUD_LowpassReader.h
new file mode 100644 (file)
index 0000000..a490ba5
--- /dev/null
@@ -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_LOWPASSREADER
+#define AUD_LOWPASSREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+#define AUD_LOWPASS_ORDER 3
+
+/**
+ * This class represents a lowpass filter.
+ */
+class AUD_LowpassReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+       /**
+        * The last out values buffer.
+        */
+       AUD_Buffer *m_outvalues;
+
+       /**
+        * The last in values buffer.
+        */
+       AUD_Buffer *m_invalues;
+
+       /**
+        * The position for buffer cycling.
+        */
+       int m_position;
+
+       /**
+        * Filter coefficients.
+        */
+       float m_coeff[2][AUD_LOWPASS_ORDER];
+
+public:
+       /**
+        * Creates a new lowpass reader.
+        * \param reader The reader to read from.
+        * \param frequency The cutoff frequency.
+        * \param Q The Q factor.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_LowpassReader(AUD_IReader* reader, float frequency, float Q);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_LowpassReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_LOWPASSREADER
index 3209aa4..96c4d0d 100644 (file)
@@ -45,7 +45,7 @@ public:
         * \param factory The input factory.
         * \param pitch The desired pitch.
         */
-       AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0);
+       AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0f);
 
        /**
         * Creates a new pitch factory.
diff --git a/intern/audaspace/FX/AUD_RectifyFactory.cpp b/intern/audaspace/FX/AUD_RectifyFactory.cpp
new file mode 100644 (file)
index 0000000..f97defd
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * $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_RectifyFactory.h"
+#include "AUD_RectifyReader.h"
+
+AUD_RectifyFactory::AUD_RectifyFactory(AUD_IFactory* factory) :
+               AUD_EffectFactory(factory) {}
+
+AUD_RectifyFactory::AUD_RectifyFactory() :
+               AUD_EffectFactory(0) {}
+
+AUD_IReader* AUD_RectifyFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_RectifyReader(reader); AUD_NEW("reader")
+       }
+
+       return reader;
+}
similarity index 66%
rename from intern/audaspace/SDL/AUD_SDLMixerFactory.h
rename to intern/audaspace/FX/AUD_RectifyFactory.h
index 44b36d0..ed00620 100644 (file)
  * ***** END LGPL LICENSE BLOCK *****
  */
 
-#ifndef AUD_SDLMIXERFACTORY
-#define AUD_SDLMIXERFACTORY
+#ifndef AUD_RECTIFYFACTORY
+#define AUD_RECTIFYFACTORY
 
-#include "AUD_MixerFactory.h"
+#include "AUD_EffectFactory.h"
 
 /**
- * This factory creates a resampling reader that uses SDL's resampling
- * functionality which unfortunately is very very very limited.
+ * This factory rectifies another factory.
  */
-class AUD_SDLMixerFactory : public AUD_MixerFactory
+class AUD_RectifyFactory : public AUD_EffectFactory
 {
 public:
-       AUD_SDLMixerFactory(AUD_IReader* reader, AUD_Specs specs);
-       AUD_SDLMixerFactory(AUD_IFactory* factory, AUD_Specs specs);
-       AUD_SDLMixerFactory(AUD_Specs specs);
+       /**
+        * Creates a new rectify factory.
+        * \param factory The input factory.
+        */
+       AUD_RectifyFactory(AUD_IFactory* factory = 0);
+
+       /**
+        * Creates a new rectify factory.
+        */
+       AUD_RectifyFactory();
 
        virtual AUD_IReader* createReader();
 };
 
-#endif //AUD_SDLMIXERFACTORY
+#endif //AUD_RECTIFYFACTORY
diff --git a/intern/audaspace/FX/AUD_RectifyReader.cpp b/intern/audaspace/FX/AUD_RectifyReader.cpp
new file mode 100644 (file)
index 0000000..5d3ce80
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * $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_RectifyReader.h"
+#include "AUD_Buffer.h"
+
+#include <cmath>
+
+AUD_RectifyReader::AUD_RectifyReader(AUD_IReader* reader) :
+               AUD_EffectReader(reader)
+{
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_RectifyReader::~AUD_RectifyReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+}
+
+void AUD_RectifyReader::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();
+
+       for(int i = 0; i < length * specs.channels; i++)
+               buffer[i] = fabs(buf[i]);
+}
diff --git a/intern/audaspace/FX/AUD_RectifyReader.h b/intern/audaspace/FX/AUD_RectifyReader.h
new file mode 100644 (file)
index 0000000..afbe2e5
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * $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_RECTIFYREADER
+#define AUD_RECTIFYREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class reads another reader and rectifies it.
+ */
+class AUD_RectifyReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+public:
+       /**
+        * Creates a new rectify reader.
+        * \param reader The reader to read from.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_RectifyReader(AUD_IReader* reader);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_RectifyReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_RECTIFYREADER
index 043480b..82d6c70 100644 (file)
@@ -65,7 +65,7 @@ int AUD_ReverseReader::getPosition()
 void AUD_ReverseReader::read(int & length, sample_t* & buffer)
 {
        // first correct the length
-       if(m_position+length > m_length)
+       if(m_position + length > m_length)
                length = m_length-m_position;
 
        if(length <= 0)
@@ -74,7 +74,8 @@ void AUD_ReverseReader::read(int & length, sample_t* & buffer)
                return;
        }
 
-       int samplesize = AUD_SAMPLE_SIZE(getSpecs());
+       AUD_Specs specs = getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
 
        // resize buffer if needed
        if(m_buffer->getSize() < length * samplesize)
@@ -86,23 +87,20 @@ void AUD_ReverseReader::read(int & length, sample_t* & buffer)
        int len = length;
 
        // read from reader
-       m_reader->seek(m_length-m_position-len);
+       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;
+               memset(buffer, 0, (length - len) * samplesize);
+               buffer += (length - len) * specs.channels;
        }
 
        // copy the samples reverted
        for(int i = 0; i < len; i++)
-               memcpy(buffer + i * samplesize,
-                          buf + (len - 1 - i) * samplesize,
+               memcpy(buffer + i * specs.channels,
+                          buf + (len - 1 - i) * specs.channels,
                           samplesize);
 
        m_position += length;
diff --git a/intern/audaspace/FX/AUD_SquareFactory.cpp b/intern/audaspace/FX/AUD_SquareFactory.cpp
new file mode 100644 (file)
index 0000000..638acaa
--- /dev/null
@@ -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_SquareFactory.h"
+#include "AUD_SquareReader.h"
+
+AUD_SquareFactory::AUD_SquareFactory(AUD_IFactory* factory, float threshold) :
+               AUD_EffectFactory(factory),
+               m_threshold(threshold) {}
+
+AUD_SquareFactory::AUD_SquareFactory(float threshold) :
+               AUD_EffectFactory(0),
+               m_threshold(threshold) {}
+
+float AUD_SquareFactory::getThreshold()
+{
+       return m_threshold;
+}
+
+void AUD_SquareFactory::setThreshold(float threshold)
+{
+       m_threshold = threshold;
+}
+
+AUD_IReader* AUD_SquareFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_SquareReader(reader, m_threshold); AUD_NEW("reader")
+       }
+
+       return reader;
+}
similarity index 51%
rename from intern/audaspace/SDL/AUD_SDLMixer.h
rename to intern/audaspace/FX/AUD_SquareFactory.h
index 2cc4e51..dfbe5ae 100644 (file)
  * ***** END LGPL LICENSE BLOCK *****
  */
 
-#ifndef AUD_SDLMIXER
-#define AUD_SDLMIXER
+#ifndef AUD_SQUAREFACTORY
+#define AUD_SQUAREFACTORY
 
-#include "AUD_IMixer.h"
-class AUD_SDLMixerFactory;
-#include <list>
-
-struct AUD_SDLMixerBuffer
-{
-       sample_t* buffer;
-       int length;
-       float volume;
-};
+#include "AUD_EffectFactory.h"
 
 /**
- * This class is able to mix audiosignals with the help of SDL.
+ * This factory Transforms any signal to a square signal.
  */
-class AUD_SDLMixer : public AUD_IMixer
+class AUD_SquareFactory : public AUD_EffectFactory
 {
 private:
        /**
-        * The mixer factory that prepares all readers for superposition.
+        * The threshold.
         */
-       AUD_SDLMixerFactory* m_factory;
+       float m_threshold;
 
+public:
        /**
-        * The list of buffers to superpose.
+        * Creates a new square factory.
+        * \param factory The input factory.
+        * \param threshold The threshold.
         */
-       std::list<AUD_SDLMixerBuffer> m_buffers;
+       AUD_SquareFactory(AUD_IFactory* factory = 0, float threshold = 0.0f);
 
        /**
-        * The size of an output sample.
+        * Creates a new square factory.
+        * \param threshold The threshold.
         */
-       int m_samplesize;
+       AUD_SquareFactory(float threshold);
 
-public:
        /**
-        * Creates the mixer.
+        * Returns the threshold.
         */
-       AUD_SDLMixer();
+       float getThreshold();
 
-       virtual ~AUD_SDLMixer();
+       /**
+        * Sets the threshold.
+        * \param threshold The new threshold value. Should be between 0.0 and 1.0.
+        */
+       void setThreshold(float threshold);
 
-       virtual AUD_IReader* prepare(AUD_IReader* reader);
-       virtual void setSpecs(AUD_Specs specs);
-       virtual void add(sample_t* buffer, AUD_Specs specs, int length,
-                                        float volume);
-       virtual void superpose(sample_t* buffer, int length, float volume);
+       virtual AUD_IReader* createReader();
 };
 
-#endif //AUD_SDLMIXER
+#endif //AUD_SQUAREFACTORY
diff --git a/intern/audaspace/FX/AUD_SquareReader.cpp b/intern/audaspace/FX/AUD_SquareReader.cpp
new file mode 100644 (file)
index 0000000..2d4dc52
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * $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_SquareReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_SquareReader::AUD_SquareReader(AUD_IReader* reader, float threshold) :
+               AUD_EffectReader(reader),
+               m_threshold(threshold)
+{
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_SquareReader::~AUD_SquareReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+}
+
+void AUD_SquareReader::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();
+
+       for(int i = 0; i < length * specs.channels; i++)
+       {
+               if(buf[i] >= m_threshold)
+                       buffer[i] = 1.0f;
+               else if(buf[i] <= -m_threshold)
+                       buffer[i] = -1.0f;
+               else
+                       buffer[i] = 0.0f;
+       }
+}
diff --git a/intern/audaspace/FX/AUD_SquareReader.h b/intern/audaspace/FX/AUD_SquareReader.h
new file mode 100644 (file)
index 0000000..63dda35
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * $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_SQUAREREADER
+#define AUD_SQUAREREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class changes another signal into a square signal.
+ */
+class AUD_SquareReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+       /**
+        * The threshold level.
+        */
+       float m_threshold;
+
+public:
+       /**
+        * Creates a new square reader.
+        * \param reader The reader to read from.
+        * \param threshold The size of the buffer.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_SquareReader(AUD_IReader* reader, float threshold);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_SquareReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_SQUAREREADER
diff --git a/intern/audaspace/FX/AUD_SumFactory.cpp b/intern/audaspace/FX/AUD_SumFactory.cpp
new file mode 100644 (file)
index 0000000..f7990aa
--- /dev/null
@@ -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_SumFactory.h"
+#include "AUD_SumReader.h"
+
+AUD_SumFactory::AUD_SumFactory(AUD_IFactory* factory) :
+               AUD_EffectFactory(factory) {}
+
+AUD_IReader* AUD_SumFactory::createReader()
+{
+       AUD_IReader* reader = getReader();
+
+       if(reader != 0)
+       {
+               reader = new AUD_SumReader(reader);
+               AUD_NEW("reader")
+       }
+
+       return reader;
+}
diff --git a/intern/audaspace/FX/AUD_SumFactory.h b/intern/audaspace/FX/AUD_SumFactory.h
new file mode 100644 (file)
index 0000000..5cb48e2
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * $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_SUMFACTORY
+#define AUD_SUMFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory creates a sum reader.
+ */
+class AUD_SumFactory : public AUD_EffectFactory
+{
+public:
+       /**
+        * Creates a new sum factory.
+        * \param factory The input factory.
+        */
+       AUD_SumFactory(AUD_IFactory* factory = 0);
+
+       virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_SUMFACTORY
diff --git a/intern/audaspace/FX/AUD_SumReader.cpp b/intern/audaspace/FX/AUD_SumReader.cpp
new file mode 100644 (file)
index 0000000..0874779
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * $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_SumReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+#define CC specs.channels + channel
+
+AUD_SumReader::AUD_SumReader(AUD_IReader* reader) :
+               AUD_EffectReader(reader)
+{
+       AUD_Specs specs = reader->getSpecs();
+       int samplesize = AUD_SAMPLE_SIZE(specs);
+
+       m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+
+       m_sums = new AUD_Buffer(samplesize); AUD_NEW("buffer")
+       memset(m_sums->getBuffer(), 0, samplesize);
+}
+
+AUD_SumReader::~AUD_SumReader()
+{
+       delete m_buffer; AUD_DELETE("buffer")
+       delete m_sums; AUD_DELETE("buffer")
+}
+
+void AUD_SumReader::read(int & length, sample_t* & buffer)
+{
+       sample_t* buf;
+       sample_t* sums;
+       sums = m_sums->getBuffer();
+
+       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();
+
+       for(int channel = 0; channel < specs.channels; channel++)
+               for(int i = 0; i < length * specs.channels; i++)
+                       buffer[i * CC] = sums[channel] = sums[channel] + buf[i * CC];
+}
diff --git a/intern/audaspace/FX/AUD_SumReader.h b/intern/audaspace/FX/AUD_SumReader.h
new file mode 100644 (file)
index 0000000..76ccf2f
--- /dev/null
@@ -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_SUMREADER
+#define AUD_SUMREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class represents an summer.
+ */
+class AUD_SumReader : public AUD_EffectReader
+{
+private:
+       /**
+        * The playback buffer.
+        */
+       AUD_Buffer *m_buffer;
+
+       /**
+        * The sums of the specific channels.
+        */
+       AUD_Buffer *m_sums;
+
+public:
+       /**
+        * Creates a new sum reader.
+        * \param reader The reader to read from.
+        * \exception AUD_Exception Thrown if the reader specified is NULL.
+        */
+       AUD_SumReader(AUD_IReader* reader);
+
+       /**
+        * Destroys the reader.
+        */
+       virtual ~AUD_SumReader();
+
+       virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_SUMREADER
index d281253..09f9124 100644 (file)
@@ -47,7 +47,7 @@ public:
         * \param factory The input factory.
         * \param volume The desired volume.
         */
-       AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0);
+       AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0f);
 
        /**
         * Creates a new volume factory.
index fc3f201..f094c1e 100644 (file)
@@ -32,35 +32,6 @@ 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")
 }
 
@@ -93,5 +64,6 @@ void AUD_VolumeReader::read(int & length, sample_t* & buffer)
 
        buffer = m_buffer->getBuffer();
 
-       m_adjust(buffer, buf, length * specs.channels, m_volume);
+       for(int i = 0; i < length * specs.channels; i++)
+               buffer[i] = buf[i] * m_volume;
 }
index f38ae4d..489f85b 100644 (file)
@@ -27,7 +27,6 @@
 #define AUD_VOLUMEREADER
 
 #include "AUD_EffectReader.h"
-#include "AUD_ConverterFunctions.h"
 class AUD_Buffer;
 
 /**
@@ -46,11 +45,6 @@ private:
         */
        float m_volume;
 
-       /**
-        * Volume adjustment function.
-        */
-       AUD_volume_adjust_f m_adjust;
-
 public:
        /**
         * Creates a new volume reader.
index 474f53f..4cd15e5 100644 (file)
@@ -56,6 +56,10 @@ ifeq ($(WITH_SNDFILE),true)
   DIRS += sndfile
 endif
 
+ifeq ($(WITH_FFTW3),true)
+  DIRS += fftw
+endif
+
 include nan_subdirs.mk
 
 install: $(ALL_OR_DEBUG)
@@ -80,6 +84,10 @@ ifeq ($(WITH_SNDFILE),true)
        @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_sndfile.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
 endif
 
+ifeq ($(WITH_FFTW3),true)
+       @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_fftw.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
+endif
+
 ifeq ($(OS),darwin)
        ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a
        ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a
@@ -102,5 +110,9 @@ ifeq ($(WITH_SNDFILE),true)
        ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sndfile.a
 endif
 
+ifeq ($(WITH_FFTW3),true)
+       ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fftw.a
+endif
+
 endif
        @../tools/cpifdiff.sh intern/*.h $(NAN_AUDASPACE)/include/
index aa9f425..0d90b01 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "AUD_OpenALDevice.h"
 #include "AUD_IReader.h"
-#include "AUD_IMixer.h"
 #include "AUD_ConverterFactory.h"
 #include "AUD_SourceCaps.h"
 
@@ -119,7 +118,7 @@ void AUD_OpenALDevice::updateStreams()
        sample_t* buffer;
 
        ALint info;
-       AUD_Specs specs;
+       AUD_DeviceSpecs specs = m_specs;
 
        while(1)
        {
@@ -145,7 +144,7 @@ void AUD_OpenALDevice::updateStreams()
 
                                        if(info)
                                        {
-                                               specs = sound->reader->getSpecs();
+                                               specs.specs = sound->reader->getSpecs();
 
                                                // for all empty buffers
                                                while(info--)
@@ -177,8 +176,8 @@ void AUD_OpenALDevice::updateStreams()
                                                                // fill with new data
                                                                alBufferData(sound->buffers[sound->current],
                                                                                         sound->format,
-                                                                                        buffer,
-                                                                                        length * AUD_SAMPLE_SIZE(specs),
+                                                                                        buffer, length *
+                                                                                        AUD_DEVICE_SAMPLE_SIZE(specs),
                                                                                         specs.rate);
 
                                                                if(alGetError() != AL_NO_ERROR)
@@ -264,7 +263,7 @@ bool AUD_OpenALDevice::isValid(AUD_Handle* handle)
        return false;
 }
 
-AUD_OpenALDevice::AUD_OpenALDevice(AUD_Specs specs, int buffersize)
+AUD_OpenALDevice::AUD_OpenALDevice(AUD_DeviceSpecs specs, int buffersize)
 {
        // cannot determine how many channels or which format OpenAL uses, but
        // it at least is able to play 16 bit stereo audio
@@ -289,14 +288,17 @@ AUD_OpenALDevice::AUD_OpenALDevice(AUD_Specs specs, int buffersize)
 
        // check for specific formats and channel counts to be played back
        if(alIsExtensionPresent("AL_EXT_FLOAT32") == AL_TRUE)
+       {
                specs.format = AUD_FORMAT_FLOAT32;
+               m_converter = NULL;
+       }
+       else
+               m_converter = new AUD_ConverterFactory(specs); AUD_NEW("factory")
 
        m_useMC = alIsExtensionPresent("AL_EXT_MCFORMATS") == AL_TRUE;
 
        alGetError();
 
-       m_converter = new AUD_ConverterFactory(specs); AUD_NEW("factory")
-
        m_specs = specs;
        m_buffersize = buffersize;
        m_playing = false;
@@ -378,12 +380,13 @@ AUD_OpenALDevice::~AUD_OpenALDevice()
        alcDestroyContext(m_context);
        alcCloseDevice(m_device);
 
-       delete m_converter; AUD_DELETE("factory")
+       if(m_converter)
+               delete m_converter; AUD_DELETE("factory")
 
        pthread_mutex_destroy(&m_mutex);
 }
 
-AUD_Specs AUD_OpenALDevice::getSpecs()
+AUD_DeviceSpecs AUD_OpenALDevice::getSpecs()
 {
        return m_specs;
 }
@@ -393,45 +396,8 @@ bool AUD_OpenALDevice::getFormat(ALenum &format, AUD_Specs specs)
        bool valid = true;
        format = 0;
 
-       switch(specs.format)
+       switch(m_specs.format)
        {
-       case AUD_FORMAT_U8:
-               switch(specs.channels)
-               {
-               case AUD_CHANNELS_MONO:
-                       format = AL_FORMAT_MONO8;
-                       break;
-               case AUD_CHANNELS_STEREO:
-                       format = AL_FORMAT_STEREO8;
-                       break;
-               case AUD_CHANNELS_SURROUND4:
-                       if(m_useMC)
-                       {
-                               format = alGetEnumValue("AL_FORMAT_QUAD8");
-                               break;
-                       }
-               case AUD_CHANNELS_SURROUND51:
-                       if(m_useMC)
-                       {
-                               format = alGetEnumValue("AL_FORMAT_51CHN8");
-                               break;
-                       }
-               case AUD_CHANNELS_SURROUND61:
-                       if(m_useMC)
-                       {
-                               format = alGetEnumValue("AL_FORMAT_61CHN8");
-                               break;
-                       }
-               case AUD_CHANNELS_SURROUND71:
-                       if(m_useMC)
-                       {
-                               format = alGetEnumValue("AL_FORMAT_71CHN8");
-                               break;
-                       }
-               default:
-                       valid = false;
-               }
-               break;
        case AUD_FORMAT_S16:
                switch(specs.channels)
                {
@@ -591,23 +557,16 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep)
        if(reader == NULL)
                AUD_THROW(AUD_ERROR_READER);
 
-       AUD_Specs specs;
-
-       specs = reader->getSpecs();
+       AUD_DeviceSpecs specs = m_specs;
+       specs.specs = reader->getSpecs();
 
        // check format
-       bool valid = true;
+       bool valid = specs.channels != AUD_CHANNELS_INVALID;
 
-       if(specs.format == AUD_FORMAT_INVALID)
-               valid = false;
-       else if(specs.format == AUD_FORMAT_S24 ||
-                       specs.format == AUD_FORMAT_S32 ||
-                       specs.format == AUD_FORMAT_FLOAT32 ||
-                       specs.format == AUD_FORMAT_FLOAT64)
+       if(m_converter)
        {
                m_converter->setReader(reader);
                reader = m_converter->createReader();
-               specs = reader->getSpecs();
        }
 
        // create the handle
@@ -618,7 +577,7 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep)
        sound->isBuffered = false;
        sound->data_end = false;
 
-       valid &= getFormat(sound->format, specs);
+       valid &= getFormat(sound->format, specs.specs);
 
        if(!valid)
        {
@@ -647,7