Merging r39652 through r39842 from trunk into vgroup_modifiers.
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 1 Sep 2011 17:49:57 +0000 (17:49 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 1 Sep 2011 17:49:57 +0000 (17:49 +0000)
642 files changed:
CMakeLists.txt
SConstruct
build_files/cmake/Modules/FindOpenCOLLADA.cmake [new file with mode: 0644]
build_files/cmake/config/blender_lite.cmake
build_files/cmake/packaging.cmake
build_files/package_spec/rpm/blender.spec.in
build_files/scons/config/darwin-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
doc/python_api/examples/bpy.types.BlendDataLibraries.load.py
doc/python_api/rst/bge.render.rst
doc/python_api/rst/bge.types.rst
doc/python_api/rst/info_gotcha.rst [new file with mode: 0644]
doc/python_api/rst/info_overview.rst [new file with mode: 0644]
doc/python_api/rst/info_quickstart.rst [new file with mode: 0644]
doc/python_api/rst/info_tips_and_tricks.rst [new file with mode: 0644]
doc/python_api/sphinx_doc_gen.py
doc/python_api/sphinx_doc_gen.sh
intern/audaspace/CMakeLists.txt
intern/audaspace/FX/AUD_AccumulatorFactory.cpp
intern/audaspace/FX/AUD_AccumulatorFactory.h
intern/audaspace/FX/AUD_BaseIIRFilterReader.cpp
intern/audaspace/FX/AUD_BaseIIRFilterReader.h
intern/audaspace/FX/AUD_ButterworthFactory.cpp
intern/audaspace/FX/AUD_ButterworthFactory.h
intern/audaspace/FX/AUD_CallbackIIRFilterReader.cpp
intern/audaspace/FX/AUD_CallbackIIRFilterReader.h
intern/audaspace/FX/AUD_DelayFactory.cpp
intern/audaspace/FX/AUD_DelayFactory.h
intern/audaspace/FX/AUD_DelayReader.cpp
intern/audaspace/FX/AUD_DelayReader.h
intern/audaspace/FX/AUD_DoubleFactory.cpp
intern/audaspace/FX/AUD_DoubleFactory.h
intern/audaspace/FX/AUD_DoubleReader.cpp
intern/audaspace/FX/AUD_DoubleReader.h
intern/audaspace/FX/AUD_DynamicIIRFilterFactory.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h [new file with mode: 0644]
intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp [new file with mode: 0644]
intern/audaspace/FX/AUD_DynamicIIRFilterReader.h [new file with mode: 0644]
intern/audaspace/FX/AUD_EffectFactory.cpp
intern/audaspace/FX/AUD_EffectFactory.h
intern/audaspace/FX/AUD_EffectReader.cpp
intern/audaspace/FX/AUD_EffectReader.h
intern/audaspace/FX/AUD_EnvelopeFactory.cpp
intern/audaspace/FX/AUD_EnvelopeFactory.h
intern/audaspace/FX/AUD_FaderFactory.cpp
intern/audaspace/FX/AUD_FaderFactory.h
intern/audaspace/FX/AUD_FaderReader.cpp
intern/audaspace/FX/AUD_FaderReader.h
intern/audaspace/FX/AUD_HighpassFactory.cpp
intern/audaspace/FX/AUD_HighpassFactory.h
intern/audaspace/FX/AUD_IIRFilterFactory.cpp
intern/audaspace/FX/AUD_IIRFilterFactory.h
intern/audaspace/FX/AUD_IIRFilterReader.cpp
intern/audaspace/FX/AUD_IIRFilterReader.h
intern/audaspace/FX/AUD_LimiterFactory.cpp
intern/audaspace/FX/AUD_LimiterFactory.h
intern/audaspace/FX/AUD_LimiterReader.cpp
intern/audaspace/FX/AUD_LimiterReader.h
intern/audaspace/FX/AUD_LoopFactory.cpp
intern/audaspace/FX/AUD_LoopFactory.h
intern/audaspace/FX/AUD_LoopReader.cpp
intern/audaspace/FX/AUD_LoopReader.h
intern/audaspace/FX/AUD_LowpassFactory.cpp
intern/audaspace/FX/AUD_LowpassFactory.h
intern/audaspace/FX/AUD_PingPongFactory.cpp
intern/audaspace/FX/AUD_PingPongFactory.h
intern/audaspace/FX/AUD_PitchFactory.cpp
intern/audaspace/FX/AUD_PitchFactory.h
intern/audaspace/FX/AUD_PitchReader.cpp
intern/audaspace/FX/AUD_PitchReader.h
intern/audaspace/FX/AUD_RectifyFactory.cpp
intern/audaspace/FX/AUD_RectifyFactory.h
intern/audaspace/FX/AUD_ReverseFactory.cpp
intern/audaspace/FX/AUD_ReverseFactory.h
intern/audaspace/FX/AUD_ReverseReader.cpp
intern/audaspace/FX/AUD_ReverseReader.h
intern/audaspace/FX/AUD_SquareFactory.cpp
intern/audaspace/FX/AUD_SquareFactory.h
intern/audaspace/FX/AUD_SumFactory.cpp
intern/audaspace/FX/AUD_SumFactory.h
intern/audaspace/FX/AUD_SuperposeFactory.cpp
intern/audaspace/FX/AUD_SuperposeFactory.h
intern/audaspace/FX/AUD_SuperposeReader.cpp
intern/audaspace/FX/AUD_SuperposeReader.h
intern/audaspace/FX/AUD_VolumeFactory.cpp
intern/audaspace/FX/AUD_VolumeFactory.h
intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
intern/audaspace/OpenAL/AUD_OpenALDevice.h
intern/audaspace/Python/AUD_PyAPI.cpp
intern/audaspace/Python/AUD_PyAPI.h
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/ffmpeg/AUD_FFMPEGFactory.cpp
intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h
intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
intern/audaspace/ffmpeg/AUD_FFMPEGReader.h
intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp [new file with mode: 0644]
intern/audaspace/ffmpeg/AUD_FFMPEGWriter.h [new file with mode: 0644]
intern/audaspace/fftw/AUD_BandPassReader.cpp
intern/audaspace/intern/AUD_3DMath.h
intern/audaspace/intern/AUD_AnimateableProperty.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_AnimateableProperty.h [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_BufferReader.h
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_ChannelMapperReader.h
intern/audaspace/intern/AUD_ConverterFactory.cpp
intern/audaspace/intern/AUD_ConverterFactory.h
intern/audaspace/intern/AUD_ConverterFunctions.cpp
intern/audaspace/intern/AUD_ConverterReader.cpp
intern/audaspace/intern/AUD_ConverterReader.h
intern/audaspace/intern/AUD_DefaultMixer.cpp [deleted file]
intern/audaspace/intern/AUD_FileFactory.cpp
intern/audaspace/intern/AUD_FileFactory.h
intern/audaspace/intern/AUD_FileWriter.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_FileWriter.h [new file with mode: 0644]
intern/audaspace/intern/AUD_I3DDevice.h
intern/audaspace/intern/AUD_I3DHandle.h [new file with mode: 0644]
intern/audaspace/intern/AUD_IDevice.h
intern/audaspace/intern/AUD_IFactory.h
intern/audaspace/intern/AUD_IHandle.h [new file with mode: 0644]
intern/audaspace/intern/AUD_IReader.h
intern/audaspace/intern/AUD_IWriter.h [new file with mode: 0644]
intern/audaspace/intern/AUD_JOSResampleFactory.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_JOSResampleFactory.h [new file with mode: 0644]
intern/audaspace/intern/AUD_JOSResampleReader.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_JOSResampleReader.h [new file with mode: 0644]
intern/audaspace/intern/AUD_JOSResampleReaderCoeff.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_LinearResampleFactory.cpp
intern/audaspace/intern/AUD_LinearResampleFactory.h
intern/audaspace/intern/AUD_LinearResampleReader.cpp
intern/audaspace/intern/AUD_LinearResampleReader.h
intern/audaspace/intern/AUD_Mixer.cpp
intern/audaspace/intern/AUD_Mixer.h
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_Reference.h
intern/audaspace/intern/AUD_ReferenceHandler.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_ResampleReader.cpp [moved from intern/audaspace/intern/AUD_DefaultMixer.h with 56% similarity]
intern/audaspace/intern/AUD_ResampleReader.h [new file with mode: 0644]
intern/audaspace/intern/AUD_SequencerEntry.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_SequencerEntry.h [new file with mode: 0644]
intern/audaspace/intern/AUD_SequencerFactory.cpp
intern/audaspace/intern/AUD_SequencerFactory.h
intern/audaspace/intern/AUD_SequencerHandle.cpp [new file with mode: 0644]
intern/audaspace/intern/AUD_SequencerHandle.h [new file with mode: 0644]
intern/audaspace/intern/AUD_SequencerReader.cpp
intern/audaspace/intern/AUD_SequencerReader.h
intern/audaspace/intern/AUD_SilenceFactory.cpp
intern/audaspace/intern/AUD_SilenceFactory.h
intern/audaspace/intern/AUD_SilenceReader.cpp
intern/audaspace/intern/AUD_SilenceReader.h
intern/audaspace/intern/AUD_SinusFactory.cpp
intern/audaspace/intern/AUD_SinusFactory.h
intern/audaspace/intern/AUD_SinusReader.cpp
intern/audaspace/intern/AUD_SinusReader.h
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/AUD_StreamBufferFactory.h
intern/audaspace/jack/AUD_JackDevice.cpp
intern/audaspace/jack/AUD_JackDevice.h
intern/audaspace/sndfile/AUD_SndFileFactory.cpp
intern/audaspace/sndfile/AUD_SndFileFactory.h
intern/audaspace/sndfile/AUD_SndFileReader.cpp
intern/audaspace/sndfile/AUD_SndFileReader.h
intern/audaspace/sndfile/AUD_SndFileWriter.cpp [new file with mode: 0644]
intern/audaspace/sndfile/AUD_SndFileWriter.h [new file with mode: 0644]
intern/ffmpeg/ffmpeg_compat.h
intern/ghost/intern/GHOST_ISystemPaths.cpp
intern/ghost/intern/GHOST_Path-api.cpp
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/guardedalloc/intern/mallocn.c
intern/itasc/kdl/frames_io.cpp
release/datafiles/blenderbuttons
release/scripts/modules/bpy_extras/image_utils.py
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/modules/bpy_extras/mesh_utils.py
release/scripts/modules/bpy_extras/object_utils.py
release/scripts/modules/bpy_extras/view3d_utils.py
release/scripts/modules/bpy_types.py
release/scripts/modules/console_python.py
release/scripts/presets/ffmpeg/DV.py
release/scripts/presets/ffmpeg/DVD.py
release/scripts/presets/ffmpeg/SVCD.py
release/scripts/presets/ffmpeg/VCD.py
release/scripts/startup/bl_operators/nla.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_data_speaker.py [new file with mode: 0644]
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_graph.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_nla.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_text.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/keyingsets_builtins.py
source/blender/CMakeLists.txt
source/blender/avi/intern/avi.c
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/BKE_anim.h
source/blender/blenkernel/BKE_animsys.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_constraint.h
source/blender/blenkernel/BKE_fcurve.h
source/blender/blenkernel/BKE_image.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/BKE_nla.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/BKE_speaker.h [new file with mode: 0644]
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/DerivedMesh.c
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/cdderivedmesh.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh_validate.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/report.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/speaker.c [new file with mode: 0644]
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/unit.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/BLI_callbacks.h
source/blender/blenlib/BLI_math_rotation.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_string.h
source/blender/blenlib/BLI_utildefines.h
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/BLI_kdtree.c
source/blender/blenlib/intern/callbacks.c
source/blender/blenlib/intern/graph.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/noise.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/string.c
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/iff.h
source/blender/collada/AnimationExporter.cpp [new file with mode: 0644]
source/blender/collada/AnimationExporter.h [new file with mode: 0644]
source/blender/collada/AnimationImporter.cpp
source/blender/collada/AnimationImporter.h
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureExporter.h
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/ArmatureImporter.h
source/blender/collada/CMakeLists.txt
source/blender/collada/CameraExporter.cpp
source/blender/collada/DocumentExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/DocumentImporter.h
source/blender/collada/EffectExporter.cpp
source/blender/collada/ExtraHandler.cpp
source/blender/collada/ExtraHandler.h
source/blender/collada/GeometryExporter.h
source/blender/collada/LightExporter.cpp
source/blender/collada/SkinInfo.cpp
source/blender/collada/TransformReader.cpp
source/blender/collada/TransformWriter.cpp
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/poseUtils.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/datafiles/blenderbuttons.c
source/blender/editors/datafiles/startup.blend.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/editaction_gpencil.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_intern.h
source/blender/editors/gpencil/gpencil_ops.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_gpencil.h
source/blender/editors/include/ED_keyframes_draw.h
source/blender/editors/include/ED_keyframes_edit.h
source/blender/editors/include/ED_keyframing.h
source/blender/editors/include/ED_markers.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_icons.h
source/blender/editors/include/UI_resources.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_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_lib.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_intern.h
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/physics/particle_edit.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sound/CMakeLists.txt
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_intern.h
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/fsmenu.c
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_ops.c
source/blender/editors/space_graph/graph_select.c
source/blender/editors/space_graph/graph_utils.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_nla/nla_intern.h
source/blender/editors/space_nla/nla_ops.c
source/blender/editors/space_nla/nla_select.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_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_ops.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_sequencer/SConscript
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_text/space_text.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_intern.h
source/blender/editors/space_time/time_ops.c
source/blender/editors/space_view3d/drawanimviz.c
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/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/intern/gpu_shader_material.glsl
source/blender/gpu/intern/gpu_shader_material.glsl.c
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/intern/IMB_anim.h
source/blender/imbuf/intern/IMB_indexer.h [new file with mode: 0644]
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
source/blender/imbuf/intern/filter.c
source/blender/imbuf/intern/indexer.c [new file with mode: 0644]
source/blender/imbuf/intern/indexer_dv.c [new file with mode: 0644]
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/openexr/openexr_multi.h
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/imbuf/intern/writeimage.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_actuator_types.h
source/blender/makesdna/DNA_anim_types.h
source/blender/makesdna/DNA_armature_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_gpencil_types.h
source/blender/makesdna/DNA_ipo_types.h
source/blender/makesdna/DNA_nla_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_sound_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_speaker_types.h [new file with mode: 0644]
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/intern/CMakeLists.txt
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_actuator.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_animation_api.c
source/blender/makesrna/intern/rna_animviz.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_constraint.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_gpencil.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.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_scene.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_sound.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_speaker.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_texture_api.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_userdef.c
source/blender/python/generic/bgl.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/intern/bpy_intern_string.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_props.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_traceback.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pointdensity.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ActionActuator.h
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_ArmatureObject.h
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_DeformableGameObject.cpp
source/gameengine/Converter/BL_DeformableGameObject.h
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/BL_ShapeActionActuator.h
source/gameengine/Converter/BL_ShapeDeformer.cpp
source/gameengine/Converter/BL_ShapeDeformer.h
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/BL_SkinDeformer.h
source/gameengine/Converter/BlenderWorldInfo.cpp
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
source/gameengine/Converter/KX_BlenderScalarInterpolator.h
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertControllers.cpp
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/Converter/KX_IpoConvert.cpp
source/gameengine/Converter/KX_IpoConvert.h
source/gameengine/Converter/SConscript
source/gameengine/Expressions/InputParser.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp
source/gameengine/GameLogic/SCA_RandomSensor.cpp
source/gameengine/GameLogic/SCA_XORController.cpp
source/gameengine/GamePlayer/common/bmfont.cpp
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/BL_Action.cpp [new file with mode: 0644]
source/gameengine/Ketsji/BL_Action.h [new file with mode: 0644]
source/gameengine/Ketsji/BL_ActionManager.cpp [new file with mode: 0644]
source/gameengine/Ketsji/BL_ActionManager.h [new file with mode: 0644]
source/gameengine/Ketsji/BL_BlenderShader.cpp
source/gameengine/Ketsji/BL_Material.h
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_Dome.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.h
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/SConscript
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
source/gameengine/Rasterizer/RAS_IRasterizer.h
source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
source/gameengine/SceneGraph/SG_BBox.cpp
source/gameengine/SceneGraph/SG_IObject.cpp
source/gameengine/SceneGraph/SG_IObject.h
source/gameengine/SceneGraph/SG_Spatial.cpp
source/gameengine/VideoTexture/Exception.cpp
source/gameengine/VideoTexture/FilterColor.h
source/gameengine/VideoTexture/ImageBase.cpp
source/gameengine/VideoTexture/ImageMix.cpp
source/gameengine/VideoTexture/ImageRender.cpp
source/gameengine/VideoTexture/ImageViewport.cpp
source/gameengine/VideoTexture/VideoFFmpeg.cpp
source/gameengine/VideoTexture/blendVideoTex.cpp

index 4a544cbfa0567e7ab42352be93c00bc4ee2dfac0..38ce86898552da0509a9143d596c3362e15507b3 100644 (file)
@@ -274,6 +274,11 @@ endif()
 
 TEST_SSE_SUPPORT()
 
+# don't store paths to libs for portable distrobution
+if(WITH_INSTALL_PORTABLE)
+       set(CMAKE_SKIP_BUILD_RPATH TRUE)
+endif()
+
 #-----------------------------------------------------------------------------
 # Initialize un-cached vars, avoid unused warning
 
@@ -445,21 +450,20 @@ if(UNIX AND NOT APPLE)
        endif()
 
        if(WITH_OPENCOLLADA)
-               set(OPENCOLLADA /usr/local/opencollada CACHE PATH "OpenCollada Directory")
-               mark_as_advanced(OPENCOLLADA)
-               set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
-               set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer xml2)
-               set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA})
-
-               set(PCRE /usr CACHE PATH "PCRE Directory")
-               mark_as_advanced(PCRE)
-               set(PCRE_LIBPATH ${PCRE}/lib)
-               set(PCRE_LIB pcre)
+               find_package(OpenCOLLADA)
+               if(OPENCOLLADA_FOUND)
+                       set(PCRE /usr CACHE PATH "PCRE Directory")
+                       mark_as_advanced(PCRE)
+                       set(PCRE_LIBPATH ${PCRE}/lib)
+                       set(PCRE_LIB pcre)
 
-               set(EXPAT /usr CACHE PATH "Expat Directory")
-               mark_as_advanced(EXPAT)
-               set(EXPAT_LIBPATH ${EXPAT}/lib)
-               set(EXPAT_LIB expat)
+                       set(EXPAT /usr CACHE PATH "Expat Directory")
+                       mark_as_advanced(EXPAT)
+                       set(EXPAT_LIBPATH ${EXPAT}/lib)
+                       set(EXPAT_LIB expat)
+               else()
+                       set(WITH_OPENCOLLADA OFF)
+               endif()
        endif()
 
        if(WITH_MEM_JEMALLOC)
@@ -684,9 +688,15 @@ elseif(WIN32)
                endif()
 
                if(WITH_OPENCOLLADA)
-                       set(OPENCOLLADA_INCLUDE_DIR
-                               ${LIBDIR}/opencollada/include
+
+                       set(OPENCOLLADA_INCLUDE_DIRS
+                               ${LIBDIR}/opencollada/include/COLLADAStreamWriter/include
+                               ${LIBDIR}/opencollada/include/COLLADABaseUtils/include
+                               ${LIBDIR}/opencollada/include/COLLADAFramework/include
+                               ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
+                               ${LIBDIR}/opencollada/include/GeneratedSaxParser/include                        
                        )
+
                        set(OPENCOLLADA_LIBRARIES
                                ${LIBDIR}/opencollada/lib/OpenCOLLADASaxFrameworkLoader.lib
                                ${LIBDIR}/opencollada/lib/OpenCOLLADAFramework.lib
@@ -832,7 +842,13 @@ elseif(WIN32)
 
                if(WITH_OPENCOLLADA)
                        set(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
-                       set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA}/include)
+                       set(OPENCOLLADA_INCLUDE_DIRS
+                               ${LIBDIR}/gcc/opencollada/include/COLLADAStreamWriter/include
+                               ${LIBDIR}/gcc/opencollada/include/COLLADABaseUtils/include
+                               ${LIBDIR}/gcc/opencollada/include/COLLADAFramework/include
+                               ${LIBDIR}/gcc/opencollada/include/COLLADASaxFrameworkLoader/include
+                               ${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include                    
+                       )
                        set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
                        set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
                        set(PCRE_LIB pcre)
@@ -932,7 +948,7 @@ elseif(APPLE)
                # we use precompiled libraries for py 3.2 and up by default
 
                # normally cached but not since we include them with blender
-                set(PYTHON_VERSION 3.2)
+               set(PYTHON_VERSION 3.2)
                set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
                # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
                set(PYTHON_LIBRARY python${PYTHON_VERSION})
@@ -1043,7 +1059,15 @@ elseif(APPLE)
 
        if(WITH_OPENCOLLADA)
                set(OPENCOLLADA ${LIBDIR}/opencollada)
-               set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA}/include)
+
+               set(OPENCOLLADA_INCLUDE_DIRS
+                       ${LIBDIR}/opencollada/include/COLLADAStreamWriter
+                       ${LIBDIR}/opencollada/include/COLLADABaseUtils
+                       ${LIBDIR}/opencollada/include/COLLADAFramework
+                       ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
+                       ${LIBDIR}/opencollada/include/GeneratedSaxParser
+               )
+
                set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
                set(OPENCOLLADA_LIBRARIES "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
                #pcre is bundled with openCollada
index 7f11397a286d6b6a74dcc89abd0f98a5451d943c..2531872af6c6de85647ae1ee8d55ab720ebe7b59 100644 (file)
@@ -272,12 +272,12 @@ if env['OURPLATFORM']=='darwin':
     # for now, Mac builders must download and install the 3DxWare 10 Beta 4 driver framework from 3Dconnexion
     # necessary header file lives here when installed:
     # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h
-    if env['WITH_BF_3DMOUSE'] == 1 and not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
-        print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
-        env['WITH_BF_3DMOUSE'] = 0
-    else:
-        env.Append(LINKFLAGS=['-weak_framework','3DconnexionClient'])
-
+    if env['WITH_BF_3DMOUSE'] == 1:
+        if not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
+            print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
+            env['WITH_BF_3DMOUSE'] = 0
+        else:
+            env.Append(LINKFLAGS=['-weak_framework','3DconnexionClient'])
 
 if env['WITH_BF_OPENMP'] == 1:
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
diff --git a/build_files/cmake/Modules/FindOpenCOLLADA.cmake b/build_files/cmake/Modules/FindOpenCOLLADA.cmake
new file mode 100644 (file)
index 0000000..c763728
--- /dev/null
@@ -0,0 +1,118 @@
+# - Find OpenCOLLADA library
+# Find the native OpenCOLLADA includes and library
+# This module defines
+#  OPENCOLLADA_INCLUDE_DIRS, where to find COLLADABaseUtils/ and 
+#                 COLLADAFramework/, Set when OPENCOLLADA_INCLUDE_DIR is found.
+#  OPENCOLLADA_LIBRARIES, libraries to link against to use OpenCOLLADA.
+#  OPENCOLLADA_ROOT_DIR, The base directory to search for OpenCOLLADA.
+#                    This can also be an environment variable.
+#  OPENCOLLADA_FOUND, If false, do not try to use OpenCOLLADA.
+#
+# also defined, but not for general use are
+#  OPENCOLLADA_LIBRARY, where to find the OpenCOLLADA library.
+
+#=============================================================================
+# Copyright 2011 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# note about include paths, there are 2 ways includes are set
+#
+# Where '/usr/include/opencollada' is the root dir:
+#   /usr/include/opencollada/COLLADABaseUtils/COLLADABUPlatform.h
+#
+# Where '/opt/opencollada' is the base dir:
+# /opt/opencollada/COLLADABaseUtils/include/COLLADABUPlatform.h
+
+# If OPENCOLLADA_ROOT_DIR was defined in the environment, use it.
+IF(NOT OPENCOLLADA_ROOT_DIR AND NOT $ENV{OPENCOLLADA_ROOT_DIR} STREQUAL "")
+  SET(OPENCOLLADA_ROOT_DIR $ENV{OPENCOLLADA_ROOT_DIR})
+ENDIF()
+
+SET(_opencollada_FIND_INCLUDES
+  COLLADAStreamWriter
+  COLLADABaseUtils
+  COLLADAFramework
+  COLLADASaxFrameworkLoader
+  GeneratedSaxParser
+)
+
+SET(_opencollada_FIND_COMPONENTS
+  OpenCOLLADAStreamWriter
+  OpenCOLLADASaxFrameworkLoader
+  OpenCOLLADAFramework
+  OpenCOLLADABaseUtils
+  GeneratedSaxParser
+  UTF
+  MathMLSolver
+  pcre
+  ftoa
+  buffer
+  xml2
+)
+
+SET(_opencollada_SEARCH_DIRS
+  ${OPENCOLLADA_ROOT_DIR}
+  /usr/local
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+)
+
+SET(_opencollada_INCLUDES)
+FOREACH(COMPONENT ${_opencollada_FIND_INCLUDES})
+  STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+
+  # need to use this even thouh we are looking for a dir
+  FIND_FILE(OPENCOLLADA_${UPPERCOMPONENT}_INCLUDE_DIR
+    NAMES
+      ${COMPONENT}/include
+      ${COMPONENT}
+      # Ubuntu ppa needs this.
+      # Alternative would be to suffix all members of search path
+      # but this is less trouble, just looks strange.
+      include/opencollada/${COMPONENT}
+    HINTS
+      ${_opencollada_SEARCH_DIRS}
+    )
+  MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_INCLUDE_DIR)
+  LIST(APPEND _opencollada_INCLUDES "${OPENCOLLADA_${UPPERCOMPONENT}_INCLUDE_DIR}")
+ENDFOREACH()
+
+
+SET(_opencollada_LIBRARIES)
+FOREACH(COMPONENT ${_opencollada_FIND_COMPONENTS})
+  STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+
+  FIND_LIBRARY(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY
+    NAMES
+      ${COMPONENT}
+    HINTS
+      ${_opencollada_SEARCH_DIRS}
+    PATH_SUFFIXES
+      lib64 lib
+      # Ubuntu ppa needs this.
+      lib64/opencollada lib/opencollada
+    )
+  MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
+  LIST(APPEND _opencollada_LIBRARIES "${OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY}")
+ENDFOREACH()
+
+
+# handle the QUIETLY and REQUIRED arguments and set OPENCOLLADA_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCOLLADA  DEFAULT_MSG
+    _opencollada_LIBRARIES _opencollada_INCLUDES)
+
+
+IF(OPENCOLLADA_FOUND)
+  SET(OPENCOLLADA_LIBRARIES ${_opencollada_LIBRARIES})
+  SET(OPENCOLLADA_INCLUDE_DIRS ${_opencollada_INCLUDES})
+ENDIF(OPENCOLLADA_FOUND)
index d2b791baede546d22bcdbc0b731c1a06c44ee57d..f09a8058f1434b0414f3b13bef44cbfbd8e2f900 100644 (file)
@@ -1,4 +1,4 @@
-# turn everything OFF CACHE FORCE BOOL) except for python which defaults to ON
+# turn everything OFF except for python which defaults to ON
 # and is needed for the UI
 #
 # Example usage:
index 6cda62b487fd69ab89849a51845aede5b790810a..c0124fe81999414d047b7d275549044fb5a5a2eb 100644 (file)
@@ -43,7 +43,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
                set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
                set(CPACK_PACKAGE_RELOCATABLE "false")
                set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
-               set(CPACK_RPM_PACKAGE_GROUP "Amusements/Graphics")
+               set(CPACK_RPM_PACKAGE_GROUP "Amusements/Multimedia")
                set(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_SOURCE_DIR}/build_files/package_spec/rpm/blender.spec.in")
        endif()
 endif()
@@ -75,14 +75,14 @@ endmacro()
 
 if(APPLE)
        add_package_archive(
-               "blender-${BLENDER_VERSION}-r${BUILD_REV}-OSX-${CMAKE_OSX_ARCHITECTURES}"
+               "${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-OSX-${CMAKE_OSX_ARCHITECTURES}"
                "zip")
 elseif(UNIX)
        # platform name could be tweaked, to include glibc, and ensure processor is correct (i386 vs i686)
        string(TOLOWER ${CMAKE_SYSTEM_NAME} PACKAGE_SYSTEM_NAME)
 
        add_package_archive(
-               "blender-${BLENDER_VERSION}-r${BUILD_REV}-${PACKAGE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}"
+               "${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${PACKAGE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}"
                "tar.bz2")
 endif()
 
index 502e9f36251ef40a4b1dac319c38f03798af4963..25ad5344721848e6ad0e8a9d6b6b5c1d1e263421 100644 (file)
@@ -9,6 +9,7 @@ Release:        @CPACK_RPM_PACKAGE_RELEASE@%{?dist}
 License:        @CPACK_RPM_PACKAGE_LICENSE@
 Group:          @CPACK_RPM_PACKAGE_GROUP@
 Vendor:         @CPACK_RPM_PACKAGE_VENDOR@
+Epoch:         1
 
 %define _rpmdir @CPACK_RPM_DIRECTORY@
 %define _rpmfilename @CPACK_RPM_FILE_NAME@
index ec6a3b082b8a0bead7854284080d489d5960e377..102ec73a4e309439232208a9d0f460492c54ae28 100644 (file)
@@ -14,7 +14,7 @@ USE_SDK=True
 ###################     Cocoa & architecture settings      ##################
 #############################################################################
 WITH_GHOST_COCOA=True
-MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
+MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
 
 
 cmd = 'uname -p'
@@ -104,14 +104,26 @@ BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg bz2'
 #bz2 is a standard osx dynlib
 
-# python 3.1 uses precompiled libraries in bf svn /lib by default
 BF_PYTHON_VERSION = '3.2'
-BF_PYTHON = LIBDIR + '/python'
-BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
-# BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
-# BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
+WITH_OSX_STATICPYTHON = True
+
+if WITH_OSX_STATICPYTHON:
+       # python 3.2 uses precompiled libraries in bf svn /lib by default
+
+       BF_PYTHON = LIBDIR + '/python'
+       BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
+       # BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
+       BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
+       BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
+       # BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
+else:
+       # python 3.2 uses Python-framework additionally installed in /Library/Frameworks
+       
+       BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
+       BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}m'
+       BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
+       #BF_PYTHON_LIB = ''
+       BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config-3.2m'
        
 WITH_BF_OPENAL = True
 #different lib must be used  following version of gcc
@@ -315,8 +327,16 @@ if WITH_BF_QUICKTIME:
        else:
                PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
 
+if not WITH_OSX_STATICPYTHON:
+               PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','Python']
+
+
 #note to build succesfully on 10.3.9 SDK you need to patch  10.3.9 by adding the SystemStubs.a lib from 10.4
-LLIBS = ['stdc++', 'SystemStubs']
+#for 10.7.sdk, SystemStubs needs to be excluded (lib doesn't exist anymore)
+if MACOSX_DEPLOYMENT_TARGET == '10.7':
+       LLIBS = ['stdc++']
+else:
+       LLIBS = ['stdc++', 'SystemStubs']
 
 # some flags shuffling for different OS versions
 if MAC_MIN_VERS == '10.3':
index 2f8fa297667d977ce05fec81d001aee5f6d23c66..2950ca9380f60f962965382a1e523f296edc33cc 100644 (file)
@@ -40,7 +40,7 @@ BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
 BF_JACK_LIB = 'libjack'
 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 = 'libsndfile-1'
index 94d09732be75f45c165f2c72eba9787fb5a4ed07..c537e435de8c3ae0bd6afd1c1139b1b42b54756b 100644 (file)
@@ -536,7 +536,10 @@ def AppIt(target=None, source=None, env=None):
     print("Installing to %s"%(installdir))
     # TODO, use tar.
     python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
-    print("unzipping to app-bundle: %s"%(python_zip))
+    if env['WITH_OSX_STATICPYTHON']:
+        print("unzipping to app-bundle: %s"%(python_zip))
+    else:
+        print("dynamic build - make sure to have python3.x-framework installed")
     bldroot = env.Dir('.').abspath
     binary = env['BINARYKIND']
      
@@ -569,10 +572,11 @@ def AppIt(target=None, source=None, env=None):
     commands.getoutput(cmd)
     cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
     commands.getoutput(cmd)
-    cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
-    commands.getoutput(cmd)
-    cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
-    commands.getoutput(cmd)
+    if env['WITH_OSX_STATICPYTHON']:
+        cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
+        commands.getoutput(cmd)
+        cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
+        commands.getoutput(cmd) 
 
     if binary == 'blender':#not copy everything for blenderplayer
         cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
index d222c0bcc18a11f4410eb93ca3426a593a848fc6..be059241727a5f13bcf19d2aa0dc67a14cd7393a 100644 (file)
@@ -78,7 +78,7 @@ def print_arguments(args, bc):
 
 def validate_arguments(args, bc):
     opts_list = [
-            'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 
+            'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 
             'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
             'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
             'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH', 'WITH_BF_STATICLIBSAMPLERATE', 'BF_LIBSAMPLERATE_LIB_STATIC',
@@ -230,6 +230,7 @@ def read_opts(env, cfg, args):
         ('BF_PYTHON_LIBPATH', 'Library path', ''),
         ('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
         (BoolVariable('WITH_BF_STATICPYTHON', 'Staticly link to python', False)),
+        (BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
         ('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
 
         (BoolVariable('BF_NO_ELBEEM', 'Disable Fluid Sim', False)),
index 42e2a71cc70893af22deb0b5d232fbbe8a6bf137..5e7022c88b43712c0657d8308cbb07b1a83ac7f2 100644 (file)
@@ -23,11 +23,6 @@ with bpy.data.libraries.load(filepath) as (data_from, data_to):
         setattr(data_to, attr, getattr(data_from, attr))
 
 
-# the 'data_to' variables lists are
-with bpy.data.libraries.load(filepath) as (data_from, data_to):
-    data_to.scenes = ["Scene"]
-
-
 # the loaded objects can be accessed from 'data_to' outside of the context
 # since loading the data replaces the strings for the datablocks or None
 # if the datablock could not be loaded.
index 10514049a8a7efecb7f18f4dbcb54c7134c353c2..eeb50a833ffbd2577b8b141146041f3108450e72 100644 (file)
@@ -215,7 +215,19 @@ Functions
    :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
    :rtype: boolean
 
+.. function:: setAnisotropicFiltering(level)
 
+   Set the anisotropic filtering level for textures.
+   
+   :arg level: The new anisotropic filtering level to use
+   :type level: integer (must be one of 1, 2, 4, 8, 16)
+   
+.. function:: getAnisotropicFiltering()
+
+   Get the anisotropic filtering level used for textures.
+   
+   :rtype: integer (one of 1, 2, 4, 8, 16)
+   
 .. function:: drawLine(fromVec,toVec,color)
 
    Draw a line in the 3D scene.
index 36ef9154e1753640daa12a7c5b79662f659747ef..d9a93a945edc81e12627cb10646c77b390b808a9 100644 (file)
@@ -1539,6 +1539,67 @@ Game Types (bge.types)
       Return the value matching key, or the default value if its not found.
       :return: The key value or a default.
 
+   .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0 blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0)
+
+      Plays an action.
+      
+      :arg name: the name of the action
+      :type name: string
+      :arg start: the start frame of the action
+      :type start: float
+      :arg end: the end frame of the action
+      :type end: float
+      :arg layer: the layer the action will play in (actions in different layers are added/blended together)
+      :type layer: integer
+      :arg priority: only play this action if there isn't an action currently playing in this layer with a higher (lower number) priority
+      :type priority: integer
+      :arg blendin: the amount of blending between this animation and the previous one on this layer
+      :type blendin: float
+      :arg play_mode: the play mode
+      :type play_mode: KX_ACTION_MODE_PLAY, KX_ACTION_MODE_LOOP, or KX_ACTION_MODE_PING_PONG
+      :arg layer_weight: how much of the previous layer to use for blending (0 = add)
+      :type layer_weight: float
+      :arg ipo_flags: flags for the old IPO behaviors (force, etc)
+      :type ipo_flags: int bitfield
+      :arg speed: the playback speed of the action as a factor (1.0 = normal speed, 2.0 = 2x speed, etc)
+      :type speed: float
+
+   .. method:: stopAction(layer=0)
+      
+      Stop playing the action on the given layer.
+      
+      :arg layer: The layer to stop playing.
+      :type layer: integer
+      
+   .. method:: getActionFrame(layer=0)
+   
+      Gets the current frame of the action playing in the supplied layer.
+      
+      :arg layer: The layer that you want to get the frame from.
+      :type layer: integer
+      
+      :return: The current frame of the action
+      :rtype: float
+      
+   .. method:: setActionFrame(frame, layer=0)
+   
+      Set the current frame of the action playing in the supplied layer.
+      
+      :arg layer: The layer where you want to set the frame
+      :type layer: integer
+      :arg frame: The frame to set the action to
+      :type frame: float
+
+   .. method:: isPlayingAction(layer=0)
+   
+       Checks to see if there is an action playing in the given layer.
+       
+       :arg layer: The layer to check for a playing action.
+       :type layer: integer
+       
+       :return: Whether or not the action is playing
+       :rtype: boolean
+
 .. class:: KX_IpoActuator(SCA_IActuator)
 
    IPO actuator activates an animation.
diff --git a/doc/python_api/rst/info_gotcha.rst b/doc/python_api/rst/info_gotcha.rst
new file mode 100644 (file)
index 0000000..c97fc3a
--- /dev/null
@@ -0,0 +1,405 @@
+********
+Gotcha's
+********
+
+This document attempts to help you work with the Blender API in areas that can be troublesome and avoid practices that are known to give instability.
+
+
+Using Operators
+===============
+
+Blender's operators are tools for users to access, that python can access them too is very useful nevertheless operators have limitations that can make them cumbersome to script.
+
+Main limits are...
+
+* Can't pass data such as objects, meshes or materials to operate on (operators use the context instead)
+
+* The return value from calling an operator gives the success (if it finished or was canceled),
+  in some cases it would be more logical from an API perspective to return the result of the operation.
+
+* Operators poll function can fail where an API function would raise an exception giving details on exactly why.
+
+
+Why does an operator's poll fail?
+---------------------------------
+
+When calling an operator gives an error like this:
+
+   >>> bpy.ops.action.clean(threshold=0.001)
+   RuntimeError: Operator bpy.ops.action.clean.poll() failed, context is incorrect
+
+Which raises the question as to what the correct context might be?
+
+Typically operators check for the active area type, a selection or active object they can operate on, but some operators are more picky about when they run.
+
+In most cases you can figure out what context an operator needs simply be seeing how its used in Blender and thinking about what it does.
+
+
+Unfortunately if you're still stuck - the only way to **really** know whats going on is to read the source code for the poll function and see what its checking.
+
+For python operators its not so hard to find the source since its included with with Blender and the source file/line is included in the operator reference docs.
+
+Downloading and searching the C code isn't so simple, especially if you're not familiar with the C language but by searching the operator name or description you should be able to find the poll function with no knowledge of C.
+
+.. note::
+
+   Blender does have the functionality for poll functions to describe why they fail, but its currently not used much, if you're interested to help improve our API feel free to add calls to ``CTX_wm_operator_poll_msg_set`` where its not obvious why poll fails.
+
+      >>> bpy.ops.gpencil.draw()
+      RuntimeError: Operator bpy.ops.gpencil.draw.poll() Failed to find Grease Pencil data to draw into
+
+
+The operator still doesn't work!
+--------------------------------
+
+Certain operators in Blender are only intended for use in a specific context, some operators for example are only called from the properties window where they check the current material, modifier or constraint.
+
+Examples of this are:
+
+* :mod:`bpy.ops.texture.slot_move`
+* :mod:`bpy.ops.constraint.limitdistance_reset`
+* :mod:`bpy.ops.object.modifier_copy`
+* :mod:`bpy.ops.buttons.file_browse`
+
+Another possibility is that you are the first person to attempt to use this operator in a script and some modifications need to be made to the operator to run in a different context, if the operator should logically be able to run but fails when accessed from a script it should be reported to the bug tracker.
+
+
+Stale Data
+==========
+
+No updates after setting values
+-------------------------------
+
+Sometimes you want to modify values from python and immediately access the updated values, eg:
+
+Once changing the objects :class:`bpy.types.Object.location` you may want to access its transformation right after from :class:`bpy.types.Object.matrix_world`, but this doesn't work as you might expect.
+
+Consider the calculations that might go into working out the objects final transformation, this includes:
+
+* animation function curves.
+* drivers and their pythons expressions.
+* constraints
+* parent objects and all of their f-curves, constraints etc.
+
+To avoid expensive recalculations every time a property is modified, Blender defers making the actual calculations until they are needed.
+
+However, while the script runs you may want to access the updated values.
+
+This can be done by calling :class:`bpy.types.Scene.update` after modifying values which recalculates all data that is tagged to be updated.
+
+
+Can I redraw during the script?
+-------------------------------
+
+The official answer to this is no, or... *"You don't want to do that"*.
+
+To give some background on the topic...
+
+While a script executes Blender waits for it to finish and is effectively locked until its done, while in this state Blender won't redraw or respond to user input.
+Normally this is not such a problem because scripts distributed with Blender tend not to run for an extended period of time, nevertheless scripts *can* take ages to execute and its nice to see whats going on in the view port.
+
+Tools that lock Blender in a loop and redraw are highly discouraged since they conflict with Blenders ability to run multiple operators at once and update different parts of the interface as the tool runs.
+
+So the solution here is to write a **modal** operator, that is - an operator which defines a modal() function, See the modal operator template in the text  editor.
+
+Modal operators execute on user input or setup their own timers to run frequently, they can handle the events or pass through to be handled by the keymap or other modal operators.
+
+Transform, Painting, Fly-Mode and File-Select are example of a modal operators.
+
+Writing modal operators takes more effort then a simple ``for`` loop that happens to redraw but is more flexible and integrates better with Blenders design.
+
+
+**Ok, Ok! I still want to draw from python**
+
+If you insist - yes its possible, but scripts that use this hack wont be considered for inclusion in Blender and any issues with using it wont be considered bugs, this is also not guaranteed to work in future releases.
+
+.. code-block:: python
+
+   bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
+
+
+Matrix multiplication is wrong
+==============================
+
+Every so often users complain that Blenders matrix math is wrong, the confusion comes from mathutils matrices being column-major to match OpenGL and the rest of Blenders matrix operations and stored matrix data.
+
+This is different to **numpy** which is row-major which matches what you would expect when using conventional matrix math notation.
+
+
+I can't edit the mesh in edit-mode!
+===================================
+
+Blenders EditMesh is an internal data structure (not saved and not exposed to python), this gives the main annoyance that you need to exit edit-mode to edit the mesh from python.
+
+The reason we have not made much attempt to fix this yet is because we
+will likely move to BMesh mesh API eventually, so any work on the API now will be wasted effort.
+
+With the BMesh API we may expose mesh data to python so we can
+write useful tools in python which are also fast to execute while in edit-mode.
+
+For the time being this limitation just has to be worked around but we're aware its frustrating needs to be addressed.
+
+
+EditBones, PoseBones, Bone... Bones
+===================================
+
+Armature Bones in Blender have three distinct data structures that contain them. If you are accessing the bones through one of them, you may not have access to the properties you really need.
+
+.. note::
+
+       In the following examples ``bpy.context.object`` is assumed to be an armature object.
+
+
+Edit Bones
+----------
+
+``bpy.context.object.data.edit_bones`` contains a editbones; to access them you must set the armature mode to edit mode first (editbones do not exist in object or pose mode). Use these to create new bones, set their head/tail or roll, change their parenting relationships to other bones, etc.
+
+Example using :class:`bpy.types.EditBone` in armature editmode:
+
+This is only possible in edit mode.
+
+   >>> bpy.context.object.data.edit_bones["Bone"].head = Vector((1.0, 2.0, 3.0)) 
+
+This will be empty outside of editmode.
+
+       >>> mybones = bpy.context.selected_editable_bones
+
+Returns an editbone only in edit mode.
+
+       >>> bpy.context.active_bone
+
+
+Bones (Object Mode)
+-------------------
+
+``bpy.context.object.data.bones`` contains bones. These *live* in object mode, and have various properties you can change, note that the head and tail properties are read-only.
+
+Example using :class:`bpy.types.Bone` in object or pose mode:
+
+Returns a bone (not an editbone) outside of edit mode
+
+       >>> bpy.context.active_bone
+
+This works, as with blender the setting can be edited in any mode
+
+       >>> bpy.context.object.data.bones["Bone"].use_deform = True
+
+Accessible but read-only
+
+       >>> tail = myobj.data.bones["Bone"].tail
+
+
+Pose Bones
+----------
+
+``bpy.context.object.pose.bones`` contains pose bones. This is where animation data resides, i.e. animatable transformations are applied to pose bones, as are constraints and ik-settings.
+
+Examples using :class:`bpy.types.PoseBone` in object or pose mode:
+
+.. code-block:: python
+
+       # Gets the name of the first constraint (if it exists)
+       bpy.context.object.pose.bones["Bone"].constraints[0].name 
+
+       # Gets the last selected pose bone (pose mode only)
+       bpy.context.active_pose_bone
+
+
+.. note::
+
+       Notice the pose is accessed from the object rather than the object data, this is why blender can have 2 or more objects sharing the same armature in different poses.
+
+.. note::
+
+       Strictly speaking PoseBone's are not bones, they are just the state of the armature, stored in the :class:`bpy.types.Object` rather than the :class:`bpy.types.Armature`, the real bones are however accessible from the pose bones - :class:`bpy.types.PoseBone.bone`
+
+
+Armature Mode Switching
+-----------------------
+
+While writing scripts that deal with armatures you may find you have to switch between modes, when doing so take care when switching out of editmode not to keep references to the edit-bones or their head/tail vectors. Further access to these will crash blender so its important the script clearly separates sections of the code which operate in different modes.
+
+This is mainly an issue with editmode since pose data can be manipulated without having to be in pose mode, however for operator access you may still need to enter pose mode.
+
+
+Unicode Problems
+================
+
+Python supports many different encpdings so there is nothing stopping you from writing a script in latin1 or iso-8859-15.
+
+See `pep-0263 <http://www.python.org/dev/peps/pep-0263/>`_
+
+However this complicates things for the python api because blend files themselves dont have an encoding.
+
+To simplify the problem for python integration and script authors we have decieded all strings in blend files **must** be UTF-8 or ASCII compatible.
+
+This means assigning strings with different encodings to an object names for instance will raise an error.
+
+Paths are an exception to this rule since we cannot ignore the existane of non-utf-8 paths on peoples filesystems.
+
+This means seemingly harmless expressions can raise errors, eg.
+
+   >>> print(bpy.data.filepath)
+   UnicodeEncodeError: 'ascii' codec can't encode characters in position 10-21: ordinal not in range(128)
+
+   >>> bpy.context.object.name = bpy.data.filepath
+   Traceback (most recent call last):
+     File "<blender_console>", line 1, in <module>
+   TypeError: bpy_struct: item.attr= val: Object.name expected a string type, not str
+
+
+Here are 2 ways around filesystem encoding issues:
+
+   >>> print(repr(bpy.data.filepath))
+
+   >>> import os
+   >>> filepath_bytes = os.fsencode(bpy.data.filepath)
+   >>> filepath_utf8 = filepath_bytes.decode('utf-8', "replace")
+   >>> bpy.context.object.name = filepath_utf8
+
+
+Unicode encoding/decoding is a big topic with comprehensive python documentation, to avoid getting stuck too deep in encoding problems - here are some suggestions:
+
+* Always use utf-8 encoiding or convert to utf-8 where the input is unknown.
+
+* Avoid manipulating filepaths as strings directly, use ``os.path`` functions instead.
+
+* Use ``os.fsencode()`` / ``os.fsdecode()`` rather then the built in string decoding functions when operating on paths.
+
+* To print paths or to include them in the user interface use ``repr(path)`` first or ``"%r" % path`` with string formatting.
+
+* **Possibly** - use bytes instead of python strings, when reading some input its less trouble to read it as binary data though you will still need to deciede how to treat any strings you want to use with Blender, some importers do this.
+
+
+Strange errors using 'threading' module
+=======================================
+
+Python threading with Blender only works properly when the threads finish up before the script does. By using ``threading.join()`` for example.
+
+Heres an example of threading supported by Blender:
+
+.. code-block:: python
+
+   import threading
+   import time
+
+   def prod():
+       print(threading.current_thread().name, "Starting")
+
+       # do something vaguely useful
+       import bpy
+       from mathutils import Vector
+       from random import random
+
+       prod_vec = Vector((random() - 0.5, random() - 0.5, random() - 0.5))
+       print("Prodding", prod_vec)
+       bpy.data.objects["Cube"].location += prod_vec
+       time.sleep(random() + 1.0)
+       # finish
+
+       print(threading.current_thread().name, "Exiting")
+
+   threads = [threading.Thread(name="Prod %d" % i, target=prod) for i in range(10)]
+
+
+   print("Starting threads...")
+
+   for t in threads:
+       t.start()
+
+   print("Waiting for threads to finish...")
+
+   for t in threads:
+       t.join()
+
+
+This an example of a timer which runs many times a second and moves the default cube continuously while Blender runs (Unsupported).
+
+.. code-block:: python
+
+   def func():
+       print("Running...")
+       import bpy
+       bpy.data.objects['Cube'].location.x += 0.05
+
+   def my_timer():
+       from threading import Timer
+       t = Timer(0.1, my_timer)
+       t.start()
+       func()
+
+   my_timer()
+
+Use cases like the one above which leave the thread running once the script finishes may seem to work for a while but end up causing random crashes or errors in Blenders own drawing code.
+
+So far no work has gone into making Blenders python integration thread safe, so until its properly supported, best not make use of this.
+
+.. note::
+
+   Pythons threads only allow co-currency and wont speed up you're scripts on multi-processor systems, the ``subprocess`` and ``multiprocess`` modules can be used with blender and make use of multiple CPU's too.
+
+
+Help! My script crashes Blender
+===============================
+
+Ideally it would be impossible to crash Blender from python however there are some problems with the API where it can be made to crash.
+
+Strictly speaking this is a bug in the API but fixing it would mean adding memory verification on every access since most crashes are caused by the python objects referencing Blenders memory directly, whenever the memory is freed, further python access to it can crash the script. But fixing this would make the scripts run very slow, or writing a very different kind of API which doesn't reference the memory directly.
+
+Here are some general hints to avoid running into these problems.
+
+* Be aware of memory limits, especially when working with large lists since Blender can crash simply by running out of memory.
+
+* Many hard to fix crashes end up being because of referencing freed data, when removing data be sure not to hold any references to it.
+
+* Modules or classes that remain active while Blender is used, should not hold references to data the user may remove, instead, fetch data from the context each time the script is activated.
+
+* Crashes may not happen every time, they may happen more on some configurations/operating-systems.
+
+
+Undo/Redo
+---------
+
+Undo invalidates all :class:`bpy.types.ID` instances (Object, Scene, Mesh etc).
+
+This example shows how you can tell undo changes the memory locations.
+
+   >>> hash(bpy.context.object)
+   -9223372036849950810
+   >>> hash(bpy.context.object)
+   -9223372036849950810
+
+   # ... move the active object, then undo
+
+   >>> hash(bpy.context.object)
+   -9223372036849951740
+
+As suggested above, simply not holding references to data when Blender is used interactively by the user is the only way to ensure the script doesn't become unstable.
+
+
+Array Re-Allocation
+-------------------
+
+When adding new points to a curve or vertices's/edges/faces to a mesh, internally the array which stores this data is re-allocated.
+
+.. code-block:: python
+
+   bpy.ops.curve.primitive_bezier_curve_add()
+   point = bpy.context.object.data.splines[0].bezier_points[0]
+   bpy.context.object.data.splines[0].bezier_points.add()
+
+   # this will crash!
+   point.co = 1.0, 2.0, 3.0
+
+This can be avoided by re-assigning the point variables after adding the new one or by storing indices's to the points rather then the points themselves.
+
+The best way is to sidestep the problem altogether add all the points to the curve at once. This means you don't have to worry about array re-allocation and its faster too since reallocating the entire array for every point added is inefficient.
+
+
+Removing Data
+-------------
+
+**Any** data that you remove shouldn't be modified or accessed afterwards, this includes f-curves, drivers, render layers, timeline markers, modifiers, constraints along with objects, scenes, groups, bones.. etc.
+
+This is a problem in the API at the moment that we should eventually solve.
diff --git a/doc/python_api/rst/info_overview.rst b/doc/python_api/rst/info_overview.rst
new file mode 100644 (file)
index 0000000..fe73008
--- /dev/null
@@ -0,0 +1,373 @@
+*******************
+Python API Overview
+*******************
+
+This document is to give an understanding of how python and blender fit together, covering some of the functionality that isn't obvious from reading the API reference and example scripts.
+
+
+Python in Blender
+=================
+
+Blender embeds a python interpreter which is started with blender and stays active. This interpreter runs scripts to draw the user interface and is used for some of Blender's internal tools too.
+
+This is a typical python environment so tutorials on how to write python scripts will work running the scripts in blender too. Blender provides the :mod:`bpy` module to the python interpreter. This module can be imported in a script and gives access to blender data, classes, and functions. Scripts that deal with blender data will need to import this module. 
+
+Here is a simple example of moving a vertex of the object named **Cube**:
+
+.. code-block:: python
+
+   import bpy
+   bpy.data.objects["Cube"].data.vertices[0].co.x += 1.0
+
+This modifies Blender's internal data directly. When you run this in the interactive console you will see the 3D viewport update.
+
+
+The Default Environment
+=======================
+
+When developing your own scripts it may help to understand how blender sets up its python environment. Many python scripts come bundled with blender and can be used as a reference because they use the same API that script authors write tools in. Typical usage for scripts include: user interface, import/export, scene manipulation, automation, defining your own toolset and customization.
+
+On startup blender scans the ``scripts/startup/`` directory for python modules and imports them. The exact location of this directory depends on your installation. `See the directory layout docs <http://wiki.blender.org/index.php/Doc:2.5/Manual/Introduction/Installing_Blender/DirectoryLayout>`_
+
+
+Script Loading
+==============
+
+This may seem obvious but it's important to note the difference between executing a script directly or importing it as a module.
+
+Scripts that extend blender - define classes that exist beyond the scripts execution, this makes future access to these classes (to unregister for example) more difficult than importing as a module where class instance is kept in the module and can be accessed by importing that module later on.
+
+For this reason it's preferable to only use directly execute scripts that don't extend blender by registering classes.
+
+
+Here are some ways to run scripts directly in blender.
+
+* Loaded in the text editor and press **Run Script**.
+
+* Typed or pasted into the interactive console.
+
+* Execute a python file from the command line with blender, eg:
+
+  ``blender --python /home/me/my_script.py``
+
+
+To run as modules:
+
+* The obvious way, ``import some_module`` command from the text window or interactive console.
+
+* Open as a text block and tick "Register" option, this will load with the blend file.
+
+* copy into one of the directories ``scripts/startup``, where they will be automatically imported on startup.
+
+* define as an addon, enabling the addon will load it as a python module.
+
+
+Addons
+------
+
+Some of blenders functionality is best kept optional, alongside scripts loaded at startup we have addons which are kept in their own directory ``scripts/addons``, and only load on startup if selected from the user preferences.
+
+The only difference between addons and built-in python modules is that addons must contain a **bl_info** variable which blender uses to read metadata such as name, author, category and URL.
+
+The user preferences addon listing uses **bl_info** to display information about each addon.
+
+`See Addons <http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons>`_ for details on the **bl_info** dictionary.
+
+
+Integration through Classes
+===========================
+
+Running python scripts in the text editor is useful for testing but you’ll want to extend blender to make tools accessible like other built-in functionality.
+
+The blender python api allows integration for:
+
+* :class:`bpy.types.Panel`
+
+* :class:`bpy.types.Menu`
+
+* :class:`bpy.types.Operator`
+
+* :class:`bpy.types.PropertyGroup`
+
+* :class:`bpy.types.KeyingSet`
+
+* :class:`bpy.types.RenderEngine`
+
+
+This is intentionally limited. Currently, for more advanced features such as mesh modifiers, object types, or shader nodes, C/C++ must be used.
+
+For python intergration Blender defines methods which are common to all types. This works by creating a python subclass of a Blender class which contains variables and functions specified by the parent class which are pre-defined to interface with Blender.
+
+For example:
+
+.. code-block:: python
+
+   import bpy
+   class SimpleOperator(bpy.types.Operator):
+       bl_idname = "object.simple_operator"
+       bl_label = "Tool Name"
+
+       def execute(self, context):
+           print("Hello World")
+           return {'FINISHED'}
+
+   bpy.utils.register_class(SimpleOperator)
+
+First note that we subclass a member of :mod:`bpy.types`, this is common for all classes which can be integrated with blender and used so we know if this is an Operator and not a Panel when registering.
+
+Both class properties start with a **bl_** prefix. This is a convention used to distinguish blender properties from those you add yourself.
+
+Next see the execute function, which takes an instance of the operator and the current context. A common prefix is not used for functions.
+
+Lastly the register function is called, this takes the class and loads it into blender. See `Class Registration`_.
+
+Regarding inheritance, blender doesn't impose restrictions on the kinds of class inheritance used, the registration checks will use attributes and functions defined in parent classes.
+
+class mix-in example:
+
+.. code-block:: python
+
+   import bpy
+   class BaseOperator:
+       def execute(self, context):
+           print("Hello World BaseClass")
+           return {'FINISHED'}
+
+   class SimpleOperator(bpy.types.Operator, BaseOperator):
+       bl_idname = "object.simple_operator"
+       bl_label = "Tool Name"
+
+   bpy.utils.register_class(SimpleOperator)
+
+Notice these classes don't define an ``__init__(self)`` function. While ``__init__()`` and ``__del__()`` will be called if defined, the class instances lifetime only spans the execution. So a panel for example will have a new instance for every redraw, for this reason there is rarely a cause to store variables in the panel instance. Instead, persistent variables should be stored in Blenders data so that the state can be restored when blender is restarted.
+
+.. note:: Modal operators are an exception, keeping their instance variable as blender runs, see modal operator template.
+
+So once the class is registered with blender, instancing the class and calling the functions is left up to blender. In fact you cannot instance these classes from the script as you would expect with most python API's.
+
+To run operators you can call them through the operator api, eg:
+
+.. code-block:: python
+
+   import bpy
+   bpy.ops.object.simple_operator()
+
+User interface classes are given a context in which to draw, buttons window, file header, toolbar etc, then they are drawn when that area is displayed so they are never called by python scripts directly.
+
+
+Registration
+============
+
+
+Module Registration
+-------------------
+
+Blender modules loaded at startup require ``register()`` and ``unregister()`` functions. These are the *only* functions that blender calls from your code, which is otherwise a regular python module.
+
+A simple blender/python module can look like this:
+
+.. code-block:: python
+
+   import bpy
+
+   class SimpleOperator(bpy.types.Operator):
+       """ See example above """
+
+   def register():
+       bpy.utils.register_class(SimpleOperator)
+
+   def unregister():
+       bpy.utils.unregister_class(SimpleOperator)    
+
+   if __name__ == "__main__":
+       register()
+
+These functions usually appear at the bottom of the script containing class registration sometimes adding menu items. You can also use them for internal purposes setting up data for your own tools but take care since register won't re-run when a new blend file is loaded.
+
+The register/unregister calls are used so it's possible to toggle addons and reload scripts while blender runs.
+If the register calls were placed in the body of the script, registration would be called on import, meaning there would be no distinction between importing a module or loading its classes into blender.
+
+This becomes problematic when a script imports classes from another module making it difficult to manage which classes are being loaded and when.
+
+The last 2 lines are only for testing:
+
+.. code-block:: python
+
+   if __name__ == "__main__":
+       register()
+
+This allows the script to be run directly in the text editor to test changes.
+This ``register()`` call won't run when the script is imported as a module since ``__main__`` is reserved for direct execution.
+
+
+Class Registration
+------------------
+
+Registering a class with blender results in the class definition being loaded into blender, where it becomes available alongside existing functionality.
+
+Once this class is loaded you can access it from :mod:`bpy.types`, using the bl_idname rather than the classes original name.
+
+When loading a class, blender performs sanity checks making sure all required properties and functions are found, that properties have the correct type, and that functions have the right number of arguments.
+
+Mostly you will not need concern yourself with this but if there is a problem with the class definition it will be raised on registering:
+
+Using the function arguments ``def execute(self, context, spam)``, will raise an exception:
+
+``ValueError: expected Operator, SimpleOperator class "execute" function to have 2 args, found 3``
+
+Using ``bl_idname = 1`` will raise.
+
+``TypeError: validating class error: Operator.bl_idname expected a string type, not int``
+
+
+Multiple-Classes
+^^^^^^^^^^^^^^^^
+
+Loading classes into blender is described above, for simple cases calling :mod:`bpy.utils.register_class` (SomeClass) is sufficient, but when there are many classes or a packages submodule has its own classes it can be tedious to list them all for registration.
+
+For more convenient loading/unloading :mod:`bpy.utils.register_module` (module) and :mod:`bpy.utils.unregister_module` (module) functions exist.
+
+A script which defines many of its own operators, panels menus etc. you only need to write:
+
+.. code-block:: python
+
+   def register():
+       bpy.utils.register_module(__name__)
+
+   def unregister():
+       bpy.utils.unregister_module(__name__)
+
+Internally blender collects subclasses on registrable types, storing them by the module in which they are defined. By passing the module name to :mod:`bpy.utils.register_module` blender can register all classes created by this module and its submodules.
+
+
+Inter Classes Dependencies
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When customizing blender you may want to group your own settings together, after all, they will likely have to co-exist with other scripts. To group these properties classes need to be defined, for groups within groups or collections within groups you can find yourself having to deal with order of registration/unregistration.
+
+Custom properties groups are themselves classes which need to be registered.
+
+Say you want to store material settings for a custom engine.
+
+.. code-block:: python
+
+   # Create new property
+   # bpy.data.materials[0].my_custom_props.my_float
+   import bpy
+
+   class MyMaterialProps(bpy.types.PropertyGroup):
+       my_float = bpy.props.FloatProperty()
+
+   def register():
+       bpy.utils.register_class(MyMaterialProps)
+       bpy.types.Material.my_custom_props = bpy.props.PointerProperty(type=MyMaterialProps)
+
+   def unregister():
+       del bpy.types.Material.my_custom_props
+       bpy.utils.unregister_class(MyMaterialProps)
+
+   if __name__ == "__main__":
+       register()
+
+.. note::
+
+   *The class must be registered before being used in a property, failing to do so will raise an error:*
+   
+   ``ValueError: bpy_struct "Material" registration error: my_custom_props could not register``
+
+
+.. code-block:: python
+
+   # Create new property group with a sub property
+   # bpy.data.materials[0].my_custom_props.sub_group.my_float
+   import bpy
+
+   class MyMaterialSubProps(bpy.types.PropertyGroup):
+       my_float = bpy.props.FloatProperty()
+
+   class MyMaterialGroupProps(bpy.types.PropertyGroup):
+       sub_group = bpy.props.PointerProperty(type=MyMaterialSubProps)
+
+   def register():
+       bpy.utils.register_class(MyMaterialSubProps)
+       bpy.utils.register_class(MyMaterialGroupProps)
+       bpy.types.Material.my_custom_props = bpy.props.PointerProperty(type=MyMaterialGroupProps)
+
+   def unregister():
+       del bpy.types.Material.my_custom_props
+       bpy.utils.unregister_class(MyMaterialGroupProps)
+       bpy.utils.unregister_class(MyMaterialSubProps)
+
+   if __name__ == "__main__":
+       register()
+
+.. note::
+
+   *The lower most class needs to be registered first and that unregister() is a mirror of register()*
+
+
+Manipulating Classes
+^^^^^^^^^^^^^^^^^^^^
+
+Properties can be added and removed as blender runs, normally happens on register or unregister but for some special cases it may be useful to modify types as the script runs.
+
+For example:
+
+.. code-block:: python
+
+   # add a new property to an existing type
+   bpy.types.Object.my_float = bpy.props.FloatProperty()
+   # remove
+   del bpy.types.Object.my_float
+
+This works just as well for PropertyGroup subclasses you define yourself.
+
+.. code-block:: python
+
+   class MyPropGroup(bpy.types.PropertyGroup):
+       pass
+   MyPropGroup.my_float = bpy.props.FloatProperty()
+
+...this is equivalent to:
+
+.. code-block:: python
+
+   class MyPropGroup(bpy.types.PropertyGroup):
+       my_float = bpy.props.FloatProperty()
+
+
+Dynamic Defined-Classes (Advanced)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In some cases the specifier for data may not be in blender, renderman shader definitions for example and it may be useful to define types and remove them on the fly.
+
+.. code-block:: python
+
+   for i in range(10):
+       idname = "object.operator_%d" % i
+
+       def func(self, context):
+           print("Hello World", self.bl_idname)
+           return {'FINISHED'}
+
+       opclass = type("DynOp%d" % i,
+                      (bpy.types.Operator, ),
+                      {"bl_idname": idname, "bl_label": "Test", "execute": func},
+                      )
+       bpy.utils.register_class(opclass)
+
+.. note::
+
+   Notice ``type()`` is called to define the class. This is an alternative syntax for class creation in python, better suited to constructing classes dynamically.
+
+
+Calling these operators:
+
+   >>> bpy.ops.object.operator_1()
+   Hello World OBJECT_OT_operator_1
+   {'FINISHED'}
+
+   >>> bpy.ops.object.operator_2()
+   Hello World OBJECT_OT_operator_2
+   {'FINISHED'}
+
diff --git a/doc/python_api/rst/info_quickstart.rst b/doc/python_api/rst/info_quickstart.rst
new file mode 100644 (file)
index 0000000..e77e9a7
--- /dev/null
@@ -0,0 +1,468 @@
+***********************
+Quickstart Introduction
+***********************
+
+Intro
+=====
+
+This API is generally stable but some areas are still being added and improved.
+
+The Blender/Python API can do the following:
+
+* Edit any data the user interface can (Scenes, Meshes, Particles etc.)
+
+* Modify user preferences, keymaps and themes
+
+* Run tools with own settings
+
+* Create user interface elements such as menus, headers and panels
+
+* Create new tools
+
+* Create interactive tools
+
+* Create new rendering engines that integrate with Blender
+
+* Define new settings in existing Blender data
+
+* Draw in the 3D view using OpenGL commands from Python
+
+
+The Blender/Python API **can't** (yet)...
+
+* Create new space types.
+
+* Assign custom properties to every type.
+
+* Define callbacks or listeners to be notified when data is changed.
+
+
+Before Starting
+===============
+
+This document isn't intended to fully cover each topic. Rather, its purpose is to familiarize you with Blender 2.5's new Python API.
+
+
+A quick list of helpful things to know before starting:
+
+* Blender uses Python 3.x; some 3rd party extensions are not available yet.
+
+* The interactive console in Blender 2.5 has been improved; testing one-liners in the console is a good way to learn.
+
+* Button tool tips show Python attributes and operator names.
+
+* Right clicking on buttons and menu items directly links to API documentation.
+
+* For more examples, the text menu has a templates section where some example operators can be found.
+
+* To examine further scripts distributed with Blender, see ``~/.blender/scripts/startup/bl_ui`` for the user interface and ``~/.blender/scripts/startup/bl_op`` for operators.
+
+
+Key Concepts
+============
+
+Data Access
+-----------
+
+Accessing datablocks
+^^^^^^^^^^^^^^^^^^^^
+
+Python accesses Blender's data in the same way as the animation system and user interface, which means any setting that is changed via a button can also be changed from Python.
+
+Accessing data from the currently loaded blend file is done with the module :mod:`bpy.data`. This gives access to library data. For example:
+
+   >>> bpy.data.objects
+   <bpy_collection[3], BlendDataObjects>
+
+   >>> bpy.data.scenes
+   <bpy_collection[1], BlendDataScenes>
+
+   >>> bpy.data.materials
+   <bpy_collection[1], BlendDataMaterials>
+
+
+About Collections
+^^^^^^^^^^^^^^^^^
+
+You'll notice that an index as well as a string can be used to access members of the collection.
+
+Unlike Python's dictionaries, both methods are acceptable; however, the index of a member may change while running Blender.
+
+   >>> list(bpy.data.objects)
+   [bpy.data.objects["Cube"], bpy.data.objects["Plane"]]
+
+   >>> bpy.data.objects['Cube']
+   bpy.data.objects["Cube"]
+
+   >>> bpy.data.objects[0]
+   bpy.data.objects["Cube"]
+
+
+Accessing attributes
+^^^^^^^^^^^^^^^^^^^^
+
+Once you have a data block such as a material, object, groups etc. its attributes can be accessed just like changing a setting in the interface; in fact, the button tooltip also displays the Python attribute which can help in finding what settings to change in a script.
+
+   >>> bpy.data.objects[0].name 
+   'Camera'
+
+   >>> bpy.data.scenes["Scene"]
+   bpy.data.scenes['Scene']
+
+   >>> bpy.data.materials.new("MyMaterial")
+   bpy.data.materials['MyMaterial']
+
+
+For testing what data to access it's useful to use the "Console", which is its own space type in Blender 2.5. This supports auto-complete, giving you a fast way to dig into different data in your file.
+
+Example of a data path that can be quickly found via the console:
+
+   >>> bpy.data.scenes[0].render.resolution_percentage
+   100
+   >>> bpy.data.scenes[0].objects["Torus"].data.vertices[0].co.x
+   1.0
+
+
+Custom Properties
+^^^^^^^^^^^^^^^^^
+
+Python can access properties on any datablock that has an ID (data that can be linked in and accessed from :mod:`bpy.data`. When assigning a property, you can make up your own names, these will be created when needed or overwritten if they exist.
+
+This data is saved with the blend file and copied with objects.
+
+Example:
+
+.. code-block:: python
+
+   bpy.context.object["MyOwnProperty"] = 42
+
+   if "SomeProp" in bpy.context.object:
+       print("Property found")
+
+   # Use the get function like a python dictionary
+   # which can have a fallback value.
+   value = bpy.data.scenes["Scene"].get("test_prop", "fallback value")
+
+   # dictionaries can be assigned as long as they only use basic types.
+   group = bpy.data.groups.new("MyTestGroup")
+   group["GameSettings"] = {"foo": 10, "bar": "spam", "baz": {}}
+
+   del group["GameSettings"]
+
+
+Note that these properties can only be assigned  basic Python types.
+
+* int, float, string
+
+* array of ints/floats
+
+* dictionary (only string keys types on this list)
+
+These properties are valid outside of Python. They can be animated by curves or used in driver paths.
+
+
+Context
+-------
+
+While it's useful to be able to access data directly by name or as a list, it's more common to operate on the user's selection. The context is always available from '''bpy.context''' and can be used to get the active object, scene, tool settings along with many other attributes.
+
+Common-use cases:
+
+   >>> bpy.context.object
+   >>> bpy.context.selected_objects
+   >>> bpy.context.visible_bones
+
+Note that the context is read-only. These values cannot be modified directly, though they may be changed by running API functions or by using the data API.
+
+So ``bpy.context.object = obj`` will raise an error.
+
+But ``bpy.context.scene.objects.active = obj`` will work as expected.
+
+
+The context attributes change depending on where it is accessed. The 3D view has different context members to the Console, so take care when accessing context attributes that the user state is known.
+
+See :mod:`bpy.context` API reference
+
+
+Operators (Tools)
+-----------------
+
+Operators are tools generally accessed by the user from buttons, menu items or key shortcuts. From the user perspective they are a tool but Python can run these with its own settings through the :mod:`bpy.ops` module.
+
+Examples:
+
+   >>> bpy.ops.mesh.flip_normals()
+   {'FINISHED'}
+   >>> bpy.ops.mesh.hide(unselected=False)
+   {'FINISHED'}
+   >>> bpy.ops.object.scale_apply()
+   {'FINISHED'}
+
+.. note::
+
+   The menu item: Help -> Operator Cheat Sheet" gives a list of all operators and their default values in Python syntax, along with the generated docs. This is a good way to get an overview of all blender's operators.
+
+
+Operator Poll()
+^^^^^^^^^^^^^^^
+
+Many operators have a "poll" function which may check that the mouse is a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc). When an operator's poll function fails within python, an exception is raised.
+
+For example, calling bpy.ops.view3d.render_border() from the console raises the following error:
+
+.. code-block:: python
+
+   RuntimeError: Operator bpy.ops.view3d.render_border.poll() failed, context is incorrect
+
+In this case the context must be the 3d view with an active camera.
+
+To avoid using try/except clauses wherever operators are called you can call the operators own .poll() function to check if it can run in the current context.
+
+.. code-block:: python
+
+   if bpy.ops.view3d.render_border.poll():
+       bpy.ops.view3d.render_border()
+
+
+Integration
+===========
+
+Python scripts can integrate with Blender in the following ways:
+
+* By defining a rendering engine.
+
+* By defining operators.
+
+* By defining menus, headers and panels.
+
+* By inserting new buttons into existing menus, headers and panels
+
+
+In Python, this is done by defining a class, which is a subclass of an existing type.
+
+
+Example Operator
+----------------
+
+.. literalinclude:: ../../../release/scripts/templates/operator_simple.py
+
+Once this script runs, ``SimpleOperator`` is registered with Blender and can be called from the operator search popup or added to the toolbar.
+
+To run the script:
+
+#. Highlight the above code then press Ctrl+C to copy it.
+
+#. Start Blender
+
+#. Press Ctrl+Right twice to change to the Scripting layout.
+
+#. Press Ctrl+V to paste the code into the text panel (the upper left frame).
+
+#. Click on the button **Run Script**.
+
+#. Move you're mouse into the 3D view, press spacebar for the operator search
+   menu, and type "Simple".
+
+#. Click on the "Simple Operator" item found in search.
+
+
+.. seealso:: The class members with the **bl_** prefix are documented in the API
+   reference :class:`bpy.types.Operator`
+
+
+Example Panel
+-------------
+
+Panels register themselves as a class, like an operator. Notice the extra **bl_** variables used to set the context they display in.
+
+.. literalinclude:: ../../../release/scripts/templates/ui_panel_simple.py
+
+To run the script:
+
+#. Highlight the above code then press Ctrl+C to copy it
+
+#. Start Blender
+
+#. Press Ctrl+Right twice to change to the Scripting layout
+
+#. Press Ctrl+V to paste the code into the text panel (the upper left frame)
+
+#. Click on the button **Run Script**.
+
+
+To view the results:
+
+#. Select the the default cube.
+
+#. Click on the Object properties icon in the buttons panel (far right; appears as a tiny cube).
+
+#. Scroll down to see a panel named **Hello World Panel**.
+
+#. Changing the object name also updates **Hello World Panel's** Name: field.
+
+Note the row distribution and the label and properties that are available through the code.
+
+.. seealso:: :class:`bpy.types.Panel`
+
+
+Types
+=====
+
+Blender defines a number of Python types but also uses Python native types.
+
+Blender's Python API can be split up into 3 categories. 
+
+
+Native Types
+------------
+
+In simple cases returning a number or a string as a custom type would be cumbersome, so these are accessed as normal python types.
+
+* blender float/int/boolean -> float/int/boolean
+
+* blender enumerator -> string
+
+     >>> C.object.rotation_mode = 'AXIS_ANGLE'
+
+
+* blender enumerator (multiple) -> set of strings
+
+  .. code-block:: python
+
+     # setting multiple camera overlay guides
+     bpy.context.scene.camera.data.show_guide = {'GOLDEN', 'CENTER'}
+
+     # passing as an operator argument for report types
+     self.report({'WARNING', 'INFO'}, "Some message!")
+
+
+Internal Types
+--------------
+
+Used for Blender datablocks and collections: :class:`bpy.types.bpy_struct`
+
+For data that contains its own attributes groups/meshes/bones/scenes... etc.
+
+There are 2 main types that wrap Blenders data, one for datablocks (known internally as bpy_struct), another for properties.
+
+   >>> bpy.context.object
+   bpy.data.objects['Cube']
+
+   >>> C.scene.objects
+   bpy.data.scenes['Scene'].objects
+
+Note that these types reference Blender's data so modifying them is immediately visible.
+
+
+Mathutils Types
+---------------
+
+Used for vectors, quaternion, eulers, matrix and color types, accessible from :mod:`mathutils`
+
+Some attributes such as :class:`bpy.types.Object.location`, :class:`bpy.types.PoseBone.rotation_euler` and :class:`bpy.types.Scene.cursor_location` can be accessed as special math types which can be used together and manipulated in various useful ways.
+
+Example of a matrix, vector multiplication:
+
+.. code-block:: python
+
+   bpy.context.object.matrix_world * bpy.context.object.data.verts[0].co
+
+.. note::
+
+   mathutils types keep a reference to Blender's internal data so changes can
+   be applied back.
+
+
+   Example:
+
+   .. code-block:: python
+
+      # modifies the Z axis in place.
+      bpy.context.object.location.z += 2.0
+
+      # location variable holds a reference to the object too.
+      location = bpy.context.object.location
+      location *= 2.0
+
+      # Copying the value drops the reference so the value can be passed to
+      # functions and modified without unwanted side effects.
+      location = bpy.context.object.location.copy()
+
+
+Animation
+=========
+
+There are 2 ways to add keyframes through Python.
+
+The first is through key properties directly, which is similar to inserting a keyframe from the button as a user. You can also manually create the curves and keyframe data, then set the path to the property. Here are examples of both methods.
+
+Both examples insert a keyframe on the active object's Z axis.
+
+Simple example:
+
+.. code-block:: python
+
+   obj = bpy.context.object
+   obj.location[2] = 0.0
+   obj.keyframe_insert(data_path="location", frame=10.0, index=2)
+   obj.location[2] = 1.0
+   obj.keyframe_insert(data_path="location", frame=20.0, index=2)
+
+Using Low-Level Functions:
+
+.. code-block:: python
+
+   obj = bpy.context.object
+   obj.animation_data_create()
+   obj.animation_data.action = bpy.data.actions.new(name="MyAction")
+   fcu_z = obj.animation_data.action.fcurves.new(data_path="location", index=2)
+   fcu_z.keyframe_points.add(2)
+   fcu_z.keyframe_points[0].co = 10.0, 0.0
+   fcu_z.keyframe_points[1].co = 20.0, 1.0
+
+
+Style Conventions
+=================
+
+For Blender 2.5 we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
+
+Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
+
+This style guide is known as pep8 and can be found `here <http://www.python.org/dev/peps/pep-0008>`_
+
+A brief listing of pep8 criteria.
+
+* camel caps for class names: MyClass
+
+* all lower case underscore separated module names: my_module
+
+* indentation of 4 spaces (no tabs)
+
+* spaces around operators. ``1 + 1``, not ``1+1``
+
+* only use explicit imports, (no importing '*')
+
+* don't use single line: ``if val: body``, separate onto 2 lines instead.
+
+
+As well as pep8 we have other conventions used for blender python scripts.
+
+* Use single quotes for enums, and double quotes for strings.
+
+  Both are of course strings but in our internal API enums are unique items from a limited set. eg.
+
+  .. code-block:: python
+
+     bpy.context.scene.render.file_format = 'PNG'
+     bpy.context.scene.render.filepath = "//render_out"
+
+* pep8 also defines that lines should not exceed 79 characters, we felt this is too restrictive so this is optional per script.
+
+Periodically we run checks for pep8 compliance on blender scripts, for scripts to be included in this check add this line as a comment at the top of the script.
+
+``# <pep8 compliant>``
+
+To enable line length checks use this instead.
+
+``# <pep8-80 compliant>``
+
diff --git a/doc/python_api/rst/info_tips_and_tricks.rst b/doc/python_api/rst/info_tips_and_tricks.rst
new file mode 100644 (file)
index 0000000..bd5faf0
--- /dev/null
@@ -0,0 +1,57 @@
+###############
+Tips and Tricks
+###############
+
+Some of these are just python features that scripters may not have thaught to use with blender.
+
+
+****************
+Use The Terminal
+****************
+
+For Linux and OSX users this means starting the terminal first, then running blender from within it. on Windows the terminal can be enabled from the help menu.
+
+********************
+Run External Scripts
+********************
+
+
+******************
+Don't Use Blender!
+******************
+
+
+******************
+Use External Tools
+******************
+
+
+**************
+Bundled Python
+**************
+
+Blender from blender.org includes a compleate python installation on all platforms, this has the disadvantage that any extensions you have installed in you're systems python wont be found by blender.
+
+There are 2 ways around this:
+
+* remove blender python subdirectory, blender will then look for the systems python and use that instead **python version must match the one that blender comes with**.
+
+* copy the extensions into blender's python subdirectry so blender can access them, you could also copy the entire python installation into blenders subdirectory, replacing the one blender comes with. This works as long as the python versions match and the paths are created in the same location relative locations. Doing this has the advantage that you can redistribute this bundle to others with blender and/or the game player, including any extensions you rely on.
+
+********
+Advanced
+********
+
+
+===================
+Blender as a module
+===================
+
+
+============================
+Python Safety (Build Option)
+============================
+
+=================
+CTypes in Blender
+=================
index a20e799811bca283542b5e01b3af92de956d1d86..e378dd19e733d7082397e63a8040c97c21b6459d 100644 (file)
@@ -60,11 +60,13 @@ if __import__("sys").modules.get("bpy") is None:
 # Switch for quick testing
 if 1:
     # full build
+    EXCLUDE_INFO_DOCS = False
     EXCLUDE_MODULES = ()
     FILTER_BPY_TYPES = None
     FILTER_BPY_OPS = None
 
 else:
+    EXCLUDE_INFO_DOCS = False
     # for testing so doc-builds dont take so long.
     EXCLUDE_MODULES = (
         "bpy.context",
@@ -74,7 +76,7 @@ else:
         "bpy.props",
         "bpy.utils",
         "bpy.context",
-        #"bpy.types",  # supports filtering
+        "bpy.types",  # supports filtering
         "bpy.ops",  # supports filtering
         "bpy_extras",
         "bge",
@@ -96,6 +98,13 @@ sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
 
     """
 
+# extra info, not api reference docs
+# stored in ./rst/info/
+INFO_DOCS = (
+    ("info_quickstart.rst", "Blender/Python Quickstart: new to blender/scripting and want to get you're feet wet?"),
+    ("info_overview.rst", "Blender/Python API Overview: a more complete explanation of python integration"),
+    ("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"),
+    )
 
 # import rpdb2; rpdb2.start_embedded_debugger('test')
 
@@ -1001,14 +1010,17 @@ def rna2sphinx(BASEPATH):
 
     fw("\n")
 
-    fw("============================\n")
-    fw("Blender/Python Documentation\n")
-    fw("============================\n")
-    fw("\n")
-    fw("\n")
-    fw("* `Quickstart Intro <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>`_ if you are new to scripting in blender and want to get you're feet wet!\n")
-    fw("* `Blender/Python Overview <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Overview>`_ for a more complete explanation of python integration in blender\n")
-    fw("\n")
+    if not EXCLUDE_INFO_DOCS:
+        fw("============================\n")
+        fw("Blender/Python Documentation\n")
+        fw("============================\n")
+        fw("\n")
+        fw("\n")
+        fw(".. toctree::\n")
+        fw("   :maxdepth: 1\n\n")
+        for info, info_desc in INFO_DOCS:
+            fw("   %s <%s>\n\n" % (info_desc, info))
+        fw("\n")
 
     fw("===================\n")
     fw("Application Modules\n")
@@ -1210,6 +1222,10 @@ def rna2sphinx(BASEPATH):
 
     shutil.copy2(os.path.join(BASEPATH, "..", "rst", "change_log.rst"), BASEPATH)
 
+    if not EXCLUDE_INFO_DOCS:
+        for info, info_desc in INFO_DOCS:
+            shutil.copy2(os.path.join(BASEPATH, "..", "rst", info), BASEPATH)
+
     if 0:
         filepath = os.path.join(BASEPATH, "bpy.rst")
         file = open(filepath, "w")
index a3befe1b7cb9d2928a177bed37a7299cd4364233..ea55fbb390733ef372cc0f0b2d2037d75a6a8737 100755 (executable)
@@ -3,11 +3,21 @@
 #   bash source/blender/python/doc/sphinx_doc_gen.sh
 # ssh upload means you need an account on the server
 
+
+# ----------------------------------------------------------------------------
+# Upload vars
+
+# disable for testing
+DO_UPLOAD=true
+
 BLENDER="./blender.bin"
 SSH_USER="ideasman42"
 SSH_HOST=$SSH_USER"@emo.blender.org"
 SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api_VERSION, added after
 
+# ----------------------------------------------------------------------------
+# Blender Version & Info
+
 # 'Blender 2.53 (sub 1) Build' --> '2_53_1' as a shell script.
 # "_".join(str(v) for v in bpy.app.version)
 # custom blender vars
@@ -28,28 +38,52 @@ SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
 
 SPHINXBASE=doc/python_api/
 
+
+# ----------------------------------------------------------------------------
+# Generate reStructuredText (blender/python only)
+
 # dont delete existing docs, now partial updates are used for quick builds.
 $BLENDER --background --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
 
-# html
-sphinx-build $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
 
-cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
-ssh $SSH_USER@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
-rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
+# ----------------------------------------------------------------------------
+# Generate HTML (sphinx)
 
-## symlink the dir to a static URL
-#ssh $SSH_USER@emo.blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
+sphinx-build -n -b html $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
 
-# better redirect
-ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
 
-# pdf
-sphinx-build -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
-cd $SPHINXBASE/sphinx-out
-make
-cd -
+# ----------------------------------------------------------------------------
+# Generate PDF (sphinx/laytex)
 
-# rename so local PDF has matching name.
+sphinx-build -n -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
+make -C $SPHINXBASE/sphinx-out
 mv $SPHINXBASE/sphinx-out/contents.pdf $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
-rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
+
+# ----------------------------------------------------------------------------
+# Upload to blender servers, comment this section for testing
+
+if $DO_UPLOAD ; then
+
+       cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
+       ssh $SSH_USER@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
+       rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
+
+       ## symlink the dir to a static URL
+       #ssh $SSH_USER@emo.blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
+
+       # better redirect
+       ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
+
+       # rename so local PDF has matching name.
+       rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
+
+fi
+
+
+# ----------------------------------------------------------------------------
+# Print some useful text
+
+echo ""
+echo "Finished! view the docs from: "
+echo "  html:" $SPHINXBASE/sphinx-out/contents.html
+echo "   pdf:" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
index 7eef13b103beb9e9cdaa74656bce3bd99a548d08..25510ebd2a5f99a10889c777eff555efd04b6551 100644 (file)
@@ -41,6 +41,8 @@ set(SRC
        FX/AUD_DelayReader.cpp
        FX/AUD_DoubleFactory.cpp
        FX/AUD_DoubleReader.cpp
+       FX/AUD_DynamicIIRFilterFactory.cpp
+       FX/AUD_DynamicIIRFilterReader.cpp
        FX/AUD_EffectFactory.cpp
        FX/AUD_EffectReader.cpp
        FX/AUD_EnvelopeFactory.cpp
@@ -66,6 +68,8 @@ set(SRC
        FX/AUD_SuperposeReader.cpp
        FX/AUD_VolumeFactory.cpp
        intern/AUD_3DMath.h
+       intern/AUD_AnimateableProperty.cpp
+       intern/AUD_AnimateableProperty.h
        intern/AUD_Buffer.cpp
        intern/AUD_Buffer.h
        intern/AUD_BufferReader.cpp
@@ -82,14 +86,21 @@ set(SRC
        intern/AUD_ConverterFunctions.h
        intern/AUD_ConverterReader.cpp
        intern/AUD_ConverterReader.h
-       intern/AUD_DefaultMixer.cpp
-       intern/AUD_DefaultMixer.h
        intern/AUD_FileFactory.cpp
        intern/AUD_FileFactory.h
+       intern/AUD_FileWriter.cpp
+       intern/AUD_FileWriter.h
        intern/AUD_I3DDevice.h
+       intern/AUD_I3DHandle.h
        intern/AUD_IDevice.h
        intern/AUD_IFactory.h
+       intern/AUD_IHandle.h
        intern/AUD_IReader.h
+       intern/AUD_IWriter.h
+       intern/AUD_JOSResampleFactory.cpp
+       intern/AUD_JOSResampleFactory.h
+       intern/AUD_JOSResampleReader.cpp
+       intern/AUD_JOSResampleReader.h
        intern/AUD_LinearResampleFactory.cpp
        intern/AUD_LinearResampleFactory.h
        intern/AUD_LinearResampleReader.cpp
@@ -104,9 +115,16 @@ set(SRC
        intern/AUD_ReadDevice.cpp
        intern/AUD_ReadDevice.h
        intern/AUD_Reference.h
+       intern/AUD_ReferenceHandler.cpp
        intern/AUD_ResampleFactory.h
+       intern/AUD_ResampleReader.cpp
+       intern/AUD_ResampleReader.h
+       intern/AUD_SequencerEntry.cpp
+       intern/AUD_SequencerEntry.h
        intern/AUD_SequencerFactory.cpp
        intern/AUD_SequencerFactory.h
+       intern/AUD_SequencerHandle.cpp
+       intern/AUD_SequencerHandle.h
        intern/AUD_SequencerReader.cpp
        intern/AUD_SequencerReader.h
        intern/AUD_SilenceFactory.cpp
@@ -131,6 +149,8 @@ set(SRC
        FX/AUD_DelayReader.h
        FX/AUD_DoubleFactory.h
        FX/AUD_DoubleReader.h
+       FX/AUD_DynamicIIRFilterFactory.h
+       FX/AUD_DynamicIIRFilterReader.h
        FX/AUD_EffectFactory.h
        FX/AUD_EffectReader.h
        FX/AUD_EnvelopeFactory.h
@@ -168,9 +188,11 @@ if(WITH_CODEC_FFMPEG)
        list(APPEND SRC
                ffmpeg/AUD_FFMPEGFactory.cpp
                ffmpeg/AUD_FFMPEGReader.cpp
+               ffmpeg/AUD_FFMPEGWriter.cpp
 
                ffmpeg/AUD_FFMPEGFactory.h
                ffmpeg/AUD_FFMPEGReader.h
+               ffmpeg/AUD_FFMPEGWriter.h
        )
 endif()
 
@@ -230,9 +252,11 @@ if(WITH_CODEC_SNDFILE)
        list(APPEND SRC
                sndfile/AUD_SndFileFactory.cpp
                sndfile/AUD_SndFileReader.cpp
+               sndfile/AUD_SndFileWriter.cpp
 
                sndfile/AUD_SndFileFactory.h
                sndfile/AUD_SndFileReader.h
+               sndfile/AUD_SndFileWriter.h
        )
 endif()
 
index d60924958b162ea25af477a565db5d7bac25c66b..0dffa7fc9ea57f8916e07c8bb9c3bd41cf3320ac 100644 (file)
@@ -32,7 +32,7 @@
 #include "AUD_AccumulatorFactory.h"
 #include "AUD_CallbackIIRFilterReader.h"
 
-sample_t accumulatorFilterAdditive(AUD_CallbackIIRFilterReader* reader, void* useless)
+sample_t AUD_AccumulatorFactory::accumulatorFilterAdditive(AUD_CallbackIIRFilterReader* reader, void* useless)
 {
        float in = reader->x(0);
        float lastin = reader->x(-1);
@@ -42,7 +42,7 @@ sample_t accumulatorFilterAdditive(AUD_CallbackIIRFilterReader* reader, void* us
        return out;
 }
 
-sample_t accumulatorFilter(AUD_CallbackIIRFilterReader* reader, void* useless)
+sample_t AUD_AccumulatorFactory::accumulatorFilter(AUD_CallbackIIRFilterReader* reader, void* useless)
 {
        float in = reader->x(0);
        float lastin = reader->x(-1);
@@ -52,14 +52,14 @@ sample_t accumulatorFilter(AUD_CallbackIIRFilterReader* reader, void* useless)
        return out;
 }
 
-AUD_AccumulatorFactory::AUD_AccumulatorFactory(AUD_IFactory* factory,
+AUD_AccumulatorFactory::AUD_AccumulatorFactory(AUD_Reference<AUD_IFactory> factory,
                                                                                           bool additive) :
                AUD_EffectFactory(factory),
                m_additive(additive)
 {
 }
 
-AUD_IReader* AUD_AccumulatorFactory::createReader() const
+AUD_Reference<AUD_IReader> AUD_AccumulatorFactory::createReader()
 {
        return new AUD_CallbackIIRFilterReader(getReader(), 2, 2,
                                                        m_additive ? accumulatorFilterAdditive : accumulatorFilter);
index 3c3b32ce0711d5c0b6f6a108515093accf54f41a..95246ef534110ae5009a86fb928cdac26b905615 100644 (file)
 #define AUD_ACCUMULATORFACTORY
 
 #include "AUD_EffectFactory.h"
+class AUD_CallbackIIRFilterReader;
 
 /**
  * This factory creates an accumulator reader.
+ *
+ * The accumulator adds the difference at the input to the last output in case
+ * it's positive. In additive mode it additionaly adds the difference always.
+ * So in case the difference is positive, it's added twice.
  */
 class AUD_AccumulatorFactory : public AUD_EffectFactory
 {
@@ -55,9 +60,12 @@ public:
         * \param factory The input factory.
         * \param additive Whether the accumulator is additive.
         */
-       AUD_AccumulatorFactory(AUD_IFactory* factory, bool additive = false);
+       AUD_AccumulatorFactory(AUD_Reference<AUD_IFactory> factory, bool additive = false);
+
+       virtual AUD_Reference<AUD_IReader> createReader();
 
-       virtual AUD_IReader* createReader() const;
+       static sample_t accumulatorFilterAdditive(AUD_CallbackIIRFilterReader* reader, void* useless);
+       static sample_t accumulatorFilter(AUD_CallbackIIRFilterReader* reader, void* useless);
 };
 
 #endif //AUD_ACCUMULATORFACTORY
index 563722d921397b00496e0310fba4b851c9f93900..29ff6d90080b17df533cec5b3432ccecf03037bd 100644 (file)
 
 #include <cstring>
 
-#define CC m_channels + m_channel
+#define CC m_specs.channels + m_channel
 
-AUD_BaseIIRFilterReader::AUD_BaseIIRFilterReader(AUD_IReader* reader, int in,
+AUD_BaseIIRFilterReader::AUD_BaseIIRFilterReader(AUD_Reference<AUD_IReader> reader, int in,
                                                                                                 int out) :
                AUD_EffectReader(reader),
-               m_channels(reader->getSpecs().channels),
+               m_specs(reader->getSpecs()),
                m_xlen(in), m_ylen(out),
                m_xpos(0), m_ypos(0), m_channel(0)
 {
-       m_x = new sample_t[in * m_channels];
-       m_y = new sample_t[out * m_channels];
+       m_x = new sample_t[m_xlen * m_specs.channels];
+       m_y = new sample_t[m_ylen * m_specs.channels];
 
-       memset(m_x, 0, sizeof(sample_t) * in * m_channels);
-       memset(m_y, 0, sizeof(sample_t) * out * m_channels);
+       memset(m_x, 0, sizeof(sample_t) * m_xlen * m_specs.channels);
+       memset(m_y, 0, sizeof(sample_t) * m_ylen * m_specs.channels);
 }
 
 AUD_BaseIIRFilterReader::~AUD_BaseIIRFilterReader()
@@ -55,24 +55,77 @@ AUD_BaseIIRFilterReader::~AUD_BaseIIRFilterReader()
        delete[] m_y;
 }
 
-void AUD_BaseIIRFilterReader::read(int & length, sample_t* & buffer)
+void AUD_BaseIIRFilterReader::setLengths(int in, int out)
 {
-       sample_t* buf;
+       if(in != m_xlen)
+       {
+               sample_t* xn = new sample_t[in * m_specs.channels];
+               memset(xn, 0, sizeof(sample_t) * in * m_specs.channels);
+
+               for(m_channel = 0; m_channel < m_specs.channels; m_channel++)
+               {
+                       for(int i = 1; i <= in && i <= m_xlen; i++)
+                       {
+                               xn[(in - i) * CC] = x(-i);
+                       }
+               }
+
+               delete[] m_x;
+               m_x = xn;
+               m_xpos = 0;
+               m_xlen = in;
+       }
+
+       if(out != m_ylen)
+       {
+               sample_t* yn = new sample_t[out * m_specs.channels];
+               memset(yn, 0, sizeof(sample_t) * out * m_specs.channels);
+
+               for(m_channel = 0; m_channel < m_specs.channels; m_channel++)
+               {
+                       for(int i = 1; i <= out && i <= m_ylen; i++)
+                       {
+                               yn[(out - i) * CC] = y(-i);
+                       }
+               }
+
+               delete[] m_y;
+               m_y = yn;
+               m_ypos = 0;
+               m_ylen = out;
+       }
+}
+
+void AUD_BaseIIRFilterReader::read(int& length, bool& eos, sample_t* buffer)
+{
+       AUD_Specs specs = m_reader->getSpecs();
+       if(specs.channels != m_specs.channels)
+       {
+               m_specs.channels = specs.channels;
+
+               delete[] m_x;
+               delete[] m_y;
 
-       int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
+               m_x = new sample_t[m_xlen * m_specs.channels];
+               m_y = new sample_t[m_ylen * m_specs.channels];
 
-       m_reader->read(length, buf);
+               memset(m_x, 0, sizeof(sample_t) * m_xlen * m_specs.channels);
+               memset(m_y, 0, sizeof(sample_t) * m_ylen * m_specs.channels);
+       }
 
-       if(m_buffer.getSize() < length * samplesize)
-               m_buffer.resize(length * samplesize);
+       if(specs.rate != m_specs.rate)
+       {
+               m_specs = specs;
+               sampleRateChanged(m_specs.rate);
+       }
 
-       buffer = m_buffer.getBuffer();
+       m_reader->read(length, eos, buffer);
 
-       for(m_channel = 0; m_channel < m_channels; m_channel++)
+       for(m_channel = 0; m_channel < m_specs.channels; m_channel++)
        {
                for(int i = 0; i < length; i++)
                {
-                       m_x[m_xpos * CC] = buf[i * CC];
+                       m_x[m_xpos * CC] = buffer[i * CC];
                        m_y[m_ypos * CC] = buffer[i * CC] = filter();
 
                        m_xpos = (m_xpos + 1) % m_xlen;
@@ -80,3 +133,7 @@ void AUD_BaseIIRFilterReader::read(int & length, sample_t* & buffer)
                }
        }
 }
+
+void AUD_BaseIIRFilterReader::sampleRateChanged(AUD_SampleRate rate)
+{
+}
index 436e6469a58284ce86d875347878fc0e2fade4ee..6bf877d66dadf7f09d930ce07c94959d6a86911f 100644 (file)
@@ -42,24 +42,19 @@ class AUD_BaseIIRFilterReader : public AUD_EffectReader
 {
 private:
        /**
-        * Channel count.
+        * Specs.
         */
-       const int m_channels;
+       AUD_Specs m_specs;
 
        /**
         * Length of input samples needed.
         */
-       const int m_xlen;
+       int m_xlen;
 
        /**
         * Length of output samples needed.
         */
-       const int m_ylen;
-
-       /**
-        * The playback buffer.
-        */
-       AUD_Buffer m_buffer;
+       int m_ylen;
 
        /**
         * The last in samples array.
@@ -97,24 +92,46 @@ protected:
         * \param in The count of past input samples needed.
         * \param out The count of past output samples needed.
         */
-       AUD_BaseIIRFilterReader(AUD_IReader* reader, int in, int out);
+       AUD_BaseIIRFilterReader(AUD_Reference<AUD_IReader> reader, int in, int out);
+
+       void setLengths(int in, int out);
 
 public:
+       /**
+        * Retrieves the last input samples.
+        * \param pos The position, valid are 0 (current) or negative values.
+        * \return The sample value.
+        */
        inline sample_t x(int pos)
        {
-               return m_x[(m_xpos + pos + m_xlen) % m_xlen * m_channels + m_channel];
+               return m_x[(m_xpos + pos + m_xlen) % m_xlen * m_specs.channels + m_channel];
        }
 
+       /**
+        * Retrieves the last output samples.
+        * \param pos The position, valid are negative values.
+        * \return The sample value.
+        */
        inline sample_t y(int pos)
        {
-               return m_y[(m_ypos + pos + m_ylen) % m_ylen * m_channels + m_channel];
+               return m_y[(m_ypos + pos + m_ylen) % m_ylen * m_specs.channels + m_channel];
        }
 
        virtual ~AUD_BaseIIRFilterReader();
 
-       virtual void read(int & length, sample_t* & buffer);
+       virtual void read(int& length, bool& eos, sample_t* buffer);
 
+       /**
+        * Runs the filtering function.
+        * \return The current output sample value.
+        */
        virtual sample_t filter()=0;
+
+       /**
+        * Notifies the filter about a sample rate change.
+        * \param rate The new sample rate.
+        */
+       virtual void sampleRateChanged(AUD_SampleRate rate);
 };
 
 #endif //AUD_BASEIIRFILTERREADER
index ea957c81ed37733bae638771ce73de8110c6b174..4b45512ffa64c2b3dbb640796703f29a183efce1 100644 (file)
 #define BWPB41 0.76536686473
 #define BWPB42 1.84775906502
 
-AUD_ButterworthFactory::AUD_ButterworthFactory(AUD_IFactory* factory,
+AUD_ButterworthFactory::AUD_ButterworthFactory(AUD_Reference<AUD_IFactory> factory,
                                                                                           float frequency) :
-               AUD_EffectFactory(factory),
+               AUD_DynamicIIRFilterFactory(factory),
                m_frequency(frequency)
 {
 }
 
-AUD_IReader* AUD_ButterworthFactory::createReader() const
+void AUD_ButterworthFactory::recalculateCoefficients(AUD_SampleRate rate,
+                                                                                                        std::vector<float> &b,
+                                                                                                        std::vector<float> &a)
 {
-       AUD_IReader* reader = getReader();
-
-       // calculate coefficients
-       float omega = 2 * tan(m_frequency * M_PI / reader->getSpecs().rate);
+       float omega = 2 * tan(m_frequency * M_PI / rate);
        float o2 = omega * omega;
        float o4 = o2 * o2;
        float x1 = o2 + 2 * BWPB41 * omega + 4;
@@ -62,7 +61,6 @@ AUD_IReader* AUD_ButterworthFactory::createReader() const
        float y2 = o2 - 2 * BWPB42 * omega + 4;
        float o228 = 2 * o2 - 8;
        float norm = x1 * x2;
-       std::vector<float> a, b;
        a.push_back(1);
        a.push_back((x1 + x2) * o228 / norm);
        a.push_back((x1 * y2 + x2 * y1 + o228 * o228) / norm);
@@ -73,6 +71,4 @@ AUD_IReader* AUD_ButterworthFactory::createReader() const
        b.push_back(6 * o4 / norm);
        b.push_back(b[1]);
        b.push_back(b[0]);
-
-       return new AUD_IIRFilterReader(reader, b, a);
 }
index c8b731449c4e90d04ca223cf6a77b35ff374436a..12d28eb40383740eafa3e75c4142b9581f11c137 100644 (file)
 #ifndef AUD_BUTTERWORTHFACTORY
 #define AUD_BUTTERWORTHFACTORY
 
-#include "AUD_EffectFactory.h"
+#include "AUD_DynamicIIRFilterFactory.h"
 
 /**
- * This factory creates a butterworth filter reader.
+ * This factory creates a butterworth lowpass filter reader.
  */
-class AUD_ButterworthFactory : public AUD_EffectFactory
+class AUD_ButterworthFactory : public AUD_DynamicIIRFilterFactory
 {
 private:
        /**
@@ -55,9 +55,11 @@ public:
         * \param factory The input factory.
         * \param frequency The cutoff frequency.
         */
-       AUD_ButterworthFactory(AUD_IFactory* factory, float frequency);
+       AUD_ButterworthFactory(AUD_Reference<AUD_IFactory> factory, float frequency);
 
-       virtual AUD_IReader* createReader() const;
+       virtual void recalculateCoefficients(AUD_SampleRate rate,
+                                                                                std::vector<float>& b,
+                                                                                std::vector<float>& a);
 };
 
 #endif //AUD_BUTTERWORTHFACTORY
index 2f9bb7762a04af704d08badcc550ed68a4afe19e..e6c83322435dc72a2d5226afd303bd587bb44013 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "AUD_CallbackIIRFilterReader.h"
 
-AUD_CallbackIIRFilterReader::AUD_CallbackIIRFilterReader(AUD_IReader* reader,
+AUD_CallbackIIRFilterReader::AUD_CallbackIIRFilterReader(AUD_Reference<AUD_IReader> reader,
                                                                                                                 int in, int out,
                                                                                                                 doFilterIIR doFilter,
                                                                                                                 endFilterIIR endFilter,
index a969db7297ef0692adf236323b51d49be701ea0f..6d53edeecc2e1c90264db1701ca958a80727cc01 100644 (file)
@@ -76,7 +76,7 @@ public:
         * \param endFilter The finishing callback.
         * \param data Data pointer for the callbacks.
         */
-       AUD_CallbackIIRFilterReader(AUD_IReader* reader, int in, int out,
+       AUD_CallbackIIRFilterReader(AUD_Reference<AUD_IReader> reader, int in, int out,
                                                                doFilterIIR doFilter,
                                                                endFilterIIR endFilter = 0,
                                                                void* data = 0);
index 1d2d99adc03fcf12bf4003a72cd226c414fa61eb..e452870281d27c2f79c125635a6112e85c6275ea 100644 (file)
@@ -33,7 +33,7 @@
 #include "AUD_DelayReader.h"
 #include "AUD_Space.h"
 
-AUD_DelayFactory::AUD_DelayFactory(AUD_IFactory* factory, float delay) :
+AUD_DelayFactory::AUD_DelayFactory(AUD_Reference<AUD_IFactory> factory, float delay) :
                AUD_EffectFactory(factory),
                m_delay(delay)
 {
@@ -44,7 +44,7 @@ float AUD_DelayFactory::getDelay() const
        return m_delay;
 }
 
-AUD_IReader* AUD_DelayFactory::createReader() const
+AUD_Reference<AUD_IReader> AUD_DelayFactory::createReader()
 {
        return new AUD_DelayReader(getReader(), m_delay);
 }
index 1e67cd689909c5dd7b3e8fb93903f7533cb65e6e..5ab7f850d2f1700f87fb8d40fbb50ddc10e23e23 100644 (file)
@@ -55,14 +55,14 @@ public:
         * \param factory The input factory.
         * \param delay The desired delay in seconds.
         */
-       AUD_DelayFactory(AUD_IFactory* factory, float delay = 0);
+       AUD_DelayFactory(AUD_Reference<AUD_IFactory> factory, float delay = 0);
 
        /**
         * Returns the delay in seconds.
         */
        float getDelay() const;
 
-       virtual AUD_IReader* createReader() const;
+       virtual AUD_Reference<AUD_IReader> createReader();
 };
 
 #endif //AUD_DELAYFACTORY
index 374b876455d42f95a24aa238d21937564c5c689d..7d58b3dae4f33c82269e4e85c17df2c864b097fa 100644 (file)
 
 #include <cstring>
 
-AUD_DelayReader::AUD_DelayReader(AUD_IReader* reader, float delay) :
+AUD_DelayReader::AUD_DelayReader(AUD_Reference<AUD_IReader> reader, float delay) :
                AUD_EffectReader(reader),
                m_delay(int(delay * reader->getSpecs().rate)),
-               m_remdelay(int(delay * reader->getSpecs().rate)),
-               m_empty(true)
+               m_remdelay(int(delay * reader->getSpecs().rate))
 {
 }
 
@@ -70,49 +69,30 @@ int AUD_DelayReader::getPosition() const
        return m_reader->getPosition() + m_delay;
 }
 
-void AUD_DelayReader::read(int & length, sample_t* & buffer)
+void AUD_DelayReader::read(int& length, bool& eos, sample_t* buffer)
 {
        if(m_remdelay > 0)
        {
                AUD_Specs specs = m_reader->getSpecs();
                int samplesize = AUD_SAMPLE_SIZE(specs);
 
-               if(m_buffer.getSize() < length * samplesize)
-               {
-                       m_buffer.resize(length * samplesize);
-                       m_empty = false;
-               }
-
-               buffer = m_buffer.getBuffer();
-
                if(length > m_remdelay)
                {
-                       if(!m_empty)
-                               memset(buffer, 0, m_remdelay * samplesize);
+                       memset(buffer, 0, m_remdelay * samplesize);
 
                        int len = length - m_remdelay;
-                       sample_t* buf;
-                       m_reader->read(len, buf);
-
-                       memcpy(buffer + m_remdelay * specs.channels,
-                                  buf, len * samplesize);
+                       m_reader->read(len, eos, buffer + m_remdelay * specs.channels);
 
-                       if(len < length-m_remdelay)
-                               length = m_remdelay + len;
+                       length = m_remdelay + len;
 
                        m_remdelay = 0;
-                       m_empty = false;
                }
                else
                {
-                       if(!m_empty)
-                       {
-                               memset(buffer, 0, length * samplesize);
-                               m_empty = true;
-                       }
+                       memset(buffer, 0, length * samplesize);
                        m_remdelay -= length;
                }
        }
        else
-               m_reader->read(length, buffer);
+               m_reader->read(length, eos, buffer);
 }
index 5f0af660bdf90bf5c36fa27d070b660754986119..128e589eede7171f28c0c1f8a8775dc4aa36fc05 100644 (file)
 #include "AUD_Buffer.h"
 
 /**
- * This class reads another reader and changes it's delay.
+ * This class reads another reader and delays it.
  */
 class AUD_DelayReader : public AUD_EffectReader
 {
 private:
-       /**
-        * The playback buffer.
-        */
-       AUD_Buffer m_buffer;
-
        /**
         * The delay level.
         */
@@ -56,11 +51,6 @@ private:
         */
        int m_remdelay;
 
-       /**
-        * Whether the buffer is currently filled with zeros.
-        */
-       bool m_empty;
-
        // hide copy constructor and operator=
        AUD_DelayReader(const AUD_DelayReader&);
        AUD_DelayReader& operator=(const AUD_DelayReader&);
@@ -71,12 +61,12 @@ public:
         * \param reader The reader to read from.
         * \param delay The delay in seconds.
         */
-       AUD_DelayReader(AUD_IReader* reader, float delay);
+       AUD_DelayReader(AUD_Reference<AUD_IReader> reader, float delay);
 
        virtual void seek(int position);
        virtual int getLength() const;
        virtual int getPosition() const;
-       virtual void read(int & length, sample_t* & buffer);
+       virtual void read(int& length, bool& eos, sample_t* buffer);
 };
 
 #endif //AUD_DELAYREADER
index 7a40f1f8c96b07def0543d307370adc0888109b1..e1e6ba504359c03adf82c789ffcb11582d92825a 100644 (file)
 #include "AUD_DoubleFactory.h"
 #include "AUD_DoubleReader.h"
 
-AUD_DoubleFactory::AUD_DoubleFactory(AUD_IFactory* factory1, AUD_IFactory* factory2) :
+AUD_DoubleFactory::AUD_DoubleFactory(AUD_Reference<AUD_IFactory> factory1, AUD_Reference<AUD_IFactory> factory2) :
                m_factory1(factory1), m_factory2(factory2)
 {
 }
 
-AUD_IReader* AUD_DoubleFactory::createReader() const
+AUD_Reference<AUD_IReader> AUD_DoubleFactory::createReader()
 {
-       AUD_IReader* reader1 = m_factory1->createReader();
-       AUD_IReader* reader2;
-
-       try
-       {
-               reader2 = m_factory2->createReader();
-       }
-       catch(AUD_Exception&)
-       {
-               delete reader1;
-               throw;
-       }
+       AUD_Reference<AUD_IReader> reader1 = m_factory1->createReader();
+       AUD_Reference<AUD_IReader> reader2 = m_factory2->createReader();
 
        return new AUD_DoubleReader(reader1, reader2);
 }
index 52a299c7157dc79cdc4221d7e10240bff18f08d5..2db2257244c7c4aaa70fcb5d416894067c93fe9c 100644 (file)
@@ -36,7 +36,6 @@
 
 /**
  * This factory plays two other factories behind each other.
- * \note Readers from the underlying factories must have the same sample rate and channel count.
  */
 class AUD_DoubleFactory : public AUD_IFactory
 {
@@ -44,12 +43,12 @@ private:
        /**
         * First played factory.
         */
-       AUD_IFactory* m_factory1;
+       AUD_Reference<AUD_IFactory> m_factory1;
 
        /**
         * Second played factory.
         */
-       AUD_IFactory* m_factory2;
+       AUD_Reference<AUD_IFactory> m_factory2;
 
        // hide copy constructor and operator=
        AUD_DoubleFactory(const AUD_DoubleFactory&);
@@ -61,9 +60,9 @@ public:
         * \param factory1 The first input factory.
         * \param factory2 The second input factory.
         */
-       AUD_DoubleFactory(AUD_IFactory* factory1, AUD_IFactory* factory2);
+       AUD_DoubleFactory(AUD_Reference<AUD_IFactory> factory1, AUD_Reference<AUD_IFactory> factory2);
 
-       virtual AUD_IReader* createReader() const;
+       virtual AUD_Reference<AUD_IReader> createReader();
 };
 
 #endif //AUD_DOUBLEFACTORY
index 113bed14ce3a0bd5b25354ed9f2dd07242bf2311..3b1d105954c122c4fad7d7a03c29acfae7a97b3b 100644 (file)
 
 #include <cstring>
 
-static const char* specs_error = "AUD_DoubleReader: Both readers have to have "
-                                                                "the same specs.";
-
-AUD_DoubleReader::AUD_DoubleReader(AUD_IReader* reader1,
-                                                                  AUD_IReader* reader2) :
+AUD_DoubleReader::AUD_DoubleReader(AUD_Reference<AUD_IReader> reader1,
+                                                                  AUD_Reference<AUD_IReader> reader2) :
                m_reader1(reader1), m_reader2(reader2), m_finished1(false)
 {
        AUD_Specs s1, s2;
        s1 = reader1->getSpecs();
        s2 = reader2->getSpecs();
-       if(memcmp(&s1, &s2, sizeof(AUD_Specs)) != 0)
-       {
-               delete reader1;
-               delete reader2;
-               AUD_THROW(AUD_ERROR_SPECS, specs_error);
-       }
 }
 
 AUD_DoubleReader::~AUD_DoubleReader()
 {
-       delete m_reader1;
-       delete m_reader2;
 }
 
 bool AUD_DoubleReader::isSeekable() const
@@ -90,43 +79,36 @@ int AUD_DoubleReader::getPosition() const
 
 AUD_Specs AUD_DoubleReader::getSpecs() const
 {
-       return m_reader1->getSpecs();
+       return m_finished1 ? m_reader1->getSpecs() : m_reader2->getSpecs();
 }
 
-void AUD_DoubleReader::read(int & length, sample_t* & buffer)
+void AUD_DoubleReader::read(int& length, bool& eos, sample_t* buffer)
 {
+       eos = false;
+
        if(!m_finished1)
        {
                int len = length;
-               m_reader1->read(len, buffer);
+
+               m_reader1->read(len, m_finished1, buffer);
 
                if(len < length)
                {
-                       AUD_Specs specs = m_reader1->getSpecs();
-                       int samplesize = AUD_SAMPLE_SIZE(specs);
-
-                       if(m_buffer.getSize() < length * samplesize)
-                               m_buffer.resize(length * samplesize);
-
-                       sample_t* buf = buffer;
-                       buffer = m_buffer.getBuffer();
-
-                       memcpy(buffer, buf, len * samplesize);
-
-                       len = length - len;
-                       length -= len;
-                       m_reader2->read(len, buf);
-
-                       memcpy(buffer + length * specs.channels, buf,
-                                  len * samplesize);
-
-                       length += len;
-
-                       m_finished1 = true;
+                       AUD_Specs specs1, specs2;
+                       specs1 = m_reader1->getSpecs();
+                       specs2 = m_reader2->getSpecs();
+                       if(AUD_COMPARE_SPECS(specs1, specs2))
+                       {
+                               int len2 = length - len;
+                               m_reader2->read(len2, eos, buffer + specs1.channels * len);
+                               length = len + len2;
+                       }
+                       else
+                               length = len;
                }
        }
        else
        {
-               m_reader2->read(length, buffer);
+               m_reader2->read(length, eos, buffer);
        }
 }
index 7b3b812ef80f8f794b66ae31bc8869bb322980ea..750868a94007a7d2c0d3c7fadc8aa9e1046d61a0 100644 (file)
 
 #include "AUD_IReader.h"
 #include "AUD_Buffer.h"
+#include "AUD_Reference.h"
 
 /**
- * This reader plays two readers with the same specs sequently.
+ * This reader plays two readers sequently.
  */
 class AUD_DoubleReader : public AUD_IReader
 {
@@ -44,35 +45,29 @@ private:
        /**
         * The first reader.
         */
-       AUD_IReader* m_reader1;
+       AUD_Reference<AUD_IReader> m_reader1;
 
        /**
         * The second reader.
         */
-       AUD_IReader* m_reader2;
+       AUD_Reference<AUD_IReader> m_reader2;
 
        /**
         * Whether we've reached the end of the first reader.
         */
        bool m_finished1;
 
-       /**
-        * The playback buffer for the intersecting part.
-        */
-       AUD_Buffer m_buffer;
-
        // hide copy constructor and operator=
        AUD_DoubleReader(const AUD_DoubleReader&);
        AUD_DoubleReader& operator=(const AUD_DoubleReader&);
 
 public:
        /**
-        * Creates a new ping pong reader.
+        * Creates a new double reader.
         * \param reader1 The first reader to read from.
         * \param reader2 The second reader to read from.
-        * \exception AUD_Exception Thrown if the specs from the readers differ.
         */
-       AUD_DoubleReader(AUD_IReader* reader1, AUD_IReader* reader2);
+       AUD_DoubleReader(AUD_Reference<AUD_IReader> reader1, AUD_Reference<AUD_IReader> reader2);
 
        /**
         * Destroys the reader.
@@ -84,7 +79,7 @@ public:
        virtual int getLength() const;
        virtual int getPosition() const;
        virtual AUD_Specs getSpecs() const;
-       virtual void read(int & length, sample_t* & buffer);
+       virtual void read(int& length, bool& eos, sample_t* buffer);
 };
 
 #endif //AUD_DOUBLEREADER
diff --git a/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.cpp b/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.cpp
new file mode 100644 (file)
index 0000000..3018a2d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 Jörg Hermann Müller
+ *
+ * This file is part of AudaSpace.
+ *
+ * Audaspace is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * AudaSpace is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file audaspace/FX/AUD_DynamicIIRFilterFactory.cpp
+ *  \ingroup audfx
+ */
+
+#include "AUD_DynamicIIRFilterFactory.h"
+#include "AUD_DynamicIIRFilterReader.h"
+
+AUD_DynamicIIRFilterFactory::AUD_DynamicIIRFilterFactory(AUD_Reference<AUD_IFactory> factory) :
+       AUD_EffectFactory(factory)
+{
+}
+
+AUD_Reference<AUD_IReader> AUD_DynamicIIRFilterFactory::createReader()
+{
+       return new AUD_DynamicIIRFilterReader(getReader(), this);
+}
diff --git a/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h b/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h
new file mode 100644 (file)
index 0000000..56d56a9
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 Jörg Hermann Müller
+ *
+ * This file is part of AudaSpace.
+ *
+ * Audaspace is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * AudaSpace is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file audaspace/FX/AUD_DynamicIIRFilterFactory.h
+ *  \ingroup audfx
+ */
+
+#ifndef AUD_DYNAMICIIRFILTERFACTORY
+#define AUD_DYNAMICIIRFILTERFACTORY
+
+#include "AUD_EffectFactory.h"
+#include <vector>
+
+/**
+ * This factory creates a IIR filter reader.
+ *
+ * This means that on sample rate change the filter recalculates its
+ * coefficients.
+ */
+class AUD_DynamicIIRFilterFactory : public AUD_EffectFactory
+{
+public:
+       /**
+        * Creates a new Dynmic IIR filter factory.
+        * \param factory The input factory.
+        */
+       AUD_DynamicIIRFilterFactory(AUD_Reference<AUD_IFactory> factory);
+
+       virtual AUD_Reference<AUD_IReader> createReader();
+
+       /**
+        * Recalculates the filter coefficients.
+        * \param rate The sample rate of the audio data.
+        * \param[out] b The input filter coefficients.
+        * \param[out] a The output filter coefficients.
+        */
+       virtual void recalculateCoefficients(AUD_SampleRate rate,
+                                                                                std::vector<float>& b,
+                                                                                std::vector<float>& a)=0;
+};
+
+#endif // AUD_DYNAMICIIRFILTERFACTORY
diff --git a/intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp b/intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp
new file mode 100644 (file)
index 0000000..ed9b2d3
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 Jörg Hermann Müller
+ *
+ * This file is part of AudaSpace.
+ *
+ * Audaspace is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * AudaSpace is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file audaspace/FX/AUD_DynamicIIRFilterReader.cpp
+ *  \ingroup audfx
+ */
+
+#include "AUD_DynamicIIRFilterReader.h"
+
+AUD_DynamicIIRFilterReader::AUD_DynamicIIRFilterReader(AUD_Reference<AUD_IReader> reader,
+                                                                                                          AUD_Reference<AUD_DynamicIIRFilterFactory> factory) :
+       AUD_IIRFilterReader(reader, std::vector<float>(), std::vector<float>())
+{
+       sampleRateChanged(reader->getSpecs().rate);
+}
+
+void AUD_DynamicIIRFilterReader::sampleRateChanged(AUD_SampleRate rate)
+{
+       std::vector<float> a, b;
+       m_factory->recalculateCoefficients(rate, b, a);
+       setCoefficients(b, a);
+}
diff --git a/intern/audaspace/FX/AUD_DynamicIIRFilterReader.h b/intern/audaspace/FX/AUD_DynamicIIRFilterReader.h
new file mode 100644 (file)
index 0000000..4278972
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 Jörg Hermann Müller
+ *
+ * This file is part of AudaSpace.
+ *
+ * Audaspace is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * AudaSpace is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file audaspace/FX/AUD_DynamicIIRFilterReader.h
+ *  \ingroup audfx
+ */
+
+#ifndef AUD_DYNAMICIIRFILTERREADER
+#define AUD_DYNAMICIIRFILTERREADER
+
+#include "AUD_IIRFilterReader.h"
+#include "AUD_DynamicIIRFilterFactory.h"
+
+/**
+ * This class is for dynamic infinite impulse response filters with simple
+ * coefficients that change depending on the sample rate.
+ */
+class AUD_DynamicIIRFilterReader : public AUD_IIRFilterReader
+{
+private:
+       /**
+        * The factory for dynamically recalculating filter coefficients.
+        */
+       AUD_Reference<AUD_DynamicIIRFilterFactory> m_factory;
+
+public:
+       AUD_DynamicIIRFilterReader(AUD_Reference<AUD_IReader> reader,
+                                                          AUD_Reference<AUD_DynamicIIRFilterFactory> factory);
+
+       virtual void sampleRateChanged(AUD_SampleRate rate);
+};
+
+#endif // AUD_DYNAMICIIRFILTERREADER
index a0d9256e6911c94381deae8c96b76bcfbaeaacc3..6173ffb5a979a5bfcd3d2fc9188dacbd532274c2 100644 (file)
@@ -32,7 +32,7 @@
 #include "AUD_EffectFactory.h"
 #include "AUD_IReader.h"
 
-AUD_EffectFactory::AUD_EffectFactory(AUD_IFactory* factory)
+AUD_EffectFactory::AUD_EffectFactory(AUD_Reference<AUD_IFactory> factory)
 {
        m_factory = factory;
 }
@@ -41,7 +41,7 @@ AUD_EffectFactory::~AUD_EffectFactory()
 {
 }
 
-AUD_IFactory* AUD_EffectFactory::getFactory() const
+AUD_Reference<AUD_IFactory> AUD_EffectFactory::getFactory() const
 {
        return m_factory;
 }
index a6a28eea5770e4eee5338fa27886d949125c47b8..72fdb3f0833b968baea1a1d00fdc69c36ee49d12 100644 (file)
@@ -49,7 +49,7 @@ protected:
        /**
         * If there is no reader it is created out of this factory.
         */
-       AUD_IFactory* m_factory;
+       AUD_Reference<AUD_IFactory> m_factory;
 
        /**
         * Returns the reader created out of the factory.
@@ -57,7 +57,7 @@ protected:
         * classes.
         * \return The reader created out of the factory.
         */
-       inline AUD_IReader* getReader() const
+       inline AUD_Reference<AUD_IReader> getReader() const
        {
                return m_factory->createReader();
        }
@@ -67,7 +67,7 @@ public:
         * Creates a new factory.
         * \param factory The input factory.
         */
-       AUD_EffectFactory(AUD_IFactory* factory);
+       AUD_EffectFactory(AUD_Reference<AUD_IFactory> factory);
 
        /**
         * Destroys the factory.
@@ -78,7 +78,7 @@ public:
         * Returns the saved factory.
         * \return The factory or NULL if there has no factory been saved.
         */
-       AUD_IFactory* getFactory() const;
+       AUD_Reference<AUD_IFactory> getFactory() const;
 };
 
 #endif //AUD_EFFECTFACTORY
index 3ad9f67bfd6ce93794c5da8eb4c6299bddad0eb7..4d14af76438ac1ede4de8492890b2905ffaf078b 100644 (file)
 
 #include "AUD_EffectReader.h"
 
-AUD_EffectReader::AUD_EffectReader(AUD_IReader* reader)
+AUD_EffectReader::AUD_EffectReader(AUD_Reference<AUD_IReader> reader)
 {
        m_reader = reader;
 }
 
 AUD_EffectReader::~AUD_EffectReader()
 {
-       delete m_reader;
 }
 
 bool AUD_EffectReader::isSeekable() const
@@ -66,7 +65,7 @@ AUD_Specs AUD_EffectReader::getSpecs() const
        return m_reader->getSpecs();
 }
 
-void AUD_EffectReader::read(int & length, sample_t* & buffer)
+void AUD_EffectReader::read(int& length, bool& eos, sample_t* buffer)
 {
-       m_reader->read(length, buffer);
+       m_reader->read(length, eos, buffer);
 }
index fb8066f36d8c0a300104dd6574d139ca05e7309c..c03abd1182891577e149c485ff58a15170593922 100644 (file)
@@ -33,6 +33,7 @@
 #define AUD_EFFECTREADER
 
 #include "AUD_IReader.h"
+#include "AUD_Reference.h"
 
 /**
  * This reader is a base class for all effect readers that take one other reader
@@ -49,14 +50,14 @@ protected:
        /**
         * The reader to read from.
         */
-       AUD_IReader* m_reader;
+       AUD_Reference<AUD_IReader> m_reader;
 
 public:
        /**
         * Creates a new effect reader.
         * \param reader The reader to read from.
         */
-       AUD_EffectReader(AUD_IReader* reader);
+       AUD_EffectReader(AUD_Reference<AUD_IReader> reader);
 
        /**
         * Destroys the reader.
@@ -68,7 +69,7 @@ public:
        virtual int getLength() const;
        virtual int getPosition() const;
        virtual AUD_Specs getSpecs() const;
-       virtual void read(int & length, sample_t* & buffer);
+       virtual void read(int& length, bool& eos, sample_t* buffer);
 };
 
 #endif //AUD_EFFECTREADER
index 069317d1c8b1a766ca49fdb57e356ebcdc74476a..80df7e9f8748e249c5fce9610c5bb32a97103b62 100644 (file)
@@ -42,7 +42,7 @@ struct EnvelopeParameters
        float arthreshold;
 };
 
-sample_t envelopeFilter(AUD_CallbackIIRFilterReader* reader, EnvelopeParameters* param)
+sample_t AUD_EnvelopeFactory::envelopeFilter(AUD_CallbackIIRFilterReader* reader, EnvelopeParameters* param)
 {
        float in = fabs(reader->x(0));
        float out = reader->y(-1);
@@ -51,12 +51,12 @@ sample_t envelopeFilter(AUD_CallbackIIRFilterReader* reader, EnvelopeParameters*
        return (in > out ? param->attack : param->release) * (out - in) + in;
 }
 
-void endEnvelopeFilter(EnvelopeParameters* param)
+void AUD_EnvelopeFactory::endEnvelopeFilter(EnvelopeParameters* param)
 {
        delete param;
 }
 
-AUD_EnvelopeFactory::AUD_EnvelopeFactory(AUD_IFactory* factory, float attack,
+AUD_EnvelopeFactory::AUD_EnvelopeFactory(AUD_Reference<AUD_IFactory> factory, float attack,
                                                                                 float release, float threshold,
                                                                                 float arthreshold) :
                AUD_EffectFactory(factory),
@@ -67,14 +67,14 @@ AUD_EnvelopeFactory::AUD_EnvelopeFactory(AUD_IFactory* factory, float attack,
 {
 }
 
-AUD_IReader* AUD_EnvelopeFactory::createReader() const
+AUD_Reference<AUD_IReader> AUD_EnvelopeFactory::createReader()
 {
-       AUD_IReader* reader = getReader();
+       AUD_Reference<AUD_IReader> reader = getReader();
 
        EnvelopeParameters* param = new EnvelopeParameters();
        param->arthreshold = m_arthreshold;
-       param->attack = pow(m_arthreshold, 1.0f/(reader->getSpecs().rate * m_attack));
-       param->release = pow(m_arthreshold, 1.0f/(reader->getSpecs().rate * m_release));
+       param->attack = pow(m_arthreshold, 1.0f/(static_cast<float>(reader->getSpecs().rate) * m_attack));
+       param->release = pow(m_arthreshold, 1.0f/(static_cast<float>(reader->getSpecs().rate) * m_release));
        param->threshold = m_threshold;
 
        return new AUD_CallbackIIRFilterReader(reader, 1, 2,
index 45ee811b6e040274f765f33a91ecd19ed9ef0dc4..a480a05d47801789a00640a8a056087dfe8af8c9 100644 (file)
@@ -33,6 +33,8 @@
 #define AUD_ENVELOPEFACTORY
 
 #include "AUD_EffectFactory.h"
+class AUD_CallbackIIRFilterReader;
+struct EnvelopeParameters;
 
 /**
  * This factory creates an envelope follower reader.
@@ -73,10 +75,13 @@ public:
         * \param threshold The threshold value.
         * \param arthreshold The attack/release threshold value.
         */
-       AUD_EnvelopeFactory(AUD_IFactory* factory, float attack, float release,
+       AUD_EnvelopeFactory(AUD_Reference<AUD_IFactory> factory, float attack, float release,
                                                float threshold, float arthreshold);
 
-       virtual AUD_IReader* createReader() const;
+       virtual AUD_Reference<AUD_IReader> createReader();
+
+       static sample_t envelopeFilter(AUD_CallbackIIRFilterReader* reader, EnvelopeParameters* param);
+       static void endEnvelopeFilter(EnvelopeParameters* param);
 };
 
 #endif //AUD_ENVELOPEFACTORY
index d887e9e68d9cc69b65ac7e07a59c11c728bd866c..635873e0ee572eb8b80c094aecb1dee4060666a5 100644 (file)
@@ -32,7 +32,7 @@
 #include "AUD_FaderFactory.h"
 #include "AUD_FaderReader.h"
 
-AUD_FaderFactory::AUD_FaderFactory(AUD_IFactory* factory, AUD_FadeType type,
+AUD_FaderFactory::AUD_FaderFactory(AUD_Reference<AUD_IFactory> factory, AUD_FadeType type,
                                                                   float start, float length) :
                AUD_EffectFactory(factory),
                m_type(type),
@@ -56,7 +56,7 @@ float AUD_FaderFactory::getLength() const
        return m_length;
 }
 
-AUD_IReader* AUD_FaderFactory::createReader() const
+AUD_Reference<AUD_IReader> AUD_FaderFactory::createReader()
 {
        return new AUD_FaderReader(getReader(), m_type, m_start, m_length);
 }
index b85475bc5346dc710bd7c3a32e86f4dd24f053e4..d8314c77ed4c2a1ee1c4bbc1e5c9a5b8e14203c5 100644 (file)
@@ -69,7 +69,7 @@ public:
         * \param start The time where fading should start in seconds.
         * \param length How long fading should last in seconds.
         */
-       AUD_FaderFactory(AUD_IFactory* factory,
+       AUD_FaderFactory(AUD_Reference<AUD_IFactory> factory,
                                          AUD_FadeType type = AUD_FADE_IN,
                                          float start = 0.0f, float length = 1.0f);
 
@@ -88,7 +88,7 @@ public:
         */
        float getLength() const;
 
-       virtual AUD_IReader* createReader() const;
+       virtual AUD_Reference<AUD_IReader> createReader();
 };
 
 #endif //AUD_FADERFACTORY
index 6114bb486fce871784a94a0fe37d898ada54d70d..4a6050cf0f359984310b56df07f63b9d5f72aa67 100644 (file)
 
 #include <cstring>
 
-AUD_FaderReader::AUD_FaderReader(AUD_IReader* reader, AUD_FadeType type,
+AUD_FaderReader::AUD_FaderReader(AUD_Reference<AUD_IReader> reader, AUD_FadeType type,
                                                                 float start,float length) :
                AUD_EffectReader(reader),
                m_type(type),
                m_start(start),
-               m_length(length),
-               m_empty(true)
+               m_length(length)
 {
 }
 
-void AUD_FaderReader::read(int & length, sample_t* & buffer)
+void AUD_FaderReader::read(int& length, bool& eos, sample_t* buffer)
 {
        int position = m_reader->getPosition();
        AUD_Specs specs = m_reader->getSpecs();
        int samplesize = AUD_SAMPLE_SIZE(specs);
 
-       m_reader->read(length, buffer);
+       m_reader->read(length, eos, buffer);
 
        if((position + length) / (float)specs.rate <= m_start)
        {
                if(m_type != AUD_FADE_OUT)
                {
-                       if(m_buffer.getSize() < length * samplesize)
-                       {
-                               m_buffer.resize(length * samplesize);
-                               m_empty = false;
-                       }
-
-                       buffer = m_buffer.getBuffer();
-
-                       if(!m_empty)
-                       {
-                               memset(buffer, 0, length * samplesize);
-                               m_empty = true;
-                       }
+                       memset(buffer, 0, length * samplesize);
                }
        }
        else if(position / (float)specs.rate >= m_start+m_length)
        {
                if(m_type == AUD_FADE_OUT)
                {
-                       if(m_buffer.getSize() < length * samplesize)
-                       {
-                               m_buffer.resize(length * samplesize);
-                               m_empty = false;
-                       }
-
-                       buffer = m_buffer.getBuffer();
-
-                       if(!m_empty)
-                       {
-                               memset(buffer, 0, length * samplesize);
-                               m_empty = true;
-                       }
+                       memset(buffer, 0, length * samplesize);
                }
        }
        else
        {
-               if(m_buffer.getSize() < length * samplesize)
-                       m_buffer.resize(length * samplesize);
-
-               sample_t* buf = m_buffer.getBuffer();
                float volume = 1.0f;
 
                for(int i = 0; i < length * specs.channels; i++)
@@ -111,10 +82,7 @@ void AUD_FaderReader::read(int & length, sample_t* & buffer)
                                        volume = 1.0f - volume;
                        }
 
-                       buf[i] = buffer[i] * volume;
+                       buffer[i] = buffer[i] * volume;
                }
-
-               buffer = buf;
-               m_empty = false;
        }
 }
index fb927192b45ae310e91f1f17d41994d3f70d3dbd..e702ac0ec19be9c79792d5bcfd03bb1189fadc04 100644 (file)
@@ -58,16 +58,6 @@ private:
         */
        const float m_length;
 
-       /**
-        * The playback buffer.
-        */
-       AUD_Buffer m_buffer;
-
-       /**
-        * Whether the buffer is empty.
-        */
-       bool m_empty;
-
        // hide copy constructor and operator=
        AUD_FaderReader(const AUD_FaderReader&);
        AUD_FaderReader& operator=(const AUD_FaderReader&);
@@ -79,10 +69,10 @@ public:
         * \param start The time where fading should start in seconds.
         * \param length How long fading should last in seconds.
         */
-       AUD_FaderReader(AUD_IReader* reader, AUD_FadeType type,
+       AUD_FaderReader(AUD_Reference<AUD_IReader> reader, AUD_FadeType type,
                                        float start,float length);
 
-       virtual void read(int & length, sample_t* & buffer);
+       virtual void read(int& length, bool& eos, sample_t* buffer);
 };
 
 #endif //AUD_FADERREADER
index 61008eea44e7162423630deeb83ec6f8801d913c..399ec5ca406d8bb3fcfb3bb1dc6f9345d9ff733d 100644 (file)
 #define M_PI 3.14159265358979323846
 #endif
 
-AUD_HighpassFactory::AUD_HighpassFactory(AUD_IFactory* factory, float frequency,
+AUD_HighpassFactory::AUD_HighpassFactory(AUD_Reference<AUD_IFactory> factory, float frequency,
                                                                                 float Q) :
-               AUD_EffectFactory(factory),
+               AUD_DynamicIIRFilterFactory(factory),
                m_frequency(frequency),
                m_Q(Q)
 {
 }
 
-AUD_IReader* AUD_HighpassFactory::createReader() const
+void AUD_HighpassFactory::recalculateCoefficients(AUD_SampleRate rate,
+                                                                                                 std::vector<float> &b,
+                                                                                                 std::vector<float> &a)
 {
-       AUD_IReader* reader = getReader();
-
-       // calculate coefficients
-       float w0 = 2 * M_PI * m_frequency / reader->getSpecs().rate;
+       float w0 = 2 * M_PI * m_frequency / rate;
        float alpha = sin(w0) / (2 * m_Q);
        float norm = 1 + alpha;
        float c = cos(w0);
-       std::vector<float> a, b;
        a.push_back(1);
        a.push_back(-2 * c / norm);
        a.push_back((1 - alpha) / norm);
        b.push_back((1 + c) / (2 * norm));
        b.push_back((-1 - c) / norm);
        b.push_back(b[0]);
-
-       return new AUD_IIRFilterReader(reader, b, a);
 }
index 48f4c1baefc4ccd7bc856f27e993a4449a042bd0..c135be27d770f0ac3753aec243e79a872d6c76d9 100644 (file)
 #ifndef AUD_HIGHPASSFACTORY
 #define AUD_HIGHPASSFACTORY
 
-#include "AUD_EffectFactory.h"
+#include "AUD_DynamicIIRFilterFactory.h"
 
 /**
  * This factory creates a highpass filter reader.
  */
-class AUD_HighpassFactory : public AUD_EffectFactory
+class AUD_HighpassFactory : public AUD_DynamicIIRFilterFactory
 {
 private:
        /**
-        * The attack value in seconds.
+        * The cutoff frequency.
         */
        const float m_frequency;
 
@@ -61,9 +61,9 @@ public:
         * \param frequency The cutoff frequency.
         * \param Q The Q factor.
         */
-       AUD_HighpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0f);
+       AUD_HighpassFactory(AUD_Reference<AUD_IFactory> factory, float frequency, float Q = 1.0f);
 
-       virtual AUD_IReader* createReader() const;
+       virtual void recalculateCoefficients(AUD_SampleRate rate, std::vector<float> &b, std::vector<float> &a);
 };
 
 #endif //AUD_HIGHPASSFACTORY
index ff90ce6273910bff479d59bcbbaf624cdce02c8c..f6ccda6f67e5f6f9a9c12e0d46c90a461ad3c4cd 100644 (file)
 #include "AUD_IIRFilterFactory.h"
 #include "AUD_IIRFilterReader.h"
 
-AUD_IIRFilterFactory::AUD_IIRFilterFactory(AUD_IFactory* factory,
+AUD_IIRFilterFactory::AUD_IIRFilterFactory(AUD_Reference<AUD_IFactory> factory,
                                                                                   std::vector<float> b,
                                                                                   std::vector<float> a) :
                AUD_EffectFactory(factory), m_a(a), m_b(b)
 {
 }
 
-AUD_IReader* AUD_IIRFilterFactory::createReader() const
+AUD_Reference<AUD_IReader> AUD_IIRFilterFactory::createReader()
 {
        return new AUD_IIRFilterReader(getReader(), m_b, m_a);
 }
index d48ad453ee46c115fb679141d50afd3800f07f56..0e92ab1a568e88d712ee4c55d3b4b7d269cd6dbf 100644 (file)
@@ -63,10 +63,10 @@ public:
         * \param b The input filter coefficients.
         * \param a The output filter coefficients.
         */
-       AUD_IIRFilterFactory(AUD_IFactory* factory, std::vector<float> b,
+       AUD_IIRFilterFactory(AUD_Reference<AUD_IFactory> factory, std::vector<float> b,
                                                 std::vector<float> a);
 
-       virtual AUD_IReader* createReader() const;
+       virtual AUD_Reference<AUD_IReader> createReader();
 };
 
 #endif //AUD_IIRFILTERFACTORY
index 0d55421d2b4965312456f0ff06c35f0a43ce9542..1bfb9b97b62a2b4b2a79886d349523bd811f5d6a 100644 (file)
@@ -31,9 +31,9 @@
 
 #include "AUD_IIRFilterReader.h"
 
-AUD_IIRFilterReader::AUD_IIRFilterReader(AUD_IReader* reader,
-                                                                                std::vector<float> b,
-                                                                                std::vector<float> a) :
+AUD_IIRFilterReader::AUD_IIRFilterReader(AUD_Reference<AUD_IReader> reader,
+                                                                                const std::vector<float>& b,
+                                                                                const std::vector<float>& a) :
        AUD_BaseIIRFilterReader(reader, b.size(), a.size()), m_a(a), m_b(b)
 {
        for(int i = 1; i < m_a.size(); i++)
@@ -54,3 +54,11 @@ sample_t AUD_IIRFilterReader::filter()
 
        return out;
 }
+
+void AUD_IIRFilterReader::setCoefficients(const std::vector<float>& b,
+                                                                                 const std::vector<float>& a)
+{
+       setLengths(m_b.size(), m_a.size());
+       m_a = a;
+       m_b = b;
+}
index af50b6f1cdc26a70adbac271467b455fe916dc72..41de67d4d27419de773ba8e73162bd0b81463aab 100644 (file)
@@ -63,10 +63,13 @@ public:
         * \param b The input filter coefficients.
         * \param a The output filter coefficients.
         */
-       AUD_IIRFilterReader(AUD_IReader* reader, std::vector<float> b,
-                                               std::vector<float> a);
+       AUD_IIRFilterReader(AUD_Reference<AUD_IReader> reader, const std::vector<float>& b,
+                                               const std::vector<float>& a);
 
        virtual sample_t filter();
+
+       void setCoefficients(const std::vector<float>& b,
+                                                const std::vector<float>& a);
 };
 
 #endif //AUD_IIRFILTERREADER
index 62ea01bb76191e58c2147a08c10969faf12eb651..8d1dd14f3aed7601f2a370fb8cf15d8d9b4175a8 100644 (file)
@@ -33,7 +33,7 @@
 #include "AUD_LimiterReader.h"
 #include "AUD_Space.h"
 
-AUD_LimiterFactory::AUD_LimiterFactory(AUD_IFactory* factory,
+AUD_LimiterFactory::AUD_LimiterFactory(AUD_Reference<AUD_IFactory> factory,
                                                                           float start, float end) :
                AUD_EffectFactory(factory),
                m_start(start),
@@ -51,7 +51,7 @@ float AUD_LimiterFactory::getEnd() const
        return m_end;
 }
 
-AUD_IReader* AUD_LimiterFactory::createReader() const
+AUD_Reference<AUD_IReader> AUD_LimiterFactory::createReader()
 {
        return new AUD_LimiterReader(getReader(), m_start, m_end);
 }
index f93f4b3276c4d650e07e3fe683d415cd7a572371..c04bfe861b2752c7bea69493a7fa347a1f73256c 100644 (file)
@@ -62,7 +62,7 @@ public:
         * \param end The desired end time, a negative value signals that it should
         *            play to the end.
         */
-       AUD_LimiterFactory(AUD_IFactory* factory,
+       AUD_LimiterFactory(AUD_Reference<AUD_IFactory> factory,
                                           float start = 0, float end = -1);
 
        /**
@@ -75,7 +75,7 @@ public:
         */
        float getEnd() const;
 
-       virtual AUD_IReader* createReader() const;
+       virtual AUD_Reference<AUD_IReader> createReader();
 };
 
 #endif //AUD_LIMITERFACTORY
index d67fbb4d0e52931c9e1aadf710d2b8a9669f44a5..dc31477d2eb21f66ca69a22506cc85286de5d69d 100644 (file)
 #include "AUD_LimiterReader.h"
 #include "AUD_Buffer.h"
 
-#include <iostream>
-
-AUD_LimiterReader::AUD_LimiterReader(AUD_IReader* reader,
+AUD_LimiterReader::AUD_LimiterReader(AUD_Reference<AUD_IReader> reader,
                                                                         float start, float end) :
                AUD_EffectReader(reader),
-               m_start(int(start * reader->getSpecs().rate)),
-               m_end(int(end * reader->getSpecs().rate))
+               m_start(start),
+               m_end(end)
 {
        if(m_start > 0)
        {
+               AUD_Specs specs = m_reader->getSpecs();
+               AUD_Specs specs2;
+
                if(m_reader->isSeekable())
-                       m_reader->seek(m_start);
+                       m_reader->seek(m_start * specs.rate);
                else
                {
                        // skip first m_start samples by reading them
                        int length = AUD_DEFAULT_BUFFER_SIZE;
-                       sample_t* buffer;
-                       for(int len = m_start;
-                               length == AUD_DEFAULT_BUFFER_SIZE;
-                               len -= AUD_DEFAULT_BUFFER_SIZE)
+                       AUD_Buffer buffer(AUD_DEFAULT_BUFFER_SIZE * AUD_SAMPLE_SIZE(specs));
+                       bool eos = false;
+                       for(int len = m_start * specs.rate;
+                               length > 0 && !eos;
+                               len -= length)
                        {
                                if(len < AUD_DEFAULT_BUFFER_SIZE)
                                        length = len;
-                               m_reader->read(length, buffer);
+
+                               m_reader->read(length, eos, buffer.getBuffer());
+
+                               specs2 = m_reader->getSpecs();
+                               if(specs2.rate != specs.rate)
+                               {
+                                       len = len * specs2.rate / specs.rate;
+                                       specs.rate = specs2.rate;
+                               }
+
+                               if(specs2.channels != specs.channels)
+                               {
+                                       specs = specs2;
+                                       buffer.assureSize(AUD_DEFAULT_BUFFER_SIZE * AUD_SAMPLE_SIZE(specs));
+                               }
                        }
                }
        }
@@ -63,35 +79,71 @@ AUD_LimiterReader::AUD_LimiterReader(AUD_IReader* reader,
 
 void AUD_LimiterReader::seek(int position)
 {
-       m_reader->seek(position + m_start);
+       m_reader->seek(position + m_start * m_reader->getSpecs().rate);
 }
 
 int AUD_LimiterReader::getLength() const
 {
        int len = m_reader->getLength();
-       if(len < 0 || (len > m_end && m_end >= 0))
-               len = m_end;
-       return len - m_start;
+       AUD_SampleRate rate = m_reader->getSpecs().rate;
+       if(len < 0 || (len > m_end * rate && m_end >= 0))
+               len = m_end * rate;
+       return len - m_start * rate;
 }
 
 int AUD_LimiterReader::getPosition() const
 {
        int pos = m_reader->getPosition();
-       return AUD_MIN(pos, m_end) - m_start;
+       AUD_SampleRate rate = m_reader->getSpecs().rate;
+       return AUD_MIN(pos, m_end * rate) - m_start * rate;
 }
 
-void AUD_LimiterReader::read(int & length, sample_t* & buffer)
+void AUD_LimiterReader::read(int& length, bool& eos, sample_t* buffer)
 {
+       eos = false;
        if(m_end >= 0)
        {
                int position = m_reader->getPosition();
-               if(position + length > m_end)
-                       length = m_end - position;
+               AUD_SampleRate rate = m_reader->getSpecs().rate;
+
+               if(position + length > m_end * rate)
+               {
+                       length = m_end * rate - position;
+                       eos = true;
+               }
+
+               if(position < m_start * rate)
+               {
+                       int len2 = length;
+