[Bf-blender-cvs] [0ed4945aabd] soc-2021-curve-fillet: Merge branch 'master' into soc-2021-curve-fillet
dilithjay
noreply at git.blender.org
Mon Sep 20 08:22:28 CEST 2021
Commit: 0ed4945aabdb321d7890ec4092e66963b61fe49d
Author: dilithjay
Date: Mon Sep 20 09:58:53 2021 +0530
Branches: soc-2021-curve-fillet
https://developer.blender.org/rB0ed4945aabdb321d7890ec4092e66963b61fe49d
Merge branch 'master' into soc-2021-curve-fillet
===================================================================
M doc/python_api/examples/aud.py
M doc/python_api/requirements.txt
M extern/audaspace/CMakeLists.txt
M extern/audaspace/bindings/C/AUD_PlaybackManager.h
M extern/audaspace/bindings/C/AUD_Sound.cpp
M extern/audaspace/bindings/C/AUD_Sound.h
M extern/audaspace/bindings/C/AUD_Special.cpp
M extern/audaspace/bindings/C/AUD_Special.h
M extern/audaspace/bindings/C/AUD_Types.h
M extern/audaspace/bindings/python/PySound.cpp
M extern/audaspace/include/IReader.h
M extern/audaspace/include/file/File.h
A extern/audaspace/include/file/FileInfo.h
M extern/audaspace/include/file/FileManager.h
M extern/audaspace/include/file/IFileInput.h
M extern/audaspace/include/fx/VolumeReader.h
M extern/audaspace/plugins/ffmpeg/FFMPEG.cpp
M extern/audaspace/plugins/ffmpeg/FFMPEG.h
M extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp
M extern/audaspace/plugins/ffmpeg/FFMPEGReader.h
M extern/audaspace/plugins/libsndfile/SndFile.cpp
M extern/audaspace/plugins/libsndfile/SndFile.h
M extern/audaspace/plugins/libsndfile/SndFileReader.cpp
M extern/audaspace/plugins/libsndfile/SndFileReader.h
M extern/audaspace/src/file/File.cpp
M extern/audaspace/src/file/FileManager.cpp
M extern/audaspace/src/fx/VolumeReader.cpp
M release/datafiles/userdef/userdef_default.c
M release/scripts/addons
M release/scripts/modules/bl_keymap_utils/io.py
M release/scripts/modules/rna_keymap_ui.py
M release/scripts/startup/bl_operators/assets.py
M release/scripts/startup/bl_ui/properties_freestyle.py
M release/scripts/startup/bl_ui/properties_mask_common.py
M release/scripts/startup/bl_ui/space_clip.py
M release/scripts/startup/bl_ui/space_dopesheet.py
M release/scripts/startup/bl_ui/space_graph.py
M release/scripts/startup/bl_ui/space_node.py
M release/scripts/startup/bl_ui/space_topbar.py
M release/scripts/startup/bl_ui/space_userpref.py
M release/scripts/startup/bl_ui/space_view3d.py
M release/scripts/startup/nodeitems_builtins.py
M source/blender/CMakeLists.txt
M source/blender/blenkernel/BKE_attribute_access.hh
M source/blender/blenkernel/BKE_geometry_set.hh
M source/blender/blenkernel/BKE_global.h
M source/blender/blenkernel/BKE_idtype.h
M source/blender/blenkernel/BKE_lib_id.h
M source/blender/blenkernel/BKE_lib_remap.h
M source/blender/blenkernel/BKE_mesh.h
M source/blender/blenkernel/BKE_node.h
M source/blender/blenkernel/BKE_packedFile.h
M source/blender/blenkernel/BKE_sound.h
M source/blender/blenkernel/BKE_spline.hh
M source/blender/blenkernel/CMakeLists.txt
M source/blender/blenkernel/intern/attribute_access.cc
M source/blender/blenkernel/intern/brush.c
M source/blender/blenkernel/intern/curve_eval.cc
M source/blender/blenkernel/intern/displist.cc
M source/blender/blenkernel/intern/dynamicpaint.c
M source/blender/blenkernel/intern/fluid.c
M source/blender/blenkernel/intern/fmodifier.c
M source/blender/blenkernel/intern/font.c
M source/blender/blenkernel/intern/geometry_component_curve.cc
M source/blender/blenkernel/intern/geometry_component_mesh.cc
M source/blender/blenkernel/intern/gpencil.c
M source/blender/blenkernel/intern/gpencil_modifier.c
M source/blender/blenkernel/intern/icons.cc
M source/blender/blenkernel/intern/idtype.c
M source/blender/blenkernel/intern/ipo.c
M source/blender/blenkernel/intern/key.c
M source/blender/blenkernel/intern/lib_id.c
M source/blender/blenkernel/intern/lib_override.c
M source/blender/blenkernel/intern/lib_query.c
M source/blender/blenkernel/intern/lib_remap.c
M source/blender/blenkernel/intern/library.c
M source/blender/blenkernel/intern/mesh.c
R085 source/blender/blenkernel/intern/mesh_convert.c source/blender/blenkernel/intern/mesh_convert.cc
M source/blender/blenkernel/intern/node.cc
M source/blender/blenkernel/intern/screen.c
M source/blender/blenkernel/intern/sound.c
M source/blender/blenkernel/intern/spline_base.cc
M source/blender/blenkernel/intern/spline_bezier.cc
M source/blender/blenkernel/intern/spline_nurbs.cc
M source/blender/blenkernel/intern/spline_poly.cc
M source/blender/blenkernel/intern/subdiv_mesh.c
M source/blender/blenkernel/intern/undo_system.c
M source/blender/blenkernel/intern/workspace.c
M source/blender/blenlib/BLI_index_mask.hh
M source/blender/blenlib/BLI_resource_scope.hh
M source/blender/blenlib/BLI_session_uuid.h
M source/blender/blenlib/BLI_span.hh
A source/blender/blenlib/BLI_uuid.h
M source/blender/blenlib/CMakeLists.txt
A source/blender/blenlib/intern/index_mask.cc
A source/blender/blenlib/intern/uuid.cc
M source/blender/blenlib/tests/BLI_color_test.cc
M source/blender/blenlib/tests/BLI_index_mask_test.cc
M source/blender/blenlib/tests/BLI_span_test.cc
A source/blender/blenlib/tests/BLI_uuid_test.cc
M source/blender/blenloader/intern/versioning_280.c
M source/blender/blenloader/intern/versioning_300.c
M source/blender/blenloader/intern/versioning_userdef.c
M source/blender/compositor/intern/COM_Debug.cc
M source/blender/compositor/intern/COM_MemoryBuffer.cc
M source/blender/compositor/intern/COM_WorkScheduler.cc
M source/blender/compositor/nodes/COM_CryptomatteNode.cc
M source/blender/compositor/nodes/COM_DenoiseNode.cc
M source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cc
M source/blender/compositor/operations/COM_DenoiseOperation.cc
M source/blender/compositor/operations/COM_DenoiseOperation.h
M source/blender/draw/engines/gpencil/gpencil_engine.c
M source/blender/editors/armature/armature_add.c
M source/blender/editors/armature/pose_slide.c
M source/blender/editors/curve/editcurve.c
M source/blender/editors/datafiles/CMakeLists.txt
M source/blender/editors/gpencil/gpencil_edit.c
M source/blender/editors/gpencil/gpencil_select.c
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/interface/interface_layout.c
M source/blender/editors/interface/interface_template_list.cc
M source/blender/editors/interface/interface_template_search_menu.c
M source/blender/editors/interface/interface_templates.c
M source/blender/editors/mask/mask_select.c
M source/blender/editors/mesh/editmesh_bevel.c
M source/blender/editors/mesh/editmesh_bisect.c
M source/blender/editors/mesh/editmesh_extrude.c
M source/blender/editors/mesh/editmesh_inset.c
M source/blender/editors/mesh/editmesh_rip.c
M source/blender/editors/mesh/editmesh_rip_edge.c
M source/blender/editors/mesh/editmesh_tools.c
M source/blender/editors/object/CMakeLists.txt
M source/blender/editors/object/object_gpencil_modifier.c
M source/blender/editors/object/object_intern.h
M source/blender/editors/object/object_modifier.c
M source/blender/editors/object/object_ops.c
M source/blender/editors/screen/area.c
M source/blender/editors/screen/screen_geometry.c
M source/blender/editors/screen/screen_intern.h
M source/blender/editors/screen/screen_ops.c
M source/blender/editors/screen/screendump.c
M source/blender/editors/sculpt_paint/paint_mask.c
M source/blender/editors/space_action/action_select.c
M source/blender/editors/space_clip/tracking_select.c
M source/blender/editors/space_file/filesel.c
M source/blender/editors/space_graph/graph_edit.c
M source/blender/editors/space_graph/graph_select.c
M source/blender/editors/space_image/space_image.c
M source/blender/editors/space_node/drawnode.cc
M source/blender/editors/space_node/node_add.cc
M source/blender/editors/space_node/node_relationships.cc
M source/blender/editors/space_node/node_select.cc
M source/blender/editors/space_outliner/outliner_draw.c
M source/blender/editors/space_outliner/outliner_tools.c
M source/blender/editors/space_sequencer/sequencer_add.c
M source/blender/editors/space_sequencer/sequencer_draw.c
M source/blender/editors/space_spreadsheet/space_spreadsheet.cc
M source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
M source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
M source/blender/editors/space_view3d/view3d_select.c
M source/blender/editors/transform/transform.h
M source/blender/editors/transform/transform_generics.c
M source/blender/editors/transform/transform_gizmo_3d.c
M source/blender/editors/transform/transform_ops.c
M source/blender/editors/uvedit/uvedit_rip.c
M source/blender/editors/uvedit/uvedit_select.c
M source/blender/functions/CMakeLists.txt
M source/blender/functions/FN_field.hh
M source/blender/functions/FN_generic_virtual_array.hh
M source/blender/functions/FN_multi_function.hh
A source/blender/functions/FN_multi_function_parallel.hh
M source/blender/functions/FN_multi_function_params.hh
M source/blender/functions/intern/field.cc
M source/blender/functions/intern/generic_virtual_array.cc
A source/blender/functions/intern/multi_function_parallel.cc
M source/blender/functions/intern/multi_function_procedure.cc
M source/blender/functions/intern/multi_function_procedure_executor.cc
M source/blender/functions/tests/FN_field_test.cc
M source/blender/functions/tests/FN_multi_function_test.cc
M source/blender/functions/tests/FN_multi_function_test_common.hh
M source/blender/gpencil_modifiers/CMakeLists.txt
M source/blender/gpencil_modifiers/MOD_gpencil_modifiertypes.h
M source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
A source/blender/gpencil_modifiers/intern/MOD_gpencildash.c
M source/blender/gpencil_modifiers/intern/MOD_gpencillength.c
M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M source/blender/imbuf/intern/anim_movie.c
M source/blender/makesdna/DNA_gpencil_modifier_defaults.h
M source/blender/makesdna/DNA_gpencil_modifier_types.h
M source/blender/makesdna/DNA_lineart_types.h
M source/blender/makesdna/DNA_node_types.h
M source/blender/makesdna/DNA_space_types.h
M source/blender/makesdna/DNA_userdef_types.h
A source/blender/makesdna/DNA_uuid_types.h
M source/blender/makesdna/DNA_view3d_types.h
M source/blender/makesdna/intern/dna_defaults.c
M source/blender/makesdna/intern/makesdna.c
M source/blender/makesrna/RNA_access.h
M source/blender/makesrna/intern/rna_ID.c
M source/blender/makesrna/intern/rna_gpencil_modifier.c
M source/blender/makesrna/intern/rna_nodetree.c
M source/blender/makesrna/intern/rna_sequencer_api.c
M source/blender/makesrna/intern/rna_userdef.c
M source/blender/makesrna/intern/rna_wm.c
M source/blender/makesrna/intern/rna_wm_api.c
M source/blender/makesrna/intern/rna_wm_gizmo.c
M source/blender/modifiers/intern/MOD_array.c
M source/blender/modifiers/intern/MOD_bevel.c
M source/blender/modifiers/intern/MOD_boolean.cc
M source/blender/modifiers/intern/MOD_build.c
M source/blender/modifiers/intern/MOD_decimate.c
M source/blender/modifiers/intern/MOD_edgesplit.c
M source/blender/modifiers/intern/MOD_mask.cc
M source/blender/modifiers/intern/MOD_mirror.c
M source/blender/modifiers/intern/MOD_nodes.cc
M source/blender/modifiers/intern/MOD_normal_edit.c
M source/blender/modifiers/intern/MOD_ocean.c
M source/blender/modifiers/intern/MOD_particleinstance.c
M source/blender/modifiers/intern/MOD_remesh.c
M source/blender/modifiers/intern/MOD_screw.c
M source/blender/modifiers/intern/MOD_skin.c
M source/blender/modifiers/intern/MOD_solidify_extrude.c
M source/blender/modifiers/intern/MOD_solidify_nonmanifold.c
M source/blender/modifiers/intern/MOD_triangulate.c
M source/blender/modifiers/intern/MOD_util.c
M source/blender/modifiers/intern/MOD_weld.c
M source/blender/modifiers/intern/MOD_wireframe.c
M source/blender/nodes/CMakeLists.txt
M source/blender/nodes/NOD_geometry.h
M source/blender/nodes/NOD_geometry_exec.hh
M source/blender/nodes/NOD_multi_function.hh
M source/blender/nodes/NOD_node_declaration.hh
M source/blender/nodes/NOD_socket_declarations.hh
M source/blender/nodes/NOD_static_types.h
M source/blender/nodes/composite/nodes/node_composite_denoise.c
A source/blender/nodes/geometry/nodes/legacy/node_geo_material_assign.cc
R086 source/blender/nodes/geometry/nodes/node_geo_select_by_material.cc source/blender/nodes/geometry/nodes/legacy/node_geo_select_by_material.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_remove.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_vector_rotate.cc
M source/blender/nodes/geometry/nodes/node_geo_boolean.cc
M source/blender/nodes/geometry/nodes/node_geo_collection_info.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_primitive_spiral.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc
M source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
M source/blender/nodes/geometry/nodes/node_geo_input_index.cc
M source/blender/nodes/geometry/nodes/node_geo_input_normal.cc
M source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
M source/blender/nodes/geometry/nodes/node_geo_material_assign.cc
A source/blender/nodes/geometry/nodes/node_geo_material_selection.cc
M source/blender/nodes/geometry/nodes/node_geo_object_info.cc
M source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
M source/blender/nodes/geometry/nodes/node_geo_set_position.cc
M source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc
M source/blender/nodes/geometry/nodes/node_geo_transform.cc
M source/blender/nodes/intern/node_declaration.cc
M source/blender/nodes/intern/node_socket.cc
M source/blender/nodes/intern/node_socket_declarations.cc
M source/blender/python/generic/idprop_py_api.c
M source/blender/render/intern/render_result.c
M source/blender/sequencer/SEQ_add.h
M source/blender/sequencer/intern/strip_add.c
M source/blender/windowmanager/WM_api.h
M source/blender/windowmanager/WM_types.h
M source/blender/windowmanager/gizmo/WM_gizmo_types.h
M source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
M source/blender/windowmanager/intern/wm.c
M source/blender/windowmanager/intern/wm_cursors.c
M source/blender/windowmanager/intern/wm_event_system.c
M source/blender/windowmanager/intern/wm_files.c
M source/blender/windowmanager/intern/wm_files_link.c
M source/blender/windowmanager/intern/wm_gesture_ops.c
M source/blender/windowmanager/intern/wm_keymap.c
M source/blender/windowmanager/intern/wm_window.c
M source/blender/windowmanager/wm_cursors.h
M tests/python/CMakeLists.txt
M tests/python/bl_blendfile_liblink.py
===================================================================
diff --git a/doc/python_api/examples/aud.py b/doc/python_api/examples/aud.py
index a52258c1a45..0eb27647671 100644
--- a/doc/python_api/examples/aud.py
+++ b/doc/python_api/examples/aud.py
@@ -14,7 +14,7 @@ sound = aud.Sound('music.ogg')
# play the audio, this return a handle to control play/pause
handle = device.play(sound)
# if the audio is not too big and will be used often you can buffer it
-sound_buffered = aud.Sound.buffer(sound)
+sound_buffered = aud.Sound.cache(sound)
handle_buffered = device.play(sound_buffered)
# stop the sounds (otherwise they play until their ends)
diff --git a/doc/python_api/requirements.txt b/doc/python_api/requirements.txt
index b5a9d15bf7b..51440046430 100644
--- a/doc/python_api/requirements.txt
+++ b/doc/python_api/requirements.txt
@@ -10,4 +10,4 @@ requests==2.26.0
# Only needed to match the theme used for the official documentation.
# Without this theme, the default theme will be used.
-sphinx_rtd_theme==1.0.0rc1
+sphinx_rtd_theme==1.0.0
diff --git a/extern/audaspace/CMakeLists.txt b/extern/audaspace/CMakeLists.txt
index 1599c03cbad..552ff749512 100644
--- a/extern/audaspace/CMakeLists.txt
+++ b/extern/audaspace/CMakeLists.txt
@@ -152,6 +152,7 @@ set(PUBLIC_HDR
include/devices/ThreadedDevice.h
include/Exception.h
include/file/File.h
+ include/file/FileInfo.h
include/file/FileManager.h
include/file/FileWriter.h
include/file/IFileInput.h
@@ -960,7 +961,10 @@ endif()
if(BUILD_DEMOS)
include_directories(${INCLUDE})
- set(DEMOS audaplay audaconvert audaremap signalgen randsounds dynamicmusic playbackmanager)
+ set(DEMOS audainfo audaplay audaconvert audaremap signalgen randsounds dynamicmusic playbackmanager)
+
+ add_executable(audainfo demos/audainfo.cpp)
+ target_link_libraries(audainfo audaspace)
add_executable(audaplay demos/audaplay.cpp)
target_link_libraries(audaplay audaspace)
diff --git a/extern/audaspace/bindings/C/AUD_PlaybackManager.h b/extern/audaspace/bindings/C/AUD_PlaybackManager.h
index 0fa8171599d..a2f5134602a 100644
--- a/extern/audaspace/bindings/C/AUD_PlaybackManager.h
+++ b/extern/audaspace/bindings/C/AUD_PlaybackManager.h
@@ -39,7 +39,7 @@ extern AUD_API void AUD_PlaybackManager_free(AUD_PlaybackManager* manager);
* Plays a sound through the playback manager, adding it into a category.
* \param manager The PlaybackManager object.
* \param sound The sound to be played.
-* \param catKey The key of the category into which the sound will be added. If it doesn't exist a new one will be creatd.
+* \param catKey The key of the category into which the sound will be added. If it doesn't exist a new one will be created.
*/
extern AUD_API void AUD_PlaybackManager_play(AUD_PlaybackManager* manager, AUD_Sound* sound, unsigned int catKey);
diff --git a/extern/audaspace/bindings/C/AUD_Sound.cpp b/extern/audaspace/bindings/C/AUD_Sound.cpp
index 8c99ce2341f..aa246b9a047 100644
--- a/extern/audaspace/bindings/C/AUD_Sound.cpp
+++ b/extern/audaspace/bindings/C/AUD_Sound.cpp
@@ -94,6 +94,36 @@ AUD_API int AUD_Sound_getLength(AUD_Sound* sound)
return (*sound)->createReader()->getLength();
}
+AUD_API int AUD_Sound_getFileStreams(AUD_Sound* sound, AUD_StreamInfo **stream_infos)
+{
+ assert(sound);
+
+ std::shared_ptr<File> file = std::dynamic_pointer_cast<File>(*sound);
+
+ if(file)
+ {
+ auto streams = file->queryStreams();
+
+ size_t size = sizeof(AUD_StreamInfo) * streams.size();
+
+ if(!size)
+ {
+ *stream_infos = nullptr;
+ return 0;
+ }
+
+ *stream_infos = reinterpret_cast<AUD_StreamInfo*>(std::malloc(size));
+ std::memcpy(*stream_infos, streams.data(), size);
+
+ return streams.size();
+ }
+ else
+ {
+ *stream_infos = nullptr;
+ return 0;
+ }
+}
+
AUD_API sample_t* AUD_Sound_data(AUD_Sound* sound, int* length, AUD_Specs* specs)
{
assert(sound);
@@ -252,6 +282,12 @@ AUD_API AUD_Sound* AUD_Sound_bufferFile(unsigned char* buffer, int size)
return new AUD_Sound(new File(buffer, size));
}
+AUD_API AUD_Sound* AUD_Sound_bufferFileStream(unsigned char* buffer, int size, int stream)
+{
+ assert(buffer);
+ return new AUD_Sound(new File(buffer, size, stream));
+}
+
AUD_API AUD_Sound* AUD_Sound_cache(AUD_Sound* sound)
{
assert(sound);
@@ -272,6 +308,12 @@ AUD_API AUD_Sound* AUD_Sound_file(const char* filename)
return new AUD_Sound(new File(filename));
}
+AUD_API AUD_Sound* AUD_Sound_fileStream(const char* filename, int stream)
+{
+ assert(filename);
+ return new AUD_Sound(new File(filename, stream));
+}
+
AUD_API AUD_Sound* AUD_Sound_sawtooth(float frequency, AUD_SampleRate rate)
{
return new AUD_Sound(new Sawtooth(frequency, rate));
diff --git a/extern/audaspace/bindings/C/AUD_Sound.h b/extern/audaspace/bindings/C/AUD_Sound.h
index 53172616781..fc73a31e15c 100644
--- a/extern/audaspace/bindings/C/AUD_Sound.h
+++ b/extern/audaspace/bindings/C/AUD_Sound.h
@@ -36,7 +36,15 @@ extern AUD_API AUD_Specs AUD_Sound_getSpecs(AUD_Sound* sound);
* \return The length of the sound in samples.
* \note This function creates a reader from the sound and deletes it again.
*/
-extern AUD_API int AUD_getLength(AUD_Sound* sound);
+extern AUD_API int AUD_Sound_getLength(AUD_Sound* sound);
+
+/**
+ * Retrieves the stream infos of a sound file.
+ * \param sound The sound to retrieve from which must be a file sound.
+ * \param infos A pointer to a AUD_StreamInfo array that will be allocated and must afterwards be freed by the caller.
+ * \return The number of items in the infos array.
+ */
+extern AUD_API int AUD_Sound_getFileStreams(AUD_Sound* sound, AUD_StreamInfo** stream_infos);
/**
* Reads a sound's samples into memory.
@@ -89,6 +97,15 @@ extern AUD_API AUD_Sound* AUD_Sound_buffer(sample_t* data, int length, AUD_Specs
*/
extern AUD_API AUD_Sound* AUD_Sound_bufferFile(unsigned char* buffer, int size);
+/**
+ * Loads a sound file from a memory buffer.
+ * \param buffer The buffer which contains the sound file.
+ * \param size The size of the buffer.
+ * \param stream The index of the audio stream within the file if it contains multiple audio streams.
+ * \return A handle of the sound file.
+ */
+extern AUD_API AUD_Sound* AUD_Sound_bufferFileStream(unsigned char* buffer, int size, int stream);
+
/**
* Caches a sound into a memory buffer.
* \param sound The sound to cache.
@@ -103,6 +120,14 @@ extern AUD_API AUD_Sound* AUD_Sound_cache(AUD_Sound* sound);
*/
extern AUD_API AUD_Sound* AUD_Sound_file(const char* filename);
+/**
+ * Loads a sound file.
+ * \param filename The filename of the sound file.
+ * \param stream The index of the audio stream within the file if it contains multiple audio streams.
+ * \return A handle of the sound file.
+ */
+extern AUD_API AUD_Sound* AUD_Sound_fileStream(const char* filename, int stream);
+
/**
* Creates a sawtooth sound.
* \param frequency The frequency of the generated sawtooth sound.
diff --git a/extern/audaspace/bindings/C/AUD_Special.cpp b/extern/audaspace/bindings/C/AUD_Special.cpp
index 5cc33525d1d..1ce25dcd41c 100644
--- a/extern/audaspace/bindings/C/AUD_Special.cpp
+++ b/extern/audaspace/bindings/C/AUD_Special.cpp
@@ -86,7 +86,6 @@ AUD_API AUD_SoundInfo AUD_getInfo(AUD_Sound* sound)
info.specs.channels = AUD_CHANNELS_INVALID;
info.specs.rate = AUD_RATE_INVALID;
info.length = 0.0f;
- info.start_offset = 0.0f;
try
{
@@ -96,7 +95,6 @@ AUD_API AUD_SoundInfo AUD_getInfo(AUD_Sound* sound)
{
info.specs = convSpecToC(reader->getSpecs());
info.length = reader->getLength() / (float) info.specs.rate;
- info.start_offset = reader->getStartOffset();
}
}
catch(Exception&)
@@ -109,7 +107,7 @@ AUD_API AUD_SoundInfo AUD_getInfo(AUD_Sound* sound)
AUD_API float* AUD_readSoundBuffer(const char* filename, float low, float high,
float attack, float release, float threshold,
int accumulate, int additive, int square,
- float sthreshold, double samplerate, int* length)
+ float sthreshold, double samplerate, int* length, int stream)
{
Buffer buffer;
DeviceSpecs specs;
@@ -117,7 +115,7 @@ AUD_API float* AUD_readSoundBuffer(const char* filename, float low, float high,
specs.rate = (SampleRate)samplerate;
std::shared_ptr<ISound> sound;
- std::shared_ptr<ISound> file = std::shared_ptr<ISound>(new File(filename));
+ std::shared_ptr<ISound> file = std::shared_ptr<ISound>(new File(filename, stream));
int position = 0;
@@ -247,7 +245,7 @@ AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, int sampl
buffer[i * 3] = min;
buffer[i * 3 + 1] = max;
- buffer[i * 3 + 2] = sqrt(power / len); // RMS
+ buffer[i * 3 + 2] = std::sqrt(power / len);
if(overallmax < max)
overallmax = max;
diff --git a/extern/audaspace/bindings/C/AUD_Special.h b/extern/audaspace/bindings/C/AUD_Special.h
index ce51fa2e04e..2f5d13c6fd9 100644
--- a/extern/audaspace/bindings/C/AUD_Special.h
+++ b/extern/audaspace/bindings/C/AUD_Special.h
@@ -37,7 +37,7 @@ extern AUD_API float* AUD_readSoundBuffer(const char* filename, float low, float
float attack, float release, float threshold,
int accumulate, int additive, int square,
float sthreshold, double samplerate,
- int* length);
+ int* length, int stream);
/**
* Pauses a playing sound after a specific amount of time.
diff --git a/extern/audaspace/bindings/C/AUD_Types.h b/extern/audaspace/bindings/C/AUD_Types.h
index c6a96d30d3f..0f95366bc27 100644
--- a/extern/audaspace/bindings/C/AUD_Types.h
+++ b/extern/audaspace/bindings/C/AUD_Types.h
@@ -176,5 +176,17 @@ typedef struct
{
AUD_Specs specs;
float length;
- double start_offset;
} AUD_SoundInfo;
+
+/// Specification of a sound source.
+typedef struct
+{
+ /// Start time in seconds.
+ double start;
+
+ /// Duration in seconds. May be estimated or 0 if unknown.
+ double duration;
+
+ /// Audio data parameters.
+ AUD_DeviceSpecs specs;
+} AUD_StreamInfo;
diff --git a/extern/audaspace/bindings/python/PySound.cpp b/extern/audaspace/bindings/python/PySound.cpp
index 33628307249..2236057e7d2 100644
--- a/extern/audaspace/bindings/python/PySound.cpp
+++ b/extern/audaspace/bindings/python/PySound.cpp
@@ -89,10 +89,11 @@ Sound_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
self
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list