diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2012-11-12 16:30:02 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2012-11-12 16:30:02 +0400 |
commit | 6b65102c20e9bdafd90f55f60c2a2084d873e809 (patch) | |
tree | a0f5554702501d2da1073b22ff55f740aff135f9 /source/blender/editors/space_sequencer | |
parent | 053710fcbc78ff83b9617be87558876e381f85a6 (diff) | |
parent | 83de5cb30831328548502126dff84ffdb72544f2 (diff) |
Merge w/ trunk: r51141-52085 (Important Note: gameengine and blenderplayer were not merged due to complex differences)
Diffstat (limited to 'source/blender/editors/space_sequencer')
7 files changed, 70 insertions, 47 deletions
diff --git a/source/blender/editors/space_sequencer/CMakeLists.txt b/source/blender/editors/space_sequencer/CMakeLists.txt index 3563cc96861..558e3dc65d4 100644 --- a/source/blender/editors/space_sequencer/CMakeLists.txt +++ b/source/blender/editors/space_sequencer/CMakeLists.txt @@ -60,4 +60,8 @@ endif() add_definitions(-DGLEW_STATIC) +if(WITH_INTERNATIONAL) + add_definitions(-DWITH_INTERNATIONAL) +endif() + blender_add_lib(bf_editor_space_sequencer "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_sequencer/SConscript b/source/blender/editors/space_sequencer/SConscript index ec06eacae9c..0b429ae750b 100644 --- a/source/blender/editors/space_sequencer/SConscript +++ b/source/blender/editors/space_sequencer/SConscript @@ -8,7 +8,12 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../makesrna ../../blenloader ../../blenfont' incs += ' #/intern/audaspace/intern' +defs = [] + if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), [], libtype=['core'], priority=[100] ) +if env['WITH_BF_INTERNATIONAL']: + defs.append('WITH_INTERNATIONAL') + +env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), defs, libtype=['core'], priority=[100] ) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index ff895c06d57..8155f9d645e 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -325,7 +325,7 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) clip = BLI_findlink(&CTX_data_main(C)->movieclip, RNA_enum_get(op->ptr, "clip")); if (clip == NULL) { - BKE_report(op->reports, RPT_ERROR, "MovieClip not found"); + BKE_report(op->reports, RPT_ERROR, "Movie clip not found"); return OPERATOR_CANCELLED; } @@ -553,7 +553,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad } if (seq_load.tot_success == 0) { - BKE_reportf(op->reports, RPT_ERROR, "File \"%s\" could not be loaded", seq_load.path); + BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", seq_load.path); return OPERATOR_CANCELLED; } @@ -719,7 +719,9 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) seq->endstill = seq_load.end_frame - seq_load.start_frame; } } - + + BKE_sequence_init_colorspace(seq); + BKE_sequence_calc_disp(scene, seq); BKE_sequencer_sort(scene); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index c0f96052d81..dd57566ff91 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -286,8 +286,8 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, drawmeta_stipple(1); for (seq = seqm->seqbase.first; seq; seq = seq->next) { - chan_min = MIN2(chan_min, seq->machine); - chan_max = MAX2(chan_max, seq->machine); + chan_min = min_ii(chan_min, seq->machine); + chan_max = max_ii(chan_max, seq->machine); } chan_range = (chan_max - chan_min) + 1; @@ -356,7 +356,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla y2 = seq->machine + SEQ_STRIP_OFSTOP; /* set up co-ordinates/dimensions for either left or right handle */ - if (direction == SEQ_LEFTHANDLE) { + if (direction == SEQ_LEFTHANDLE) { rx1 = x1; rx2 = x1 + handsize_clamped * 0.75f; @@ -424,7 +424,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla y1 = y2 + 0.05f; } UI_view2d_text_cache_add(v2d, x1, y1, numstr, col); - } + } } static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq) @@ -825,7 +825,7 @@ static void UNUSED_FUNCTION(set_special_seq_update) (int val) /* if mouse over a sequence && LEFTMOUSE */ if (val) { -// XXX special_seq_update= find_nearest_seq(&x); +// XXX special_seq_update = find_nearest_seq(&x); } else special_seq_update = NULL; } @@ -928,6 +928,13 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq unsigned char *display_buffer; void *cache_handle = NULL; + if (G.is_rendering == FALSE) { + /* stop all running jobs, except screen one. currently previews frustrate Render + * needed to make so sequencer's rendering doesn't conflict with compositor + */ + WM_jobs_kill_all_except(CTX_wm_manager(C), CTX_wm_screen(C)); + } + render_size = sseq->render_size; if (render_size == 0) { render_size = scene->r.size; @@ -1205,7 +1212,7 @@ static void draw_seq_backdrop(View2D *v2d) gpuDrawFilledRectf(v2d->cur.xmin, -1.0, v2d->cur.xmax, 1.0); /* Alternating horizontal stripes */ - i = maxi(1, ((int)v2d->cur.ymin) - 1); + i = max_ii(1, ((int)v2d->cur.ymin) - 1); gpuBegin(GL_QUADS); while (i < v2d->cur.ymax) { @@ -1224,7 +1231,7 @@ static void draw_seq_backdrop(View2D *v2d) gpuEnd(); /* Darker lines separating the horizontal bands */ - i = maxi(1, ((int)v2d->cur.ymin) - 1); + i = max_ii(1, ((int)v2d->cur.ymin) - 1); UI_ThemeColor(TH_GRID); gpuBegin(GL_LINES); @@ -1258,8 +1265,8 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) /* boundbox and selection tests for NOT drawing the strip... */ if ((seq->flag & SELECT) != sel) continue; else if (seq == last_seq) continue; - else if (MIN2(seq->startdisp, seq->start) > v2d->cur.xmax) continue; - else if (MAX2(seq->enddisp, seq->start + seq->len) < v2d->cur.xmin) continue; + else if (min_ii(seq->startdisp, seq->start) > v2d->cur.xmax) continue; + 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; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 204930e82a6..7270516aa51 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -46,6 +46,8 @@ #include "BLI_utildefines.h" #include "BLI_threads.h" +#include "BLF_translation.h" + #include "DNA_scene_types.h" #include "DNA_userdef_types.h" @@ -507,7 +509,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen for (seq = ed->seqbasep->first; seq; seq = seq->next) { if (seq->flag & SELECT) { if (seq->type == SEQ_TYPE_SOUND_RAM && BKE_sequence_effect_get_num_inputs(type) != 0) { - *error_str = "Can't apply effects to audio sequence strips"; + *error_str = N_("Cannot apply effects to audio sequence strips"); return 0; } if ((seq != activeseq) && (seq != seq2)) { @@ -515,7 +517,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen else if (seq1 == NULL) seq1 = seq; else if (seq3 == NULL) seq3 = seq; else { - *error_str = "Can't apply effect to more than 3 sequence strips"; + *error_str = N_("Cannot apply effect to more than 3 sequence strips"); return 0; } } @@ -537,21 +539,21 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen return 1; /* succsess */ case 1: if (seq2 == NULL) { - *error_str = "Need at least one selected sequence strip"; + *error_str = N_("At least one selected sequence strip is needed"); return 0; } if (seq1 == NULL) seq1 = seq2; if (seq3 == NULL) seq3 = seq2; case 2: if (seq1 == NULL || seq2 == NULL) { - *error_str = "Need 2 selected sequence strips"; + *error_str = N_("2 selected sequence strips are needed"); return 0; } if (seq3 == NULL) seq3 = seq2; } if (seq1 == NULL && seq2 == NULL && seq3 == NULL) { - *error_str = "TODO: in what cases does this happen?"; + *error_str = N_("TODO: in what cases does this happen?"); return 0; } @@ -579,7 +581,9 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq) seq2 = del_seq_find_replace_recurs(scene, seq->seq2); seq3 = del_seq_find_replace_recurs(scene, seq->seq3); - if (seq1 == seq->seq1 && seq2 == seq->seq2 && seq3 == seq->seq3) ; + if (seq1 == seq->seq1 && seq2 == seq->seq2 && seq3 == seq->seq3) { + /* pass */ + } else if (seq1 || seq2 || seq3) { seq->seq1 = (seq1) ? seq1 : (seq2) ? seq2 : seq3; seq->seq2 = (seq2) ? seq2 : (seq1) ? seq1 : seq3; @@ -678,7 +682,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe) seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } - if (seqn) { + if (seqn) { seqn->flag |= SELECT; /* Second Strip! */ @@ -699,7 +703,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe) seqn->anim_startofs += cutframe - ts.start; seqn->anim_endofs = ts.anim_endofs; seqn->endstill = ts.endstill; - } + } /* strips with extended stillframes after */ else if (((seqn->start + seqn->len) < cutframe) && (seqn->endstill)) { @@ -771,7 +775,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe) seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } - if (seqn) { + if (seqn) { seqn->flag |= SELECT; /* Second Strip! */ @@ -789,7 +793,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe) seqn->startofs = cutframe - ts.start; seqn->endofs = ts.endofs; seqn->endstill = ts.endstill; - } + } /* strips with extended stillframes after */ else if (((seqn->start + seqn->len) < cutframe) && (seqn->endstill)) { @@ -1054,7 +1058,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op) { if ((seq->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) == 0) { /* simple but no anim update */ - /* seq->start= snap_frame-seq->startofs+seq->startstill; */ + /* seq->start = snap_frame-seq->startofs+seq->startstill; */ BKE_sequence_translate(scene, seq, (snap_frame - seq->startofs + seq->startstill) - seq->start); } @@ -1382,7 +1386,7 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op) seq_is_predecessor(seq2, last_seq) || seq_is_predecessor(seq3, last_seq)) { - BKE_report(op->reports, RPT_ERROR, "Can't reassign inputs: no cycles allowed"); + BKE_report(op->reports, RPT_ERROR, "Cannot reassign inputs: no cycles allowed"); return OPERATOR_CANCELLED; } @@ -1572,7 +1576,7 @@ static int apply_unique_name_cb(Sequence *seq, void *arg_pt) Scene *scene = (Scene *)arg_pt; char name[sizeof(seq->name) - 2]; - strcpy(name, seq->name + 2); + BLI_strncpy_utf8(name, seq->name + 2, sizeof(name)); BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq); BKE_sequencer_dupe_animdata(scene, name, seq->name + 2); return 1; @@ -1851,7 +1855,7 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_int(ot->srna, "length", 1, 1, 1000, "Length", "Length of each frame", 1, INT_MAX); + RNA_def_int(ot->srna, "length", 1, 1, INT_MAX, "Length", "Length of each frame", 1, 1000); } @@ -1950,7 +1954,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) while (seq) { next = seq->next; if (seq != seqm && (seq->flag & SELECT)) { - channel_max = MAX2(seq->machine, channel_max); + channel_max = max_ii(seq->machine, channel_max); BLI_remlink(ed->seqbasep, seq); BLI_addtail(&seqm->seqbase, seq); } @@ -2127,7 +2131,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op)) zoomY = ((float)height) / ((float)imgheight); sseq->zoom = (zoomX < zoomY) ? zoomX : zoomY; - sseq->zoom = 1.0f / power_of_2(1 / minf(zoomX, zoomY)); + sseq->zoom = 1.0f / power_of_2(1 / min_ff(zoomX, zoomY)); } else { sseq->zoom = 1.0f; @@ -2186,7 +2190,7 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot) ot->poll = ED_operator_sequencer_active; /* properties */ - RNA_def_float(ot->srna, "ratio", 1.0f, 0.0f, FLT_MAX, + RNA_def_float(ot->srna, "ratio", 1.0f, -FLT_MAX, FLT_MAX, "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX); } @@ -2253,11 +2257,11 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) for (seq = ed->seqbasep->first; seq; seq = seq->next) { if (seq->flag & SELECT) { - xmin = MIN2(xmin, seq->startdisp); - xmax = MAX2(xmax, seq->enddisp); + xmin = min_ii(xmin, seq->startdisp); + xmax = max_ii(xmax, seq->enddisp); - ymin = MIN2(ymin, seq->machine); - ymax = MAX2(ymax, seq->machine); + ymin = min_ii(ymin, seq->machine); + ymax = max_ii(ymax, seq->machine); } } @@ -2618,7 +2622,6 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, FALSE); - Sequence *seq; ListBase nseqbase = {NULL, NULL}; @@ -2654,8 +2657,11 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op) seqbase_clipboard_frame = scene->r.cfra; /* Need to remove anything that references the current scene */ - for (seq = seqbase_clipboard.first; seq; seq = seq->next) { - seq_copy_del_sound(scene, seq); + { + Sequence *seq; + for (seq = seqbase_clipboard.first; seq; seq = seq->next) { + seq_copy_del_sound(scene, seq); + } } return OPERATOR_FINISHED; @@ -2738,7 +2744,7 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op) const char *error_msg; if (BKE_sequencer_active_get_pair(scene, &seq_act, &seq_other) == 0) { - BKE_report(op->reports, RPT_ERROR, "Must select 2 strips"); + BKE_report(op->reports, RPT_ERROR, "Please select two strips"); return OPERATOR_CANCELLED; } @@ -2901,7 +2907,7 @@ static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op) } if (*seq_1 == NULL || *seq_2 == NULL) { - BKE_report(op->reports, RPT_ERROR, "One of the effect inputs is unset, can't swap"); + BKE_report(op->reports, RPT_ERROR, "One of the effect inputs is unset, cannot swap"); return OPERATOR_CANCELLED; } else { @@ -3038,7 +3044,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) seq->anim_startofs = seq->anim_endofs = 0; /* correct start/end frames so we don't move - * important not to set seq->len= len; allow the function to handle it */ + * important not to set seq->len = len; allow the function to handle it */ BKE_sequence_reload_new_file(scene, seq, TRUE); BKE_sequence_calc(scene, seq); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index be33b782fdf..192f45ac918 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -353,7 +353,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) } else { /* 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; + marker->flag |= SELECT; } } @@ -399,7 +399,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) } } else { - // seq= find_nearest_seq(scene, v2d, &hand, mval); + // seq = find_nearest_seq(scene, v2d, &hand, mval); act_orig = ed->act_seq; @@ -414,8 +414,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR); } } - else - if (seq->type == SEQ_TYPE_SOUND_RAM) { + else if (seq->type == SEQ_TYPE_SOUND_RAM) { if (seq->strip) { BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR); } @@ -1167,7 +1166,7 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (actseq == NULL) { - BKE_report(op->reports, RPT_ERROR, "No Active Sequence!"); + BKE_report(op->reports, RPT_ERROR, "No active sequence!"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 7bfe58cb50a..e8d47016608 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -311,7 +311,7 @@ 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); +// XXX sseq->gpd = gpencil_data_duplicate(sseq->gpd); return (SpaceLink *)sseqn; } @@ -363,7 +363,7 @@ static void sequencer_main_area_init(wmWindowManager *wm, ARegion *ar) static void sequencer_main_area_draw(const bContext *C, ARegion *ar) { -// ScrArea *sa= CTX_wm_area(C); +// ScrArea *sa = CTX_wm_area(C); /* NLE - strip editing timeline interface */ draw_timeline_seq(C, ar); |