예제 #1
0
static void select_neighbor_from_last(Scene *scene, int lr)
{
	Sequence *seq = BKE_sequencer_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) {
	}
}
예제 #2
0
/* used for mouse selection and for SEQUENCER_OT_select_active_side() */
static void select_linked_time(ListBase *seqbase, Sequence *seq_link)
{
	Sequence *seq;

	for (seq = seqbase->first; seq; seq = seq->next) {
		if (seq_link->machine != seq->machine) {
			int left_match = (seq->startdisp == seq_link->startdisp) ? 1 : 0;
			int right_match = (seq->enddisp == seq_link->enddisp) ? 1 : 0;

			if (left_match && right_match) {
				/* a direct match, copy the selection settinhs */
				seq->flag &= ~(SELECT | SEQ_LEFTSEL | SEQ_RIGHTSEL);
				seq->flag |= seq_link->flag & (SELECT | SEQ_LEFTSEL | SEQ_RIGHTSEL);

				recurs_sel_seq(seq);
			}
			else if (seq_link->flag & SELECT && (left_match || right_match)) {

				/* clear for reselection */
				seq->flag &= ~(SEQ_LEFTSEL | SEQ_RIGHTSEL);

				if (left_match && seq_link->flag & SEQ_LEFTSEL)
					seq->flag |= SELECT | SEQ_LEFTSEL;

				if (right_match && seq_link->flag & SEQ_RIGHTSEL)
					seq->flag |= SELECT | SEQ_RIGHTSEL;

				recurs_sel_seq(seq);
			}
		}
	}
}
예제 #3
0
static void select_surrounding_handles(Scene *scene, Sequence *test) /* XXX BRING BACK */
{
	Sequence *neighbor;
	
	neighbor = find_neighboring_sequence(scene, test, SEQ_SIDE_LEFT, -1);
	if (neighbor) {
		neighbor->flag |= SELECT;
		recurs_sel_seq(neighbor);
		neighbor->flag |= SEQ_RIGHTSEL;
	}
	neighbor = find_neighboring_sequence(scene, test, SEQ_SIDE_RIGHT, -1);
	if (neighbor) {
		neighbor->flag |= SELECT;
		recurs_sel_seq(neighbor);
		neighbor->flag |= SEQ_LEFTSEL;
	}
	test->flag |= SELECT;
}
예제 #4
0
static void select_surrounding_handles(Scene *scene, Sequence *test) /* XXX BRING BACK */
{
	Sequence *neighbor;
	
	neighbor = find_neighboring_sequence(scene, test, SEQ_SIDE_LEFT, -1);
	if (neighbor) {
		/* Only select neighbor handle if matching handle from test seq is also selected, or if neighbor
		 * was not selected at all up till now.
		 * Otherwise, we get odd mismatch when shift-alt-rmb selecting neighbor strips... */
		if (!(neighbor->flag & SELECT) || (test->flag & SEQ_LEFTSEL)) {
			neighbor->flag |= SEQ_RIGHTSEL;
		}
		neighbor->flag |= SELECT;
		recurs_sel_seq(neighbor);
	}
	neighbor = find_neighboring_sequence(scene, test, SEQ_SIDE_RIGHT, -1);
	if (neighbor) {
		if (!(neighbor->flag & SELECT) || (test->flag & SEQ_RIGHTSEL)) {  /* See comment above. */
			neighbor->flag |= SEQ_LEFTSEL;
		}
		neighbor->flag |= SELECT;
		recurs_sel_seq(neighbor);
	}
}
예제 #5
0
static void UNUSED_FUNCTION(select_single_seq)(Scene *scene, Sequence *seq, int deselect_all) /* BRING BACK */
{
	Editing *ed= seq_give_editing(scene, FALSE);
	
	if(deselect_all)
		deselect_all_seq(scene);
	seq_active_set(scene, seq);

	if((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) {
		if(seq->strip)
			BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
	}
	else if(seq->type==SEQ_SOUND) {
		if(seq->strip)
			BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
	}
	seq->flag|= SELECT;
	recurs_sel_seq(seq);
}
예제 #6
0
void ED_sequencer_select_sequence_single(Scene *scene, Sequence *seq, bool deselect_all)
{
	Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
	
	if (deselect_all)
		ED_sequencer_deselect_all(scene);

	BKE_sequencer_active_set(scene, seq);

	if ((seq->type == SEQ_TYPE_IMAGE) || (seq->type == SEQ_TYPE_MOVIE)) {
		if (seq->strip)
			BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
	}
	else if (seq->type == SEQ_TYPE_SOUND_RAM) {
		if (seq->strip)
			BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
	}
	seq->flag |= SELECT;
	recurs_sel_seq(seq);
}
예제 #7
0
static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
	View2D *v2d = UI_view2d_fromcontext(C);
	Scene *scene = CTX_data_scene(C);
	Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
	const bool extend = RNA_boolean_get(op->ptr, "extend");
	const bool linked_handle = RNA_boolean_get(op->ptr, "linked_handle");
	const bool linked_time = RNA_boolean_get(op->ptr, "linked_time");
	bool left_right = RNA_boolean_get(op->ptr, "left_right");
	
	Sequence *seq, *neighbor, *act_orig;
	int hand, sel_side;
	TimeMarker *marker;

	if (ed == NULL)
		return OPERATOR_CANCELLED;
	
	marker = find_nearest_marker(SCE_MARKERS, 1); //XXX - dummy function for now
	
	seq = find_nearest_seq(scene, v2d, &hand, event->mval);

	// XXX - not nice, Ctrl+RMB needs to do left_right only when not over a strip
	if (seq && linked_time && left_right)
		left_right = FALSE;


	if (marker) {
		int oldflag;
		/* select timeline marker */
		if (extend) {
			oldflag = marker->flag;
			if (oldflag & SELECT)
				marker->flag &= ~SELECT;
			else
				marker->flag |= SELECT;
		}
		else {
			/* deselect_markers(0, 0); */ /* XXX, in 2.4x, seq selection used to deselect all, need to re-thnik this for 2.5 */
			marker->flag |= SELECT;
		}
		
	}
	else if (left_right) {
		/* use different logic for this */
		float x;
		ED_sequencer_deselect_all(scene);
		UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, NULL);

		SEQP_BEGIN (ed, seq)
		{
			if (x < CFRA) {
				if (seq->enddisp < CFRA) {
					seq->flag |= SELECT;
					recurs_sel_seq(seq);
				}
			}
			else {
				if (seq->startdisp > CFRA) {
					seq->flag |= SELECT;
					recurs_sel_seq(seq);
				}
			}
		}
		SEQ_END
		
		{
			SpaceSeq *sseq = CTX_wm_space_seq(C);
			if (sseq && sseq->flag & SEQ_MARKER_TRANS) {
				TimeMarker *tmarker;

				for (tmarker = scene->markers.first; tmarker; tmarker = tmarker->next) {
					if (((x <  CFRA) && tmarker->frame <  CFRA) ||
					    ((x >= CFRA) && tmarker->frame >= CFRA))
					{
						tmarker->flag |= SELECT;
					}
					else {
						tmarker->flag &= ~SELECT;
					}
				}
			}
		}
	}
	else {