Page MenuHome

seqselect.v2.patch

File Metadata

Author
Roland Hess (harkyman)
Created
Nov 13 2013, 1:25 PM

seqselect.v2.patch

Index: source/blender/src/editseq.c
===================================================================
--- source/blender/src/editseq.c (.../https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/blender/src/editseq.c) (revision 11041)
+++ source/blender/src/editseq.c (.../source/blender/src/editseq.c) (working copy)
@@ -201,6 +201,41 @@
|| (get_sequence_effect_num_inputs(seq->type) == 0);
}
+Sequence *find_neighboring_sequence(int lr, Sequence *test) {
+/* looks to the left on lr==1, to the right on lr==2 */
+ Sequence *seq,*foundneighbor;
+ Editing *ed;
+
+ ed= G.scene->ed;
+ if(ed==0) return 0;
+
+ seq= ed->seqbasep->first;
+ while(seq) {
+ if(seq!=test) {
+ if (test->machine==seq->machine) {
+ if(test->depth==seq->depth) {
+ switch (lr) {
+ case 1:
+ if (test->startdisp == (seq->enddisp))
+ foundneighbor=seq;
+ break;
+ case 2:
+ if (test->enddisp == (seq->startdisp))
+ foundneighbor=seq;
+ break;
+ }
+ }
+ }
+ }
+ seq= seq->next;
+ }
+ if (foundneighbor) {
+ return foundneighbor;
+ } else {
+ return 0;
+ }
+}
+
Sequence *find_nearest_seq(int *hand)
{
Sequence *seq;
@@ -441,6 +476,48 @@
}
+void select_channel_direction(Sequence *test,int lr) {
+/* looks to the left on lr==1, to the right on lr==2 */
+ Sequence *seq;
+ Editing *ed;
+
+ ed= G.scene->ed;
+ if(ed==0) return;
+
+ seq= ed->seqbasep->first;
+ while(seq) {
+ if(seq!=test) {
+ if (test->machine==seq->machine) {
+ if(test->depth==seq->depth) {
+ if (((lr==1)&&(test->startdisp > (seq->startdisp)))||((lr==2)&&(test->startdisp < (seq->startdisp)))) {
+ if ((G.qual & LR_SHIFTKEY) && (lr==1)) {
+ if (test->flag & SEQ_LEFTSEL) {
+ seq->flag |= SELECT;
+ recurs_sel_seq(seq);
+ } else {
+ seq->flag &= SEQ_DESEL;
+ recurs_sel_seq(seq);
+ }
+ } else if ((G.qual & LR_SHIFTKEY) && (lr==2)) {
+ if (test->flag & SEQ_RIGHTSEL) {
+ seq->flag |= SELECT;
+ } else {
+ seq->flag &= SEQ_DESEL;
+ recurs_sel_seq(seq);
+ }
+ } else {
+ seq->flag |= SELECT;
+ recurs_sel_seq(seq);
+ }
+ }
+ }
+ }
+ }
+ seq= seq->next;
+ }
+ return;
+}
+
void mouse_select_seq(void)
{
Sequence *seq;
@@ -482,6 +559,34 @@
if(hand==1) seq->flag |= SEQ_LEFTSEL;
if(hand==2) seq->flag |= SEQ_RIGHTSEL;
}
+
+ /* Ctrl-Selecting handles selects the handle of another strip that abuts this one */
+ if((G.qual & LR_CTRLKEY) && (seq->flag & SELECT)) {
+ Sequence *seqneighbor;
+ if (hand==1) {
+ seqneighbor=find_neighboring_sequence(1, seq);
+ if (seqneighbor) {
+ seqneighbor->flag |= SELECT;
+ seqneighbor->flag |= SEQ_RIGHTSEL;
+ }
+ }
+ else if (hand==2) {
+ seqneighbor=find_neighboring_sequence(2, seq);
+ if (seqneighbor) {
+ seqneighbor->flag |= SELECT;
+ seqneighbor->flag |= SEQ_LEFTSEL;
+ }
+ }
+ }
+
+ if((G.qual & LR_ALTKEY) && (seq->flag & SELECT) && (hand!=0)) {
+ if (hand==1) {
+ select_channel_direction(seq,1);
+ } else {
+ select_channel_direction(seq,2);
+ }
+ }
+
recurs_sel_seq(seq);
}

Event Timeline