diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-18 16:28:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-18 16:28:03 +0300 |
commit | 50544ea6457fb1a05eedd184251e33956deab03f (patch) | |
tree | f1f6b67651c4a20dfb4b78e5fbd1ee4895f97642 /source/blender | |
parent | c836b0ae18cc49e5078420b58a70afee44727937 (diff) |
- sequence strips without scenes would crash on display
- appending scenes would not append the sound and scene ID's for sequence strips
- reload button in sequence header now reloads sounds as well.
- redrawing the sequence image view didnt work while plaing (unless play was activated from that region)
- generic functions for running a callback on sequence strips recursively. seqbase_recursive_apply() and seq_recursive_apply()
- bind marker with camera was set to home key, use Ctrl+B instead.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 74 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 11 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 3 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 4 |
7 files changed, 80 insertions, 26 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 7c74dd5b3d3..c078b92af2d 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -137,6 +137,10 @@ struct SeqEffectHandle { /* sequence.c */ void printf_strip(struct Sequence *seq); +/* apply functions recursively */ +void seqbase_recursive_apply(struct ListBase *seqbase, int (*apply_func)(struct Sequence *seq, void *), void *arg); +void seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence *, void *), void *arg); + // extern void seq_free_sequence(struct Scene *scene, struct Sequence *seq); void seq_free_strip(struct Strip *strip); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index c92640e295e..84458b0e921 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -87,6 +87,20 @@ void printf_strip(Sequence *seq) fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), seq_tx_get_final_right(seq, 0)); } +void seqbase_recursive_apply(ListBase *seqbase, int (*apply_func)(Sequence *seq, void *), void *arg) +{ + Sequence *iseq; + for(iseq= seqbase->first; iseq; iseq= iseq->next) { + seq_recursive_apply(iseq, apply_func, arg); + } +} + +void seq_recursive_apply(Sequence *seq, int (*apply_func)(Sequence *, void *), void *arg) +{ + if(apply_func(seq, arg) && seq->seqbase.first) + seqbase_recursive_apply(&seq->seqbase, apply_func, arg); +} + /* ********************************************************************** alloc / free functions ********************************************************************** */ @@ -252,7 +266,7 @@ void seq_free_editing(Scene *scene) { Editing *ed = scene->ed; MetaStack *ms; - Sequence *seq, *nseq; + Sequence *seq; if(ed==NULL) return; @@ -689,28 +703,22 @@ void sort_seq(Scene *scene) } -void clear_scene_in_allseqs(Scene *sce) +static int clear_scene_in_allseqs_cb(Sequence *seq, void *arg_pt) { - Scene *sce1; - Editing *ed; - Sequence *seq; - - /* when a scene is deleted: test all seqs */ - - sce1= G.main->scene.first; - while(sce1) { - if(sce1!=sce && sce1->ed) { - ed= sce1->ed; - - SEQ_BEGIN(ed, seq) { + if(seq->scene==(Scene *)arg_pt) + seq->scene= NULL; + return 1; +} - if(seq->scene==sce) seq->scene= 0; +void clear_scene_in_allseqs(Scene *scene) +{ + Scene *scene_iter; - } - SEQ_END + /* when a scene is deleted: test all seqs */ + for(scene_iter= G.main->scene.first; scene_iter; scene_iter= scene_iter->id.next) { + if(scene_iter != scene && scene_iter->ed) { + seqbase_recursive_apply(&scene_iter->ed->seqbase, clear_scene_in_allseqs_cb, scene); } - - sce1= sce1->id.next; } } @@ -2033,9 +2041,14 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int Render *re; RenderResult rres; char scenename[64]; - int have_seq= (sce->r.scemode & R_DOSEQ) && sce->ed && sce->ed->seqbase.first; - int sce_valid =sce && (sce->camera || have_seq); - + int have_seq= FALSE; + int sce_valid= FALSE; + + if(sce) { + have_seq= (sce->r.scemode & R_DOSEQ) && sce->ed && sce->ed->seqbase.first; + sce_valid= (sce->camera || have_seq); + } + if (se->ibuf == NULL && sce_valid && !build_proxy_run) { se->ibuf = seq_proxy_fetch(scene, seq, cfra, render_size); if (se->ibuf) { @@ -3217,6 +3230,23 @@ static void free_imbuf_seq_with_ipo(Scene *scene, struct Ipo *ipo) } #endif +static int seq_sound_reload_cb(Sequence *seq, void *arg_pt) +{ + if (seq->type==SEQ_SOUND && seq->sound) { + Scene *scene= (Scene *)arg_pt; + if(seq->sound_handle) + sound_delete_handle(scene, seq->sound_handle); + + seq->sound_handle = sound_new_handle(scene, seq->sound, seq->start, seq->start + seq->strip->len, 0); + return 0; + } + return 1; /* recurse meta's */ +} +void seqbase_sound_reload(Scene *scene, ListBase *seqbase) +{ + seqbase_recursive_apply(seqbase, seq_sound_reload_cb, (void *)scene); +} + /* seq funcs's for transforming internally notice the difference between start/end and left/right. diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f2621a1b449..9548db3278a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4232,6 +4232,7 @@ static void lib_link_scene(FileData *fd, Main *main) 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->sound) { + seq->sound_handle= NULL; if(seq->type == SEQ_HD_SOUND) seq->type = SEQ_SOUND; else @@ -11281,6 +11282,16 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) if(sce->gpd) expand_doit(fd, mainvar, sce->gpd); + if(sce->ed) { + Sequence *seq; + + SEQ_BEGIN(sce->ed, seq) { + if(seq->scene) expand_doit(fd, mainvar, seq->scene); + if(seq->sound) expand_doit(fd, mainvar, seq->sound); + } + SEQ_END + } + #ifdef DURIAN_CAMERA_SWITCH { TimeMarker *marker; diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 0d519c87a97..4cc3a8d343f 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1062,7 +1062,6 @@ void ED_marker_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MARKER_OT_move", GKEY, KM_PRESS, 0, 0); #ifdef DURIAN_CAMERA_SWITCH - WM_keymap_add_item(keymap, "MARKER_OT_camera_bind", HOMEKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "MARKER_OT_camera_bind", BKEY, KM_PRESS, KM_CTRL, 0); #endif - } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 977d04a7f45..55a977da663 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2332,6 +2332,14 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws) if(spacetype==SPACE_TIME) return 1; } + else if (regiontype==RGN_TYPE_PREVIEW) { + switch (spacetype) { + case SPACE_SEQ: + if(redraws & (TIME_SEQ|TIME_ALL_ANIM_WIN)) + return 1; + break; + } + } return 0; } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 0a12ea2e202..6704cf0ef62 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1672,6 +1672,8 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *op) free_imbuf_seq(scene, &ed->seqbase, FALSE); + seqbase_sound_reload(scene, &ed->seqbase); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); return OPERATOR_FINISHED; diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index c1ca156c9bf..767da5dc042 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -235,9 +235,9 @@ static int rna_Sequence_name_length(PointerRNA *ptr) static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) { Scene *scene= (Scene*)ptr->id.data; - Editing *ed= seq_give_editing(scene, FALSE); +// Editing *ed= seq_give_editing(scene, FALSE); Sequence *seq= (Sequence*)ptr->data; - Sequence *iseq; +// Sequence *iseq; BLI_strncpy(seq->name+2, value, sizeof(seq->name)-2); seqUniqueName(&scene->ed->seqbase, seq); |