From 44505b38df557a5711703613685a1dec9fc2c3d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 Jun 2018 09:31:30 +0200 Subject: Cleanup: strip trailing space in editors --- .../editors/space_sequencer/sequencer_add.c | 96 +++--- .../editors/space_sequencer/sequencer_buttons.c | 8 +- .../editors/space_sequencer/sequencer_draw.c | 210 ++++++------- .../editors/space_sequencer/sequencer_edit.c | 324 ++++++++++----------- .../editors/space_sequencer/sequencer_intern.h | 2 +- .../editors/space_sequencer/sequencer_ops.c | 6 +- .../editors/space_sequencer/sequencer_preview.c | 24 +- .../editors/space_sequencer/sequencer_scopes.c | 26 +- .../editors/space_sequencer/sequencer_select.c | 136 ++++----- .../editors/space_sequencer/sequencer_view.c | 4 +- .../editors/space_sequencer/space_sequencer.c | 46 +-- 11 files changed, 441 insertions(+), 441 deletions(-) (limited to 'source/blender/editors/space_sequencer') diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 8315a0eab3d..98370ea9dee 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -95,12 +95,12 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag) if (flag & SEQPROP_STARTFRAME) RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX); - + if (flag & SEQPROP_ENDFRAME) RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX, "End Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not usual since most strips have a fixed length */ - + RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to place this strip into", 1, MAXSEQ); - + RNA_def_boolean(ot->srna, "replace_sel", 1, "Replace Selection", "Replace the current selection"); /* only for python scripts which import strips and place them after */ @@ -145,7 +145,7 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type) proximity = cfra - seq->enddisp; } } - + if (tgt) { return tgt->machine; } @@ -155,16 +155,16 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type) static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, int flag, int type) { Scene *scene = CTX_data_scene(C); - + int cfra = (int) CFRA; - + /* effect strips don't need a channel initialized from the mouse */ if (!(flag & SEQPROP_NOCHAN)) { RNA_int_set(op->ptr, "channel", sequencer_generic_invoke_xy_guess_channel(C, type)); } RNA_int_set(op->ptr, "frame_start", cfra); - + if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) RNA_int_set(op->ptr, "frame_end", cfra + 25); // XXX arbitary but ok for now. @@ -201,7 +201,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato if ((is_file != -1) && relative) BLI_path_rel(seq_load->path, bmain->name); - + if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) { seq_load->end_frame = RNA_property_int_get(op->ptr, prop); } @@ -217,7 +217,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato if ((prop = RNA_struct_find_property(op->ptr, "sound")) && RNA_property_boolean_get(op->ptr, prop)) seq_load->flag |= SEQ_LOAD_MOVIE_SOUND; - + if ((prop = RNA_struct_find_property(op->ptr, "use_framerate")) && RNA_property_boolean_get(op->ptr, prop)) seq_load->flag |= SEQ_LOAD_SYNC_FPS; @@ -286,35 +286,35 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, true); - + Scene *sce_seq; Sequence *seq; /* generic strip vars */ Strip *strip; - + int start_frame, channel; /* operator props */ - + start_frame = RNA_int_get(op->ptr, "frame_start"); channel = RNA_int_get(op->ptr, "channel"); - + sce_seq = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene")); - + if (sce_seq == NULL) { BKE_report(op->reports, RPT_ERROR, "Scene not found"); return OPERATOR_CANCELLED; } - + seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel); seq->type = SEQ_TYPE_SCENE; seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */ seq->scene = sce_seq; - + /* basic defaults */ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1; strip->us = 1; - + BLI_strncpy(seq->name + 2, sce_seq->id.name + 2, sizeof(seq->name) - 2); BKE_sequence_base_unique_name_recursive(&ed->seqbase, seq); @@ -322,12 +322,12 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) BKE_sequence_calc_disp(scene, seq); BKE_sequencer_sort(scene); - + sequencer_add_apply_replace_sel(C, op, seq); sequencer_add_apply_overlap(C, op, seq); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } @@ -347,7 +347,7 @@ static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const w void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot) { PropertyRNA *prop; - + /* identifiers */ ot->name = "Add Scene Strip"; ot->idname = "SEQUENCER_OT_scene_strip_add"; @@ -358,10 +358,10 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot) ot->exec = sequencer_add_scene_strip_exec; ot->poll = ED_operator_sequencer_active_editable; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); prop = RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); RNA_def_enum_funcs(prop, RNA_scene_without_active_itemf); @@ -374,24 +374,24 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, true); - + MovieClip *clip; Sequence *seq; /* generic strip vars */ Strip *strip; - + int start_frame, channel; /* operator props */ - + start_frame = RNA_int_get(op->ptr, "frame_start"); channel = RNA_int_get(op->ptr, "channel"); - + clip = BLI_findlink(&CTX_data_main(C)->movieclip, RNA_enum_get(op->ptr, "clip")); - + if (clip == NULL) { BKE_report(op->reports, RPT_ERROR, "Movie clip not found"); return OPERATOR_CANCELLED; } - + seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel); seq->type = SEQ_TYPE_MOVIECLIP; seq->blend_mode = SEQ_TYPE_CROSS; @@ -403,18 +403,18 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); seq->len = BKE_movieclip_get_duration(clip); strip->us = 1; - + BLI_strncpy(seq->name + 2, clip->id.name + 2, sizeof(seq->name) - 2); BKE_sequence_base_unique_name_recursive(&ed->seqbase, seq); BKE_sequence_calc_disp(scene, seq); BKE_sequencer_sort(scene); - + sequencer_add_apply_replace_sel(C, op, seq); sequencer_add_apply_overlap(C, op, seq); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } @@ -669,7 +669,7 @@ static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, const w sequencer_generic_invoke_xy__internal(C, op, SEQPROP_NOPATHS, SEQ_TYPE_MOVIE); return sequencer_add_movie_strip_exec(C, op); } - + sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_MOVIE); sequencer_add_init(C, op); @@ -705,7 +705,7 @@ static void sequencer_add_draw(bContext *UNUSED(C), wmOperator *op) void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) { - + /* identifiers */ ot->name = "Add Movie Strip"; ot->idname = "SEQUENCER_OT_movie_strip_add"; @@ -721,7 +721,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + WM_operator_properties_filesel( ot, FILE_TYPE_FOLDER | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); @@ -746,7 +746,7 @@ static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, const w sequencer_generic_invoke_xy__internal(C, op, SEQPROP_NOPATHS, SEQ_TYPE_SOUND_RAM); return sequencer_add_sound_strip_exec(C, op); } - + sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_SOUND_RAM); WM_event_add_fileselect(C, op); @@ -758,7 +758,7 @@ static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, const w void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) { - + /* identifiers */ ot->name = "Add Sound Strip"; ot->idname = "SEQUENCER_OT_sound_strip_add"; @@ -769,10 +769,10 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) ot->exec = sequencer_add_sound_strip_exec; ot->poll = ED_operator_sequencer_active_editable; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + WM_operator_properties_filesel( ot, FILE_TYPE_FOLDER | FILE_TYPE_SOUND, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); @@ -928,7 +928,7 @@ static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, const w sequencer_generic_invoke_xy__internal(C, op, SEQPROP_ENDFRAME | SEQPROP_NOPATHS, SEQ_TYPE_IMAGE); return sequencer_add_image_strip_exec(C, op); } - + sequencer_generic_invoke_xy__internal(C, op, SEQPROP_ENDFRAME, SEQ_TYPE_IMAGE); sequencer_add_init(C, op); @@ -944,7 +944,7 @@ static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, const w void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) { - + /* identifiers */ ot->name = "Add Image Strip"; ot->idname = "SEQUENCER_OT_image_strip_add"; @@ -957,10 +957,10 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) ot->ui = sequencer_add_draw; ot->poll = ED_operator_sequencer_active_editable; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + WM_operator_properties_filesel( ot, FILE_TYPE_FOLDER | FILE_TYPE_IMAGE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); @@ -981,7 +981,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) struct SeqEffectHandle sh; int start_frame, end_frame, channel, type; /* operator props */ - + Sequence *seq1, *seq2, *seq3; const char *error_msg; @@ -990,7 +990,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) channel = RNA_int_get(op->ptr, "channel"); type = RNA_enum_get(op->ptr, "type"); - + // XXX move to invoke if (!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) { BKE_report(op->reports, RPT_ERROR, error_msg); @@ -1026,7 +1026,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) seq->flag |= SEQ_USE_EFFECT_DEFAULT_FADE; BKE_sequence_calc(scene, seq); - + /* basic defaults */ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); strip->us = 1; @@ -1064,7 +1064,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) /* not sure if this is needed with update_changed_seq_and_deps. * it was NOT called in blender 2.4x, but wont hurt */ - BKE_sequencer_sort(scene); + BKE_sequencer_sort(scene); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); @@ -1108,10 +1108,10 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot) ot->exec = sequencer_add_effect_strip_exec; ot->poll = ED_operator_sequencer_active_editable; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME); RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_TYPE_CROSS, "Type", "Sequencer effect type"); RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index b33a26db728..72f78d4f466 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -65,7 +65,7 @@ void sequencer_buttons_register(ARegionType *UNUSED(art)) { #if 0 PanelType *pt; - + pt = MEM_callocN(sizeof(PanelType), "spacetype sequencer panel gpencil"); strcpy(pt->idname, "SEQUENCER_PT_gpencil"); strcpy(pt->label, N_("Grease Pencil")); @@ -83,7 +83,7 @@ static int sequencer_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = sequencer_has_buttons_region(sa); - + if (ar) ED_region_toggle_hidden(C, ar); @@ -95,10 +95,10 @@ void SEQUENCER_OT_properties(wmOperatorType *ot) ot->name = "Properties"; ot->idname = "SEQUENCER_OT_properties"; ot->description = "Toggle the properties region visibility"; - + ot->exec = sequencer_properties_toggle_exec; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = 0; } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index c3a27dad538..7c32895afb4 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -125,12 +125,12 @@ void color3ubv_from_seq(Scene *curscene, Sequence *seq, unsigned char col[3]) case SEQ_TYPE_SCENE: UI_GetThemeColor3ubv(TH_SEQ_SCENE, col); - + if (seq->scene == curscene) { UI_GetColorPtrShade3ubv(col, col, 20); } break; - + /* transitions */ case SEQ_TYPE_CROSS: case SEQ_TYPE_GAMCROSS: @@ -210,14 +210,14 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc float startsample, endsample; float value1, value2; bSound *sound = seq->sound; - + SoundWaveform *waveform; - + if (!sound->spinlock) { sound->spinlock = MEM_mallocN(sizeof(SpinLock), "sound_spinlock"); BLI_spin_init(sound->spinlock); } - + BLI_spin_lock(sound->spinlock); if (!sound->waveform) { if (!(sound->flags & SOUND_FLAGS_WAVEFORM_LOADING)) { @@ -232,7 +232,7 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc return; /* nothing to draw */ } BLI_spin_unlock(sound->spinlock); - + waveform = sound->waveform; if (waveform->length == 0) { @@ -287,7 +287,7 @@ static void drawmeta_stipple(int value) if (value) { GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_HALFTONE); - + glEnable(GL_LINE_STIPPLE); glLineStipple(1, 0x8888); } @@ -358,7 +358,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, color3ubv_from_seq(scene, seq, col); glColor4ubv(col); - + /* clamp within parent sequence strip bounds */ if (x1_chan < x1) x1_chan = x1; if (x2_chan > x2) x2_chan = x2; @@ -379,7 +379,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, if (seqm->flag & SEQ_MUTE) drawmeta_stipple(0); - + glDisable(GL_BLEND); } @@ -400,10 +400,10 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla float v1[2], v2[2], v3[2], rx1 = 0, rx2 = 0; //for triangles and rect float x1, x2, y1, y2; unsigned int whichsel = 0; - + x1 = seq->startdisp; x2 = seq->enddisp; - + y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; y2 = seq->machine + SEQ_STRIP_OFSTOP; @@ -411,50 +411,50 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla if (direction == SEQ_LEFTHANDLE) { rx1 = x1; rx2 = x1 + handsize_clamped * 0.75f; - + v1[0] = x1 + handsize_clamped / 4; v1[1] = y1 + ( ((y1 + y2) / 2.0f - y1) / 2); v2[0] = x1 + handsize_clamped / 4; v2[1] = y2 - ( ((y1 + y2) / 2.0f - y1) / 2); v3[0] = v2[0] + handsize_clamped / 4; v3[1] = (y1 + y2) / 2.0f; - + whichsel = SEQ_LEFTSEL; } else if (direction == SEQ_RIGHTHANDLE) { rx1 = x2 - handsize_clamped * 0.75f; rx2 = x2; - + v1[0] = x2 - handsize_clamped / 4; v1[1] = y1 + ( ((y1 + y2) / 2.0f - y1) / 2); v2[0] = x2 - handsize_clamped / 4; v2[1] = y2 - ( ((y1 + y2) / 2.0f - y1) / 2); v3[0] = v2[0] - handsize_clamped / 4; v3[1] = (y1 + y2) / 2.0f; - + whichsel = SEQ_RIGHTSEL; } - + /* draw! */ if (!(seq->type & SEQ_TYPE_EFFECT) || BKE_sequence_effect_get_num_inputs(seq->type) == 0) { glEnable(GL_BLEND); - + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + if (seq->flag & whichsel) glColor4ub(0, 0, 0, 80); else if (seq->flag & SELECT) glColor4ub(255, 255, 255, 30); else glColor4ub(0, 0, 0, 22); - + glRectf(rx1, y1, rx2, y2); - + if (seq->flag & whichsel) glColor4ub(255, 255, 255, 200); else glColor4ub(0, 0, 0, 50); - + glEnable(GL_POLYGON_SMOOTH); glBegin(GL_TRIANGLES); glVertex2fv(v1); glVertex2fv(v2); glVertex2fv(v3); glEnd(); - + glDisable(GL_POLYGON_SMOOTH); glDisable(GL_BLEND); } - + if ((G.moving & G_TRANSFORM_SEQ) || (seq->flag & whichsel)) { const char col[4] = {255, 255, 255, 255}; char numstr[32]; @@ -570,7 +570,7 @@ static void draw_seq_text(View2D *v2d, SpaceSeq *sseq, Sequence *seq, float x1, str_len = BLI_snprintf(str, sizeof(str), "%s | %d", name, seq->len); } - + if (seq->flag & SELECT) { col[0] = col[1] = col[2] = 255; } @@ -594,23 +594,23 @@ static void draw_seq_text(View2D *v2d, SpaceSeq *sseq, Sequence *seq, float x1, void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, float y1, float x2, float y2) { float ymid1, ymid2; - + if (seq->flag & SEQ_MUTE) { GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_HALFTONE); } - + ymid1 = (y2 - y1) * 0.25f + y1; ymid2 = (y2 - y1) * 0.65f + y1; - + glBegin(GL_QUADS); - + if (seq->flag & SEQ_INVALID_EFFECT) { col[0] = 255; col[1] = 0; col[2] = 255; } else if (seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -50); /* else UI_GetColorPtrShade3ubv(col, col, 0); */ /* DO NOTHING */ - + glColor3ubv(col); - + glVertex2f(x1, y1); glVertex2f(x2, y1); @@ -619,29 +619,29 @@ void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, float y1, f else UI_GetColorPtrShade3ubv(col, col, -5); glColor3ubv((GLubyte *)col); - + glVertex2f(x2, ymid1); glVertex2f(x1, ymid1); - + glEnd(); - + glRectf(x1, ymid1, x2, ymid2); - + glBegin(GL_QUADS); - + glVertex2f(x1, ymid2); glVertex2f(x2, ymid2); - + if (seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -15); else UI_GetColorPtrShade3ubv(col, col, 25); - + glColor3ubv((GLubyte *)col); - + glVertex2f(x2, y2); glVertex2f(x1, y2); - + glEnd(); - + if (seq->flag & SEQ_MUTE) { GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } @@ -652,25 +652,25 @@ void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq) float x1, x2, y1, y2, pixely, a; unsigned char col[3], blendcol[3]; View2D *v2d = &ar->v2d; - + 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); - + color3ubv_from_seq(scene, seq, col); - + if (seq->flag & SELECT) { UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40); glColor4ub(col[0], col[1], col[2], 170); @@ -679,22 +679,22 @@ void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq) 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); - + color3ubv_from_seq(scene, seq, col); - + if (seq->flag & SELECT) { UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40); glColor4ub(col[0], col[1], col[2], 170); @@ -703,30 +703,30 @@ void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq) 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) { color3ubv_from_seq(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); } @@ -735,16 +735,16 @@ void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq) color3ubv_from_seq(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); } @@ -766,7 +766,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg /* we need to know if this is a single image/color or not for drawing */ is_single_image = (char)BKE_sequence_single_check(seq); - + /* body */ x1 = (seq->startstill) ? seq->start : seq->startdisp; y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; @@ -777,7 +777,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg /* get the correct color per strip type*/ //color3ubv_from_seq(scene, seq, col); color3ubv_from_seq(scene, seq, background_col); - + /* draw the main strip body */ if (is_single_image) { /* single image */ draw_shadedstrip(seq, background_col, @@ -796,11 +796,11 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg draw_seq_handle(v2d, seq, handsize_clamped, SEQ_LEFTHANDLE); draw_seq_handle(v2d, seq, handsize_clamped, SEQ_RIGHTHANDLE); - + /* draw the strip outline */ x1 = seq->startdisp; x2 = seq->enddisp; - + /* draw sound wave */ if (seq->type == SEQ_TYPE_SOUND_RAM) { if (!(sseq->flag & SEQ_NO_WAVEFORMS)) { @@ -848,7 +848,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg } else UI_GetColorPtrShade3ubv(col, col, outline_tint); - + if ((seq->type == SEQ_TYPE_META) || ((seq->type == SEQ_TYPE_SCENE) && (seq->flag & SEQ_SCENE_STRIPS))) { @@ -859,15 +859,15 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg glEnable(GL_LINE_STIPPLE); glLineStipple(1, 0x8888); } - + glColor3ubv((GLubyte *)col); - + UI_draw_roundbox_shade_x(GL_LINE_LOOP, x1, y1, x2, y2, 0.0, 0.1, 0.0); - + if (seq->flag & SEQ_MUTE) { glDisable(GL_LINE_STIPPLE); } - + /* calculate if seq is long enough to print a name */ x1 = seq->startdisp + handsize_clamped; x2 = seq->enddisp - handsize_clamped; @@ -997,7 +997,7 @@ static ImBuf *sequencer_make_scope(Scene *scene, ImBuf *ibuf, ImBuf *(*make_scop { ImBuf *display_ibuf = IMB_dupImBuf(ibuf); ImBuf *scope; - + IMB_colormanagement_imbuf_make_display_space(display_ibuf, &scene->view_settings, &scene->display_settings); @@ -1457,7 +1457,7 @@ void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq) { int rectx, recty; int render_size = sseq->render_size; - int proxy_size = 100.0; + int proxy_size = 100.0; if (render_size == 0) { render_size = scene->r.size; } @@ -1483,7 +1483,7 @@ void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq) static void draw_seq_backdrop(View2D *v2d) { int i; - + /* darker gray overlay over the view backdrop */ UI_ThemeColorShade(TH_BACK, -20); glRectf(v2d->cur.xmin, -1.0, v2d->cur.xmax, 1.0); @@ -1497,7 +1497,7 @@ static void draw_seq_backdrop(View2D *v2d) UI_ThemeColorShade(TH_BACK, -15); else UI_ThemeColorShade(TH_BACK, -25); - + glVertex2f(v2d->cur.xmax, i); glVertex2f(v2d->cur.xmin, i); glVertex2f(v2d->cur.xmin, i + 1); @@ -1506,16 +1506,16 @@ static void draw_seq_backdrop(View2D *v2d) i += 1.0; } glEnd(); - + /* Darker lines separating the horizontal bands */ i = max_ii(1, ((int)v2d->cur.ymin) - 1); UI_ThemeColor(TH_GRID); - + glBegin(GL_LINES); while (i < v2d->cur.ymax) { glVertex2f(v2d->cur.xmax, i); glVertex2f(v2d->cur.xmin, i); - + i += 1.0; } glEnd(); @@ -1530,12 +1530,12 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) Sequence *last_seq = BKE_sequencer_active_get(scene); int sel = 0, j; float pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); - + /* 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... */ @@ -1545,15 +1545,15 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) else if (max_ii(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(C, sseq, 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(C, sseq, scene, ar, last_seq, 120, pixelx); @@ -1575,8 +1575,8 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d) const int frame_end = PEFRA + 1; glEnable(GL_BLEND); - - /* draw darkened area outside of active timeline + + /* draw darkened area outside of active timeline * frame range used is preview range or scene range */ UI_ThemeColorShadeAlpha(TH_BACK, -25, -100); @@ -1618,27 +1618,27 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) View2DScrollers *scrollers; short unit = 0, flag = 0; float col[3]; - + /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); - if (ed && ed->metastack.first) + if (ed && ed->metastack.first) glClearColor(col[0], col[1], col[2] - 0.1f, 0.0f); - else + else glClearColor(col[0], col[1], col[2], 0.0f); glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(v2d); - - - /* calculate extents of sequencer strips/data + + + /* calculate extents of sequencer strips/data * NOTE: needed for the scrollers later */ boundbox_seq(scene, &v2d->tot); - - + + /* draw backdrop */ draw_seq_backdrop(v2d); - + /* regular grid-pattern over the rest of the view (i.e. 1-second grid lines) */ UI_view2d_constant_grid_draw(v2d, FPS); @@ -1647,30 +1647,30 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0, false, true); UI_view2d_view_ortho(v2d); } - + ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); - + seq_draw_sfra_efra(scene, v2d); /* sequence strips (if there is data available to be drawn) */ if (ed) { /* draw the data */ draw_seq_strips(C, ed, ar); - + /* text draw cached (for sequence names), in pixelspace now */ UI_view2d_text_cache_draw(ar); } - + /* current frame */ UI_view2d_view_ortho(v2d); if ((sseq->flag & SEQ_DRAWFRAMES) == 0) flag |= DRAWCFRA_UNIT_SECONDS; if ((sseq->flag & SEQ_NO_DRAW_CFRANUM) == 0) flag |= DRAWCFRA_SHOW_NUMBOX; ANIM_draw_cfra(C, v2d, flag); - + /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); ED_markers_draw(C, DRAW_MARKERS_LINES | DRAW_MARKERS_MARGIN); - + /* preview range */ UI_view2d_view_ortho(v2d); ANIM_draw_previewrange(C, v2d, 1); @@ -1687,7 +1687,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) glEnd(); } - + /* callback */ ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 1b0e20ec095..97ff55bf883 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -129,7 +129,7 @@ typedef struct TransSeq { /* ***************** proxy job manager ********************** */ typedef struct ProxyBuildJob { - Scene *scene; + Scene *scene; struct Main *main; ListBase queue; int stop; @@ -154,7 +154,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog struct SeqIndexBuildContext *context = link->data; BKE_sequencer_proxy_rebuild(context, stop, do_update, progress); - + if (*stop) { pj->stop = 1; fprintf(stderr, "Canceling proxy rebuild on users request...\n"); @@ -187,7 +187,7 @@ static void seq_proxy_build_job(const bContext *C) ScrArea *sa = CTX_wm_area(C); Sequence *seq; GSet *file_list; - + if (ed == NULL) { return; } @@ -199,7 +199,7 @@ static void seq_proxy_build_job(const bContext *C) if (!pj) { pj = MEM_callocN(sizeof(ProxyJob), "proxy rebuild job"); - + pj->scene = scene; pj->main = CTX_data_main(C); @@ -218,7 +218,7 @@ static void seq_proxy_build_job(const bContext *C) SEQ_END BLI_gset_free(file_list, MEM_freeN); - + if (!WM_jobs_is_running(wm_job)) { G.is_break = false; WM_jobs_start(CTX_wm_manager(C), wm_job); @@ -245,7 +245,7 @@ void boundbox_seq(Scene *scene, rctf *rect) Editing *ed = BKE_sequencer_editing_get(scene, false); float min[2], max[2]; - + if (ed == NULL) return; min[0] = 0.0; @@ -274,18 +274,18 @@ static int mouse_frame_side(View2D *v2d, short mouse_x, int frame) { int mval[2]; float mouseloc[2]; - + mval[0] = mouse_x; mval[1] = 0; - + /* choose the side based on which side of the playhead the mouse is on */ UI_view2d_region_to_view(v2d, mval[0], mval[1], &mouseloc[0], &mouseloc[1]); - + return mouseloc[0] > frame ? SEQ_SIDE_RIGHT : SEQ_SIDE_LEFT; } -Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int sel) +Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int sel) { /* sel - 0==unselected, 1==selected, -1==done care*/ Sequence *seq; @@ -294,7 +294,7 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se if (ed == NULL) return NULL; if (sel > 0) sel = SELECT; - + for (seq = ed->seqbasep->first; seq; seq = seq->next) { if ((seq != test) && (test->machine == seq->machine) && @@ -317,16 +317,16 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se return NULL; } -static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, int sel) +static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, int sel) { /* sel - 0==unselected, 1==selected, -1==done care*/ Sequence *seq, *best_seq = NULL; Editing *ed = BKE_sequencer_editing_get(scene, false); - + int dist, best_dist; best_dist = MAXFRAME * 2; - + if (ed == NULL) return NULL; seq = ed->seqbasep->first; @@ -337,7 +337,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i ((sel == -1) || (sel == (seq->flag & SELECT)))) { dist = MAXFRAME * 2; - + switch (lr) { case SEQ_SIDE_LEFT: if (seq->enddisp <= test->startdisp) { @@ -350,7 +350,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i } break; } - + if (dist == 0) { best_seq = seq; break; @@ -376,15 +376,15 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[ float displen; *hand = SEQ_SIDE_NONE; - + if (ed == NULL) return NULL; - + pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); - + seq = ed->seqbasep->first; - + while (seq) { if (seq->machine == (int)y) { /* check for both normal strips, and strips that have been flipped horizontally */ @@ -392,23 +392,23 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[ ((seq->startdisp > seq->enddisp) && (seq->startdisp >= x && seq->enddisp <= x)) ) { if (BKE_sequence_tx_test(seq)) { - + /* clamp handles to defined size in pixel space */ - + handsize = seq->handsize; displen = (float)abs(seq->startdisp - seq->enddisp); - + if (displen / pixelx > 16) { /* don't even try to grab the handles of small strips */ /* Set the max value to handle to 1/3 of the total len when its less than 28. * This is important because otherwise selecting handles happens even when you click in the middle */ - + if ((displen / 3) < 30 * pixelx) { handsize = displen / 3; } else { CLAMP(handsize, 7 * pixelx, 30 * pixelx); } - + if (handsize + seq->startdisp >= x) *hand = SEQ_SIDE_LEFT; else if (-handsize + seq->enddisp <= x) @@ -446,7 +446,7 @@ void ED_sequencer_deselect_all(Scene *scene) Sequence *seq; Editing *ed = BKE_sequencer_editing_get(scene, false); - + if (ed == NULL) return; SEQP_BEGIN (ed, seq) @@ -454,7 +454,7 @@ void ED_sequencer_deselect_all(Scene *scene) seq->flag &= ~SEQ_ALLSEL; } SEQ_END - + } void recurs_sel_seq(Sequence *seqm) @@ -519,7 +519,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen { Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq1 = NULL, *seq2 = NULL, *seq3 = NULL, *seq; - + *error_str = NULL; if (!activeseq) @@ -550,7 +550,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen seq2 = seq3; seq3 = tmp; } - + switch (BKE_sequence_effect_get_num_inputs(type)) { case 0: @@ -572,12 +572,12 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen if (seq3 == NULL) seq3 = seq2; break; } - + if (seq1 == NULL && seq2 == NULL && seq3 == NULL) { *error_str = N_("TODO: in what cases does this happen?"); return 0; } - + *selseq1 = seq1; *selseq2 = seq2; *selseq3 = seq3; @@ -689,7 +689,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe) /* First Strip! */ /* strips with extended stillfames before */ - + /* Precaution, needed because the length saved on-disk may not match the length saved in the blend file, * or our code may have minor differences reading file length between versions. * This causes hard-cut to fail, see: T47862 */ @@ -731,7 +731,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe) skip_dup = true; } } - + BKE_sequence_reload_new_file(scene, seq, false); BKE_sequence_calc(scene, seq); @@ -739,7 +739,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe) /* Duplicate AFTER the first change */ seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } - + if (seqn) { seqn->flag |= SELECT; @@ -841,14 +841,14 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe) skip_dup = true; } } - + BKE_sequence_calc(scene, seq); if (!skip_dup) { /* Duplicate AFTER the first change */ seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } - + if (seqn) { seqn->flag |= SELECT; @@ -902,14 +902,14 @@ static bool cut_seq_list(Scene *scene, ListBase *slist, int cutframe, { Sequence *seq, *seq_next_iter; Sequence *seq_first_new = NULL; - + seq = slist->first; while (seq && seq != seq_first_new) { seq_next_iter = seq->next; /* we need this because we may remove seq */ seq->tmp = NULL; if (seq->flag & SELECT) { - if (cutframe > seq->startdisp && + if (cutframe > seq->startdisp && cutframe < seq->enddisp) { Sequence *seqn = cut_seq(scene, seq, cutframe); @@ -947,7 +947,7 @@ static bool sequence_offset_after_frame(Scene *scene, const int delta, const int TimeMarker *marker; /* all strips >= cfra are shifted */ - + if (ed == NULL) return 0; for (seq = ed->seqbasep->first; seq; seq = seq->next) { @@ -975,7 +975,7 @@ static void set_filter_seq(Scene *scene) Sequence *seq; Editing *ed = BKE_sequencer_editing_get(scene, false); - + if (ed == NULL) return; if (okee("Set Deinterlace") == 0) return; @@ -1000,32 +1000,32 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene) Sequence *seq, *last_seq = BKE_sequencer_active_get(scene); Editing *ed = BKE_sequencer_editing_get(scene, false); char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX]; - - + + if (last_seq == NULL) return; - + BLI_strncpy(from, last_seq->strip->dir, sizeof(from)); // XXX if (0 == sbutton(from, 0, sizeof(from) - 1, "From: ")) // return; - + BLI_strncpy(to, from, sizeof(to)); // XXX if (0 == sbutton(to, 0, sizeof(to) - 1, "To: ")) // return; - + if (STREQ(to, from)) return; - + SEQP_BEGIN (ed, seq) { if (seq->flag & SELECT) { if (STREQLEN(seq->strip->dir, from, strlen(from))) { printf("found %s\n", seq->strip->dir); - + /* strip off the beginning */ stripped[0] = 0; BLI_strncpy(stripped, seq->strip->dir + strlen(from), FILE_MAX); - + /* new path */ BLI_snprintf(seq->strip->dir, sizeof(seq->strip->dir), "%s%s", to, stripped); printf("new %s\n", seq->strip->dir); @@ -1033,7 +1033,7 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene) } } SEQ_END - + } @@ -1049,7 +1049,7 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op) boundbox_seq(scene, &rectf); sfra = (int)rectf.xmin; efra = (int)rectf.xmax; - + /* first check if the current frame has a gap already */ for (cfra = CFRA; cfra >= sfra; cfra--) { if (BKE_sequencer_evaluate_frame(scene, cfra)) { @@ -1074,7 +1074,7 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op) } WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } @@ -1086,15 +1086,15 @@ void SEQUENCER_OT_gap_remove(struct wmOperatorType *ot) ot->name = "Remove Gaps"; ot->idname = "SEQUENCER_OT_gap_remove"; ot->description = "Remove gap at current frame to first strip at the right, independent of selection or locked state of strips"; - + /* api callbacks */ // ot->invoke = sequencer_snap_invoke; ot->exec = sequencer_gap_remove_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + RNA_def_boolean(ot->srna, "all", 0, "All Gaps", "Do all gaps to right of current frame"); } @@ -1102,13 +1102,13 @@ static int sequencer_gap_insert_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); int frames = RNA_int_get(op->ptr, "frames"); - + sequence_offset_after_frame(scene, frames, CFRA); - + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; - + } void SEQUENCER_OT_gap_insert(struct wmOperatorType *ot) @@ -1117,15 +1117,15 @@ void SEQUENCER_OT_gap_insert(struct wmOperatorType *ot) ot->name = "Insert Gaps"; ot->idname = "SEQUENCER_OT_gap_insert"; ot->description = "Insert gap at current frame to first strips at the right, independent of selection or locked state of strips"; - + /* api callbacks */ // ot->invoke = sequencer_snap_invoke; ot->exec = sequencer_gap_insert_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + RNA_def_int(ot->srna, "frames", 10, 0, INT_MAX, "Frames", "Frames to insert after current strip", 0, 1000); } @@ -1137,7 +1137,7 @@ static int seq_get_snaplimit(View2D *v2d) * a bit lazy but its only done once pre transform */ float xmouse, ymouse, x; int mval[2] = {24, 0}; /* 24 screen px snap */ - + UI_view2d_region_to_view(v2d, mval[0], mval[1], &xmouse, &ymouse); x = xmouse; mval[0] = 0; @@ -1190,7 +1190,7 @@ int sequencer_view_strips_poll(bContext *C) static int sequencer_snap_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - + Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq; int snap_frame; @@ -1232,31 +1232,31 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op) } } else if (seq->type & SEQ_TYPE_EFFECT) { - if (seq->seq1 && (seq->seq1->flag & SELECT)) + if (seq->seq1 && (seq->seq1->flag & SELECT)) BKE_sequence_calc(scene, seq); - else if (seq->seq2 && (seq->seq2->flag & SELECT)) + else if (seq->seq2 && (seq->seq2->flag & SELECT)) BKE_sequence_calc(scene, seq); - else if (seq->seq3 && (seq->seq3->flag & SELECT)) + else if (seq->seq3 && (seq->seq3->flag & SELECT)) BKE_sequence_calc(scene, seq); } } /* as last: */ BKE_sequencer_sort(scene); - + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } static int sequencer_snap_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); - + int snap_frame; - + snap_frame = CFRA; - + RNA_int_set(op->ptr, "frame", snap_frame); return sequencer_snap_exec(C, op); } @@ -1267,15 +1267,15 @@ void SEQUENCER_OT_snap(struct wmOperatorType *ot) ot->name = "Snap Strips to Frame"; ot->idname = "SEQUENCER_OT_snap"; ot->description = "Frame where selected strips will be snapped"; - + /* api callbacks */ ot->invoke = sequencer_snap_invoke; ot->exec = sequencer_snap_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be snapped", INT_MIN, INT_MAX); } @@ -1729,7 +1729,7 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op) bool selected; selected = !RNA_boolean_get(op->ptr, "unselected"); - + for (seq = ed->seqbasep->first; seq; seq = seq->next) { if ((seq->flag & SEQ_LOCK) == 0) { if (selected) { /* mute unselected */ @@ -1746,10 +1746,10 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op) } } } - + BKE_sequencer_update_muting(ed); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } @@ -1759,14 +1759,14 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot) ot->name = "Mute Strips"; ot->idname = "SEQUENCER_OT_mute"; ot->description = "Mute (un)selected strips"; - + /* api callbacks */ ot->exec = sequencer_mute_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips"); } @@ -1780,7 +1780,7 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op) bool selected; selected = !RNA_boolean_get(op->ptr, "unselected"); - + for (seq = ed->seqbasep->first; seq; seq = seq->next) { if ((seq->flag & SEQ_LOCK) == 0) { if (selected) { /* unmute unselected */ @@ -1797,10 +1797,10 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op) } } } - + BKE_sequencer_update_muting(ed); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } @@ -1810,14 +1810,14 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot) ot->name = "Un-Mute Strips"; ot->idname = "SEQUENCER_OT_unmute"; ot->description = "Unmute (un)selected strips"; - + /* api callbacks */ ot->exec = sequencer_unmute_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Unmute unselected rather than selected strips"); } @@ -1846,11 +1846,11 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot) ot->name = "Lock Strips"; ot->idname = "SEQUENCER_OT_lock"; ot->description = "Lock the active strip so that it can't be transformed"; - + /* api callbacks */ ot->exec = sequencer_lock_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -1879,11 +1879,11 @@ void SEQUENCER_OT_unlock(struct wmOperatorType *ot) ot->name = "UnLock Strips"; ot->idname = "SEQUENCER_OT_unlock"; ot->description = "Unlock the active strip so that it can't be transformed"; - + /* api callbacks */ ot->exec = sequencer_unlock_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -1921,11 +1921,11 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot) ot->name = "Reload Strips"; ot->idname = "SEQUENCER_OT_reload"; ot->description = "Reload strips in the sequencer"; - + /* api callbacks */ ot->exec = sequencer_reload_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER; /* no undo, the data changed is stored outside 'main' */ @@ -1961,7 +1961,7 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot) ot->name = "Refresh Sequencer"; ot->idname = "SEQUENCER_OT_refresh_all"; ot->description = "Refresh the sequencer editor"; - + /* api callbacks */ ot->exec = sequencer_refresh_all_exec; ot->poll = sequencer_refresh_all_poll; @@ -2082,14 +2082,14 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op) cut_frame = RNA_int_get(op->ptr, "frame"); cut_hard = RNA_enum_get(op->ptr, "type"); cut_side = RNA_enum_get(op->ptr, "side"); - + if (cut_hard == SEQ_CUT_HARD) { changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_hard); } else { changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_soft); } - + if (changed) { /* got new strips ? */ Sequence *seq; @@ -2142,7 +2142,7 @@ static int sequencer_cut_invoke(bContext *C, wmOperator *op, const wmEvent *even if (ED_operator_sequencer_active(C) && v2d) cut_side = mouse_frame_side(v2d, event->mval[0], cut_frame); - + RNA_int_set(op->ptr, "frame", cut_frame); RNA_enum_set(op->ptr, "side", cut_side); /*RNA_enum_set(op->ptr, "type", cut_hard); */ /*This type is set from the key shortcut */ @@ -2157,15 +2157,15 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot) ot->name = "Cut Strips"; ot->idname = "SEQUENCER_OT_cut"; ot->description = "Cut the selected strips"; - + /* api callbacks */ ot->invoke = sequencer_cut_invoke; ot->exec = sequencer_cut_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be cut", INT_MIN, INT_MAX); RNA_def_enum(ot->srna, "type", prop_cut_types, SEQ_CUT_SOFT, "Type", "The type of cut operation to perform on strips"); RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side that remains selected after cutting"); @@ -2217,14 +2217,14 @@ void SEQUENCER_OT_duplicate(wmOperatorType *ot) ot->name = "Duplicate Strips"; ot->idname = "SEQUENCER_OT_duplicate"; ot->description = "Duplicate the selected strips"; - + /* api callbacks */ ot->exec = sequencer_add_duplicate_exec; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* to give to transform */ RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); } @@ -2285,7 +2285,7 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op)) } WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } @@ -2311,12 +2311,12 @@ void SEQUENCER_OT_delete(wmOperatorType *ot) ot->name = "Erase Strips"; ot->idname = "SEQUENCER_OT_delete"; ot->description = "Erase selected strips from the sequencer"; - + /* api callbacks */ ot->invoke = sequencer_delete_invoke; ot->exec = sequencer_delete_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -2379,7 +2379,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, false); - + Sequence *seq, *seq_new; Strip *strip_new; StripElem *se, *se_new; @@ -2449,7 +2449,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) /* as last: */ BKE_sequencer_sort(scene); - + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); return OPERATOR_FINISHED; @@ -2462,12 +2462,12 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot) ot->name = "Separate Images"; ot->idname = "SEQUENCER_OT_images_separate"; ot->description = "On image sequence strips, it returns a strip for each image"; - + /* api callbacks */ ot->exec = sequencer_separate_images_exec; ot->invoke = WM_operator_props_popup_confirm; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -2553,11 +2553,11 @@ void SEQUENCER_OT_meta_toggle(wmOperatorType *ot) ot->name = "Toggle Meta Strip"; ot->idname = "SEQUENCER_OT_meta_toggle"; ot->description = "Toggle a metastrip (to edit enclosed strips)"; - + /* api callbacks */ ot->exec = sequencer_meta_toggle_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -2568,7 +2568,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, false); - + Sequence *seq, *seqm, *next, *last_seq = BKE_sequencer_active_get(scene); int channel_max = 1; @@ -2600,7 +2600,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) seqm->strip = MEM_callocN(sizeof(Strip), "metastrip"); seqm->strip->us = 1; - + BKE_sequencer_active_set(scene, seqm); if (BKE_sequence_test_overlap(ed->seqbasep, seqm) ) BKE_sequence_base_shuffle(ed->seqbasep, seqm, scene); @@ -2620,11 +2620,11 @@ void SEQUENCER_OT_meta_make(wmOperatorType *ot) ot->name = "Make Meta Strip"; ot->idname = "SEQUENCER_OT_meta_make"; ot->description = "Group selected strips into a metastrip"; - + /* api callbacks */ ot->exec = sequencer_meta_make_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -2693,11 +2693,11 @@ void SEQUENCER_OT_meta_separate(wmOperatorType *ot) ot->name = "UnMeta Strip"; ot->idname = "SEQUENCER_OT_meta_separate"; ot->description = "Put the contents of a metastrip back in the sequencer"; - + /* api callbacks */ ot->exec = sequencer_meta_separate_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -2719,11 +2719,11 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot) ot->name = "View All"; ot->idname = "SEQUENCER_OT_view_all"; ot->description = "View all the strips in the sequencer"; - + /* api callbacks */ ot->exec = sequencer_view_all_exec; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER; } @@ -2732,7 +2732,7 @@ static int sequencer_view_frame_exec(bContext *C, wmOperator *op) { const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); ANIM_center_frame(C, smooth_viewtx); - + return OPERATOR_FINISHED; } @@ -2742,11 +2742,11 @@ void SEQUENCER_OT_view_frame(wmOperatorType *ot) ot->name = "View Frame"; ot->idname = "SEQUENCER_OT_view_frame"; ot->description = "Reset viewable area to show range around current frame"; - + /* api callbacks */ ot->exec = sequencer_view_frame_exec; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -2766,7 +2766,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op)) v2d->cur = v2d->tot; UI_view2d_curRect_validate(v2d); UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY); - + #if 0 /* Like zooming on an image view */ float zoomX, zoomY; @@ -2808,11 +2808,11 @@ void SEQUENCER_OT_view_all_preview(wmOperatorType *ot) ot->name = "View All"; ot->idname = "SEQUENCER_OT_view_all_preview"; ot->description = "Zoom preview to fit in the area"; - + /* api callbacks */ ot->exec = sequencer_view_all_preview_exec; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER; } @@ -2883,11 +2883,11 @@ void SEQUENCER_OT_view_toggle(wmOperatorType *ot) ot->name = "View Toggle"; ot->idname = "SEQUENCER_OT_view_toggle"; ot->description = "Toggle between sequencer views (sequence, preview, both)"; - + /* api callbacks */ ot->exec = sequencer_view_toggle_exec; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER; } @@ -2928,7 +2928,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *op) if (ymax != 0) { const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); - + xmax += xmargin; xmin -= xmargin; ymax += ymargin; @@ -2957,7 +2957,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *op) else { return OPERATOR_CANCELLED; } - + } void SEQUENCER_OT_view_selected(wmOperatorType *ot) @@ -2966,11 +2966,11 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot) ot->name = "View Selected"; ot->idname = "SEQUENCER_OT_view_selected"; ot->description = "Zoom the sequencer on the selected strips"; - + /* api callbacks */ ot->exec = sequencer_view_selected_exec; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER; } @@ -2982,7 +2982,7 @@ static bool strip_jump_internal(Scene *scene, bool changed = false; int cfra = CFRA; int nfra = BKE_sequencer_find_next_prev_edit(scene, cfra, side, do_skip_mute, do_center, false); - + if (nfra != cfra) { CFRA = nfra; changed = true; @@ -3013,7 +3013,7 @@ static int sequencer_strip_jump_exec(bContext *C, wmOperator *op) } WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); - + return OPERATOR_FINISHED; } @@ -3030,7 +3030,7 @@ void SEQUENCER_OT_strip_jump(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ RNA_def_boolean(ot->srna, "next", true, "Next Strip", ""); RNA_def_boolean(ot->srna, "center", true, "Use strip center", ""); @@ -3082,9 +3082,9 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op) if (active_seq == NULL) return OPERATOR_CANCELLED; seq = find_next_prev_sequence(scene, active_seq, side, -1); - + if (seq) { - + /* disallow effect strips */ if (BKE_sequence_effect_get_num_inputs(seq->type) >= 1 && (seq->effectdata || seq->seq1 || seq->seq2 || seq->seq3)) return OPERATOR_CANCELLED; @@ -3092,10 +3092,10 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; switch (side) { - case SEQ_SIDE_LEFT: + case SEQ_SIDE_LEFT: swap_sequence(scene, seq, active_seq); break; - case SEQ_SIDE_RIGHT: + case SEQ_SIDE_RIGHT: swap_sequence(scene, active_seq, seq); break; } @@ -3135,14 +3135,14 @@ void SEQUENCER_OT_swap(wmOperatorType *ot) ot->name = "Swap Strip"; ot->idname = "SEQUENCER_OT_swap"; ot->description = "Swap active strip with strip to the right or left"; - + /* api callbacks */ ot->exec = sequencer_swap_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ RNA_def_enum(ot->srna, "side", prop_side_lr_types, SEQ_SIDE_RIGHT, "Side", "Side of the strip to swap"); } @@ -3194,14 +3194,14 @@ void SEQUENCER_OT_rendersize(wmOperatorType *ot) ot->name = "Set Render Size"; ot->idname = "SEQUENCER_OT_rendersize"; ot->description = "Set render size and aspect from active sequence"; - + /* api callbacks */ ot->exec = sequencer_rendersize_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ } @@ -3484,13 +3484,13 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq; GSet *file_list; - + if (ed == NULL) { return OPERATOR_CANCELLED; } file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list"); - + SEQP_BEGIN(ed, seq) { if ((seq->flag & SELECT)) { @@ -3512,7 +3512,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) SEQ_END BLI_gset_free(file_list, MEM_freeN); - + return OPERATOR_FINISHED; } @@ -3522,11 +3522,11 @@ void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot) ot->name = "Rebuild Proxy and Timecode Indices"; ot->idname = "SEQUENCER_OT_rebuild_proxy"; ot->description = "Rebuild all selected proxies and timecode indices using the job system"; - + /* api callbacks */ ot->invoke = sequencer_rebuild_proxy_invoke; ot->exec = sequencer_rebuild_proxy_exec; - + /* flags */ ot->flag = OPTYPE_REGISTER; } @@ -3563,27 +3563,27 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) if (proxy_25) seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_25; - else + else seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_25; - + if (proxy_50) seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_50; - else + else seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_50; - + if (proxy_75) seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_75; - else + else seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_75; - + if (proxy_100) seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_100; - else + else seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_100; - + if (!overwrite) seq->strip->proxy->build_flags |= SEQ_PROXY_SKIP_EXISTING; - else + else seq->strip->proxy->build_flags &= ~SEQ_PROXY_SKIP_EXISTING; } } @@ -3591,7 +3591,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) SEQ_END WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - + return OPERATOR_FINISHED; } @@ -3601,14 +3601,14 @@ void SEQUENCER_OT_enable_proxies(wmOperatorType *ot) ot->name = "Set Selected Strip Proxies"; ot->idname = "SEQUENCER_OT_enable_proxies"; ot->description = "Enable selected proxies on all selected Movie strips"; - + /* api callbacks */ ot->invoke = sequencer_enable_proxies_invoke; ot->exec = sequencer_enable_proxies_exec; - + /* flags */ ot->flag = OPTYPE_REGISTER; - + RNA_def_boolean(ot->srna, "proxy_25", false, "25%", ""); RNA_def_boolean(ot->srna, "proxy_50", false, "50%", ""); RNA_def_boolean(ot->srna, "proxy_75", false, "75%", ""); diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 04c9cd6fa54..713aa8994b3 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -175,7 +175,7 @@ enum { SEQ_SELECT_LR_NONE = 0, SEQ_SELECT_LR_MOUSE, SEQ_SELECT_LR_LEFT, - SEQ_SELECT_LR_RIGHT + SEQ_SELECT_LR_RIGHT }; /* defines used internally */ diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index a3cfcae77b8..234989ef244 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -68,7 +68,7 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_meta_toggle); WM_operatortype_append(SEQUENCER_OT_meta_make); WM_operatortype_append(SEQUENCER_OT_meta_separate); - + WM_operatortype_append(SEQUENCER_OT_gap_remove); WM_operatortype_append(SEQUENCER_OT_gap_insert); WM_operatortype_append(SEQUENCER_OT_snap); @@ -135,7 +135,7 @@ void sequencer_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap; wmKeyMapItem *kmi; - + /* Common items ------------------------------------------------------------------ */ keymap = WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0); @@ -228,7 +228,7 @@ void sequencer_keymap(wmKeyConfig *keyconf) RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_gap_remove", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "all", false); RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_gap_remove", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "all", true); WM_keymap_add_item(keymap, "SEQUENCER_OT_gap_insert", EQUALKEY, KM_PRESS, KM_SHIFT, 0); - + WM_keymap_add_item(keymap, "SEQUENCER_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_swap_inputs", SKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_preview.c b/source/blender/editors/space_sequencer/sequencer_preview.c index 3f908dc7096..c58c05b67c0 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview.c +++ b/source/blender/editors/space_sequencer/sequencer_preview.c @@ -80,11 +80,11 @@ static void preview_startjob(void *data, short *stop, short *do_update, float *p BLI_mutex_lock(pj->mutex); previewjb = pj->previews.first; BLI_mutex_unlock(pj->mutex); - + while (previewjb) { PreviewJobAudio *preview_next; bSound *sound = previewjb->sound; - + BKE_sound_read_waveform(sound, stop); if (*stop || G.is_break) { @@ -98,12 +98,12 @@ static void preview_startjob(void *data, short *stop, short *do_update, float *p BLI_spin_lock(sound->spinlock); sound->flags &= ~SOUND_FLAGS_WAVEFORM_LOADING; BLI_spin_unlock(sound->spinlock); - + BLI_mutex_lock(pj->mutex); previewjb = previewjb->next; BLI_mutex_unlock(pj->mutex); } - + BLI_mutex_lock(pj->mutex); BLI_freelistN(&pj->previews); pj->total = 0; @@ -111,12 +111,12 @@ static void preview_startjob(void *data, short *stop, short *do_update, float *p BLI_mutex_unlock(pj->mutex); break; } - + BLI_mutex_lock(pj->mutex); preview_next = previewjb->next; BLI_freelinkN(&pj->previews, previewjb); previewjb = preview_next; - pj->processed++; + pj->processed++; *progress = (pj->total > 0) ? (float)pj->processed / (float)pj->total : 1.0f; *do_update = true; BLI_mutex_unlock(pj->mutex); @@ -145,19 +145,19 @@ void sequencer_preview_add_sound(const bContext *C, Sequence *seq) if (!pj) { pj = MEM_callocN(sizeof(PreviewJob), "preview rebuild job"); - + pj->mutex = BLI_mutex_alloc(); pj->scene = CTX_data_scene(C); - + WM_jobs_customdata_set(wm_job, pj, free_preview_job); WM_jobs_timer(wm_job, 0.1, NC_SCENE | ND_SEQUENCER, NC_SCENE | ND_SEQUENCER); WM_jobs_callbacks(wm_job, preview_startjob, NULL, NULL, preview_endjob); } - + /* attempt to lock mutex of job here */ - + audiojob->sound = seq->sound; - + BLI_mutex_lock(pj->mutex); BLI_addtail(&pj->previews, audiojob); pj->total++; @@ -168,5 +168,5 @@ void sequencer_preview_add_sound(const bContext *C, Sequence *seq) WM_jobs_start(CTX_wm_manager(C), wm_job); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(sa); } diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index 8c57089f7ab..00811d68251 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -160,7 +160,7 @@ static ImBuf *make_waveform_view_from_ibuf_byte(ImBuf *ibuf) wform_put_grid(tgt, w, h); wform_put_border(tgt, w, h); - + for (x = 0; x < 256; x++) { wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, waveform_gamma) * 255); } @@ -229,7 +229,7 @@ static ImBuf *make_waveform_view_from_ibuf_float(ImBuf *ibuf) } wform_put_border(tgt, w, h); - + return rval; } @@ -285,7 +285,7 @@ static ImBuf *make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf) } wform_put_border(tgt, w, h); - + return rval; } @@ -334,7 +334,7 @@ static ImBuf *make_sep_waveform_view_from_ibuf_float(ImBuf *ibuf) } wform_put_border(tgt, w, h); - + return rval; } @@ -542,7 +542,7 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf) } wform_put_border((unsigned char *) rval->rect, rval->x, rval->y); - + return rval; } @@ -610,7 +610,7 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf) if (bins[2][x] > nb) nb = bins[2][x]; } - + for (x = 0; x < HIS_STEPS; x++) { if (nr) { draw_histogram_bar(rval, x + 1, ((float) bins[0][x]) / nr, 0); @@ -622,11 +622,11 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf) draw_histogram_bar(rval, x + 1, ((float) bins[2][x]) / nb, 2); } } - + draw_histogram_marker(rval, get_bin_float(0.0)); draw_histogram_marker(rval, get_bin_float(1.0)); wform_put_border((unsigned char *) rval->rect, rval->x, rval->y); - + return rval; } @@ -653,7 +653,7 @@ static void vectorscope_put_cross(unsigned char r, unsigned char g, unsigned ch rgb[1] = (float)g / 255.0f; rgb[2] = (float)b / 255.0f; rgb_to_yuv_normalized(rgb, yuv); - + p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); @@ -698,12 +698,12 @@ static ImBuf *make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf) for (x = 0; x < ibuf->x; x++) { const char *src1 = src + 4 * (ibuf->x * y + x); char *p; - + rgb[0] = (float)src1[0] / 255.0f; rgb[1] = (float)src1[1] / 255.0f; rgb[2] = (float)src1[2] / 255.0f; rgb_to_yuv_normalized(rgb, yuv); - + p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); scope_put_pixel(wtable, (unsigned char *)p); @@ -744,7 +744,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf) for (x = 0; x < ibuf->x; x++) { const float *src1 = src + 4 * (ibuf->x * y + x); const char *p; - + memcpy(rgb, src1, 3 * sizeof(float)); CLAMP(rgb[0], 0.0f, 1.0f); @@ -752,7 +752,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf) CLAMP(rgb[2], 0.0f, 1.0f); rgb_to_yuv_normalized(rgb, yuv); - + p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); scope_put_pixel(wtable, (unsigned char *)p); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 90a369760ac..d7206a6da4e 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -59,11 +59,11 @@ static void *find_nearest_marker(int UNUSED(d1), int UNUSED(d2)) { return NULL; } - + 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 @@ -152,10 +152,10 @@ static void select_linked_time(ListBase *seqbase, Sequence *seq_link) void select_surround_from_last(Scene *scene) { Sequence *seq = get_last_seq(scene); - + if (seq == NULL) return; - + select_surrounding_handles(scene, seq); } #endif @@ -163,7 +163,7 @@ void select_surround_from_last(Scene *scene) 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); @@ -264,11 +264,11 @@ void SEQUENCER_OT_select_all(struct wmOperatorType *ot) ot->name = "(De)select All"; ot->idname = "SEQUENCER_OT_select_all"; ot->description = "Select or deselect all strips"; - + /* api callbacks */ ot->exec = sequencer_de_select_all_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -294,7 +294,7 @@ static int sequencer_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) } WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); - + return OPERATOR_FINISHED; } @@ -304,11 +304,11 @@ void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot) ot->name = "Select Inverse"; ot->idname = "SEQUENCER_OT_select_inverse"; ot->description = "Select unselected strips"; - + /* api callbacks */ ot->exec = sequencer_select_inverse_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -322,16 +322,16 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e const bool linked_handle = RNA_boolean_get(op->ptr, "linked_handle"); const bool linked_time = RNA_boolean_get(op->ptr, "linked_time"); int left_right = RNA_enum_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 @@ -353,13 +353,13 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e /* 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 != SEQ_SELECT_LR_NONE) { /* use different logic for this */ float x; ED_sequencer_deselect_all(scene); - + switch (left_right) { case SEQ_SELECT_LR_MOUSE: x = UI_view2d_region_to_view_x(v2d, event->mval[0]); @@ -372,7 +372,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e x = CFRA; break; } - + SEQP_BEGIN (ed, seq) { if (((x < CFRA) && (seq->enddisp <= CFRA)) || @@ -408,10 +408,10 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e if (extend == 0 && linked_handle == 0) ED_sequencer_deselect_all(scene); - + if (seq) { 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); @@ -422,7 +422,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR); } } - + /* On Alt selection, select the strip and bordering handles */ if (linked_handle) { if (!ELEM(hand, SEQ_SIDE_LEFT, SEQ_SIDE_RIGHT)) { @@ -521,7 +521,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e } } } - + /* marker transform */ #if 0 // XXX probably need to redo this differently for 2.5 if (marker) { @@ -529,7 +529,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e // getmouseco_areawin(mval); xo = mval[0]; yo = mval[1]; - + while (get_mbut()) { // getmouseco_areawin(mval); if (abs(mval[0] - xo) + abs(mval[1] - yo) > 4) { @@ -539,7 +539,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e } } #endif - + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); /* allowing tweaks */ @@ -555,19 +555,19 @@ void SEQUENCER_OT_select(wmOperatorType *ot) {SEQ_SELECT_LR_RIGHT, "RIGHT", 0, "Right", "Select right"}, {0, NULL, 0, NULL, NULL} }; - + /* identifiers */ ot->name = "Activate/Select"; ot->idname = "SEQUENCER_OT_select"; ot->description = "Select a strip (last selected becomes the \"active strip\")"; - + /* api callbacks */ ot->invoke = sequencer_select_invoke; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection"); RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip"); @@ -584,10 +584,10 @@ static bool select_more_less_seq__internal(Scene *scene, bool sel, const bool li Sequence *seq, *neighbor; bool changed = false; int isel; - + if (ed == NULL) return changed; - + if (sel) { sel = SELECT; isel = 0; @@ -596,14 +596,14 @@ static bool select_more_less_seq__internal(Scene *scene, bool sel, const bool li sel = 0; isel = SELECT; } - + if (!linked) { /* if not linked we only want to touch each seq once, newseq */ for (seq = ed->seqbasep->first; seq; seq = seq->next) { seq->tmp = NULL; } } - + for (seq = ed->seqbasep->first; seq; seq = seq->next) { if ((seq->flag & SELECT) == sel) { if (linked || (seq->tmp == NULL)) { @@ -639,7 +639,7 @@ static bool select_more_less_seq__internal(Scene *scene, bool sel, const bool li } } } - + return changed; } @@ -649,12 +649,12 @@ static bool select_more_less_seq__internal(Scene *scene, bool sel, const bool li static int sequencer_select_more_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - + if (!select_more_less_seq__internal(scene, true, false)) return OPERATOR_CANCELLED; WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); - + return OPERATOR_FINISHED; } @@ -664,14 +664,14 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot) ot->name = "Select More"; ot->idname = "SEQUENCER_OT_select_more"; ot->description = "Select more strips adjacent to the current selection"; - + /* api callbacks */ ot->exec = sequencer_select_more_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ } @@ -680,12 +680,12 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot) static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - + if (!select_more_less_seq__internal(scene, false, false)) return OPERATOR_CANCELLED; WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); - + return OPERATOR_FINISHED; } @@ -695,14 +695,14 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot) ot->name = "Select Less"; ot->idname = "SEQUENCER_OT_select_less"; ot->description = "Shrink the current selection of adjacent selected strips"; - + /* api callbacks */ ot->exec = sequencer_select_less_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ } @@ -712,9 +712,9 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, cons { Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); - + bool extend = RNA_boolean_get(op->ptr, "extend"); - + Sequence *mouse_seq; int selected, hand; @@ -722,20 +722,20 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, cons mouse_seq = find_nearest_seq(scene, v2d, &hand, event->mval); if (!mouse_seq) return OPERATOR_FINISHED; /* user error as with mesh?? */ - + if (extend == 0) ED_sequencer_deselect_all(scene); - + mouse_seq->flag |= SELECT; recurs_sel_seq(mouse_seq); - + selected = 1; while (selected) { selected = select_more_less_seq__internal(scene, 1, 1); } - + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); - + return OPERATOR_FINISHED; } @@ -745,14 +745,14 @@ void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot) ot->name = "Select Pick Linked"; ot->idname = "SEQUENCER_OT_select_linked_pick"; ot->description = "Select a chain of linked strips nearest to the mouse pointer"; - + /* api callbacks */ ot->invoke = sequencer_select_linked_pick_invoke; ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection"); } @@ -780,14 +780,14 @@ void SEQUENCER_OT_select_linked(wmOperatorType *ot) ot->name = "Select Linked"; ot->idname = "SEQUENCER_OT_select_linked"; ot->description = "Select all strips adjacent to the current selection"; - + /* api callbacks */ ot->exec = sequencer_select_linked_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ } @@ -830,14 +830,14 @@ void SEQUENCER_OT_select_handles(wmOperatorType *ot) ot->name = "Select Handles"; ot->idname = "SEQUENCER_OT_select_handles"; ot->description = "Select manipulator handles on the sides of the selected strip"; - + /* api callbacks */ ot->exec = sequencer_select_handles_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side of the handle that is selected"); } @@ -867,7 +867,7 @@ void SEQUENCER_OT_select_active_side(wmOperatorType *ot) ot->name = "Select Active Side"; ot->idname = "SEQUENCER_OT_select_active_side"; ot->description = "Select strips on the nominated side of the active strip"; - + /* api callbacks */ ot->exec = sequencer_select_active_side_exec; ot->poll = sequencer_edit_poll; @@ -886,7 +886,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, false); View2D *v2d = UI_view2d_fromcontext(C); - + Sequence *seq; rctf rectf, rq; const bool select = !RNA_boolean_get(op->ptr, "deselect"); @@ -900,7 +900,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) for (seq = ed->seqbasep->first; seq; seq = seq->next) { seq_rectf(seq, &rq); - + if (BLI_rctf_isect(&rq, &rectf, NULL)) { if (select) seq->flag |= SELECT; else seq->flag &= ~SEQ_ALLSEL; @@ -915,7 +915,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); return OPERATOR_FINISHED; -} +} /* ****** Border Select ****** */ @@ -925,18 +925,18 @@ void SEQUENCER_OT_select_border(wmOperatorType *ot) ot->name = "Border Select"; ot->idname = "SEQUENCER_OT_select_border"; ot->description = "Select strips using border selection"; - + /* api callbacks */ ot->invoke = WM_gesture_border_invoke; ot->exec = sequencer_borderselect_exec; ot->modal = WM_gesture_border_modal; ot->cancel = WM_gesture_border_cancel; - + ot->poll = ED_operator_sequencer_active; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* rna */ WM_operator_properties_gesture_border_select(ot); } @@ -1267,15 +1267,15 @@ void SEQUENCER_OT_select_grouped(wmOperatorType *ot) ot->name = "Select Grouped"; ot->description = "Select all strips grouped by various properties"; ot->idname = "SEQUENCER_OT_select_grouped"; - + /* api callbacks */ ot->invoke = WM_menu_invoke; ot->exec = sequencer_select_grouped_exec; ot->poll = sequencer_edit_poll; - + /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - + /* properties */ ot->prop = RNA_def_enum(ot->srna, "type", sequencer_prop_select_grouped_types, 0, "Type", ""); RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend selection instead of deselecting everything first"); diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 4d6ea865b40..4acda8799cb 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -97,7 +97,7 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) ImBuf *ibuf = sequencer_ibuf_get(bmain, scene, sseq, CFRA, 0, NULL); ImageSampleInfo *info = op->customdata; float fx, fy; - + if (ibuf == NULL) { IMB_freeImBuf(ibuf); info->draw = 0; @@ -121,7 +121,7 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) info->colp = NULL; info->colfp = NULL; - + if (ibuf->rect) { cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index ef1e9d866e7..47c134d02e1 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -81,28 +81,28 @@ ARegion *sequencer_has_buttons_region(ScrArea *sa) ar = BKE_area_find_region_type(sa, RGN_TYPE_UI); if (ar) return ar; - + /* add subdiv level; after header */ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); /* is error! */ if (ar == NULL) return NULL; - + arnew = MEM_callocN(sizeof(ARegion), "buttons for sequencer"); - + BLI_insertlinkafter(&sa->regionbase, ar, arnew); arnew->regiontype = RGN_TYPE_UI; arnew->alignment = RGN_ALIGN_RIGHT; - + arnew->flag = RGN_FLAG_HIDDEN; - + return arnew; } static ARegion *sequencer_find_region(ScrArea *sa, short type) { ARegion *ar = NULL; - + for (ar = sa->regionbase.first; ar; ar = ar->next) if (ar->regiontype == type) return ar; @@ -117,7 +117,7 @@ static SpaceLink *sequencer_new(const bContext *C) Scene *scene = CTX_data_scene(C); ARegion *ar; SpaceSeq *sseq; - + sseq = MEM_callocN(sizeof(SpaceSeq), "initsequencer"); sseq->spacetype = SPACE_SEQ; sseq->chanshown = 0; @@ -127,19 +127,19 @@ static SpaceLink *sequencer_new(const bContext *C) /* header */ ar = MEM_callocN(sizeof(ARegion), "header for sequencer"); - + BLI_addtail(&sseq->regionbase, ar); ar->regiontype = RGN_TYPE_HEADER; ar->alignment = RGN_ALIGN_BOTTOM; - + /* buttons/list view */ ar = MEM_callocN(sizeof(ARegion), "buttons for sequencer"); - + BLI_addtail(&sseq->regionbase, ar); ar->regiontype = RGN_TYPE_UI; ar->alignment = RGN_ALIGN_RIGHT; ar->flag = RGN_FLAG_HIDDEN; - + /* preview region */ /* NOTE: if you change values here, also change them in sequencer_init_preview_region */ ar = MEM_callocN(sizeof(ARegion), "preview region for sequencer"); @@ -166,26 +166,26 @@ static SpaceLink *sequencer_new(const bContext *C) /* main region */ ar = MEM_callocN(sizeof(ARegion), "main region for sequencer"); - + BLI_addtail(&sseq->regionbase, ar); ar->regiontype = RGN_TYPE_WINDOW; - - + + /* seq space goes from (0,8) to (0, efra) */ - + ar->v2d.tot.xmin = 0.0f; ar->v2d.tot.ymin = 0.0f; ar->v2d.tot.xmax = scene->r.efra; ar->v2d.tot.ymax = 8.0f; - + ar->v2d.cur = ar->v2d.tot; - + ar->v2d.min[0] = 10.0f; ar->v2d.min[1] = 0.5f; - + ar->v2d.max[0] = MAXFRAMEF; ar->v2d.max[1] = MAXSEQ; - + ar->v2d.minzoom = 0.01f; ar->v2d.maxzoom = 100.0f; @@ -200,7 +200,7 @@ static SpaceLink *sequencer_new(const bContext *C) /* not spacelink itself */ static void sequencer_free(SpaceLink *sl) -{ +{ SpaceSeq *sseq = (SpaceSeq *) sl; SequencerScopes *scopes = &sseq->scopes; @@ -231,7 +231,7 @@ static void sequencer_free(SpaceLink *sl) /* spacetype; init callback */ static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { - + } static void sequencer_refresh(const bContext *C, ScrArea *sa) @@ -335,7 +335,7 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa) static SpaceLink *sequencer_duplicate(SpaceLink *sl) { SpaceSeq *sseqn = MEM_dupallocN(sl); - + /* clear or remove stuff from old */ // XXX sseq->gpd = gpencil_data_duplicate(sseq->gpd, false); @@ -421,7 +421,7 @@ static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop) char dir[FILE_MAX], file[FILE_MAX]; BLI_split_dirfile(drag->path, dir, file, sizeof(dir), sizeof(file)); - + RNA_string_set(drop->ptr, "directory", dir); RNA_collection_clear(drop->ptr, "files"); -- cgit v1.2.3