From 3cb3167278a7f9d488b66a7fc591aea8288408e9 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Tue, 8 Mar 2022 13:15:41 +0100 Subject: 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 --- source/blender/blenkernel/intern/sound.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to '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) -- cgit v1.2.3