diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index c7587bbeb59..9efb74ffa35 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -237,7 +237,7 @@ void ipo_default_v2d_cur(int blocktype, rctf *cur) cur->ymax= (float)+1.1; } else if(blocktype==ID_SEQ) { - cur->xmin= -5.0+G.scene->r.sfra; + cur->xmin= -5.0; cur->xmax= 105.0; cur->ymin= (float)-0.1; cur->ymax= (float)+1.1; diff --git a/source/blender/include/BIF_editseq.h b/source/blender/include/BIF_editseq.h index fb85a3290c2..600bf3314a4 100644 --- a/source/blender/include/BIF_editseq.h +++ b/source/blender/include/BIF_editseq.h @@ -40,6 +40,9 @@ void add_sequence(int type); void borderselect_seq(void); void boundbox_seq(void); void change_sequence(void); +void update_seq_ipo_rect(struct Sequence * seq); +struct Sequence* get_last_seq(); +void set_last_seq_to_null(); void clear_last_seq(void); void clever_numbuts_seq(void); void del_seq(void); diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 2505c5c6838..6762279559c 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -181,6 +181,7 @@ typedef struct GlowVars { #define SEQ_MOVIE 3 #define SEQ_RAM_SOUND 4 #define SEQ_HD_SOUND 5 +#define SEQ_MOVIE_AND_HD_SOUND 6 /* helper for add_sequence */ #define SEQ_EFFECT 8 #define SEQ_CROSS 8 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 2be600e8f44..5a9f0debc7b 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -148,7 +148,8 @@ typedef struct SpaceSeq { short mainb, zoom; short chanshown; short pad2; - + int flag; + int pad; } SpaceSeq; typedef struct SpaceFile { @@ -560,11 +561,15 @@ typedef struct SpaceImaSel { #define TIME_ALL_ANIM_WIN 4 #define TIME_ALL_BUTS_WIN 8 #define TIME_WITH_SEQ_AUDIO 16 +#define TIME_SEQ 32 /* sseq->mainb */ -#define SEQ_DRAW_SEQUENCE 0 -#define SEQ_DRAW_IMG_IMBUF 1 -#define SEQ_DRAW_IMG_WAVEFORM 2 -#define SEQ_DRAW_IMG_VECTORSCOPE 3 +#define SEQ_DRAW_SEQUENCE 0 +#define SEQ_DRAW_IMG_IMBUF 1 +#define SEQ_DRAW_IMG_WAVEFORM 2 +#define SEQ_DRAW_IMG_VECTORSCOPE 3 + +/* sseq->flag */ +#define SEQ_DRAWFRAMES 1 #endif diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index e62202cbb32..16f94a9cfa9 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -76,6 +76,7 @@ #include "BIF_space.h" #include "BIF_toolbox.h" #include "BIF_glutil.h" +#include "BIF_editseq.h" #include "BSE_drawipo.h" #include "BSE_view.h" @@ -152,13 +153,27 @@ static void step_to_grid(float *step, int *macht) *step= rem*pow(10.0, (float)*macht); // partial of a frame have no meaning - if(curarea->spacetype==SPACE_TIME) { + switch(curarea->spacetype) { + case SPACE_TIME: { SpaceTime *stime= curarea->spacedata.first; if(stime->flag & TIME_DRAWFRAMES) { rem = 1.0; *step = 1.0; } + break; } + case SPACE_SEQ: { + SpaceTime * sseq= curarea->spacedata.first; + if (sseq->flag & SEQ_DRAWFRAMES) { + rem = 1.0; + *step = 1.0; + } + } + default: + break; + } + + if(rem==1.0) (*macht)++; // prevents printing 1.0 2.0 3.0 etc } @@ -184,12 +199,25 @@ void calc_ipogrid() if(G.v2d==0) return; /* detect of we have seconds or frames, should become argument */ - if(curarea->spacetype==SPACE_TIME) { + + switch(curarea->spacetype) { + case SPACE_TIME: { SpaceTime *stime= curarea->spacedata.first; if(!(stime->flag & TIME_DRAWFRAMES)) { secondgrid= 1; secondiv= 0.01 * (float)G.scene->r.frs_sec; } + break; + } + case SPACE_SEQ: { + SpaceSeq * sseq = curarea->spacedata.first; + if (!(sseq->flag & SEQ_DRAWFRAMES)) { + secondgrid = 1; + secondiv = 0.01 * (float)G.scene->r.frs_sec; + } + } + default: + break; } space= G.v2d->cur.xmax - G.v2d->cur.xmin; @@ -311,8 +339,18 @@ void draw_ipogrid(void) /* Limits box */ if(curarea->spacetype==SPACE_IPO) { if(G.sipo->blocktype==ID_SEQ) { + Sequence * last_seq = get_last_seq(); + float start = 0.0; + float end = 100.0; + + if (last_seq && + ((last_seq->flag & SEQ_IPO_FRAME_LOCKED) != 0)) { + start = last_seq->startdisp; + end = last_seq->enddisp; + } + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glRectf(0.0, 0.0, 100.0, 1.0); + glRectf(start, 0.0, end, 1.0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } else if(ELEM(G.sipo->blocktype, ID_CU, ID_CO)) { @@ -396,7 +434,8 @@ static View2D *spacelink_get_view2d(SpaceLink *sl) return &((SpaceNla *)sl)->v2d; if(sl->spacetype==SPACE_TIME) return &((SpaceTime *)sl)->v2d; - + if(sl->spacetype==SPACE_SEQ) + return &((SpaceSeq *)sl)->v2d; return NULL; } @@ -841,10 +880,16 @@ void drawscroll(int disptype) if(curarea->spacetype==SPACE_OOPS); else if(curarea->spacetype==SPACE_SEQ) { - fac2= val/(float)G.scene->r.frs_sec; - tim= floor(fac2); - fac2= fac2-tim; - scroll_prstr(fac, 3.0+(float)(hor.ymin), tim+G.scene->r.frs_sec*fac2/100.0, 'h', disptype); + SpaceSeq * sseq = curarea->spacedata.first; + if (sseq->flag & SEQ_DRAWFRAMES) { + ipomachtx = 1; + scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); + } else { + fac2= val/(float)G.scene->r.frs_sec; + tim= floor(fac2); + fac2= fac2-tim; + scroll_prstr(fac, 3.0+(float)(hor.ymin), tim+G.scene->r.frs_sec*fac2/100.0, 'h', disptype); + } } else if (curarea->spacetype==SPACE_SOUND) { SpaceSound *ssound= curarea->spacedata.first; diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index a423a08d320..6b17446f17c 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -632,7 +632,7 @@ static void draw_image_seq(ScrArea *sa) static void draw_extra_seqinfo(void) { - extern Sequence *last_seq; + Sequence *last_seq = get_last_seq(); StripElem *se, *last; float xco, xfac; int sta, end; @@ -734,7 +734,7 @@ static void draw_extra_seqinfo(void) void do_seqbuttons(short val) { - extern Sequence *last_seq; + Sequence *last_seq = get_last_seq(); switch(val) { case SEQ_BUT_PLUGIN: @@ -756,7 +756,7 @@ void do_seqbuttons(short val) static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES { - extern Sequence *last_seq; + Sequence *last_seq = get_last_seq(); uiBlock *block; block= uiNewBlock(&curarea->uiblocks, "seq_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); @@ -785,6 +785,13 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES } } + uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED, + SEQ_BUT_RELOAD, "IPO Frame locked", + 10,-40,150,19, &last_seq->flag, + 0.0, 1.0, 0, 0, + "Lock the IPO coordinates to the " + "global frame counter."); + } else if(last_seq->type==SEQ_IMAGE) { @@ -1065,6 +1072,7 @@ void drawseqspace(ScrArea *sa, void *spacedata) seq_blockhandlers(sa); } + view2d_do_locks(curarea, V2D_LOCK_COPY); curarea->win_swap= WIN_BACK_OK; } diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index aaf60c62ceb..606c24f5bfc 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -1020,7 +1020,7 @@ static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname } } else if(blocktype==ID_SEQ) { - extern Sequence *last_seq; + Sequence *last_seq = get_last_seq(); if(last_seq && ((last_seq->type & SEQ_EFFECT)||(last_seq->type == SEQ_HD_SOUND)||(last_seq->type == SEQ_RAM_SOUND))) { *from= (ID *)last_seq; @@ -1758,6 +1758,7 @@ Ipo *verify_ipo(ID *from, short blocktype, char *actname, char *constname) if(seq->ipo==NULL) { seq->ipo= add_ipo("SeqIpo", ID_SEQ); } + update_seq_ipo_rect(seq); return seq->ipo; } } @@ -2134,7 +2135,7 @@ void insertkey_editipo(void) } } else if(id && GS(id->name)==ID_SEQ) { - extern Sequence *last_seq; /* editsequence.c */ + Sequence *last_seq = get_last_seq(); /* editsequence.c */ if(last_seq) { cfra= (float)(100.0*(cfra-last_seq->startdisp)/((float)(last_seq->enddisp-last_seq->startdisp))); diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 412becf4068..55c134492ab 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -1071,6 +1071,7 @@ static void animated_screen(bScreen *sc, short val) } if(val & TIME_ALL_ANIM_WIN) allqueue(REDRAWANIM, 0); if(val & TIME_ALL_BUTS_WIN) allqueue(REDRAWBUTSALL, 0); + if(val & TIME_SEQ) allqueue(REDRAWSEQ, 0); allqueue(REDRAWTIME, 0); } @@ -1401,7 +1402,7 @@ void screenmain(void) towin= 0; } else { - if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT); + if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT||g_activearea->spacetype==SPACE_SEQ); else if(G.qual==0) { if(val) toolbox_n(); towin= 0; diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index 60a2b18897c..461bb825aac 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -95,7 +95,7 @@ #include "blendef.h" #include "mydevice.h" -Sequence *last_seq=0; +static Sequence *last_seq=0; #ifdef WIN32 char last_imagename[FILE_MAXDIR+FILE_MAXFILE]= "c:\\"; @@ -110,6 +110,17 @@ char last_sounddir[FILE_MAXDIR+FILE_MAXFILE]= ""; static int test_overlap_seq(Sequence *); static void shuffle_seq(Sequence *); +Sequence * get_last_seq() +{ + return last_seq; +} + +/* fixme: only needed by free_sequence... */ +void set_last_seq_to_null() +{ + last_seq = 0; +} + static void change_plugin_seq(char *str) /* called from fileselect */ { struct SeqEffectHandle sh; @@ -217,6 +228,34 @@ Sequence *find_nearest_seq(int *hand) return 0; } +void update_seq_ipo_rect(Sequence * seq) +{ + float start; + float end; + + if (!seq || !seq->ipo) { + return; + } + start = -5.0; + end = 105.0; + + /* Adjust IPO window to sequence and + avoid annoying snap-back to startframe + when Lock Time is on */ + if (G.v2d->flag & V2D_VIEWLOCK) { + if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { + start = -5.0 + seq->startdisp; + end = 5.0 + seq->enddisp; + } else { + start = (float)G.scene->r.sfra - 0.1; + end = G.scene->r.efra; + } + } + + seq->ipo->cur.xmin= start; + seq->ipo->cur.xmax= end; +} + void clear_last_seq(void) { /* from (example) ipo: when it is changed, also do effects with same ipo */ @@ -548,7 +587,8 @@ static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine) /* is it a movie? */ anim = openanim(str, IB_rect); if(anim==0) { - error("The selected file is not a movie"); + error("The selected file is not a movie or " + "FFMPEG-support not compiled in!"); return; } @@ -678,7 +718,8 @@ static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine) /* is it a sound file? */ hdaudio = sound_open_hdaudio(str); if(hdaudio==0) { - error("The selected file is not a sound file"); + error("The selected file is not a sound file or " + "FFMPEG-support not compiled in!"); return; } @@ -818,6 +859,42 @@ static void add_movie_strip(char *name) } +static void add_movie_and_hdaudio_strip(char *name) +{ + SpaceFile *sfile; + float x, y; + int cfra, machine; + short mval[2]; + + deselect_all_seq(); + + /* restore windowmatrices */ + areawinset(curarea->win); + drawseqspace(curarea, curarea->spacedata.first); + + /* search sfile */ + sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); + if(sfile==0) return; + + /* where will it be */ + getmouseco_areawin(mval); + areamouseco_to_ipoco(G.v2d, mval, &x, &y); + cfra= (int)(x+0.5); + machine= (int)(y+0.5); + + waitcursor(1); + + /* read directory itself */ + sfile_to_hdsnd_sequence(sfile, cfra, machine); + sfile_to_mv_sequence(sfile, cfra, machine); + + waitcursor(0); + + BIF_undo_push("Add movie and HD-audio strip Sequencer"); + transform_seq('g', 0); + +} + static void add_sound_strip_ram(char *name) { SpaceFile *sfile; @@ -1119,6 +1196,9 @@ void add_sequence(int type) case SEQ_HD_SOUND: event = 104; break; + case SEQ_MOVIE_AND_HD_SOUND: + event = 105; + break; case SEQ_PLUGIN: event = 10; break; @@ -1158,7 +1238,24 @@ void add_sequence(int type) } } else { - event= pupmenu("Add Sequence Strip%t|Images%x1|Movie%x102|Audio (RAM)%x103|Audio (HD)%x104|Scene%x101|Plugin%x10|Cross%x2|Gamma Cross%x3|Add%x4|Sub%x5|Mul%x6|Alpha Over%x7|Alpha Under%x8|Alpha Over Drop%x9|Wipe%x13|Glow%x14"); + event= pupmenu("Add Sequence Strip%t" + "|Images%x1" + "|Movie%x102" + "|Movie + Audio (HD)%x105" + "|Audio (RAM)%x103" + "|Audio (HD)%x104" + "|Scene%x101" + "|Plugin%x10" + "|Cross%x2" + "|Gamma Cross%x3" + "|Add%x4" + "|Sub%x5" + "|Mul%x6" + "|Alpha Over%x7" + "|Alpha Under%x8" + "|Alpha Over Drop%x9" + "|Wipe%x13" + "|Glow%x14"); } if(event<1) return; @@ -1174,6 +1271,9 @@ void add_sequence(int type) activate_fileselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips); break; + case 105: + activate_fileselect(FILE_SPECIAL, "Select Movie+Audio", last_imagename, add_movie_and_hdaudio_strip); + break; case 102: activate_fileselect(FILE_SPECIAL, "Select Movie", last_imagename, add_movie_strip); diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c index 48c65a29cd9..b35790454fc 100644 --- a/source/blender/src/edittime.c +++ b/source/blender/src/edittime.c @@ -484,6 +484,9 @@ static void timeline_force_draw(short val) else if(sa->spacetype==SPACE_BUTS) { if(val & TIME_ALL_BUTS_WIN) dodraw= 1; } + else if(sa->spacetype==SPACE_SEQ) { + if (val & TIME_SEQ) dodraw = 1; + } else if(sa->spacetype==SPACE_TIME) dodraw= 2; if(dodraw) { diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c index 8346cafe15c..fe392d3a2da 100644 --- a/source/blender/src/header_seq.c +++ b/source/blender/src/header_seq.c @@ -67,11 +67,11 @@ static int viewmovetemp = 0; -extern Sequence *last_seq; - static void do_seq_viewmenu(void *arg, int event) { extern int play_anim(int mode); + Sequence * last_seq = get_last_seq(); + SpaceSeq * sseq = curarea->spacedata.first; switch(event) { @@ -92,6 +92,15 @@ static void do_seq_viewmenu(void *arg, int event) update_for_newframe(); } break; + case 5: /* Lock time */ + G.v2d->flag ^= V2D_VIEWLOCK; + if (G.v2d->flag & V2D_VIEWLOCK) { + view2d_do_locks(curarea, 0); + } + break; + case 6: /* Draw time/frames */ + sseq->flag ^= SEQ_DRAWFRAMES; + break; } } @@ -99,6 +108,7 @@ static uiBlock *seq_viewmenu(void *arg_unused) { uiBlock *block; short yco= 0, menuwidth=120; + SpaceSeq * sseq = curarea->spacedata.first; block= uiNewBlock(&curarea->uiblocks, "seq_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_seq_viewmenu, NULL); @@ -114,6 +124,21 @@ static uiBlock *seq_viewmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + /* Lock Time */ + uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, + "Lock Time to Other Windows|", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + /* Draw time or frames.*/ + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(sseq->flag & SEQ_DRAWFRAMES) + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + else + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, ""); else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); @@ -256,6 +281,9 @@ static void do_seq_addmenu(void *arg, int event) case 4: add_sequence(SEQ_SCENE); break; + case 5: + add_sequence(SEQ_MOVIE_AND_HD_SOUND); + break; } } @@ -276,6 +304,7 @@ static uiBlock *seq_addmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scene", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Images", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie + Audio (HD)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); if(curarea->headertype==HEADERTOP) { uiBlockSetDirection(block, UI_DOWN); @@ -341,6 +370,7 @@ static uiBlock *seq_editmenu(void *arg_unused) uiBlock *block; Editing *ed; short yco= 0, menuwidth=120; + Sequence * last_seq = get_last_seq(); ed = G.scene->ed; @@ -414,6 +444,7 @@ void do_seq_buttons(short event) case B_SEQHOME: G.v2d->cur= G.v2d->tot; test_view2d(G.v2d, curarea->winx, curarea->winy); + view2d_do_locks(curarea, V2D_LOCK_COPY); scrarea_queue_winredraw(curarea); break; case B_SEQCLEAR: diff --git a/source/blender/src/header_time.c b/source/blender/src/header_time.c index cc4ce725d61..8769f3e8be9 100644 --- a/source/blender/src/header_time.c +++ b/source/blender/src/header_time.c @@ -154,6 +154,11 @@ static uiBlock *time_redrawmenu(void *arg_unused) else icon= ICON_CHECKBOX_DEHLT; uiDefIconTextBut(block, BUTM, 1, icon, "Buttons Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_BUTS_WIN, ""); + /* Add sequencer only redraw*/ + if(stime->redraws & TIME_SEQ) icon= ICON_CHECKBOX_HLT; + else icon= ICON_CHECKBOX_DEHLT; + uiDefIconTextBut(block, BUTM, 1, icon, "Sequencer Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_SEQ, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); sprintf(str, "Set Frames/Sec (%d)", G.scene->r.frs_sec); diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 5ecfb89fd4d..a5d4388228f 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -76,7 +76,7 @@ #include "BSE_editipo.h" #include "BSE_headerbuttons.h" #include "BSE_view.h" - +#include "BSE_drawview.h" #include "BDR_editcurve.h" #include "BDR_editface.h" @@ -437,7 +437,6 @@ static uiBlock *view3d_view_spacehandlers(void *arg_unused) static void do_view3d_viewmenu(void *arg, int event) { View3D *v3d= curarea->spacedata.first; - extern int play_anim(int mode); switch(event) { case 0: /* User */ diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 997c0959265..c5a46fc3674 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -60,6 +60,7 @@ #include "BIF_space.h" #include "BIF_toolbox.h" #include "BIF_editsound.h" +#include "BIF_editseq.h" #include "BSE_sequence.h" #include "BSE_seqeffects.h" @@ -118,7 +119,7 @@ void new_stripdata(Sequence *seq) void free_sequence(Sequence *seq) { - extern Sequence *last_seq; + Sequence *last_seq = get_last_seq(); if(seq->strip) free_strip(seq->strip); @@ -131,7 +132,7 @@ void free_sequence(Sequence *seq) sh.free(seq); } - if(seq==last_seq) last_seq= 0; + if(seq==last_seq) set_last_seq_to_null(); MEM_freeN(seq); } diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 916257db12a..b16b5c7227e 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -3537,16 +3537,16 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) short val= evt->val; SpaceSeq *sseq= curarea->spacedata.first; View2D *v2d= &sseq->v2d; - extern Sequence *last_seq; + Sequence *last_seq = get_last_seq(); float dx, dy; int doredraw= 0, cfra, first; short mval[2]; + short nr; short mousebut = L_MOUSE; if(curarea->win==0) return; if(val) { - if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0; /* swap mouse buttons based on user preference */ @@ -3595,8 +3595,6 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } break; case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: if(sseq->mainb) break; view2dmove(event); /* in drawipo.c */ break; @@ -3605,6 +3603,7 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) mouse_select_seq(); break; case PADPLUSKEY: + case WHEELUPMOUSE: if(sseq->mainb) { sseq->zoom++; if(sseq->zoom==-1) sseq->zoom= 1; @@ -3631,6 +3630,7 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) doredraw= 1; break; case PADMINUS: + case WHEELDOWNMOUSE: if(sseq->mainb) { sseq->zoom--; if(sseq->zoom==0) sseq->zoom= -2; @@ -3669,6 +3669,15 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) else if((G.qual==0)) swap_select_seq(); break; + case SPACEKEY: + if (G.qual==0) { + if (sseq->mainb) { + play_anim(1); + } else { + add_sequence(-1); + } + } + break; case BKEY: if(sseq->mainb) break; if((G.qual==0)) @@ -3734,10 +3743,18 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if((G.qual==LR_SHIFTKEY)) seq_snap_menu(); break; - case TKEY: + case PKEY: if((G.qual==0)) touch_seq_files(); break; + case TKEY: /* popup menu */ + nr= pupmenu("Time value%t|Frames %x1|Seconds%x2"); + if (nr>0) { + if(nr==1) sseq->flag |= SEQ_DRAWFRAMES; + else sseq->flag &= ~SEQ_DRAWFRAMES; + doredraw= 1; + } + break; case XKEY: case DELKEY: if(G.qual==0) {