diff options
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_select.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_select.c | 109 |
1 files changed, 51 insertions, 58 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 437871c7fe8..83fa8bffd58 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -40,13 +40,7 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "DNA_curve_types.h" #include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_sequence_types.h" -#include "DNA_view2d_types.h" -#include "DNA_userdef_types.h" #include "BKE_context.h" #include "BKE_global.h" @@ -59,27 +53,18 @@ #include "WM_api.h" #include "WM_types.h" -#include "RNA_access.h" #include "RNA_define.h" /* for menu/popup icons etc etc*/ -#include "UI_interface.h" -#include "UI_resources.h" -#include "ED_anim_api.h" -#include "ED_space_api.h" #include "ED_types.h" #include "ED_screen.h" -#include "ED_util.h" -#include "UI_interface.h" -#include "UI_resources.h" #include "UI_view2d.h" /* own include */ #include "sequencer_intern.h" -static void *find_nearest_marker() {return NULL;} -static void deselect_markers() {} +static void *find_nearest_marker(int d1, int d2) {return NULL;} void select_surrounding_handles(Scene *scene, Sequence *test) /* XXX BRING BACK */ { @@ -181,7 +166,7 @@ void select_single_seq(Scene *scene, Sequence *seq, int deselect_all) /* BRING B if(deselect_all) deselect_all_seq(scene); - active_seq_set(scene, seq); + seq_active_set(scene, seq); if((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) { if(seq->strip) @@ -200,7 +185,7 @@ void select_single_seq(Scene *scene, Sequence *seq, int deselect_all) /* BRING B void select_neighbor_from_last(Scene *scene, int lr) { - Sequence *seq= active_seq_get(scene); + Sequence *seq= seq_active_get(scene); Sequence *neighbor; int change = 0; if (seq) { @@ -237,9 +222,6 @@ static int sequencer_deselect_exec(bContext *C, wmOperator *op) Sequence *seq; int desel = 0; - if(ed==NULL) - return OPERATOR_CANCELLED; - for(seq= ed->seqbasep->first; seq; seq=seq->next) { if(seq->flag & SEQ_ALLSEL) { desel= 1; @@ -249,7 +231,7 @@ static int sequencer_deselect_exec(bContext *C, wmOperator *op) for(seq= ed->seqbasep->first; seq; seq=seq->next) { if (desel) { - seq->flag &= SEQ_DESEL; + seq->flag &= ~SEQ_ALLSEL; } else { seq->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL); @@ -257,7 +239,7 @@ static int sequencer_deselect_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -271,8 +253,7 @@ void SEQUENCER_OT_select_all_toggle(struct wmOperatorType *ot) /* api callbacks */ ot->exec= sequencer_deselect_exec; - - ot->poll= ED_operator_sequencer_active; + ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -286,12 +267,9 @@ static int sequencer_select_inverse_exec(bContext *C, wmOperator *op) Editing *ed= seq_give_editing(scene, FALSE); Sequence *seq; - if(ed==NULL) - return OPERATOR_CANCELLED; - for(seq= ed->seqbasep->first; seq; seq=seq->next) { if (seq->flag & SELECT) { - seq->flag &= SEQ_DESEL; + seq->flag &= ~SEQ_ALLSEL; } else { seq->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL); @@ -299,7 +277,7 @@ static int sequencer_select_inverse_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -313,8 +291,7 @@ void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot) /* api callbacks */ ot->exec= sequencer_select_inverse_exec; - - ot->poll= ED_operator_sequencer_active; + ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -363,7 +340,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) marker->flag |= SELECT; } else { - deselect_markers(0, 0); + /* 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; } @@ -388,6 +365,24 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) } } SEQ_END + + { + SpaceSeq *sseq= CTX_wm_space_seq(C); + if (sseq && sseq->flag & SEQ_MARKER_TRANS) { + TimeMarker *marker; + + for (marker= scene->markers.first; marker; marker= marker->next) { + if( ((x < CFRA) && marker->frame < CFRA) || + ((x >= CFRA) && marker->frame >= CFRA) + ) { + marker->flag |= SELECT; + } + else { + marker->flag &= ~SELECT; + } + } + } + } } else { // seq= find_nearest_seq(scene, v2d, &hand, mval); @@ -397,7 +392,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) deselect_all_seq(scene); if(seq) { - active_seq_set(scene, seq); + seq_active_set(scene, seq); if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) { if(seq->strip) { @@ -414,7 +409,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) switch(hand) { case SEQ_SIDE_NONE: if (linked_handle==0) - seq->flag &= SEQ_DESEL; + seq->flag &= ~SEQ_ALLSEL; break; case SEQ_SIDE_LEFT: seq->flag ^= SEQ_LEFTSEL; @@ -510,7 +505,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) } #endif - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); /* allowing tweaks */ return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; @@ -600,7 +595,7 @@ static int sequencer_select_more_exec(bContext *C, wmOperator *op) if(!select_more_less_seq__internal(scene, 0, 0)) return OPERATOR_CANCELLED; - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -610,11 +605,11 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot) /* identifiers */ ot->name= "Select More"; ot->idname= "SEQUENCER_OT_select_more"; - ot->description="DOC_BROKEN"; + ot->description="Select more strips adjacent to the current selection"; /* api callbacks */ ot->exec= sequencer_select_more_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -631,7 +626,7 @@ static int sequencer_select_less_exec(bContext *C, wmOperator *op) if(!select_more_less_seq__internal(scene, 1, 0)) return OPERATOR_CANCELLED; - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -641,11 +636,11 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot) /* identifiers */ ot->name= "Select less"; ot->idname= "SEQUENCER_OT_select_less"; - ot->description="DOC_BROKEN"; + ot->description="Shrink the current selection of adjacent selected strips"; /* api callbacks */ ot->exec= sequencer_select_less_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -686,7 +681,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEv selected = select_more_less_seq__internal(scene, 1, 1); } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -696,7 +691,7 @@ void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot) /* identifiers */ ot->name= "Select pick linked"; ot->idname= "SEQUENCER_OT_select_linked_pick"; - ot->description="DOC_BROKEN"; + ot->description="Select a chain of linked strips nearest to the mouse pointer"; /* api callbacks */ ot->invoke= sequencer_select_linked_pick_invoke; @@ -721,7 +716,7 @@ static int sequencer_select_linked_exec(bContext *C, wmOperator *op) selected = select_more_less_seq__internal(scene, 1, 1); } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -731,11 +726,11 @@ void SEQUENCER_OT_select_linked(wmOperatorType *ot) /* identifiers */ ot->name= "Select linked"; ot->idname= "SEQUENCER_OT_select_linked"; - ot->description="DOC_BROKEN"; + ot->description="Select all strips adjacent to the current selection"; /* api callbacks */ ot->exec= sequencer_select_linked_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -752,8 +747,6 @@ static int sequencer_select_handles_exec(bContext *C, wmOperator *op) Sequence *seq; int sel_side= RNA_enum_get(op->ptr, "side"); - if (ed==NULL) - return OPERATOR_CANCELLED; for(seq= ed->seqbasep->first; seq; seq=seq->next) { if (seq->flag & SELECT) { @@ -773,7 +766,7 @@ static int sequencer_select_handles_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -783,11 +776,11 @@ void SEQUENCER_OT_select_handles(wmOperatorType *ot) /* identifiers */ ot->name= "Select Handles"; ot->idname= "SEQUENCER_OT_select_handles"; - ot->description="DOC_BROKEN"; + ot->description="Select manipulator handles on the sides of the selected strip"; /* api callbacks */ ot->exec= sequencer_select_handles_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -801,7 +794,7 @@ static int sequencer_select_active_side_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, 0); - Sequence *seq_act= active_seq_get(scene); + Sequence *seq_act= seq_active_get(scene); if (ed==NULL || seq_act==NULL) return OPERATOR_CANCELLED; @@ -810,7 +803,7 @@ static int sequencer_select_active_side_exec(bContext *C, wmOperator *op) select_active_side(ed->seqbasep, RNA_enum_get(op->ptr, "side"), seq_act->machine, seq_act->startdisp); - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } @@ -820,11 +813,11 @@ void SEQUENCER_OT_select_active_side(wmOperatorType *ot) /* identifiers */ ot->name= "Select Active Side"; ot->idname= "SEQUENCER_OT_select_active_side"; - ot->description="DOC_BROKEN"; + ot->description="Select strips on the nominated side of the active strip"; /* api callbacks */ ot->exec= sequencer_select_active_side_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -867,12 +860,12 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) if(BLI_isect_rctf(&rq, &rectf, 0)) { if(selecting) seq->flag |= SELECT; - else seq->flag &= SEQ_DESEL; + else seq->flag &= ~SEQ_ALLSEL; recurs_sel_seq(seq); } } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); return OPERATOR_FINISHED; } |