Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Schlaile <peter@schlaile.de>2011-05-16 21:14:47 +0400
committerPeter Schlaile <peter@schlaile.de>2011-05-16 21:14:47 +0400
commit70b832589a2bb90fbed2106f30d34d77f49d2010 (patch)
tree847e9fb95d4a8c153963de73c34ef3889a5ac014 /source/blender/blenkernel/intern/sequencer.c
parentb434e7f93337f65909c003ce865cc34f167c3973 (diff)
[PATCH] == Sequencer ==
This patch adds adjustment layer tracks to the sequencer and does some cleaning up of the code. What's an adjustment layer? Think of it as an effect track, which takes no explicit input, but alters the output of everything down the layer stack. So: you can add several stages of color correction with it. And: you can even use it with metastrips to group several adjustments together.
Diffstat (limited to 'source/blender/blenkernel/intern/sequencer.c')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c102
1 files changed, 42 insertions, 60 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index e3639dd1c51..b0da40bf0c5 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -79,9 +79,15 @@
#define snprintf _snprintf
#endif
-/* **** XXX ******** */
-//static void waitcursor(int val) {}
-//static int blender_test_break() {return 0;}
+
+static ImBuf* seq_render_strip_stack(
+ SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
+
+static ImBuf * seq_render_strip(
+ SeqRenderData context, Sequence * seq, float cfra);
+
+static void seq_free_animdata(Scene *scene, Sequence *seq);
+
/* **** XXX ******** */
#define SELECT 1
@@ -177,8 +183,6 @@ void seq_free_strip(Strip *strip)
MEM_freeN(strip);
}
-static void seq_free_animdata(Scene *scene, Sequence *seq);
-
void seq_free_sequence(Scene *scene, Sequence *seq)
{
if(seq->strip) seq_free_strip(seq->strip);
@@ -191,6 +195,10 @@ void seq_free_sequence(Scene *scene, Sequence *seq)
sh.free(seq);
}
+ if(seq->sound) {
+ ((ID *)seq->sound)->us--;
+ }
+
/* clipboard has no scene and will never have a sound handle or be active */
if(scene) {
Editing *ed = scene->ed;
@@ -446,51 +454,6 @@ void seq_end(SeqIterator *iter)
* in metastrips!)
**********************************************************************
*/
-#if 0 /* UNUSED */
-static void do_seq_count(ListBase *seqbase, int *totseq)
-{
- Sequence *seq;
-
- seq= seqbase->first;
- while(seq) {
- (*totseq)++;
- if(seq->seqbase.first) do_seq_count(&seq->seqbase, totseq);
- seq= seq->next;
- }
-}
-
-static void do_build_seqar(ListBase *seqbase, Sequence ***seqar, int depth)
-{
- Sequence *seq;
-
- seq= seqbase->first;
- while(seq) {
- seq->depth= depth;
- if(seq->seqbase.first) do_build_seqar(&seq->seqbase, seqar, depth+1);
- **seqar= seq;
- (*seqar)++;
- seq= seq->next;
- }
-}
-
-static void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq)
-{
- Sequence **tseqar;
-
- *totseq= 0;
- do_seq_count(seqbase, totseq);
-
- if(*totseq==0) {
- *seqar= NULL;
- return;
- }
- *seqar= MEM_mallocN(sizeof(void *)* *totseq, "seqar");
- tseqar= *seqar;
-
- do_build_seqar(seqbase, seqar, 0);
- *seqar= tseqar;
-}
-#endif /* UNUSED */
static void do_seq_count_cb(ListBase *seqbase, int *totseq,
int (*test_func)(Sequence * seq))
@@ -916,6 +879,7 @@ static const char *give_seqname_by_type(int type)
case SEQ_TRANSFORM: return "Transform";
case SEQ_COLOR: return "Color";
case SEQ_MULTICAM: return "Multicam";
+ case SEQ_ADJUSTMENT: return "Adjustment";
case SEQ_SPEED: return "Speed";
default:
return NULL;
@@ -1093,15 +1057,12 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se
}
if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) {
- if (b > 0) {
- if (seq_arr[b] == NULL) {
- return 0;
- }
- } else {
- for (b = MAXSEQ; b > 0; b--) {
- if (video_seq_is_rendered(seq_arr[b])) {
- break;
- }
+ if (b == 0) {
+ b = MAXSEQ;
+ }
+ for (; b > 0; b--) {
+ if (video_seq_is_rendered(seq_arr[b])) {
+ break;
}
}
}
@@ -2855,7 +2816,10 @@ void seq_tx_set_final_right(Sequence *seq, int val)
since they work a bit differently to normal image seq's (during transform) */
int seq_single_check(Sequence *seq)
{
- return (seq->len==1 && ELEM3(seq->type, SEQ_IMAGE, SEQ_COLOR, SEQ_MULTICAM));
+ return (seq->len==1 && (
+ seq->type == SEQ_IMAGE
+ || ((seq->type & SEQ_EFFECT) &&
+ get_sequence_effect_num_inputs(seq->type) == 0)));
}
/* check if the selected seq's reference unselected seq's */
@@ -3214,6 +3178,24 @@ ListBase *seq_seqbase(ListBase *seqbase, Sequence *seq)
return NULL;
}
+Sequence *seq_metastrip(ListBase * seqbase, Sequence * meta, Sequence *seq)
+{
+ Sequence * iseq;
+
+ for(iseq = seqbase->first; iseq; iseq = iseq->next) {
+ Sequence * rval;
+
+ if (seq == iseq) {
+ return meta;
+ } else if(iseq->seqbase.first &&
+ (rval = seq_metastrip(&iseq->seqbase, iseq, seq))) {
+ return rval;
+ }
+ }
+
+ return NULL;
+}
+
int seq_swap(Sequence *seq_a, Sequence *seq_b)
{
char name[sizeof(seq_a->name)];