Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/strip_time.c
| Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | |||||
| void seq_update_sound_bounds_recursive(Scene *scene, Sequence *metaseq) | void seq_update_sound_bounds_recursive(Scene *scene, Sequence *metaseq) | ||||
| { | { | ||||
| seq_update_sound_bounds_recursive_impl( | seq_update_sound_bounds_recursive_impl( | ||||
| scene, metaseq, metaseq_start(metaseq), metaseq_end(metaseq)); | scene, metaseq, metaseq_start(metaseq), metaseq_end(metaseq)); | ||||
| } | } | ||||
| static void seq_time_update_sequence_bounds(Scene *scene, Sequence *seq) | static void seq_time_update_sequence_bounds(Scene *scene, Sequence *seq) | ||||
| { | { | ||||
| if (seq->startofs && seq->startstill) { | seq->startdisp = seq->start + seq->startofs; | ||||
| seq->startstill = 0; | seq->enddisp = seq->start + seq->len - seq->endofs; | ||||
| } | |||||
| if (seq->endofs && seq->endstill) { | |||||
| seq->endstill = 0; | |||||
| } | |||||
| seq->startdisp = seq->start + seq->startofs - seq->startstill; | |||||
| seq->enddisp = seq->start + seq->len - seq->endofs + seq->endstill; | |||||
| if (seq->type == SEQ_TYPE_META) { | if (seq->type == SEQ_TYPE_META) { | ||||
| seq_update_sound_bounds_recursive(scene, seq); | seq_update_sound_bounds_recursive(scene, seq); | ||||
| } | } | ||||
| } | } | ||||
| static void seq_time_update_meta_strip(Scene *scene, Sequence *seq_meta) | static void seq_time_update_meta_strip(Scene *scene, Sequence *seq_meta) | ||||
| { | { | ||||
| Show All 40 Lines | if (seqm->seqbase.first) { | ||||
| SEQ_time_update_sequence(scene, &seqm->seqbase, seqm); | SEQ_time_update_sequence(scene, &seqm->seqbase, seqm); | ||||
| } | } | ||||
| seqm = seqm->next; | seqm = seqm->next; | ||||
| } | } | ||||
| /* effects and meta: automatic start and end */ | /* effects and meta: automatic start and end */ | ||||
| if (seq->type & SEQ_TYPE_EFFECT) { | if (seq->type & SEQ_TYPE_EFFECT) { | ||||
| if (seq->seq1) { | if (seq->seq1) { | ||||
| seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0; | seq->startofs = seq->endofs = 0; | ||||
| if (seq->seq3) { | if (seq->seq3) { | ||||
| seq->start = seq->startdisp = max_iii( | seq->start = seq->startdisp = max_iii( | ||||
| seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp); | seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp); | ||||
| seq->enddisp = min_iii(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp); | seq->enddisp = min_iii(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp); | ||||
| } | } | ||||
| else if (seq->seq2) { | else if (seq->seq2) { | ||||
| seq->start = seq->startdisp = max_ii(seq->seq1->startdisp, seq->seq2->startdisp); | seq->start = seq->startdisp = max_ii(seq->seq1->startdisp, seq->seq2->startdisp); | ||||
| seq->enddisp = min_ii(seq->seq1->enddisp, seq->seq2->enddisp); | seq->enddisp = min_ii(seq->seq1->enddisp, seq->seq2->enddisp); | ||||
| ▲ Show 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | for (; timeline_frame <= efra; timeline_frame++) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| bool SEQ_time_strip_intersects_frame(const Sequence *seq, const int timeline_frame) | bool SEQ_time_strip_intersects_frame(const Sequence *seq, const int timeline_frame) | ||||
| { | { | ||||
| return (seq->startdisp <= timeline_frame) && (seq->enddisp > timeline_frame); | return (seq->startdisp <= timeline_frame) && (seq->enddisp > timeline_frame); | ||||
| } | } | ||||
| bool SEQ_time_has_left_still_frames(const Sequence *seq) | |||||
| { | |||||
| return seq->startofs < 0; | |||||
| } | |||||
| bool SEQ_time_has_right_still_frames(const Sequence *seq) | |||||
| { | |||||
| return seq->endofs < 0; | |||||
| } | |||||
| bool SEQ_time_has_still_frames(const Sequence *seq) | |||||
| { | |||||
| return SEQ_time_has_right_still_frames(seq) || SEQ_time_has_left_still_frames(seq); | |||||
| } | |||||