diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-26 13:16:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-26 13:16:47 +0300 |
commit | ce3b78c73a7ccc16fdccf7decedb5d1578dfdf0a (patch) | |
tree | 87f1a9c41ebe6f74806f1ae76206f1d328c85700 /source/blender/editors/space_sequencer/sequencer_add.c | |
parent | 5279d118c2ddee0e6fef66aaf78452c1b302dd42 (diff) |
Cleanup: style, use braces for editor/spaces
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_add.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index c21d1f6f57e..5e36ad9e8bc 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -166,8 +166,9 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i RNA_int_set(op->ptr, "frame_start", cfra); - if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) + if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) { RNA_int_set(op->ptr, "frame_end", cfra + 25); // XXX arbitrary but ok for now. + } if (!(flag & SEQPROP_NOPATHS)) { sequencer_generic_invoke_path__internal(C, op, "filepath"); @@ -201,28 +202,34 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato is_file = 0; } - if ((is_file != -1) && relative) + if ((is_file != -1) && relative) { BLI_path_rel(seq_load->path, BKE_main_blendfile_path(bmain)); + } if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) { seq_load->end_frame = RNA_property_int_get(op->ptr, prop); } - if ((prop = RNA_struct_find_property(op->ptr, "replace_sel")) && RNA_property_boolean_get(op->ptr, prop)) + if ((prop = RNA_struct_find_property(op->ptr, "replace_sel")) && RNA_property_boolean_get(op->ptr, prop)) { seq_load->flag |= SEQ_LOAD_REPLACE_SEL; + } - if ((prop = RNA_struct_find_property(op->ptr, "cache")) && RNA_property_boolean_get(op->ptr, prop)) + if ((prop = RNA_struct_find_property(op->ptr, "cache")) && RNA_property_boolean_get(op->ptr, prop)) { seq_load->flag |= SEQ_LOAD_SOUND_CACHE; + } - if ((prop = RNA_struct_find_property(op->ptr, "mono")) && RNA_property_boolean_get(op->ptr, prop)) + if ((prop = RNA_struct_find_property(op->ptr, "mono")) && RNA_property_boolean_get(op->ptr, prop)) { seq_load->flag |= SEQ_LOAD_SOUND_MONO; + } - if ((prop = RNA_struct_find_property(op->ptr, "sound")) && RNA_property_boolean_get(op->ptr, prop)) + 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)) + if ((prop = RNA_struct_find_property(op->ptr, "use_framerate")) && RNA_property_boolean_get(op->ptr, prop)) { seq_load->flag |= SEQ_LOAD_SYNC_FPS; + } /* always use this for ops */ seq_load->flag |= SEQ_LOAD_FRAME_ADVANCE; @@ -338,8 +345,9 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - if (!RNA_struct_property_is_set(op->ptr, "scene")) + if (!RNA_struct_property_is_set(op->ptr, "scene")) { return WM_enum_search_invoke(C, op, event); + } sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_SCENE); return sequencer_add_scene_strip_exec(C, op); @@ -424,8 +432,9 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - if (!RNA_struct_property_is_set(op->ptr, "clip")) + if (!RNA_struct_property_is_set(op->ptr, "clip")) { return WM_enum_search_invoke(C, op, event); + } sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_MOVIECLIP); return sequencer_add_movieclip_strip_exec(C, op); @@ -509,8 +518,9 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_mask_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - if (!RNA_struct_property_is_set(op->ptr, "mask")) + if (!RNA_struct_property_is_set(op->ptr, "mask")) { return WM_enum_search_invoke(C, op, event); + } sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_MASK); return sequencer_add_mask_strip_exec(C, op); @@ -554,13 +564,16 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad seq_load_operator_info(&seq_load, C, op); - if (seq_load.flag & SEQ_LOAD_REPLACE_SEL) + if (seq_load.flag & SEQ_LOAD_REPLACE_SEL) { ED_sequencer_deselect_all(scene); + } - if (RNA_struct_property_is_set(op->ptr, "files")) + if (RNA_struct_property_is_set(op->ptr, "files")) { tot_files = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); - else + } + else { tot_files = 0; + } if (tot_files) { /* multiple files */ @@ -607,8 +620,9 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad return OPERATOR_CANCELLED; } - if (op->customdata) + if (op->customdata) { MEM_freeN(op->customdata); + } BKE_sequencer_sort(scene); BKE_sequencer_update_muting(ed); @@ -626,8 +640,9 @@ static void sequencer_add_init(bContext *UNUSED(C), wmOperator *op) static void sequencer_add_cancel(bContext *UNUSED(C), wmOperator *op) { - if (op->customdata) + if (op->customdata) { MEM_freeN(op->customdata); + } op->customdata = NULL; } @@ -703,8 +718,9 @@ static void sequencer_add_draw(bContext *UNUSED(C), wmOperator *op) RNA_pointer_create(NULL, &RNA_ImageFormatSettings, imf, &imf_ptr); /* multiview template */ - if (RNA_boolean_get(op->ptr, "show_multiview")) + if (RNA_boolean_get(op->ptr, "show_multiview")) { uiTemplateImageFormatViews(layout, &imf_ptr, op->ptr); + } } void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) @@ -872,11 +888,13 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) seq_load.len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); } - if (seq_load.len == 0) + if (seq_load.len == 0) { return OPERATOR_CANCELLED; + } - if (seq_load.flag & SEQ_LOAD_REPLACE_SEL) + if (seq_load.flag & SEQ_LOAD_REPLACE_SEL) { ED_sequencer_deselect_all(scene); + } /* main adding function */ seq = BKE_sequencer_add_image_strip(C, ed->seqbasep, &seq_load); @@ -916,8 +934,9 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) sequencer_add_apply_overlap(C, op, seq); - if (op->customdata) + if (op->customdata) { MEM_freeN(op->customdata); + } WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); @@ -1057,8 +1076,9 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) int chan = max_iii(seq->seq1 ? seq->seq1->machine : 0, seq->seq2 ? seq->seq2->machine : 0, seq->seq3 ? seq->seq3->machine : 0); - if (chan < MAXSEQ) + if (chan < MAXSEQ) { seq->machine = chan; + } } } |