Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_sequencer / sequencer_edit.c
index a4834ca..cc0f352 100644 (file)
@@ -130,7 +130,7 @@ typedef struct TransSeq {
 typedef struct ProxyBuildJob {
        struct Main *main;
        struct Depsgraph *depsgraph;
-       Scene *scene; 
+       Scene *scene;
        ListBase queue;
        int stop;
 } ProxyJob;
@@ -154,7 +154,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
                struct SeqIndexBuildContext *context = link->data;
 
                BKE_sequencer_proxy_rebuild(context, stop, do_update, progress);
-               
+
                if (*stop) {
                        pj->stop = 1;
                        fprintf(stderr,  "Canceling proxy rebuild on users request...\n");
@@ -188,7 +188,7 @@ static void seq_proxy_build_job(const bContext *C)
        ScrArea *sa = CTX_wm_area(C);
        Sequence *seq;
        GSet *file_list;
-       
+
        if (ed == NULL) {
                return;
        }
@@ -200,7 +200,7 @@ static void seq_proxy_build_job(const bContext *C)
 
        if (!pj) {
                pj = MEM_callocN(sizeof(ProxyJob), "proxy rebuild job");
-       
+
                pj->depsgraph = depsgraph;
                pj->scene = scene;
                pj->main = CTX_data_main(C);
@@ -220,7 +220,7 @@ static void seq_proxy_build_job(const bContext *C)
        SEQ_END
 
        BLI_gset_free(file_list, MEM_freeN);
-       
+
        if (!WM_jobs_is_running(wm_job)) {
                G.is_break = false;
                WM_jobs_start(CTX_wm_manager(C), wm_job);
@@ -247,7 +247,7 @@ void boundbox_seq(Scene *scene, rctf *rect)
        Editing *ed = BKE_sequencer_editing_get(scene, false);
        float min[2], max[2];
 
-       
+
        if (ed == NULL) return;
 
        min[0] = 0.0;
@@ -276,18 +276,18 @@ static int mouse_frame_side(View2D *v2d, short mouse_x, int frame)
 {
        int mval[2];
        float mouseloc[2];
-       
+
        mval[0] = mouse_x;
        mval[1] = 0;
-       
+
        /* choose the side based on which side of the playhead the mouse is on */
        UI_view2d_region_to_view(v2d, mval[0], mval[1], &mouseloc[0], &mouseloc[1]);
-       
+
        return mouseloc[0] > frame ? SEQ_SIDE_RIGHT : SEQ_SIDE_LEFT;
 }
 
 
-Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int sel) 
+Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int sel)
 {
        /* sel - 0==unselected, 1==selected, -1==done care*/
        Sequence *seq;
@@ -296,7 +296,7 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
        if (ed == NULL) return NULL;
 
        if (sel > 0) sel = SELECT;
-       
+
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
                if ((seq != test) &&
                    (test->machine == seq->machine) &&
@@ -319,16 +319,16 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
        return NULL;
 }
 
-static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, int sel) 
+static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, int sel)
 {
        /* sel - 0==unselected, 1==selected, -1==done care*/
        Sequence *seq, *best_seq = NULL;
        Editing *ed = BKE_sequencer_editing_get(scene, false);
-       
+
        int dist, best_dist;
        best_dist = MAXFRAME * 2;
 
-       
+
        if (ed == NULL) return NULL;
 
        seq = ed->seqbasep->first;
@@ -339,7 +339,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
                    ((sel == -1) || (sel == (seq->flag & SELECT))))
                {
                        dist = MAXFRAME * 2;
-                       
+
                        switch (lr) {
                                case SEQ_SIDE_LEFT:
                                        if (seq->enddisp <= test->startdisp) {
@@ -352,7 +352,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
                                        }
                                        break;
                        }
-                       
+
                        if (dist == 0) {
                                best_seq = seq;
                                break;
@@ -378,15 +378,15 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
        float displen;
        *hand = SEQ_SIDE_NONE;
 
-       
+
        if (ed == NULL) return NULL;
-       
+
        pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask);
 
        UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
-       
+
        seq = ed->seqbasep->first;
-       
+
        while (seq) {
                if (seq->machine == (int)y) {
                        /* check for both normal strips, and strips that have been flipped horizontally */
@@ -394,23 +394,23 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
                            ((seq->startdisp > seq->enddisp) && (seq->startdisp >= x && seq->enddisp <= x)) )
                        {
                                if (BKE_sequence_tx_test(seq)) {
-                                       
+
                                        /* clamp handles to defined size in pixel space */
-                                       
+
                                        handsize = seq->handsize;
                                        displen = (float)abs(seq->startdisp - seq->enddisp);
-                                       
+
                                        if (displen / pixelx > 16) { /* don't even try to grab the handles of small strips */
                                                /* Set the max value to handle to 1/3 of the total len when its less than 28.
                                                 * This is important because otherwise selecting handles happens even when you click in the middle */
-                                               
+
                                                if ((displen / 3) < 30 * pixelx) {
                                                        handsize = displen / 3;
                                                }
                                                else {
                                                        CLAMP(handsize, 7 * pixelx, 30 * pixelx);
                                                }
-                                               
+
                                                if (handsize + seq->startdisp >= x)
                                                        *hand = SEQ_SIDE_LEFT;
                                                else if (-handsize + seq->enddisp <= x)
@@ -448,7 +448,7 @@ void ED_sequencer_deselect_all(Scene *scene)
        Sequence *seq;
        Editing *ed = BKE_sequencer_editing_get(scene, false);
 
-       
+
        if (ed == NULL) return;
 
        SEQP_BEGIN (ed, seq)
@@ -456,7 +456,7 @@ void ED_sequencer_deselect_all(Scene *scene)
                seq->flag &= ~SEQ_ALLSEL;
        }
        SEQ_END
-               
+
 }
 
 void recurs_sel_seq(Sequence *seqm)
@@ -521,7 +521,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
 {
        Editing *ed = BKE_sequencer_editing_get(scene, false);
        Sequence *seq1 = NULL, *seq2 = NULL, *seq3 = NULL, *seq;
-       
+
        *error_str = NULL;
 
        if (!activeseq)
@@ -552,7 +552,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
                seq2 = seq3;
                seq3 = tmp;
        }
-       
+
 
        switch (BKE_sequence_effect_get_num_inputs(type)) {
                case 0:
@@ -574,12 +574,12 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
                        if (seq3 == NULL) seq3 = seq2;
                        break;
        }
-       
+
        if (seq1 == NULL && seq2 == NULL && seq3 == NULL) {
                *error_str = N_("TODO: in what cases does this happen?");
                return 0;
        }
-       
+
        *selseq1 = seq1;
        *selseq2 = seq2;
        *selseq3 = seq3;
@@ -691,7 +691,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
 
        /* First Strip! */
        /* strips with extended stillfames before */
-       
+
        /* Precaution, needed because the length saved on-disk may not match the length saved in the blend file,
         * or our code may have minor differences reading file length between versions.
         * This causes hard-cut to fail, see: T47862 */
@@ -733,7 +733,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
                        skip_dup = true;
                }
        }
-       
+
        BKE_sequence_reload_new_file(scene, seq, false);
        BKE_sequence_calc(scene, seq);
 
@@ -741,7 +741,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
                /* Duplicate AFTER the first change */
                seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
        }
-       
+
        if (seqn) {
                seqn->flag |= SELECT;
 
@@ -843,14 +843,14 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
                        skip_dup = true;
                }
        }
-       
+
        BKE_sequence_calc(scene, seq);
 
        if (!skip_dup) {
                /* Duplicate AFTER the first change */
                seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
        }
-       
+
        if (seqn) {
                seqn->flag |= SELECT;
 
@@ -904,14 +904,14 @@ static bool cut_seq_list(Scene *scene, ListBase *slist, int cutframe,
 {
        Sequence *seq, *seq_next_iter;
        Sequence *seq_first_new = NULL;
-       
+
        seq = slist->first;
 
        while (seq && seq != seq_first_new) {
                seq_next_iter = seq->next; /* we need this because we may remove seq */
                seq->tmp = NULL;
                if (seq->flag & SELECT) {
-                       if (cutframe > seq->startdisp && 
+                       if (cutframe > seq->startdisp &&
                            cutframe < seq->enddisp)
                        {
                                Sequence *seqn = cut_seq(scene, seq, cutframe);
@@ -949,7 +949,7 @@ static bool sequence_offset_after_frame(Scene *scene, const int delta, const int
        TimeMarker *marker;
 
        /* all strips >= cfra are shifted */
-       
+
        if (ed == NULL) return 0;
 
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -977,7 +977,7 @@ static void set_filter_seq(Scene *scene)
        Sequence *seq;
        Editing *ed = BKE_sequencer_editing_get(scene, false);
 
-       
+
        if (ed == NULL) return;
 
        if (okee("Set Deinterlace") == 0) return;
@@ -1002,32 +1002,32 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene)
        Sequence *seq, *last_seq = BKE_sequencer_active_get(scene);
        Editing *ed = BKE_sequencer_editing_get(scene, false);
        char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX];
-       
-       
+
+
        if (last_seq == NULL)
                return;
-       
+
        BLI_strncpy(from, last_seq->strip->dir, sizeof(from));
 // XXX if (0 == sbutton(from, 0, sizeof(from) - 1, "From: "))
 //             return;
-       
+
        BLI_strncpy(to, from, sizeof(to));
 // XXX if (0 == sbutton(to, 0, sizeof(to) - 1, "To: "))
 //             return;
-       
+
        if (STREQ(to, from))
                return;
-       
+
        SEQP_BEGIN (ed, seq)
        {
                if (seq->flag & SELECT) {
                        if (STREQLEN(seq->strip->dir, from, strlen(from))) {
                                printf("found %s\n", seq->strip->dir);
-                               
+
                                /* strip off the beginning */
                                stripped[0] = 0;
                                BLI_strncpy(stripped, seq->strip->dir + strlen(from), FILE_MAX);
-                               
+
                                /* new path */
                                BLI_snprintf(seq->strip->dir, sizeof(seq->strip->dir), "%s%s", to, stripped);
                                printf("new %s\n", seq->strip->dir);
@@ -1035,7 +1035,7 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene)
                }
        }
        SEQ_END
-               
+
 }
 
 
@@ -1051,7 +1051,7 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op)
        boundbox_seq(scene, &rectf);
        sfra = (int)rectf.xmin;
        efra = (int)rectf.xmax;
-       
+
        /* first check if the current frame has a gap already */
        for (cfra = CFRA; cfra >= sfra; cfra--) {
                if (BKE_sequencer_evaluate_frame(scene, cfra)) {
@@ -1076,7 +1076,7 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op)
        }
 
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-       
+
        return OPERATOR_FINISHED;
 
 }
@@ -1088,15 +1088,15 @@ void SEQUENCER_OT_gap_remove(struct wmOperatorType *ot)
        ot->name = "Remove Gaps";
        ot->idname = "SEQUENCER_OT_gap_remove";
        ot->description = "Remove gap at current frame to first strip at the right, independent of selection or locked state of strips";
-       
+
        /* api callbacks */
 //     ot->invoke = sequencer_snap_invoke;
        ot->exec = sequencer_gap_remove_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        RNA_def_boolean(ot->srna, "all", 0, "All Gaps", "Do all gaps to right of current frame");
 }
 
@@ -1104,13 +1104,13 @@ static int sequencer_gap_insert_exec(bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
        int frames = RNA_int_get(op->ptr, "frames");
-       
+
        sequence_offset_after_frame(scene, frames, CFRA);
-       
+
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-       
+
        return OPERATOR_FINISHED;
-       
+
 }
 
 void SEQUENCER_OT_gap_insert(struct wmOperatorType *ot)
@@ -1119,15 +1119,15 @@ void SEQUENCER_OT_gap_insert(struct wmOperatorType *ot)
        ot->name = "Insert Gaps";
        ot->idname = "SEQUENCER_OT_gap_insert";
        ot->description = "Insert gap at current frame to first strips at the right, independent of selection or locked state of strips";
-       
+
        /* api callbacks */
        //      ot->invoke = sequencer_snap_invoke;
        ot->exec = sequencer_gap_insert_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        RNA_def_int(ot->srna, "frames", 10, 0, INT_MAX, "Frames", "Frames to insert after current strip", 0, 1000);
 }
 
@@ -1139,7 +1139,7 @@ static int seq_get_snaplimit(View2D *v2d)
         * a bit lazy but its only done once pre transform */
        float xmouse, ymouse, x;
        int mval[2] = {24, 0}; /* 24 screen px snap */
-       
+
        UI_view2d_region_to_view(v2d, mval[0], mval[1], &xmouse, &ymouse);
        x = xmouse;
        mval[0] = 0;
@@ -1192,7 +1192,7 @@ int sequencer_view_strips_poll(bContext *C)
 static int sequencer_snap_exec(bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
-       
+
        Editing *ed = BKE_sequencer_editing_get(scene, false);
        Sequence *seq;
        int snap_frame;
@@ -1234,31 +1234,31 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
                        }
                }
                else if (seq->type & SEQ_TYPE_EFFECT) {
-                       if (seq->seq1 && (seq->seq1->flag & SELECT)) 
+                       if (seq->seq1 && (seq->seq1->flag & SELECT))
                                BKE_sequence_calc(scene, seq);
-                       else if (seq->seq2 && (seq->seq2->flag & SELECT)) 
+                       else if (seq->seq2 && (seq->seq2->flag & SELECT))
                                BKE_sequence_calc(scene, seq);
-                       else if (seq->seq3 && (seq->seq3->flag & SELECT)) 
+                       else if (seq->seq3 && (seq->seq3->flag & SELECT))
                                BKE_sequence_calc(scene, seq);
                }
        }
 
        /* as last: */
        BKE_sequencer_sort(scene);
-       
+
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-       
+
        return OPERATOR_FINISHED;
 }
 
 static int sequencer_snap_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 {
        Scene *scene = CTX_data_scene(C);
-       
+
        int snap_frame;
-       
+
        snap_frame = CFRA;
-       
+
        RNA_int_set(op->ptr, "frame", snap_frame);
        return sequencer_snap_exec(C, op);
 }
@@ -1269,15 +1269,15 @@ void SEQUENCER_OT_snap(struct wmOperatorType *ot)
        ot->name = "Snap Strips to Frame";
        ot->idname = "SEQUENCER_OT_snap";
        ot->description = "Frame where selected strips will be snapped";
-       
+
        /* api callbacks */
        ot->invoke = sequencer_snap_invoke;
        ot->exec = sequencer_snap_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be snapped", INT_MIN, INT_MAX);
 }
 
@@ -1708,7 +1708,7 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op)
        bool selected;
 
        selected = !RNA_boolean_get(op->ptr, "unselected");
-       
+
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
                if ((seq->flag & SEQ_LOCK) == 0) {
                        if (selected) { /* mute unselected */
@@ -1725,10 +1725,10 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op)
                        }
                }
        }
-       
+
        BKE_sequencer_update_muting(ed);
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -1738,14 +1738,14 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot)
        ot->name = "Mute Strips";
        ot->idname = "SEQUENCER_OT_mute";
        ot->description = "Mute (un)selected strips";
-       
+
        /* api callbacks */
        ot->exec = sequencer_mute_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips");
 }
 
@@ -1759,7 +1759,7 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op)
        bool selected;
 
        selected = !RNA_boolean_get(op->ptr, "unselected");
-       
+
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
                if ((seq->flag & SEQ_LOCK) == 0) {
                        if (selected) { /* unmute unselected */
@@ -1776,10 +1776,10 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op)
                        }
                }
        }
-       
+
        BKE_sequencer_update_muting(ed);
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -1789,14 +1789,14 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot)
        ot->name = "Un-Mute Strips";
        ot->idname = "SEQUENCER_OT_unmute";
        ot->description = "Unmute (un)selected strips";
-       
+
        /* api callbacks */
        ot->exec = sequencer_unmute_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Unmute unselected rather than selected strips");
 }
 
@@ -1825,11 +1825,11 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot)
        ot->name = "Lock Strips";
        ot->idname = "SEQUENCER_OT_lock";
        ot->description = "Lock the active strip so that it can't be transformed";
-       
+
        /* api callbacks */
        ot->exec = sequencer_lock_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -1858,11 +1858,11 @@ void SEQUENCER_OT_unlock(struct wmOperatorType *ot)
        ot->name = "UnLock Strips";
        ot->idname = "SEQUENCER_OT_unlock";
        ot->description = "Unlock the active strip so that it can't be transformed";
-       
+
        /* api callbacks */
        ot->exec = sequencer_unlock_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -1900,11 +1900,11 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot)
        ot->name = "Reload Strips";
        ot->idname = "SEQUENCER_OT_reload";
        ot->description = "Reload strips in the sequencer";
-       
+
        /* api callbacks */
        ot->exec = sequencer_reload_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER; /* no undo, the data changed is stored outside 'main' */
 
@@ -1940,7 +1940,7 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot)
        ot->name = "Refresh Sequencer";
        ot->idname = "SEQUENCER_OT_refresh_all";
        ot->description = "Refresh the sequencer editor";
-       
+
        /* api callbacks */
        ot->exec = sequencer_refresh_all_exec;
        ot->poll = sequencer_refresh_all_poll;
@@ -2061,14 +2061,14 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
        cut_frame = RNA_int_get(op->ptr, "frame");
        cut_hard = RNA_enum_get(op->ptr, "type");
        cut_side = RNA_enum_get(op->ptr, "side");
-       
+
        if (cut_hard == SEQ_CUT_HARD) {
                changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_hard);
        }
        else {
                changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_soft);
        }
-       
+
        if (changed) { /* got new strips ? */
                Sequence *seq;
 
@@ -2121,7 +2121,7 @@ static int sequencer_cut_invoke(bContext *C, wmOperator *op, const wmEvent *even
 
        if (ED_operator_sequencer_active(C) && v2d)
                cut_side = mouse_frame_side(v2d, event->mval[0], cut_frame);
-       
+
        RNA_int_set(op->ptr, "frame", cut_frame);
        RNA_enum_set(op->ptr, "side", cut_side);
        /*RNA_enum_set(op->ptr, "type", cut_hard); */ /*This type is set from the key shortcut */
@@ -2136,15 +2136,15 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot)
        ot->name = "Cut Strips";
        ot->idname = "SEQUENCER_OT_cut";
        ot->description = "Cut the selected strips";
-       
+
        /* api callbacks */
        ot->invoke = sequencer_cut_invoke;
        ot->exec = sequencer_cut_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be cut", INT_MIN, INT_MAX);
        RNA_def_enum(ot->srna, "type", prop_cut_types, SEQ_CUT_SOFT, "Type", "The type of cut operation to perform on strips");
        RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side that remains selected after cutting");
@@ -2196,14 +2196,14 @@ void SEQUENCER_OT_duplicate(wmOperatorType *ot)
        ot->name = "Duplicate Strips";
        ot->idname = "SEQUENCER_OT_duplicate";
        ot->description = "Duplicate the selected strips";
-       
+
        /* api callbacks */
        ot->exec = sequencer_add_duplicate_exec;
        ot->poll = ED_operator_sequencer_active;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        /* to give to transform */
        RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", "");
 }
@@ -2264,7 +2264,7 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
        }
 
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -2290,12 +2290,12 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
        ot->name = "Erase Strips";
        ot->idname = "SEQUENCER_OT_delete";
        ot->description = "Erase selected strips from the sequencer";
-       
+
        /* api callbacks */
        ot->invoke = sequencer_delete_invoke;
        ot->exec = sequencer_delete_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -2358,7 +2358,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
        Editing *ed = BKE_sequencer_editing_get(scene, false);
-       
+
        Sequence *seq, *seq_new;
        Strip *strip_new;
        StripElem *se, *se_new;
@@ -2428,7 +2428,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
 
        /* as last: */
        BKE_sequencer_sort(scene);
-       
+
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
 
        return OPERATOR_FINISHED;
@@ -2441,12 +2441,12 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot)
        ot->name = "Separate Images";
        ot->idname = "SEQUENCER_OT_images_separate";
        ot->description = "On image sequence strips, it returns a strip for each image";
-       
+
        /* api callbacks */
        ot->exec = sequencer_separate_images_exec;
        ot->invoke = WM_operator_props_popup_confirm;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
@@ -2532,11 +2532,11 @@ void SEQUENCER_OT_meta_toggle(wmOperatorType *ot)
        ot->name = "Toggle Meta Strip";
        ot->idname = "SEQUENCER_OT_meta_toggle";
        ot->description = "Toggle a metastrip (to edit enclosed strips)";
-       
+
        /* api callbacks */
        ot->exec = sequencer_meta_toggle_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -2547,7 +2547,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
        Editing *ed = BKE_sequencer_editing_get(scene, false);
-       
+
        Sequence *seq, *seqm, *next, *last_seq = BKE_sequencer_active_get(scene);
        int channel_max = 1;
 
@@ -2579,7 +2579,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
 
        seqm->strip = MEM_callocN(sizeof(Strip), "metastrip");
        seqm->strip->us = 1;
-       
+
        BKE_sequencer_active_set(scene, seqm);
 
        if (BKE_sequence_test_overlap(ed->seqbasep, seqm) ) BKE_sequence_base_shuffle(ed->seqbasep, seqm, scene);
@@ -2599,11 +2599,11 @@ void SEQUENCER_OT_meta_make(wmOperatorType *ot)
        ot->name = "Make Meta Strip";
        ot->idname = "SEQUENCER_OT_meta_make";
        ot->description = "Group selected strips into a metastrip";
-       
+
        /* api callbacks */
        ot->exec = sequencer_meta_make_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -2672,11 +2672,11 @@ void SEQUENCER_OT_meta_separate(wmOperatorType *ot)
        ot->name = "UnMeta Strip";
        ot->idname = "SEQUENCER_OT_meta_separate";
        ot->description = "Put the contents of a metastrip back in the sequencer";
-       
+
        /* api callbacks */
        ot->exec = sequencer_meta_separate_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -2698,11 +2698,11 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot)
        ot->name = "View All";
        ot->idname = "SEQUENCER_OT_view_all";
        ot->description = "View all the strips in the sequencer";
-       
+
        /* api callbacks */
        ot->exec = sequencer_view_all_exec;
        ot->poll = ED_operator_sequencer_active;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER;
 }
@@ -2711,7 +2711,7 @@ static int sequencer_view_frame_exec(bContext *C, wmOperator *op)
 {
        const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
        ANIM_center_frame(C, smooth_viewtx);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -2721,11 +2721,11 @@ void SEQUENCER_OT_view_frame(wmOperatorType *ot)
        ot->name = "View Frame";
        ot->idname = "SEQUENCER_OT_view_frame";
        ot->description = "Reset viewable area to show range around current frame";
-       
+
        /* api callbacks */
        ot->exec = sequencer_view_frame_exec;
        ot->poll = ED_operator_sequencer_active;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -2745,7 +2745,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
        v2d->cur = v2d->tot;
        UI_view2d_curRect_validate(v2d);
        UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY);
-       
+
 #if 0
        /* Like zooming on an image view */
        float zoomX, zoomY;
@@ -2787,11 +2787,11 @@ void SEQUENCER_OT_view_all_preview(wmOperatorType *ot)
        ot->name = "View All";
        ot->idname = "SEQUENCER_OT_view_all_preview";
        ot->description = "Zoom preview to fit in the area";
-       
+
        /* api callbacks */
        ot->exec = sequencer_view_all_preview_exec;
        ot->poll = ED_operator_sequencer_active;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER;
 }
@@ -2862,11 +2862,11 @@ void SEQUENCER_OT_view_toggle(wmOperatorType *ot)
        ot->name = "View Toggle";
        ot->idname = "SEQUENCER_OT_view_toggle";
        ot->description = "Toggle between sequencer views (sequence, preview, both)";
-       
+
        /* api callbacks */
        ot->exec = sequencer_view_toggle_exec;
        ot->poll = ED_operator_sequencer_active;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER;
 }
@@ -2907,7 +2907,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *op)
 
        if (ymax != 0) {
                const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
-               
+
                xmax += xmargin;
                xmin -= xmargin;
                ymax += ymargin;
@@ -2936,7 +2936,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *op)
        else {
                return OPERATOR_CANCELLED;
        }
-       
+
 }
 
 void SEQUENCER_OT_view_selected(wmOperatorType *ot)
@@ -2945,11 +2945,11 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot)
        ot->name = "View Selected";
        ot->idname = "SEQUENCER_OT_view_selected";
        ot->description = "Zoom the sequencer on the selected strips";
-       
+
        /* api callbacks */
        ot->exec = sequencer_view_selected_exec;
        ot->poll = ED_operator_sequencer_active;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER;
 }
@@ -2961,7 +2961,7 @@ static bool strip_jump_internal(Scene *scene,
        bool changed = false;
        int cfra = CFRA;
        int nfra = BKE_sequencer_find_next_prev_edit(scene, cfra, side, do_skip_mute, do_center, false);
-       
+
        if (nfra != cfra) {
                CFRA = nfra;
                changed = true;
@@ -2992,7 +2992,7 @@ static int sequencer_strip_jump_exec(bContext *C, wmOperator *op)
        }
 
        WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -3009,7 +3009,7 @@ void SEQUENCER_OT_strip_jump(wmOperatorType *ot)
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        /* properties */
        RNA_def_boolean(ot->srna, "next", true, "Next Strip", "");
        RNA_def_boolean(ot->srna, "center", true, "Use strip center", "");
@@ -3061,9 +3061,9 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
        if (active_seq == NULL) return OPERATOR_CANCELLED;
 
        seq = find_next_prev_sequence(scene, active_seq, side, -1);
-       
+
        if (seq) {
-               
+
                /* disallow effect strips */
                if (BKE_sequence_effect_get_num_inputs(seq->type) >= 1 && (seq->effectdata || seq->seq1 || seq->seq2 || seq->seq3))
                        return OPERATOR_CANCELLED;
@@ -3071,10 +3071,10 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
                        return OPERATOR_CANCELLED;
 
                switch (side) {
-                       case SEQ_SIDE_LEFT: 
+                       case SEQ_SIDE_LEFT:
                                swap_sequence(scene, seq, active_seq);
                                break;
-                       case SEQ_SIDE_RIGHT: 
+                       case SEQ_SIDE_RIGHT:
                                swap_sequence(scene, active_seq, seq);
                                break;
                }
@@ -3114,14 +3114,14 @@ void SEQUENCER_OT_swap(wmOperatorType *ot)
        ot->name = "Swap Strip";
        ot->idname = "SEQUENCER_OT_swap";
        ot->description = "Swap active strip with strip to the right or left";
-       
+
        /* api callbacks */
        ot->exec = sequencer_swap_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        /* properties */
        RNA_def_enum(ot->srna, "side", prop_side_lr_types, SEQ_SIDE_RIGHT, "Side", "Side of the strip to swap");
 }
@@ -3173,14 +3173,14 @@ void SEQUENCER_OT_rendersize(wmOperatorType *ot)
        ot->name = "Set Render Size";
        ot->idname = "SEQUENCER_OT_rendersize";
        ot->description = "Set render size and aspect from active sequence";
-       
+
        /* api callbacks */
        ot->exec = sequencer_rendersize_exec;
        ot->poll = sequencer_edit_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        /* properties */
 }
 
@@ -3464,13 +3464,13 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
        Editing *ed = BKE_sequencer_editing_get(scene, false);
        Sequence *seq;
        GSet *file_list;
-       
+
        if (ed == NULL) {
                return OPERATOR_CANCELLED;
        }
 
        file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
-       
+
        SEQP_BEGIN(ed, seq)
        {
                if ((seq->flag & SELECT)) {
@@ -3492,7 +3492,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
        SEQ_END
 
        BLI_gset_free(file_list, MEM_freeN);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -3502,11 +3502,11 @@ void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot)
        ot->name = "Rebuild Proxy and Timecode Indices";
        ot->idname = "SEQUENCER_OT_rebuild_proxy";
        ot->description = "Rebuild all selected proxies and timecode indices using the job system";
-       
+
        /* api callbacks */
        ot->invoke = sequencer_rebuild_proxy_invoke;
        ot->exec = sequencer_rebuild_proxy_exec;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER;
 }
@@ -3543,27 +3543,27 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
 
                                if (proxy_25)
                                        seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_25;
-                               else 
+                               else
                                        seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_25;
-                               
+
                                if (proxy_50)
                                        seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_50;
-                               else 
+                               else
                                        seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_50;
-                               
+
                                if (proxy_75)
                                        seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_75;
-                               else 
+                               else
                                        seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_75;
-                               
+
                                if (proxy_100)
                                        seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_100;
-                               else 
+                               else
                                        seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_100;
-                               
+
                                if (!overwrite)
                                        seq->strip->proxy->build_flags |= SEQ_PROXY_SKIP_EXISTING;
-                               else 
+                               else
                                        seq->strip->proxy->build_flags &= ~SEQ_PROXY_SKIP_EXISTING;
                        }
                }
@@ -3571,7 +3571,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
        SEQ_END
 
        WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -3581,14 +3581,14 @@ void SEQUENCER_OT_enable_proxies(wmOperatorType *ot)
        ot->name = "Set Selected Strip Proxies";
        ot->idname = "SEQUENCER_OT_enable_proxies";
        ot->description = "Enable selected proxies on all selected Movie strips";
-       
+
        /* api callbacks */
        ot->invoke = sequencer_enable_proxies_invoke;
        ot->exec = sequencer_enable_proxies_exec;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER;
-       
+
        RNA_def_boolean(ot->srna, "proxy_25", false, "25%", "");
        RNA_def_boolean(ot->srna, "proxy_50", false, "50%", "");
        RNA_def_boolean(ot->srna, "proxy_75", false, "75%", "");