Commit: 4139deab00970bc48343d36623b589b200846b96
Author: Antony Riakiotakis
Date:   Mon Nov 3 15:45:20 2014 +0100
Branches: terrible_consequencer
https://developer.blender.org/rB4139deab00970bc48343d36623b589b200846b96

Merge branch 'master' into terrible_consequencer

Conflicts:
        source/blender/editors/include/UI_view2d.h
        source/blender/editors/space_sequencer/sequencer_edit.c

===================================================================



===================================================================

diff --cc source/blender/editors/include/UI_view2d.h
index 33fe53c,4d7446a..1e4ead3
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@@ -161,8 -161,8 +161,8 @@@ bool UI_view2d_tab_set(struct View2D *v
  void UI_view2d_zoom_cache_reset(void);
  
  /* view matrix operations */
 -void UI_view2d_view_ortho(struct View2D *v2d);
 +float UI_view2d_view_ortho(struct View2D *v2d);
- void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, 
short xaxis);
+ void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, 
const bool xaxis);
  void UI_view2d_view_restore(const struct bContext *C);
  
  /* grid drawing */
diff --cc source/blender/editors/space_sequencer/sequencer_edit.c
index c09dbb4,2270c7d..6ba0578
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@@ -1236,46 -1231,8 +1236,46 @@@ void SEQUENCER_OT_snap(struct wmOperato
        RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame 
where selected strips will be snapped", INT_MIN, INT_MAX);
  }
  
 +static int sequencer_parent_exec(bContext *C, wmOperator *UNUSED(op))
 +{
 +      Scene *scene = CTX_data_scene(C);
 +      
 +      if (scene) {
 +              Editing *ed = BKE_sequencer_editing_get(scene, false);
 +              Sequence *seq, *active_seq = ed->act_seq;
 +              
 +              for (seq = ed->seqbasep->first; seq; seq = seq->next) {
 +                      if (seq == active_seq)
 +                              continue;
 +                      
 +                      if (seq->flag & SELECT) {
 +                              seq->parent = active_seq;
 +                      }
 +              }
 +      }
 +      
 +      WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +void SEQUENCER_OT_parent(struct wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name = "Parent Strips";
 +      ot->idname = "SEQUENCER_OT_parent";
 +      ot->description = "";
 +
 +      /* api callbacks */
 +      ot->exec = sequencer_parent_exec;
 +      ot->poll = sequencer_edit_poll;
 +
 +      /* flags */
 +      ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 +}
 +
  
- typedef struct TrimData {
+ typedef struct SlipData {
        int init_mouse[2];
        float init_mouseloc[2];
        TransSeq *ts;
@@@ -1284,8 -1241,7 +1284,8 @@@
        int num_seq;
        bool slow;
        int slow_offset; /* offset at the point where offset was turned on */
 +      void *draw_handle;
- } TrimData;
+ } SlipData;
  
  static void transseq_backup(TransSeq *ts, Sequence *seq)
  {
@@@ -1318,121 -1274,8 +1318,122 @@@ static void transseq_restore(TransSeq *
        seq->len = ts->len;
  }
  
- static void draw_trim_extensions(const bContext *C, ARegion *ar, void *data)
 -static int slip_add_sequences_rec(ListBase *seqbasep, Sequence **seq_array, 
bool *trim, int offset, bool first_level)
++static void draw_slip_extensions(const bContext *C, ARegion *ar, void *data)
 +{
 +      Scene *scene = CTX_data_scene(C);
 +      float x1, x2, y1, y2, pixely, a;
 +      unsigned char col[3], blendcol[3];
 +      View2D *v2d = &ar->v2d;
-       TrimData *td = data;
++      SlipData *td = data;
 +      int i;
 +
 +      for (i = 0; i < td->num_seq; i++) {
 +              Sequence *seq = td->seq_array[i];
 +
 +              if ((seq->type != SEQ_TYPE_META) && td->trim[i]) {
 +
 +                      x1 = seq->startdisp;
 +                      x2 = seq->enddisp;
 +
 +                      y1 = seq->machine + SEQ_STRIP_OFSBOTTOM;
 +                      y2 = seq->machine + SEQ_STRIP_OFSTOP;
 +
 +                      pixely = BLI_rctf_size_y(&v2d->cur) / 
BLI_rcti_size_y(&v2d->mask);
 +
 +                      if (pixely <= 0) return;  /* can happen when the view 
is split/resized */
 +
 +                      blendcol[0] = blendcol[1] = blendcol[2] = 120;
 +
 +                      if (seq->startofs) {
 +                              glEnable(GL_BLEND);
 +                              glBlendFunc(GL_SRC_ALPHA, 
GL_ONE_MINUS_SRC_ALPHA);
 +
 +                              get_seq_color3ubv(scene, seq, col);
 +
 +                              if (seq->flag & SELECT) {
 +                                      UI_GetColorPtrBlendShade3ubv(col, 
blendcol, col, 0.3, -40);
 +                                      glColor4ub(col[0], col[1], col[2], 170);
 +                              }
 +                              else {
 +                                      UI_GetColorPtrBlendShade3ubv(col, 
blendcol, col, 0.6, 0);
 +                                      glColor4ub(col[0], col[1], col[2], 110);
 +                              }
 +
 +                              glRectf((float)(seq->start), y1 - 
SEQ_STRIP_OFSBOTTOM, x1, y1);
 +
 +                              if (seq->flag & SELECT) glColor4ub(col[0], 
col[1], col[2], 255);
 +                              else glColor4ub(col[0], col[1], col[2], 160);
 +
 +                              fdrawbox((float)(seq->start), y1 - 
SEQ_STRIP_OFSBOTTOM, x1, y1);  //outline
 +
 +                              glDisable(GL_BLEND);
 +                      }
 +                      if (seq->endofs) {
 +                              glEnable(GL_BLEND);
 +                              glBlendFunc(GL_SRC_ALPHA, 
GL_ONE_MINUS_SRC_ALPHA);
 +
 +                              get_seq_color3ubv(scene, seq, col);
 +
 +                              if (seq->flag & SELECT) {
 +                                      UI_GetColorPtrBlendShade3ubv(col, 
blendcol, col, 0.3, -40);
 +                                      glColor4ub(col[0], col[1], col[2], 170);
 +                              }
 +                              else {
 +                                      UI_GetColorPtrBlendShade3ubv(col, 
blendcol, col, 0.6, 0);
 +                                      glColor4ub(col[0], col[1], col[2], 110);
 +                              }
 +
 +                              glRectf(x2, y2, (float)(seq->start + seq->len), 
y2 + SEQ_STRIP_OFSBOTTOM);
 +
 +                              if (seq->flag & SELECT) glColor4ub(col[0], 
col[1], col[2], 255);
 +                              else glColor4ub(col[0], col[1], col[2], 160);
 +
 +                              fdrawbox(x2, y2, (float)(seq->start + 
seq->len), y2 + SEQ_STRIP_OFSBOTTOM); //outline
 +
 +                              glDisable(GL_BLEND);
 +                      }
 +                      if (seq->startstill) {
 +                              get_seq_color3ubv(scene, seq, col);
 +                              UI_GetColorPtrBlendShade3ubv(col, blendcol, 
col, 0.75, 40);
 +                              glColor3ubv((GLubyte *)col);
 +
 +                              draw_shadedstrip(seq, col, x1, y1, 
(float)(seq->start), y2);
 +
 +                              /* feint pinstripes, helps see exactly which is 
extended and which isn't,
 +                               * especially when the extension is very small 
*/
 +                              if (seq->flag & SELECT) 
UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24);
 +                              else UI_GetColorPtrShade3ubv(col, col, -16);
 +
 +                              glColor3ubv((GLubyte *)col);
 +
 +                              for (a = y1; a < y2; a += pixely * 2.0f) {
 +                                      fdrawline(x1,  a,  (float)(seq->start), 
 a);
 +                              }
 +                      }
 +                      if (seq->endstill) {
 +                              get_seq_color3ubv(scene, seq, col);
 +                              UI_GetColorPtrBlendShade3ubv(col, blendcol, 
col, 0.75, 40);
 +                              glColor3ubv((GLubyte *)col);
 +
 +                              draw_shadedstrip(seq, col, (float)(seq->start + 
seq->len), y1, x2, y2);
 +
 +                              /* feint pinstripes, helps see exactly which is 
extended and which isn't,
 +               * especially when the extension is very small */
 +                              if (seq->flag & SELECT) 
UI_GetColorPtrShade3ubv(col, col, 24);
 +                              else UI_GetColorPtrShade3ubv(col, col, -16);
 +
 +                              glColor3ubv((GLubyte *)col);
 +
 +                              for (a = y1; a < y2; a += pixely * 2.0f) {
 +                                      fdrawline((float)(seq->start + 
seq->len),  a,  x2,  a);
 +                              }
 +                      }
 +              }
 +      }
 +}
 +
- static int trim_add_sequences_rec(ListBase *seqbasep, Sequence **seq_array, 
bool *trim, int offset, bool do_trim) {
++static int slip_add_sequences_rec(ListBase *seqbasep, Sequence **seq_array, 
bool *trim, int offset, bool do_trim)
+ {
        Sequence *seq;
        int num_items = 0;
  
@@@ -1472,12 -1317,11 +1475,12 @@@ static int slip_count_sequences_rec(Lis
        return trimmed_sequences;
  }
  
- static int sequencer_trim_invoke(bContext *C, wmOperator *op, const wmEvent 
*event)
+ static int sequencer_slip_invoke(bContext *C, wmOperator *op, const wmEvent 
*event)
  {
-       TrimData *data;
+       SlipData *data;
        Scene *scene = CTX_data_scene(C);
        Editing *ed = BKE_sequencer_editing_get(scene, false);
 +      ARegion *ar = CTX_wm_region(C);
        float mouseloc[2];
        int num_seq, i;
        View2D *v2d = UI_view2d_fromcontext(C);
@@@ -1608,12 -1453,11 +1614,12 @@@ static int sequencer_slip_exec(bContex
        else return OPERATOR_CANCELLED;
  }
  
- static int sequencer_trim_modal(bContext *C, wmOperator *op, const wmEvent 
*event)
+ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent 
*event)
  {
        Scene *scene = CTX_data_scene(C);
-       TrimData *data = (TrimData *)op->customdata;
+       SlipData *data = (SlipData *)op->customdata;
        ScrArea *sa = CTX_wm_area(C);
 +      ARegion *ar = CTX_wm_region(C);
  
        switch (event->type) {
                case MOUSEMOVE:
@@@ -1735,9 -1578,11 +1743,10 @@@ void SEQUENCER_OT_slip(struct wmOperato
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
  
-       RNA_def_int(ot->srna, "offset", 0, INT32_MIN, INT32_MAX, "Offset", 
"offset to the data of the strip", INT32_MIN, INT32_MAX);
+       RNA_def_int(ot->srna, "offset", 0, INT32_MIN, INT32_MAX, "Offset", 
"Offset to the data of the strip",
+                   INT32_MIN, INT32_MAX);
  }
  
 -
  /* mute operator */
  static int sequencer_mute_exec(bContext *C, wmOperator *op)
  {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to