Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 42d44ee2e37..f1452d001bc 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -669,6 +669,7 @@ const EnumPropertyItem rna_enum_transform_orientation_items[] = {
# include "BKE_pointcache.h"
# include "BKE_scene.h"
# include "BKE_mesh.h"
+# include "BKE_sound.h"
# include "BKE_screen.h"
# include "BKE_sequencer.h"
# include "BKE_animsys.h"
@@ -814,17 +815,22 @@ static void rna_Scene_camera_update(Main *bmain, Scene *UNUSED(scene_unused), Po
static void rna_Scene_fps_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_FPS | ID_RECALC_SEQUENCER_STRIPS);
+ BKE_sound_update_fps(scene);
+ BKE_sequencer_update_sound_bounds_all(scene);
}
static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_LISTENER);
+ BKE_sound_update_scene_listener(scene);
}
-static void rna_Scene_volume_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
+static void rna_Scene_volume_set(PointerRNA *ptr, float value)
{
- DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_VOLUME);
+ Scene *scene = (Scene *)(ptr->data);
+
+ scene->audio.volume = value;
+ if (scene->sound_scene)
+ BKE_sound_set_scene_volume(scene, value);
}
static const char *rna_Scene_statistics_string_get(Scene *scene,
@@ -950,12 +956,10 @@ static void rna_Scene_show_subframe_update(Main *UNUSED(bmain),
scene->r.subframe = 0.0f;
}
-static void rna_Scene_frame_update(Main *UNUSED(bmain),
- Scene *UNUSED(current_scene),
- PointerRNA *ptr)
+static void rna_Scene_frame_update(Main *bmain, Scene *UNUSED(current_scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->id.data;
- DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_SEEK);
+ BKE_sound_seek_scene(bmain, scene);
WM_main_add_notifier(NC_SCENE | ND_FRAME, scene);
}
@@ -1786,11 +1790,8 @@ static void rna_Scene_use_audio_set(PointerRNA *ptr, bool value)
scene->audio.flag |= AUDIO_MUTE;
else
scene->audio.flag &= ~AUDIO_MUTE;
-}
-static void rna_Scene_use_audio_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
-{
- DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_MUTE);
+ BKE_sound_mute_scene(scene, value);
}
static int rna_Scene_sync_mode_get(PointerRNA *ptr)
@@ -7518,7 +7519,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
RNA_def_property_ui_text(
prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted");
- RNA_def_property_update(prop, NC_SCENE, "rna_Scene_use_audio_update");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
# if 0 /* XXX: Is this actually needed? */
prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
@@ -7565,7 +7566,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Volume", "Audio volume");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND);
RNA_def_property_update(prop, NC_SCENE, NULL);
- RNA_def_property_update(prop, NC_SCENE, "rna_Scene_volume_update");
+ RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL);
/* Statistics */
func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get");