==Sequencer==
authorPeter Schlaile <peter@schlaile.de>
Sun, 26 Mar 2006 21:36:42 +0000 (21:36 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 26 Mar 2006 21:36:42 +0000 (21:36 +0000)
This patch is mostly a usability patch for the sequencer, mainly written by
Anders Gudmundson and twisted a little bit by me.

- Lock Time to other windows
- Possibility to switch the X-Axis between frames and seconds-display
- IPO-Frame Locking for plugins (T-Key)
- Additional Popup to add HD-Sound and Movie at once
- In Timeline-Window: Sequencer windows only playback
- Make the IPOs a little bit IPO-Frame-Lock friendlier (doesn't jump;
  the frame that is drawn has the right dimension)
- Wheel-Mouse buttons make the sequencer window zoom again.
- The "This is not a sound/movie-file message" now reads "... or
  FFMPEG-support not compiled in!" since I learned some prominent
  people who complained, that hdaudio does not work for them ;-)
- Make SPACEKEY open up the "Add Strip"-Popup on the timeline and start
  playback in the preview window.

15 files changed:
source/blender/blenkernel/intern/ipo.c
source/blender/include/BIF_editseq.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/src/drawipo.c
source/blender/src/drawseq.c
source/blender/src/editipo.c
source/blender/src/editscreen.c
source/blender/src/editseq.c
source/blender/src/edittime.c
source/blender/src/header_seq.c
source/blender/src/header_time.c
source/blender/src/header_view3d.c
source/blender/src/sequence.c
source/blender/src/space.c

index c7587bbeb5982706afa9184add204c4a767fc5cd..9efb74ffa359320f8d436eadce2c96039045a879 100644 (file)
@@ -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;
index fb85a3290c275ef9135a42b6734d6c442985b275..600bf3314a42e2c9c27c06926271f912855945b5 100644 (file)
@@ -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);
index 2505c5c6838e235bc93a02b257e9ac740937e2f6..6762279559c5d547731de1f23057cda9117d609b 100644 (file)
@@ -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
index 2be600e8f4451c05e36c8ca5f3bf4dbe666b3e49..5a9f0debc7b40f918e9dd7638f2b9591bb3de012 100644 (file)
@@ -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
index e62202cbb326e9e0093e9fa42dacb81633dd4448..16f94a9cfa92aef4736a6d6c16077ab58dc08e9d 100644 (file)
@@ -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;
index a423a08d32010613c191b0f021dabb7d4b490cd6..6b17446f17c40c9af608340f78db34de3b7f45e3 100644 (file)
@@ -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;
 }
 
index aaf60c62ceb8ef1139e448f10207fcf4c26ab8a3..606c24f5bfc815cc4ee967a952760573ac89988a 100644 (file)
@@ -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)));
index 412becf40689902434a9872a98e6af6a8b2bcbb6..55c134492abe50a4bb3f9e5d504a2ca035d9d439 100644 (file)
@@ -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;
index 60a2b18897c5a5d9b3e1ac9c904cf1e27594d5bb..461bb825aaca7fc82137c79655be89a2ffdd873d 100644 (file)
@@ -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);
index 48c65a29cd9cf97c97e7620cb5d318552af2320f..b35790454fcea6fa6214f85e28ee1a4cbdb70171 100644 (file)
@@ -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) {
index 8346cafe15c9c3bc771c71adb706a1d785e69316..fe392d3a2da8d95a2cd447e7a1b6b45a8a820a85 100644 (file)
 
 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:
index cc4ce725d613365b9b8da897595d3ae045969b64..8769f3e8be96907f94fa3aae8deef489edb9f37a 100644 (file)
@@ -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);
index 5ecfb89fd4d497475157da527c6427c9880949d8..a5d4388228fafe77c18e408862713b2ea653d06d 100644 (file)
@@ -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 */
index 997c09592650f81b9518f7c65253cf9c674fd97a..c5a46fc36745bea529d82efcc76c48c38aa3c382 100644 (file)
@@ -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);
 }
index 916257db12a1075adf1d478f3b20a70bab64a0ab..b16b5c7227e52ef0f3e6672a4ac19b9f79920182 100644 (file)
@@ -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) {