diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 24 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/bpath.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 25 |
5 files changed, 39 insertions, 30 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index b6d901c8ef2..fd881175872 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -62,30 +62,34 @@ typedef struct SeqIterator { int valid; } SeqIterator; -void BKE_sequence_iterator_begin(struct Editing *ed, SeqIterator *iter, bool use_pointer); +void BKE_sequence_iterator_begin(struct Editing *ed, + SeqIterator *iter, + const bool use_current_sequences); void BKE_sequence_iterator_next(SeqIterator *iter); void BKE_sequence_iterator_end(SeqIterator *iter); -#define SEQP_BEGIN(_ed, _seq) \ - { \ - SeqIterator iter_macro; \ - for (BKE_sequence_iterator_begin(_ed, &iter_macro, true); iter_macro.valid; \ - BKE_sequence_iterator_next(&iter_macro)) { \ - _seq = iter_macro.seq; - -#define SEQ_BEGIN(ed, _seq) \ +#define SEQ_ALL_BEGIN(ed, _seq) \ { \ SeqIterator iter_macro; \ for (BKE_sequence_iterator_begin(ed, &iter_macro, false); iter_macro.valid; \ BKE_sequence_iterator_next(&iter_macro)) { \ _seq = iter_macro.seq; -#define SEQ_END \ +#define SEQ_ALL_END \ } \ BKE_sequence_iterator_end(&iter_macro); \ } \ ((void)0) +#define SEQ_CURRENT_BEGIN(_ed, _seq) \ + { \ + SeqIterator iter_macro; \ + for (BKE_sequence_iterator_begin(_ed, &iter_macro, true); iter_macro.valid; \ + BKE_sequence_iterator_next(&iter_macro)) { \ + _seq = iter_macro.seq; + +#define SEQ_CURRENT_END SEQ_ALL_END + typedef enum eSeqTaskId { SEQ_TASK_MAIN_RENDER, SEQ_TASK_PREFETCH_RENDER, diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c index 1833ad5a748..4ab8ea5a647 100644 --- a/source/blender/blenkernel/intern/bpath.c +++ b/source/blender/blenkernel/intern/bpath.c @@ -703,7 +703,7 @@ void BKE_bpath_traverse_id( if (scene->ed) { Sequence *seq; - SEQ_BEGIN (scene->ed, seq) { + SEQ_ALL_BEGIN (scene->ed, seq) { if (SEQ_HAS_PATH(seq)) { StripElem *se = seq->strip->stripdata; @@ -732,7 +732,7 @@ void BKE_bpath_traverse_id( } } } - SEQ_END; + SEQ_ALL_END; } break; } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 94a142600b6..968ce1d4a1c 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -2197,7 +2197,7 @@ void do_versions_ipos_to_animato(Main *bmain) AnimData *adt = BKE_animdata_add_id(id); - SEQ_BEGIN (ed, seq) { + SEQ_ALL_BEGIN (ed, seq) { IpoCurve *icu = (seq->ipo) ? seq->ipo->curve.first : NULL; short adrcode = SEQ_FAC1; @@ -2238,7 +2238,7 @@ void do_versions_ipos_to_animato(Main *bmain) id_us_min(&seq->ipo->id); seq->ipo = NULL; } - SEQ_END; + SEQ_ALL_END; } } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 01fcfc597aa..c5c721bc6a5 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -469,7 +469,7 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData *data) } if (scene->ed) { Sequence *seq; - SEQ_BEGIN (scene->ed, seq) { + SEQ_ALL_BEGIN (scene->ed, seq) { BKE_LIB_FOREACHID_PROCESS(data, seq->scene, IDWALK_CB_NEVER_SELF); BKE_LIB_FOREACHID_PROCESS(data, seq->scene_camera, IDWALK_CB_NOP); BKE_LIB_FOREACHID_PROCESS(data, seq->clip, IDWALK_CB_USER); @@ -486,7 +486,7 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData *data) BKE_LIB_FOREACHID_PROCESS(data, text_data->text_font, IDWALK_CB_USER); } } - SEQ_END; + SEQ_ALL_END; } /* This pointer can be NULL during old files reading, better be safe than sorry. */ @@ -2570,13 +2570,13 @@ static void scene_sequencer_disable_sound_strips(Scene *scene) return; } Sequence *seq; - SEQ_BEGIN (scene->ed, seq) { + SEQ_ALL_BEGIN (scene->ed, seq) { if (seq->scene_sound != NULL) { BKE_sound_remove_scene_sound(scene, seq->scene_sound); seq->scene_sound = NULL; } } - SEQ_END; + SEQ_ALL_END; } void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene) @@ -2587,7 +2587,7 @@ void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene) } BKE_sound_ensure_scene(scene); Sequence *seq; - SEQ_BEGIN (scene->ed, seq) { + SEQ_ALL_BEGIN (scene->ed, seq) { if (seq->scene_sound == NULL) { if (seq->sound != NULL) { if (seq->scene_sound == NULL) { @@ -2625,7 +2625,7 @@ void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene) seq->scene_sound, seq->pan, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0); } } - SEQ_END; + SEQ_ALL_END; BKE_sequencer_update_muting(scene->ed); BKE_sequencer_update_sound_bounds_all(scene); } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 3e75f09fed6..dc9e94e3c56 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -507,11 +507,12 @@ void BKE_sequencer_editing_free(Scene *scene, const bool do_id_user) BKE_sequencer_prefetch_free(scene); BKE_sequencer_cache_destruct(scene); - SEQ_BEGIN (ed, seq) { + SEQ_ALL_BEGIN(ed, seq) + { /* handle cache freeing above */ BKE_sequence_free_ex(scene, seq, false, do_id_user, false); } - SEQ_END; + SEQ_ALL_END; BLI_freelistN(&ed->metastack); MEM_freeN(ed); @@ -662,7 +663,7 @@ void BKE_sequencer_new_render_data(Main *bmain, /* ************************* iterator ************************** */ /* *************** (replaces old WHILE_SEQ) ********************* */ -/* **************** use now SEQ_BEGIN () SEQ_END ***************** */ +/* **************** use now SEQ_ALL_BEGIN () SEQ_ALL_END ***************** */ /* sequence strip iterator: * - builds a full array, recursively into meta strips @@ -697,7 +698,10 @@ static void seq_build_array(ListBase *seqbase, Sequence ***array, int depth) } } -static void seq_array(Editing *ed, Sequence ***seqarray, int *tot, bool use_pointer) +static void seq_array(Editing *ed, + Sequence ***seqarray, + int *tot, + const bool use_current_sequences) { Sequence **array; @@ -708,7 +712,7 @@ static void seq_array(Editing *ed, Sequence ***seqarray, int *tot, bool use_poin return; } - if (use_pointer) { + if (use_current_sequences) { seq_count(ed->seqbasep, tot); } else { @@ -720,7 +724,7 @@ static void seq_array(Editing *ed, Sequence ***seqarray, int *tot, bool use_poin } *seqarray = array = MEM_mallocN(sizeof(Sequence *) * (*tot), "SeqArray"); - if (use_pointer) { + if (use_current_sequences) { seq_build_array(ed->seqbasep, &array, 0); } else { @@ -728,10 +732,10 @@ static void seq_array(Editing *ed, Sequence ***seqarray, int *tot, bool use_poin } } -void BKE_sequence_iterator_begin(Editing *ed, SeqIterator *iter, bool use_pointer) +void BKE_sequence_iterator_begin(Editing *ed, SeqIterator *iter, const bool use_current_sequences) { memset(iter, 0, sizeof(*iter)); - seq_array(ed, &iter->array, &iter->tot, use_pointer); + seq_array(ed, &iter->array, &iter->tot, use_current_sequences); if (iter->tot) { iter->cur = 0; @@ -6168,7 +6172,8 @@ void BKE_sequencer_check_uuids_unique_and_report(const Scene *scene) BLI_session_uuid_ghash_hash, BLI_session_uuid_ghash_compare, "sequencer used uuids"); const Sequence *sequence; - SEQ_BEGIN (scene->ed, sequence) { + SEQ_ALL_BEGIN(scene->ed, sequence) + { const SessionUUID *session_uuid = &sequence->runtime.session_uuid; if (!BLI_session_uuid_is_generated(session_uuid)) { printf("Sequence %s does not have UUID generated.\n", sequence->name); @@ -6182,7 +6187,7 @@ void BKE_sequencer_check_uuids_unique_and_report(const Scene *scene) BLI_gset_insert(used_uuids, (void *)session_uuid); } - SEQ_END; + SEQ_ALL_END; BLI_gset_free(used_uuids, NULL); } |