X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fzwindowgui.C;h=6f1f8132848bfc62b8115c46640c30c445230a8c;hb=f377b3322b0c0cdf4b39abadac9ff528fa6ff70c;hp=b6cccd03f82352ce4f285a98ccc267bf754f644e;hpb=98e035865979cda9805a58a85d52f8d70a7ec54e;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/zwindowgui.C b/cinelerra-5.1/cinelerra/zwindowgui.C index b6cccd03..6f1f8132 100644 --- a/cinelerra-5.1/cinelerra/zwindowgui.C +++ b/cinelerra-5.1/cinelerra/zwindowgui.C @@ -85,7 +85,7 @@ int ZWindowGUI::translation_event() int ZWindowGUI::close_event() { - set_done(0); + set_done(1); return 1; } @@ -194,6 +194,18 @@ int ZWindowGUI::draw_overlays() return 1; } + +ZWindowCanvasTileMixers::ZWindowCanvasTileMixers(ZWindowCanvas *canvas) + : BC_MenuItem(_("Tile Mixers")) +{ + this->canvas = canvas; +} +int ZWindowCanvasTileMixers::handle_event() +{ + canvas->mwindow->tile_mixers(); + return 1; +} + ZWindowCanvas::ZWindowCanvas(MWindow *mwindow, ZWindowGUI *gui, int x, int y, int w, int h) : Canvas(mwindow, gui, x,y, w,h, 0,0,0) @@ -202,6 +214,12 @@ ZWindowCanvas::ZWindowCanvas(MWindow *mwindow, ZWindowGUI *gui, this->gui = gui; } +void ZWindowCanvas::create_objects(EDL *edl) +{ + Canvas::create_objects(edl); + canvas_menu->add_item(new ZWindowCanvasTileMixers(this)); +} + void ZWindowCanvas::close_source() { gui->unlock_window(); @@ -214,7 +232,6 @@ void ZWindowCanvas::close_source() } } - void ZWindowCanvas::draw_refresh(int flush) { EDL *edl = gui->zwindow->edl; @@ -259,3 +276,33 @@ float ZWindowCanvas::get_auto_zoom() return zoom_x < zoom_y ? zoom_x : zoom_y; } +float ZWindowCanvas::get_zoom() +{ + return gui->zwindow->zoom; +} +void ZWindowCanvas::update_zoom(int x, int y, float zoom) +{ + gui->zwindow->zoom = zoom; +} + +void ZWindowCanvas::zoom_auto() +{ + EDL *edl = gui->zwindow->edl; + if( !edl ) edl = mwindow->edl; + set_zoom(edl, 0); +} + +void ZWindowCanvas::zoom_resize_window(float zoom) +{ + if( !zoom ) zoom = get_auto_zoom(); + EDL *edl = gui->zwindow->edl; + if( !edl ) edl = mwindow->edl; + int ow = edl->session->output_w, oh = edl->session->output_h; + int canvas_w, canvas_h; + calculate_sizes(mwindow->edl->get_aspect_ratio(), ow, oh, + zoom, canvas_w, canvas_h); + int new_w = canvas_w + xS(20); + int new_h = canvas_h + yS(20); + gui->resize_window(new_w, new_h); + gui->resize_event(new_w, new_h); +}