diff options
author | Ton Roosendaal <ton@blender.org> | 2003-10-17 23:03:53 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-10-17 23:03:53 +0400 |
commit | 58a0811ad9633236f75b692fbe0955d3b91ccabb (patch) | |
tree | f474124ab73fd8ac6d40e6d7af76bf7f1ba9e065 /source/blender/src/editsound.c | |
parent | 8ce5ece950305d50966ad6409295207fcf3ed42b (diff) |
- fixed bug in windows with extreme small height... it didnt accept
input
- was needed for usage of this windowtype (headerless) as 'timeline'
dragger, which was supposed to be...
- as extra I fixed 'home', it sets start/end frame for sound window
- at mouselocation the current frame or time is printed
- rightmouse menu switches seconds/frames (should be in header as option...)
- displaybutton 'frs/sec/' updates soundwindow too
So, its not perfect... but try opening a tiny high headerless audio
window on top of buttonswin or somewhere full width. not bad...
Diffstat (limited to 'source/blender/src/editsound.c')
-rw-r--r-- | source/blender/src/editsound.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/source/blender/src/editsound.c b/source/blender/src/editsound.c index 6a23731a755..74d2086c8e9 100644 --- a/source/blender/src/editsound.c +++ b/source/blender/src/editsound.c @@ -98,11 +98,12 @@ void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *e /* Right. Now for some implementation: */ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt) { + SpaceSound *ssound= spacedata; unsigned short event= evt->event; short val= evt->val; float dx, dy; int doredraw= 0, cfra, first = 0; - short mval[2]; + short mval[2], nr; if(curarea->win==0) return; @@ -110,30 +111,27 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0; - switch(event) - { + switch(event) { case LEFTMOUSE: - if( view2dmove(event)==0 ) - { - do - { - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - - cfra = (int)dx; - if(cfra< 1) cfra= 1; - - if( cfra!=CFRA || first ) - { - first= 0; - CFRA= cfra; - update_for_newframe(); - force_draw_plus(SPACE_VIEW3D); - } + + do { + getmouseco_areawin(mval); + areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - } while(get_mbut()&L_MOUSE); + cfra = (int)dx; + if(cfra< 1) cfra= 1; - } + if( cfra!=CFRA || first ) + { + first= 0; + CFRA= cfra; + update_for_newframe(); + force_draw_plus(SPACE_VIEW3D); + } + + } while(get_mbut()&L_MOUSE); + doredraw= 1; + break; case MIDDLEMOUSE: case WHEELUPMOUSE: @@ -141,7 +139,13 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt) view2dmove(event); /* in drawipo.c */ break; case RIGHTMOUSE: - /* mouse_select_seq(); */ + nr= pupmenu("Time value%t|Frames %x1|Seconds%x2"); + if (nr>0) { + if(nr==1) ssound->flag |= SND_DRAWFRAMES; + else ssound->flag &= ~SND_DRAWFRAMES; + doredraw= 1; + } + break; case PADPLUSKEY: dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin)); |