[Bf-blender-cvs] [3cb3167278a] master: Simplify sound property handling

Richard Antalik noreply at git.blender.org
Tue Mar 8 13:22:44 CET 2022


Commit: 3cb3167278a7f9d488b66a7fc591aea8288408e9
Author: Richard Antalik
Date:   Tue Mar 8 13:15:41 2022 +0100
Branches: master
https://developer.blender.org/rB3cb3167278a7f9d488b66a7fc591aea8288408e9

Simplify sound property handling

Sound properties like volume, pitch and muting are handled in
`BKE_sound_add_scene_sound()`. This is unnecessary, because in
properties are then set to real values in `SEQ_edit_update_muting()` and
`seq_update_seq_cb()`.

Alternatively, it may be better to remove all other updates leave them
in `BKE_sound_add_scene_sound()`. But I want to add muting per channel,
whhich is easier and probably cleaner to do with function
`SEQ_edit_update_muting()`.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D14269

===================================================================

M	source/blender/blenkernel/intern/sound.c

===================================================================

diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index fd9735ff07f..8b72fd05057 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -727,16 +727,11 @@ void *BKE_sound_add_scene_sound(
   }
   sound_verify_evaluated_id(&sequence->sound->id);
   const double fps = FPS;
-  void *handle = AUD_Sequence_add(scene->sound_scene,
-                                  sequence->sound->playback_handle,
-                                  startframe / fps,
-                                  endframe / fps,
-                                  frameskip / fps + sequence->sound->offset_time);
-  AUD_SequenceEntry_setMuted(handle, (sequence->flag & SEQ_MUTE) != 0);
-  AUD_SequenceEntry_setAnimationData(handle, AUD_AP_VOLUME, CFRA, &sequence->volume, 0);
-  AUD_SequenceEntry_setAnimationData(handle, AUD_AP_PITCH, CFRA, &sequence->pitch, 0);
-  AUD_SequenceEntry_setAnimationData(handle, AUD_AP_PANNING, CFRA, &sequence->pan, 0);
-  return handle;
+  return AUD_Sequence_add(scene->sound_scene,
+                          sequence->sound->playback_handle,
+                          startframe / fps,
+                          endframe / fps,
+                          frameskip / fps + sequence->sound->offset_time);
 }
 
 void *BKE_sound_add_scene_sound_defaults(Scene *scene, Sequence *sequence)



More information about the Bf-blender-cvs mailing list