diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-07 12:30:00 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-07 12:50:38 +0300 |
commit | 2b9965122e132a2c25652ebf62d6353183f0f644 (patch) | |
tree | 776af5327831e6e680e7e911e5ee16114a665740 /source/blender/makesrna | |
parent | 90a9ff44083e29b4a9f557a6e039099a7115f5db (diff) |
Sound: Revert all the recent changes to sound
This happened to be a bigger rabbit hole to hell than it originally seemed,
and there are higher priority design tasks to be handled (at this point high
priority design task is more important than high priority bug fix).
After talking to Brecht the decision was made to revert to the known isolated
issue, which will allow everyone in the studio work same as prior to last
Friday.
The remaining bits will be worked on after all the design tasks are out of
the way.
This commit reverts:
4cdb4b9532c Fix T64161: Crashing using undo and multiple windows
064273a4ae7 Sound: Port more cases to be a part of dependency graph
2e582f8ab53 Sound: Fix access wrong dependency graph
5fc49d9c915 Sound: add stubs to build without audaspace
c68c81a870b Sound: Make sure spin lock is initialized for new sound datablocks
c02534469ac Sound: Delay creating sound scene handle for until is needed
9f681bea68f Fix T64144: Crash when displaying audio waveforms in VSE
2f79286453e Cleanup: unused vars
bed8ad6f95a Fix crash in background rendering after recent sound changes
773691310f9 Fix T64143: Crash when scrubbing in the graph editor
888852055c1 Sound: Fix for being unable to jump to a frame during playback with A/V sync
6ab7b384645 Sound: More fixes for access of original scene
35db1195455 Sound: Fix access original scene during playback
211c4fd2e9a Depsgraph: Make comment about evaluation more obvious
c5fe16e121e Sound: Make sound handles only be in evaluated datablocks
b4e1e0946bf Depsgraph: Preserve sound and audio pointers through copy-on-write
4eedf784b04 Depsgraph: Store original sequencer strip pointer
6990ef151c1 Sound: Move evaluation to dependency graph
d02da8de23b Sound: Delay opening handlers for until really needed
3369b828916 Depsgraph: Add scene audio component
e8f10d64757 Depsgraph: Tag sequencer for update on changes
6e4b7a6e4d9 Depsgraph: Initial work to cover sequencer
17447ac5a6b Depsgraph: Make sound ID part of the graph
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 29 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 43 |
2 files changed, 50 insertions, 22 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"); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index ca4ab07fc58..0b1e35e3a74 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -75,8 +75,6 @@ const EnumPropertyItem rna_enum_sequence_modifier_type_items[] = { # include "WM_api.h" -# include "DEG_depsgraph.h" - # include "IMB_imbuf.h" typedef struct SequenceSearchData { @@ -693,9 +691,34 @@ static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr) return strlen(path); } -static void rna_Sequence_audio_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +static void rna_Sequence_volume_set(PointerRNA *ptr, float value) { - DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); + Sequence *seq = (Sequence *)(ptr->data); + + seq->volume = value; + if (seq->scene_sound) + BKE_sound_set_scene_sound_volume( + seq->scene_sound, value, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0); +} + +static void rna_Sequence_pitch_set(PointerRNA *ptr, float value) +{ + Sequence *seq = (Sequence *)(ptr->data); + + seq->pitch = value; + if (seq->scene_sound) + BKE_sound_set_scene_sound_pitch( + seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0); +} + +static void rna_Sequence_pan_set(PointerRNA *ptr, float value) +{ + Sequence *seq = (Sequence *)(ptr->data); + + seq->pan = value; + if (seq->scene_sound) + BKE_sound_set_scene_sound_pan( + seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0); } static int rna_Sequence_input_count_get(PointerRNA *ptr) @@ -739,8 +762,9 @@ static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), static void rna_Sequence_mute_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->id.data; + Editing *ed = BKE_sequencer_editing_get(scene, false); - DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); + BKE_sequencer_update_muting(ed); rna_Sequence_update(bmain, scene, ptr); } @@ -2310,20 +2334,23 @@ static void rna_def_sound(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND); - RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update"); + RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pitch"); RNA_def_property_range(prop, 0.1f, 10.0f); RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND); - RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update"); + RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); prop = RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pan"); RNA_def_property_range(prop, -2.0f, 2.0f); RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)"); - RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update"); + RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); prop = RNA_def_property(srna, "show_waveform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM); |