Exemple #1
0
/* draw the contents of the sequencer strips view */
static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
{
    Scene *scene= CTX_data_scene(C);
    View2D *v2d= &ar->v2d;
    Sequence *last_seq = seq_active_get(scene);
    int sel = 0, j;
    float pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);

    /* loop through twice, first unselected, then selected */
    for (j=0; j<2; j++) {
        Sequence *seq;
        int outline_tint= (j) ? -60 : -150; /* highlighting around strip edges indicating selection */

        /* loop through strips, checking for those that are visible */
        for (seq= ed->seqbasep->first; seq; seq= seq->next) {
            /* boundbox and selection tests for NOT drawing the strip... */
            if ((seq->flag & SELECT) != sel) continue;
            else if (seq == last_seq) continue;
            else if (MIN2(seq->startdisp, seq->start) > v2d->cur.xmax) continue;
            else if (MAX2(seq->enddisp, seq->start+seq->len) < v2d->cur.xmin) continue;
            else if (seq->machine+1.0f < v2d->cur.ymin) continue;
            else if (seq->machine > v2d->cur.ymax) continue;

            /* strip passed all tests unscathed... so draw it now */
            draw_seq_strip(scene, ar, seq, outline_tint, pixelx);
        }

        /* draw selected next time round */
        sel= SELECT;
    }

    /* draw the last selected last (i.e. 'active' in other parts of Blender), removes some overlapping error */
    if (last_seq)
        draw_seq_strip(scene, ar, last_seq, 120, pixelx);
}
Exemple #2
0
static void select_neighbor_from_last(Scene *scene, int lr)
{
	Sequence *seq= seq_active_get(scene);
	Sequence *neighbor;
	int change = 0;
	if (seq) {
		neighbor=find_neighboring_sequence(scene, seq, lr, -1);
		if (neighbor) {
			switch (lr) {
			case SEQ_SIDE_LEFT:
				neighbor->flag |= SELECT;
				recurs_sel_seq(neighbor);
				neighbor->flag |= SEQ_RIGHTSEL;
				seq->flag |= SEQ_LEFTSEL;
				break;
			case SEQ_SIDE_RIGHT:
				neighbor->flag |= SELECT;
				recurs_sel_seq(neighbor);
				neighbor->flag |= SEQ_LEFTSEL;
				seq->flag |= SEQ_RIGHTSEL;
				break;
			}
		seq->flag |= SELECT;
		change = 1;
		}
	}
	if (change) {
	}
}