X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcwindow.C;h=1511867bd8ab1c4e99157a218fbaf4a6f13f915d;hp=1611f7534342100a018fdf8a6ef338ba26b11981;hb=6a9fa3df95fb5ef53e1b09fdd2297a8aaf549fe5;hpb=2e28d225c343f02500594688bf8d0528df40600c diff --git a/cinelerra-5.1/cinelerra/cwindow.C b/cinelerra-5.1/cinelerra/cwindow.C index 1611f753..1511867b 100644 --- a/cinelerra-5.1/cinelerra/cwindow.C +++ b/cinelerra-5.1/cinelerra/cwindow.C @@ -145,24 +145,19 @@ Track* CWindow::calculate_affected_track() } Auto* CWindow::calculate_affected_auto(Autos *autos, - int create, - int *created, - int redraw) + int create, int *created, int redraw) { Auto* affected_auto = 0; - if(created) *created = 0; + if( created ) *created = 0; - if(create) - { + if( create ) { int total = autos->total(); - affected_auto = autos->get_auto_for_editing(); + affected_auto = autos->get_auto_for_editing(-1, create); // Got created - if(total != autos->total()) - { - if(created) *created = 1; - if(redraw) - { + if( total != autos->total() ) { + if( created ) *created = 1; + if( redraw ) { // May have to unlock CWindowGUI here. mwindow->gui->lock_window("CWindow::calculate_affected_auto"); mwindow->gui->draw_overlays(1); @@ -170,8 +165,7 @@ Auto* CWindow::calculate_affected_auto(Autos *autos, } } } - else - { + else { affected_auto = autos->get_prev_auto(PLAY_FORWARD, affected_auto); } @@ -180,39 +174,28 @@ Auto* CWindow::calculate_affected_auto(Autos *autos, -void CWindow::calculate_affected_autos(FloatAuto **x_auto, - FloatAuto **y_auto, - FloatAuto **z_auto, - Track *track, - int use_camera, - int create_x, - int create_y, - int create_z) +void CWindow::calculate_affected_autos(Track *track, + FloatAuto **x_auto, FloatAuto **y_auto, FloatAuto **z_auto, + int use_camera, int create_x, int create_y, int create_z, + int redraw) { - if(x_auto) (*x_auto) = 0; - if(y_auto) (*y_auto) = 0; - if(z_auto) (*z_auto) = 0; - - if(!track) return; - - if(use_camera) - { - if(x_auto) (*x_auto) = (FloatAuto*)calculate_affected_auto( - track->automation->autos[AUTOMATION_CAMERA_X], create_x); - if(y_auto) (*y_auto) = (FloatAuto*)calculate_affected_auto( - track->automation->autos[AUTOMATION_CAMERA_Y], create_y); - if(z_auto) (*z_auto) = (FloatAuto*)calculate_affected_auto( - track->automation->autos[AUTOMATION_CAMERA_Z], create_z); - } - else - { - if(x_auto) (*x_auto) = (FloatAuto*)calculate_affected_auto( - track->automation->autos[AUTOMATION_PROJECTOR_X], create_x); - if(y_auto) (*y_auto) = (FloatAuto*)calculate_affected_auto( - track->automation->autos[AUTOMATION_PROJECTOR_Y], create_y); - if(z_auto) (*z_auto) = (FloatAuto*)calculate_affected_auto( - track->automation->autos[AUTOMATION_PROJECTOR_Z], create_z); - } + if( x_auto ) *x_auto = 0; + if( y_auto ) *y_auto = 0; + if( z_auto ) *z_auto = 0; + if( !track ) return; + + int ix = use_camera ? AUTOMATION_CAMERA_X : AUTOMATION_PROJECTOR_X, x_created = 0; + int iy = use_camera ? AUTOMATION_CAMERA_Y : AUTOMATION_PROJECTOR_Y, y_created = 0; + int iz = use_camera ? AUTOMATION_CAMERA_Z : AUTOMATION_PROJECTOR_Z, z_created = 0; + + if( x_auto ) + *x_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[ix], + create_x, &x_created, redraw); + if( y_auto ) + *y_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iy], + create_y, &y_created, redraw); + if( z_auto ) *z_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iz], + create_z, &z_created, redraw); } void CWindow::stop_playback(int wait) @@ -228,24 +211,24 @@ void CWindow::run() void CWindow::update(int dir, int overlays, int tool_window, int operation, int timebar) { - if(dir) + if( dir ) refresh_frame(CHANGE_NONE, dir); gui->lock_window("CWindow::update 2"); // Create tool window - if(operation) + if( operation ) gui->set_operation(mwindow->edl->session->cwindow_operation); // Updated by video device. - if(overlays && !dir) + if( overlays && !dir ) gui->canvas->draw_refresh(); // Update tool parameters // Never updated by someone else - if(tool_window || dir) + if( tool_window || dir ) gui->update_tool(); - if(timebar) + if( timebar ) gui->timebar->update(1); double zoom = !mwindow->edl->session->cwindow_scrollbars ?