markers in the sequencer

- added a new redraw type - REDRAWMARKER, at the moment this draws the same windows as REDRAWANIM, but this may not always be true, and it is more explicit whats 
happening, This replaced 5 or so draw calls in quite a few places.
This commit is contained in:
2007-10-17 15:27:38 +00:00
parent 8bb97b6efa
commit 4b6b27ea70
15 changed files with 283 additions and 279 deletions

View File

@@ -253,6 +253,8 @@
#define REDRAWANIM 0x4037 #define REDRAWANIM 0x4037
#define REDRAWNODE 0x4038 #define REDRAWNODE 0x4038
#define RECALC_COMPOSITE 0x4039 #define RECALC_COMPOSITE 0x4039
#define REDRAWMARKER 0x4040 /* all views that display markers */
#endif /* !__MYDEVICE_H__ */ #endif /* !__MYDEVICE_H__ */

View File

@@ -945,7 +945,7 @@ static void draw_extra_seqinfo(void)
} }
} else { /* single image */ } else { /* single image */
if (last_seq->strip) { if (last_seq->strip) {
sprintf(str, "Single: %s", last_seq->strip->stripdata->name); sprintf(str, "Single: %s len: %d", last_seq->strip->stripdata->name, last_seq->enddisp-last_seq->startdisp);
glRasterPos3f(xco, yco, 0.0); glRasterPos3f(xco, yco, 0.0);
BMF_DrawString(G.font, str); BMF_DrawString(G.font, str);
xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac; xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac;
@@ -1443,6 +1443,9 @@ void drawseqspace(ScrArea *sa, void *spacedata)
draw_extra_seqinfo(); draw_extra_seqinfo();
/* Draw markers */
draw_markers_timespace();
/* restore viewport */ /* restore viewport */
mywinset(sa->win); mywinset(sa->win);

View File

@@ -127,7 +127,7 @@ static void draw_cfra_time(SpaceTime *stime)
ui_rasterpos_safe(x * xscale, y * yscale, 1.0); ui_rasterpos_safe(x * xscale, y * yscale, 1.0);
BIF_DrawString(G.fonts, str, 0); BIF_DrawString(G.fonts, str, 0);
printf("%f -- %f\n", xscale, yscale);
glScalef(xscale, yscale, 1.0); glScalef(xscale, yscale, 1.0);
} }

View File

@@ -2253,11 +2253,7 @@ static void mouse_action (int selectmode)
std_rmouse_transform(transform_markers); std_rmouse_transform(transform_markers);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
} }
@@ -2680,10 +2676,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
column_select_action_keys(val); column_select_action_keys(val);
} }
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
break; break;
case MKEY: case MKEY:
@@ -2706,11 +2699,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
rename_marker(); rename_marker();
else else
break; break;
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
break; break;
@@ -2734,11 +2723,8 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else if (G.qual & LR_ALTKEY) /* clear preview range */ else if (G.qual & LR_ALTKEY) /* clear preview range */
anim_previewrange_clear(); anim_previewrange_clear();
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWBUTSALL, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);
break; break;
case SKEY: case SKEY:

View File

@@ -1203,11 +1203,7 @@ void borderselect_nla(void)
} }
} }
BIF_undo_push("Border select NLA"); BIF_undo_push("Border select NLA");
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
} }
@@ -1262,11 +1258,7 @@ static void mouse_nla(int selectmode)
std_rmouse_transform(transform_markers); std_rmouse_transform(transform_markers);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
else { else {
/* Try action ipo selection */ /* Try action ipo selection */
@@ -1725,11 +1717,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
shift_nlastrips_up(); shift_nlastrips_up();
else { else {
nextprev_marker(1); nextprev_marker(1);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
break; break;
@@ -1742,11 +1730,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
shift_nlastrips_down(); shift_nlastrips_down();
else { else {
nextprev_marker(-1); nextprev_marker(-1);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
break; break;
@@ -1758,11 +1742,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} }
else if (G.qual & LR_CTRLKEY) { else if (G.qual & LR_CTRLKEY) {
deselect_markers(1, 0); deselect_markers(1, 0);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
else{ else{
if (mval[0]>=NLAWIDTH) if (mval[0]>=NLAWIDTH)
@@ -1831,11 +1811,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
rename_marker(); rename_marker();
else else
break; break;
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case NKEY: case NKEY:
@@ -1856,11 +1832,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
anim_previewrange_set(); anim_previewrange_set();
else if (G.qual & LR_ALTKEY) /* clear preview range */ else if (G.qual & LR_ALTKEY) /* clear preview range */
anim_previewrange_clear(); anim_previewrange_clear();
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWBUTSALL, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);
break; break;
case SKEY: case SKEY:
@@ -1908,11 +1880,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
remove_marker(); remove_marker();
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
} }
break; break;

View File

@@ -83,6 +83,7 @@
#include "BIF_editview.h" #include "BIF_editview.h"
#include "BIF_scrarea.h" #include "BIF_scrarea.h"
#include "BIF_editsound.h" #include "BIF_editsound.h"
#include "BIF_imasel.h"
#include "BSE_edit.h" #include "BSE_edit.h"
#include "BSE_sequence.h" #include "BSE_sequence.h"
@@ -90,6 +91,7 @@
#include "BSE_filesel.h" #include "BSE_filesel.h"
#include "BSE_drawipo.h" #include "BSE_drawipo.h"
#include "BSE_seqaudio.h" #include "BSE_seqaudio.h"
#include "BSE_time.h"
#include "BDR_editobject.h" #include "BDR_editobject.h"
@@ -144,7 +146,6 @@ void clear_last_seq(Sequence *seq)
} }
/* seq funcs's for transforming internally /* seq funcs's for transforming internally
notice the difference between start/end and left/right. notice the difference between start/end and left/right.
@@ -664,99 +665,141 @@ void mouse_select_seq(void)
{ {
Sequence *seq,*neighbor; Sequence *seq,*neighbor;
int hand,seldir; int hand,seldir;
TimeMarker *marker;
seq= find_nearest_seq(&hand);
marker=find_nearest_marker(1);
if(!(G.qual & LR_SHIFTKEY)&&!(G.qual & LR_ALTKEY)&&!(G.qual & LR_CTRLKEY)) deselect_all_seq();
if (marker) {
if(seq) { int oldflag;
set_last_seq(seq); /* select timeline marker */
if ((G.qual & LR_SHIFTKEY)==0) {
if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) { oldflag= marker->flag;
if(seq->strip) { deselect_markers(0, 0);
strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
} if (oldflag & SELECT)
} else marker->flag &= ~SELECT;
if (seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND) { else
if(seq->strip) { marker->flag |= SELECT;
strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
}
}
if((G.qual & LR_SHIFTKEY) && (seq->flag & SELECT)) {
if(hand==0) seq->flag &= SEQ_DESEL;
else if(hand==1) {
if(seq->flag & SEQ_LEFTSEL)
seq->flag &= ~SEQ_LEFTSEL;
else seq->flag |= SEQ_LEFTSEL;
}
else if(hand==2) {
if(seq->flag & SEQ_RIGHTSEL)
seq->flag &= ~SEQ_RIGHTSEL;
else seq->flag |= SEQ_RIGHTSEL;
}
} }
else { else {
seq->flag |= SELECT; marker->flag |= SELECT;
if(hand==1) seq->flag |= SEQ_LEFTSEL;
if(hand==2) seq->flag |= SEQ_RIGHTSEL;
} }
allqueue(REDRAWMARKER, 0);
force_draw(0);
BIF_undo_push("Select Strips, Sequencer");
/* On Ctrl-Alt selection, select the strip and bordering handles */ } else {
if ((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
seq->flag |= SELECT;
select_surrounding_handles(seq);
/* Ctrl signals Left, Alt signals Right
First click selects adjacent handles on that side.
Second click selects all strips in that direction.
If there are no adjacent strips, it just selects all in that direction. */
} else if (((G.qual & LR_CTRLKEY) || (G.qual & LR_ALTKEY)) && (seq->flag & SELECT)) {
if (G.qual & LR_CTRLKEY) seldir=1; seq= find_nearest_seq(&hand);
else seldir=2; if(!(G.qual & LR_SHIFTKEY)&&!(G.qual & LR_ALTKEY)&&!(G.qual & LR_CTRLKEY)) deselect_all_seq();
neighbor=find_neighboring_sequence(seq, seldir);
if (neighbor) { if(seq) {
switch (seldir) { set_last_seq(seq);
case 1:
if ((seq->flag & SEQ_LEFTSEL)&&(neighbor->flag & SEQ_RIGHTSEL)) { if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq(); if(seq->strip) {
select_channel_direction(seq,1); strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
} else { }
neighbor->flag |= SELECT; } else
recurs_sel_seq(neighbor); if (seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND) {
neighbor->flag |= SEQ_RIGHTSEL; if(seq->strip) {
seq->flag |= SEQ_LEFTSEL; strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
}
break;
case 2:
if ((seq->flag & SEQ_RIGHTSEL)&&(neighbor->flag & SEQ_LEFTSEL)) {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
select_channel_direction(seq,2);
} else {
neighbor->flag |= SELECT;
recurs_sel_seq(neighbor);
neighbor->flag |= SEQ_LEFTSEL;
seq->flag |= SEQ_RIGHTSEL;
}
break;
} }
} else {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
select_channel_direction(seq,seldir);
} }
}
if((G.qual & LR_SHIFTKEY) && (seq->flag & SELECT)) {
if(hand==0) seq->flag &= SEQ_DESEL;
else if(hand==1) {
if(seq->flag & SEQ_LEFTSEL)
seq->flag &= ~SEQ_LEFTSEL;
else seq->flag |= SEQ_LEFTSEL;
}
else if(hand==2) {
if(seq->flag & SEQ_RIGHTSEL)
seq->flag &= ~SEQ_RIGHTSEL;
else seq->flag |= SEQ_RIGHTSEL;
}
}
else {
seq->flag |= SELECT;
if(hand==1) seq->flag |= SEQ_LEFTSEL;
if(hand==2) seq->flag |= SEQ_RIGHTSEL;
}
/* On Ctrl-Alt selection, select the strip and bordering handles */
if ((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
seq->flag |= SELECT;
select_surrounding_handles(seq);
/* Ctrl signals Left, Alt signals Right
First click selects adjacent handles on that side.
Second click selects all strips in that direction.
If there are no adjacent strips, it just selects all in that direction. */
} else if (((G.qual & LR_CTRLKEY) || (G.qual & LR_ALTKEY)) && (seq->flag & SELECT)) {
recurs_sel_seq(seq); if (G.qual & LR_CTRLKEY) seldir=1;
else seldir=2;
neighbor=find_neighboring_sequence(seq, seldir);
if (neighbor) {
switch (seldir) {
case 1:
if ((seq->flag & SEQ_LEFTSEL)&&(neighbor->flag & SEQ_RIGHTSEL)) {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
select_channel_direction(seq,1);
} else {
neighbor->flag |= SELECT;
recurs_sel_seq(neighbor);
neighbor->flag |= SEQ_RIGHTSEL;
seq->flag |= SEQ_LEFTSEL;
}
break;
case 2:
if ((seq->flag & SEQ_RIGHTSEL)&&(neighbor->flag & SEQ_LEFTSEL)) {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
select_channel_direction(seq,2);
} else {
neighbor->flag |= SELECT;
recurs_sel_seq(neighbor);
neighbor->flag |= SEQ_LEFTSEL;
seq->flag |= SEQ_RIGHTSEL;
}
break;
}
} else {
if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
select_channel_direction(seq,seldir);
}
}
recurs_sel_seq(seq);
}
force_draw(0);
if(get_last_seq()) allqueue(REDRAWIPO, 0);
BIF_undo_push("Select Strips, Sequencer");
std_rmouse_transform(transform_seq);
}
/* marker transform */
if (marker) {
short mval[2], xo, yo;
getmouseco_areawin(mval);
xo= mval[0];
yo= mval[1];
while(get_mbut()&R_MOUSE) {
getmouseco_areawin(mval);
if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) {
transform_markers('g', 0);
allqueue(REDRAWMARKER, 0);
return;
}
BIF_wait_for_statechange();
}
} }
force_draw(0);
if(get_last_seq()) allqueue(REDRAWIPO, 0);
BIF_undo_push("Select Strips, Sequencer");
std_rmouse_transform(transform_seq);
} }
@@ -1684,8 +1727,11 @@ void add_sequence(int type)
switch(event) { switch(event) {
case 1: case 1:
/* Image Dosnt work at the moment - TODO */
activate_fileselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips); //if(G.qual & LR_CTRLKEY)
// activate_imageselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips);
//else
activate_fileselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips);
break; break;
case 105: case 105:
activate_fileselect(FILE_SPECIAL, "Select Movie+Audio", last_imagename, add_movie_and_hdaudio_strip); activate_fileselect(FILE_SPECIAL, "Select Movie+Audio", last_imagename, add_movie_and_hdaudio_strip);
@@ -3052,7 +3098,7 @@ void seq_separate_images(void)
Sequence *seq, *seq_new, *seq_next; Sequence *seq, *seq_new, *seq_next;
Strip *strip_new; Strip *strip_new;
StripElem *se, *se_new; StripElem *se, *se_new;
int start, start_ofs, cfra, frame_end; int start_ofs, cfra, frame_end;
static int step= 1; static int step= 1;
add_numbut(0, NUM|INT, "Image Duration:", 1, 256, &step, NULL); add_numbut(0, NUM|INT, "Image Duration:", 1, 256, &step, NULL);

View File

@@ -219,11 +219,7 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case AKEY: /* select/deselect all */ case AKEY: /* select/deselect all */
deselect_markers(1, 0); deselect_markers(1, 0);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case BKEY: /* borderselect markers */ case BKEY: /* borderselect markers */
@@ -234,11 +230,7 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if (G.qual & LR_SHIFTKEY) { if (G.qual & LR_SHIFTKEY) {
duplicate_marker(); duplicate_marker();
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
break; break;
@@ -252,11 +244,7 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else else
add_marker(CFRA); add_marker(CFRA);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case TKEY: /* toggle time display */ case TKEY: /* toggle time display */
@@ -273,12 +261,7 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case XKEY: case XKEY:
if (okee("Erase selected")) { if (okee("Erase selected")) {
remove_marker(); remove_marker();
allqueue(REDRAWMARKER, 0);
allqueue(REDRAWTIME, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
break; break;
} }

View File

@@ -282,11 +282,7 @@ void transform_markers(int mode, int smode) // mode and smode unused here, for c
BIF_undo_push("Move Markers"); BIF_undo_push("Move Markers");
} }
MEM_freeN(oldframe); MEM_freeN(oldframe);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
/* select/deselect all TimeMarkers /* select/deselect all TimeMarkers
@@ -387,11 +383,7 @@ void borderselect_markers(void)
borderselect_markers_func(rectf.xmin, rectf.xmax, selectmode); borderselect_markers_func(rectf.xmin, rectf.xmax, selectmode);
BIF_undo_push("Border Select Markers"); BIF_undo_push("Border Select Markers");
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
} }
@@ -919,11 +911,7 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case AKEY: case AKEY:
/* deselect all TimeMarkers */ /* deselect all TimeMarkers */
deselect_markers(1, 0); deselect_markers(1, 0);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case BKEY: case BKEY:
/* borderselect markers */ /* borderselect markers */
@@ -954,11 +942,7 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
rename_marker(); rename_marker();
else else
add_marker(CFRA); add_marker(CFRA);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case PKEY: /* preview-range stuff */ case PKEY: /* preview-range stuff */
if (G.qual & LR_CTRLKEY) /* set preview range */ if (G.qual & LR_CTRLKEY) /* set preview range */
@@ -989,11 +973,7 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if( okee("Erase selected")==0 ) break; if( okee("Erase selected")==0 ) break;
remove_marker(); remove_marker();
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
} }
} }

View File

@@ -499,11 +499,7 @@ static void do_action_selectmenu(void *arg, int event)
case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */ case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */
deselect_markers(1, 0); deselect_markers(1, 0);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */ case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */
@@ -515,11 +511,7 @@ static void do_action_selectmenu(void *arg, int event)
case ACTMENU_SEL_INVERSE_MARKERS: /* invert selection of markers */ case ACTMENU_SEL_INVERSE_MARKERS: /* invert selection of markers */
deselect_markers(0, 2); deselect_markers(0, 2);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
} }
} }
@@ -1062,11 +1054,7 @@ static void do_action_markermenu(void *arg, int event)
break; break;
} }
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
static uiBlock *action_markermenu(void *arg_unused) static uiBlock *action_markermenu(void *arg_unused)

View File

@@ -796,14 +796,11 @@ static void do_ipo_selectmenu(void *arg, int event)
break; break;
case 2: case 2:
borderselect_markers(); borderselect_markers();
allqueue(REDRAWMARKER, 0);
break; break;
case 3: case 3:
deselect_markers(1, 0); deselect_markers(1, 0);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
} }
} }
@@ -858,11 +855,7 @@ static void do_ipo_markermenu(void *arg, int event)
break; break;
} }
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
static uiBlock *ipo_markermenu(void *arg_unused) static uiBlock *ipo_markermenu(void *arg_unused)

View File

@@ -202,11 +202,7 @@ static void do_nla_selectmenu(void *arg, int event)
break; break;
case 3: /* Select/Deselect All Markers */ case 3: /* Select/Deselect All Markers */
deselect_markers(1, 0); deselect_markers(1, 0);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case 4: /* Borderselect markers */ case 4: /* Borderselect markers */
borderselect_markers(); borderselect_markers();
@@ -405,11 +401,7 @@ static void do_nla_markermenu(void *arg, int event)
break; break;
} }
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
static uiBlock *nla_markermenu(void *arg_unused) static uiBlock *nla_markermenu(void *arg_unused)

View File

@@ -63,7 +63,7 @@
#include "BSE_drawipo.h" #include "BSE_drawipo.h"
#include "BSE_headerbuttons.h" #include "BSE_headerbuttons.h"
#include "BSE_sequence.h" #include "BSE_sequence.h"
#include "BSE_time.h"
#include "blendef.h" #include "blendef.h"
#include "mydevice.h" #include "mydevice.h"
@@ -507,6 +507,65 @@ static uiBlock *seq_editmenu(void *arg_unused)
return block; return block;
} }
static void do_seq_markermenu(void *arg, int event)
{
switch(event)
{
case 1:
add_marker(CFRA);
break;
case 2:
duplicate_marker();
break;
case 3:
remove_marker();
break;
case 4:
rename_marker();
break;
case 5:
transform_markers('g', 0);
break;
}
allqueue(REDRAWMARKER, 0);
}
static uiBlock *seq_markermenu(void *arg_unused)
{
uiBlock *block;
short yco= 0, menuwidth=120;
block= uiNewBlock(&curarea->uiblocks, "ipo_markermenu",
UI_EMBOSSP, UI_HELV, curarea->headwin);
uiBlockSetButmFunc(block, do_seq_markermenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|Ctrl Alt M", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
}
else {
uiBlockSetDirection(block, UI_TOP);
uiBlockFlipOrder(block);
}
uiTextBoundsBlock(block, 50);
return block;
}
void do_seq_buttons(short event) void do_seq_buttons(short event)
{ {
@@ -582,6 +641,10 @@ void seq_buttons()
uiDefPulldownBut(block,seq_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); uiDefPulldownBut(block,seq_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
xco+=xmax; xco+=xmax;
xmax= GetButStringLength("Marker");
uiDefPulldownBut(block,seq_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, "");
xco+=xmax;
xmax= GetButStringLength("Add"); xmax= GetButStringLength("Add");
uiDefPulldownBut(block, seq_addmenu, NULL, "Add", xco, -2, xmax-3, 24, ""); uiDefPulldownBut(block, seq_addmenu, NULL, "Add", xco, -2, xmax-3, 24, "");
xco+= xmax; xco+= xmax;

View File

@@ -269,11 +269,7 @@ static void do_sound_markermenu(void *arg, int event)
break; break;
} }
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
static uiBlock *sound_markermenu(void *arg_unused) static uiBlock *sound_markermenu(void *arg_unused)

View File

@@ -2749,11 +2749,7 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case RIGHTMOUSE: case RIGHTMOUSE:
mouse_select_ipo(); mouse_select_ipo();
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case MIDDLEMOUSE: case MIDDLEMOUSE:
if(in_ipo_buttons()) { if(in_ipo_buttons()) {
@@ -2801,11 +2797,7 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case AKEY: case AKEY:
if (G.qual & LR_CTRLKEY) { if (G.qual & LR_CTRLKEY) {
deselect_markers(1, 0); deselect_markers(1, 0);
allqueue(REDRAWTIME, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
} }
else if (G.qual==0) { else if (G.qual==0) {
if(in_ipo_buttons()) { if(in_ipo_buttons()) {
@@ -2834,15 +2826,18 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
move_to_frame(); move_to_frame();
break; break;
case DKEY: case DKEY:
if (G.qual==LR_SHIFTKEY) if (G.qual==LR_SHIFTKEY) {
add_duplicate_editipo(); add_duplicate_editipo();
else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) } else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
duplicate_marker(); duplicate_marker();
allqueue(REDRAWMARKER, 0);
}
break; break;
case GKEY: case GKEY:
if (G.qual & LR_CTRLKEY) if (G.qual & LR_CTRLKEY) {
transform_markers('g', 0); transform_markers('g', 0);
else if (G.qual==0) allqueue(REDRAWMARKER, 0);
} else if (G.qual==0)
transform_ipo('g'); transform_ipo('g');
break; break;
case HKEY: case HKEY:
@@ -2866,21 +2861,17 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} }
break; break;
case MKEY: case MKEY:
if (G.qual==LR_SHIFTKEY) { if (G.qual==0) {
add_marker(CFRA);
} else if (G.qual==LR_SHIFTKEY) {
ipo_mirror_menu(); ipo_mirror_menu();
break; break;
} } else if (G.qual == LR_CTRLKEY) {
if (G.qual == 0)
add_marker(CFRA);
else if (G.qual == LR_CTRLKEY)
rename_marker(); rename_marker();
else } else {
break; break;
allqueue(REDRAWTIME, 0); }
allqueue(REDRAWIPO, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
break; break;
case NKEY: case NKEY:
toggle_blockhandler(sa, IPO_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); toggle_blockhandler(sa, IPO_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
@@ -4552,8 +4543,12 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} }
break; break;
case DKEY: case DKEY:
if(sseq->mainb) break; if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
if((G.qual==LR_SHIFTKEY)) add_duplicate_seq(); duplicate_marker();
else if ((G.qual==LR_SHIFTKEY)) {
if(sseq->mainb) break;
add_duplicate_seq();
}
break; break;
case EKEY: case EKEY:
if(sseq->mainb) break; if(sseq->mainb) break;
@@ -4565,9 +4560,12 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
set_filter_seq(); set_filter_seq();
break; break;
case GKEY: case GKEY:
if(sseq->mainb) break; if (G.qual & LR_CTRLKEY)
if((G.qual==0)) transform_markers('g', 0);
else if (G.qual==0) {
if(sseq->mainb) break;
transform_seq('g', 0); transform_seq('g', 0);
}
break; break;
case KKEY: case KKEY:
if((G.qual==0)) { /* Cut at current frame */ if((G.qual==0)) { /* Cut at current frame */
@@ -4580,19 +4578,28 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} }
break; break;
case MKEY: case MKEY:
if(G.qual==LR_ALTKEY) if(G.qual==LR_ALTKEY) {
un_meta(); un_meta();
else if((G.qual==0)){ break; /*dont redraw timeline etc */
} else if((G.qual==0)){
if ((last_seq) && if ((last_seq) &&
(last_seq->type == SEQ_RAM_SOUND (last_seq->type == SEQ_RAM_SOUND
|| last_seq->type == SEQ_HD_SOUND)) || last_seq->type == SEQ_HD_SOUND))
{ {
last_seq->flag ^= SEQ_MUTE; last_seq->flag ^= SEQ_MUTE;
doredraw = 1; doredraw = 1;
} } else {
else
make_meta(); make_meta();
}
break; /*dont redraw timeline etc */
} else if ((G.qual==(LR_CTRLKEY|LR_ALTKEY) )) {
add_marker(CFRA);
} else if ((G.qual==LR_CTRLKEY)) {
rename_marker();
} else {
break; /* do nothing */
} }
allqueue(REDRAWMARKER, 0);
break; break;
case NKEY: case NKEY:
if(G.qual==0) { if(G.qual==0) {
@@ -6179,6 +6186,11 @@ void allqueue(unsigned short event, short val)
scrarea_queue_winredraw(sa); scrarea_queue_winredraw(sa);
if(val) scrarea_queue_headredraw(sa); if(val) scrarea_queue_headredraw(sa);
} }
case REDRAWMARKER: /* markers may not always match animation */
if ELEM6(sa->spacetype, SPACE_TIME, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_SOUND, SPACE_SEQ) {
scrarea_queue_winredraw(sa);
if(val) scrarea_queue_headredraw(sa);
}
} }
} }
sa= sa->next; sa= sa->next;

View File

@@ -2614,11 +2614,7 @@ void autokeyframe_ob_cb_func(Object *ob, int tmode)
} }
remake_object_ipos(ob); remake_object_ipos(ob);
allqueue(REDRAWIPO, 0); allqueue(REDRAWMARKER, 0);
allspace(REMAKEIPO, 0);
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWTIME, 0);
} }
} }
@@ -2700,11 +2696,7 @@ void autokeyframe_pose_cb_func(Object *ob, int tmode, short targetless_ik)
} }
remake_action_ipos (act); remake_action_ipos (act);
allspace(REMAKEIPO, 0); allqueue(REDRAWMARKER, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWTIME, 0);
} }
else { else {
/* tag channels that should have unkeyed data */ /* tag channels that should have unkeyed data */