"Fix" aka implementation of [#21548] Audio doesn't work when adding scenes with audio...
authorJoerg Mueller <nexyon@gmail.com>
Sat, 20 Mar 2010 11:15:16 +0000 (11:15 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Sat, 20 Mar 2010 11:15:16 +0000 (11:15 +0000)
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_edit.c

index fa035d62d6298ab67ebbe0f3681b49f8431ab0b8..b89767d25862c79eebb2dbc172a16e5a5adfd766 100644 (file)
@@ -72,6 +72,8 @@ void sound_create_scene(struct Scene *scene);
 
 void sound_destroy_scene(struct Scene *scene);
 
+void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
+
 void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
 
 void sound_remove_scene_sound(struct Scene *scene, void* handle);
index 42586ce18d774bdf0682b0b4a1eae60f58f5b0c9..424ca162bb4f83659a1f9650ea4285a9422c4966 100644 (file)
@@ -3698,7 +3698,7 @@ static void seq_update_muting_recursive(Scene *scene, ListBase *seqbasep, Sequen
 
                        seq_update_muting_recursive(scene, &seq->seqbase, metaseq, seqmute);
                }
-               else if(seq->type == SEQ_SOUND) {
+               else if((seq->type == SEQ_SOUND) || (seq->type == SEQ_SCENE)) {
                        if(seq->scene_sound) {
                                sound_mute_scene_sound(scene, seq->scene_sound, seqmute);
                        }
index 9d189237ba016af02847a9b9c09823de9a4d6473..2f0cb318ca043f782fad0d19ec6ddce26c6cd9ea 100644 (file)
@@ -349,6 +349,11 @@ void sound_destroy_scene(struct Scene *scene)
                AUD_destroySequencer(scene->sound_scene);
 }
 
+void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
+{
+       return AUD_addSequencer(scene->sound_scene, &(sequence->scene->sound_scene), startframe / FPS, endframe / FPS, frameskip / FPS, sequence);
+}
+
 void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
 {
        return AUD_addSequencer(scene->sound_scene, &(sequence->sound->playback_handle), startframe / FPS, endframe / FPS, frameskip / FPS, sequence);
index cc8686c89ba79acad1dce0784ac9bb44fdda828c..747920e68cea90849132bc5e9f0eb1ba293454ed 100644 (file)
@@ -4143,7 +4143,10 @@ static void lib_link_scene(FileData *fd, Main *main)
 
                        SEQ_BEGIN(sce->ed, seq) {
                                if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
-                               if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
+                               if(seq->scene) {
+                                       seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
+                                       seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs);
+                               }
                                if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
                                if(seq->sound) {
                                        seq->scene_sound = NULL;
index a138866956a8f205d357d275d7999d6ab9aadb6b..439fd6c13d1f54ae91cad77118e55e87c7dcf162 100644 (file)
@@ -215,6 +215,8 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
        else
                strcpy(seq->name+2, sce_seq->id.name+2);
        
+       seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0);
+
        calc_sequence_disp(scene, seq);
        sort_seq(scene);
        
index 1cc2a935a3251059769ce657bc9e757559975c13..dfc78eedf2af4cc5d84c9a4cc461519592ee174c 100644 (file)
@@ -828,6 +828,8 @@ static Sequence *dupli_seq(struct Scene *scene, Sequence *seq)
                /* - recurs_dupli_seq(&seq->seqbase,&seqn->seqbase);*/
        } else if(seq->type == SEQ_SCENE) {
                seqn->strip->stripdata = 0;
+               if(seq->scene_sound)
+                       seqn->scene_sound = sound_scene_add_scene_sound(scene, seqn, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
        } else if(seq->type == SEQ_MOVIE) {
                seqn->strip->stripdata = 
                                MEM_dupallocN(seq->strip->stripdata);