From 70500121b457d1bb7ce6aeab39eb3c4c30a6ffe3 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 21 Aug 2020 18:55:27 +0200 Subject: Cleanup: rename iterators over sequences to be more clear about what they do. No functional changes expected. --- .../editors/space_sequencer/sequencer_select.c | 70 +++++++++++++--------- 1 file changed, 42 insertions(+), 28 deletions(-) (limited to 'source/blender/editors/space_sequencer/sequencer_select.c') diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 85b70354ab3..66430d55ea4 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -415,14 +415,15 @@ static int sequencer_select_exec(bContext *C, wmOperator *op) const float x = UI_view2d_region_to_view_x(v2d, mval[0]); - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (((x < CFRA) && (seq->enddisp <= CFRA)) || ((x >= CFRA) && (seq->startdisp >= CFRA))) { /* Select left or right. */ seq->flag |= SELECT; recurs_sel_seq(seq); } } - SEQ_END; + SEQ_CURRENT_END; { SpaceSeq *sseq = CTX_wm_space_seq(C); @@ -975,7 +976,8 @@ static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op) ED_sequencer_deselect_all(scene); } const int cfra = CFRA; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { bool test = false; switch (side) { case -1: @@ -994,7 +996,7 @@ static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op) recurs_sel_seq(seq); } } - SEQ_END; + SEQ_CURRENT_END; ED_outliner_select_sync_from_sequence_tag(C); @@ -1282,13 +1284,14 @@ static bool select_grouped_type(Editing *ed, Sequence *actseq, const int channel Sequence *seq; bool changed = false; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == actseq->type) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; return changed; } @@ -1299,13 +1302,14 @@ static bool select_grouped_type_basic(Editing *ed, Sequence *actseq, const int c bool changed = false; const bool is_sound = SEQ_IS_SOUND(actseq); - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && (is_sound ? SEQ_IS_SOUND(seq) : !SEQ_IS_SOUND(seq))) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; return changed; } @@ -1316,14 +1320,15 @@ static bool select_grouped_type_effect(Editing *ed, Sequence *actseq, const int bool changed = false; const bool is_effect = SEQ_IS_EFFECT(actseq); - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && (is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq))) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; return changed; } @@ -1339,45 +1344,49 @@ static bool select_grouped_data(Editing *ed, Sequence *actseq, const int channel } if (SEQ_HAS_PATH(actseq) && dir) { - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && SEQ_HAS_PATH(seq) && seq->strip && STREQ(seq->strip->dir, dir)) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; } else if (actseq->type == SEQ_TYPE_SCENE) { Scene *sce = actseq->scene; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_SCENE && seq->scene == sce) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; } else if (actseq->type == SEQ_TYPE_MOVIECLIP) { MovieClip *clip = actseq->clip; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MOVIECLIP && seq->clip == clip) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; } else if (actseq->type == SEQ_TYPE_MASK) { struct Mask *mask = actseq->mask; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MASK && seq->mask == mask) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; } return changed; @@ -1394,15 +1403,17 @@ static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int chann effects[i] = false; } - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && (seq->type & SEQ_TYPE_EFFECT) && ELEM(actseq, seq->seq1, seq->seq2, seq->seq3)) { effects[seq->type] = true; } } - SEQ_END; + SEQ_CURRENT_END; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (SEQ_CHANNEL_CHECK(seq, channel) && effects[seq->type]) { if (seq->seq1) { seq->seq1->flag |= SELECT; @@ -1416,7 +1427,7 @@ static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int chann changed = true; } } - SEQ_END; + SEQ_CURRENT_END; return changed; } @@ -1426,13 +1437,14 @@ static bool select_grouped_time_overlap(Editing *ed, Sequence *actseq) Sequence *seq; bool changed = false; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { if (seq->startdisp < actseq->enddisp && seq->enddisp > actseq->startdisp) { seq->flag |= SELECT; changed = true; } } - SEQ_END; + SEQ_CURRENT_END; return changed; } @@ -1447,10 +1459,11 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int int machine = actseq->machine; SeqIterator iter; - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { seq->tmp = NULL; } - SEQ_END; + SEQ_CURRENT_END; actseq->tmp = POINTER_FROM_INT(true); @@ -1523,11 +1536,12 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op) bool changed = false; if (!extend) { - SEQP_BEGIN (ed, seq) { + SEQ_CURRENT_BEGIN(ed, seq) + { seq->flag &= ~SELECT; changed = true; } - SEQ_END; + SEQ_CURRENT_END; } switch (type) { -- cgit v1.2.3