diff options
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 8a705ef49dd..eb4a1601187 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -43,9 +43,10 @@ #include "BKE_lib_id.h" #include "BKE_main.h" #include "BKE_report.h" -#include "BKE_sequencer.h" #include "BKE_sound.h" +#include "SEQ_sequencer.h" + #include "WM_api.h" #include "WM_types.h" @@ -97,11 +98,11 @@ EnumPropertyItem sequencer_prop_effect_types[] = { #define SEQ_SIDE_MOUSE -1 EnumPropertyItem prop_side_types[] = { - {SEQ_SIDE_MOUSE, "MOUSE", 0, "Mouse position", ""}, + {SEQ_SIDE_MOUSE, "MOUSE", 0, "Mouse Position", ""}, {SEQ_SIDE_LEFT, "LEFT", 0, "Left", ""}, {SEQ_SIDE_RIGHT, "RIGHT", 0, "Right", ""}, {SEQ_SIDE_BOTH, "BOTH", 0, "Both", ""}, - {SEQ_SIDE_NO_CHANGE, "NO_CHANGE", 0, "No change", ""}, + {SEQ_SIDE_NO_CHANGE, "NO_CHANGE", 0, "No Change", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -153,7 +154,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog for (link = pj->queue.first; link; link = link->next) { struct SeqIndexBuildContext *context = link->data; - BKE_sequencer_proxy_rebuild(context, stop, do_update, progress); + SEQ_proxy_rebuild(context, stop, do_update, progress); if (*stop) { pj->stop = 1; @@ -170,7 +171,7 @@ static void proxy_endjob(void *pjv) LinkData *link; for (link = pj->queue.first; link; link = link->next) { - BKE_sequencer_proxy_rebuild_finish(link->data, pj->stop); + SEQ_proxy_rebuild_finish(link->data, pj->stop); } BKE_sequencer_free_imbuf(pj->scene, &ed->seqbase, false); @@ -233,7 +234,7 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports) continue; } - bool success = BKE_sequencer_proxy_rebuild_context( + bool success = SEQ_proxy_rebuild_context( pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue); if (!success && (seq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) != 0) { @@ -588,7 +589,7 @@ int seq_effect_find_selected(Scene *scene, *r_error_str = N_("Cannot apply effects to audio sequence strips"); return 0; } - if ((seq != activeseq) && (seq != seq2)) { + if (!ELEM(seq, activeseq, seq2)) { if (seq2 == NULL) { seq2 = seq; } @@ -984,21 +985,21 @@ static bool split_seq_list( return (seq_first_new != NULL); } -static bool sequence_offset_after_frame(Scene *scene, const int delta, const int cfra) +static bool sequence_offset_after_frame(Scene *scene, const int delta, const int timeline_frame) { Sequence *seq; Editing *ed = BKE_sequencer_editing_get(scene, false); bool done = false; TimeMarker *marker; - /* All strips >= cfra are shifted. */ + /* All strips >= timeline_frame are shifted. */ if (ed == NULL) { return 0; } for (seq = ed->seqbasep->first; seq; seq = seq->next) { - if (seq->startdisp >= cfra) { + if (seq->startdisp >= timeline_frame) { BKE_sequence_translate(scene, seq, delta); BKE_sequence_calc(scene, seq); BKE_sequence_invalidate_cache_preprocessed(scene, seq); @@ -1008,7 +1009,7 @@ static bool sequence_offset_after_frame(Scene *scene, const int delta, const int if (!scene->toolsettings->lock_markers) { for (marker = scene->markers.first; marker; marker = marker->next) { - if (marker->frame >= cfra) { + if (marker->frame >= timeline_frame) { marker->frame += delta; } } @@ -1094,7 +1095,7 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); rctf rectf; - int cfra, efra, sfra; + int timeline_frame, efra, sfra; bool first = false, done; bool do_all = RNA_boolean_get(op->ptr, "all"); @@ -1104,24 +1105,24 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op) efra = (int)rectf.xmax; /* Check if the current frame has a gap already. */ - for (cfra = CFRA; cfra >= sfra; cfra--) { - if (BKE_sequencer_evaluate_frame(scene, cfra)) { + for (timeline_frame = CFRA; timeline_frame >= sfra; timeline_frame--) { + if (SEQ_render_evaluate_frame(scene, timeline_frame)) { first = true; break; } } - for (; cfra < efra; cfra++) { + for (; timeline_frame < efra; timeline_frame++) { /* There's still no strip to remove a gap for. */ if (first == false) { - if (BKE_sequencer_evaluate_frame(scene, cfra)) { + if (SEQ_render_evaluate_frame(scene, timeline_frame)) { first = true; } } - else if (BKE_sequencer_evaluate_frame(scene, cfra) == 0) { + else if (SEQ_render_evaluate_frame(scene, timeline_frame) == 0) { done = true; - while (BKE_sequencer_evaluate_frame(scene, cfra) == 0) { - done = sequence_offset_after_frame(scene, -1, cfra); + while (SEQ_render_evaluate_frame(scene, timeline_frame) == 0) { + done = sequence_offset_after_frame(scene, -1, timeline_frame); if (done == false) { break; } @@ -2658,7 +2659,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) Sequence *seq, *seq_new; Strip *strip_new; StripElem *se, *se_new; - int start_ofs, cfra, frame_end; + int start_ofs, timeline_frame, frame_end; int step = RNA_int_get(op->ptr, "length"); seq = ed->seqbasep->first; /* Poll checks this is valid. */ @@ -2675,12 +2676,12 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) /* if (seq->ipo) id_us_min(&seq->ipo->id); */ /* XXX, remove fcurve and assign to split image strips */ - start_ofs = cfra = BKE_sequence_tx_get_final_left(seq, false); + start_ofs = timeline_frame = BKE_sequence_tx_get_final_left(seq, false); frame_end = BKE_sequence_tx_get_final_right(seq, false); - while (cfra < frame_end) { + while (timeline_frame < frame_end) { /* New seq. */ - se = BKE_sequencer_give_stripelem(seq, cfra); + se = SEQ_render_give_stripelem(seq, timeline_frame); seq_new = BKE_sequence_dupli_recursive( scene, scene, ed->seqbasep, seq, SEQ_DUPE_UNIQUE_NAME); @@ -2712,7 +2713,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) /* XXX, COPY FCURVES */ - cfra++; + timeline_frame++; start_ofs += step; } @@ -3018,11 +3019,12 @@ static bool strip_jump_internal(Scene *scene, const bool do_center) { bool changed = false; - int cfra = CFRA; - int nfra = BKE_sequencer_find_next_prev_edit(scene, cfra, side, do_skip_mute, do_center, false); + int timeline_frame = CFRA; + int next_frame = BKE_sequencer_find_next_prev_edit( + scene, timeline_frame, side, do_skip_mute, do_center, false); - if (nfra != cfra) { - CFRA = nfra; + if (next_frame != timeline_frame) { + CFRA = next_frame; changed = true; } @@ -3220,7 +3222,7 @@ static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op)) if (active_seq->strip) { switch (active_seq->type) { case SEQ_TYPE_IMAGE: - se = BKE_sequencer_give_stripelem(active_seq, scene->r.cfra); + se = SEQ_render_give_stripelem(active_seq, scene->r.cfra); break; case SEQ_TYPE_MOVIE: se = active_seq->strip->stripdata; @@ -3504,12 +3506,12 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) short stop = 0, do_update; float progress; - BKE_sequencer_proxy_rebuild_context(bmain, depsgraph, scene, seq, file_list, &queue); + SEQ_proxy_rebuild_context(bmain, depsgraph, scene, seq, file_list, &queue); for (link = queue.first; link; link = link->next) { struct SeqIndexBuildContext *context = link->data; - BKE_sequencer_proxy_rebuild(context, &stop, &do_update, &progress); - BKE_sequencer_proxy_rebuild_finish(context, 0); + SEQ_proxy_rebuild(context, &stop, &do_update, &progress); + SEQ_proxy_rebuild_finish(context, 0); } BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); } @@ -3568,7 +3570,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) SEQ_CURRENT_BEGIN (ed, seq) { if ((seq->flag & SELECT)) { if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_META)) { - BKE_sequencer_proxy_set(seq, turnon); + SEQ_proxy_set(seq, turnon); if (seq->strip->proxy == NULL) { continue; } @@ -3787,7 +3789,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) Sequence *seq = BKE_sequencer_active_get(scene); const bool is_relative_path = RNA_boolean_get(op->ptr, "relative_path"); const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders"); - int minframe, numdigits; + int minext_frameme, numdigits; if (seq->type == SEQ_TYPE_IMAGE) { char directory[FILE_MAX]; @@ -3796,7 +3798,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) /* Need to find min/max frame for placeholders. */ if (use_placeholders) { - len = sequencer_image_seq_get_minmax_frame(op, seq->sfra, &minframe, &numdigits); + len = sequencer_image_seq_get_minmax_frame(op, seq->sfra, &minext_frameme, &numdigits); } else { len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); @@ -3820,7 +3822,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) seq->strip->stripdata = se = MEM_callocN(len * sizeof(StripElem), "stripelem"); if (use_placeholders) { - sequencer_image_seq_reserve_frames(op, se, len, minframe, numdigits); + sequencer_image_seq_reserve_frames(op, se, len, minext_frameme, numdigits); } else { RNA_BEGIN (op->ptr, itemptr, "files") { @@ -3918,7 +3920,7 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot) WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILEPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_boolean(ot->srna, "use_placeholders", false, @@ -4063,7 +4065,7 @@ void SEQUENCER_OT_export_subtitles(struct wmOperatorType *ot) FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); } /** \} */ |