diff options
author | Peter Schlaile <peter@schlaile.de> | 2008-05-12 21:16:54 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2008-05-12 21:16:54 +0400 |
commit | d2fcba7f65366440017178bcf21d4a8ad439fbcf (patch) | |
tree | 829822ac7a9e05a8880a16def5495e2ad47841c5 /source/blender/src/editipo.c | |
parent | c471b6db74d95d1a7a3a759e1597330129e64c9e (diff) |
== Ipo ==
This fixes [#11118] Record Mouse in IPO Curve Editor 2.46rc3
and adds thereby a new feature: correct audio sync to IPO mouse recording :)
Diffstat (limited to 'source/blender/src/editipo.c')
-rw-r--r-- | source/blender/src/editipo.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index a8b2ff761e5..c5dd41e16d5 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -116,6 +116,7 @@ #include "BSE_headerbuttons.h" #include "BSE_node.h" #include "BSE_sequence.h" +#include "BSE_seqaudio.h" #include "BSE_time.h" #include "blendef.h" @@ -5643,7 +5644,7 @@ void ipo_record(void) if(poin) ei1->icu->curval= read_ipo_poin(poin, type); or1= ei1->icu->curval; ei1->icu->flag |= IPO_LOCK; - + if(ei2) { if(ei2->icu==NULL) ei2->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei2->adrcode); @@ -5671,8 +5672,9 @@ void ipo_record(void) } sa= sa->next; } + if(sa) areawinset(sa->win); - + /* can we? */ while(get_mbut()&L_MOUSE) BIF_wait_for_statechange(); data1= MEM_callocN(sizeof(float)*(EFRA-SFRA+1), "data1"); @@ -5681,14 +5683,18 @@ void ipo_record(void) getmouseco_areawin(mvalo); xn= mvalo[0]; yn= mvalo[1]; waitcursor(1); - + tottime= 0.0; swaptime= 1.0/FPS; cfrao= CFRA; cfra=efra= SFRA; sfra= EFRA; - + + if (G.scene->audio.flag & AUDIO_SYNC) { + audiostream_start(cfra); + } + while(afbreek==0) { getmouseco_areawin(mval); @@ -5698,7 +5704,7 @@ void ipo_record(void) else firsttime= 0; set_timecursor(cfra); - + /* do ipo: first all, then the specific ones */ if(anim==2) { do_ob_ipo(ob); @@ -5729,7 +5735,7 @@ void ipo_record(void) /* minimal wait swaptime */ tottime -= swaptime; - while (update_time()) PIL_sleep_ms(1); + while (update_time(cfra)) PIL_sleep_ms(1); screen_swapbuffers(); @@ -5739,8 +5745,18 @@ void ipo_record(void) mvalo[1]= mval[1]; if(anim || (G.qual & LR_CTRLKEY)) { - cfra++; - if(cfra>EFRA) cfra= SFRA; + if (G.scene->audio.flag & AUDIO_SYNC) { + cfra = audiostream_pos(); + } else { + cfra++; + } + if(cfra>EFRA) { + cfra= SFRA; + if (G.scene->audio.flag & AUDIO_SYNC) { + audiostream_stop(); + audiostream_start( cfra ); + } + } } } @@ -5793,6 +5809,9 @@ void ipo_record(void) editipo_changed(G.sipo, 0); do_ipo(G.sipo->ipo); waitcursor(0); + if (G.scene->audio.flag & AUDIO_SYNC) { + audiostream_stop(); + } allqueue(REDRAWVIEW3D, 0); if(sa) scrarea_queue_headredraw(sa); /* headerprint */ |