X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcwindowgui.C;h=c51eb0c3d155fc8bcef72a316efbc8521689849d;hb=c279e21fc2394a7908bbd1ba8c79b116fe9fb14a;hp=b4b8008d8c9513d66c613213e5029f8451849218;hpb=d94bbdeebde4f16a77c388f9f28114b945db41d9;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index b4b8008d..c51eb0c3 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -219,14 +219,7 @@ void CWindowGUI::create_objects() tool_panel = new CWindowTool(mwindow, this); tool_panel->Thread::start(); - set_operation(mwindow->edl->session->cwindow_operation); - - - - canvas->draw_refresh(0); - - draw_status(0); unlock_window(); } @@ -298,6 +291,7 @@ int CWindowGUI::button_press_event() { if( current_operation == CWINDOW_NONE && mwindow->edl != 0 && canvas->get_canvas() && + mwindow->edl->session->cwindow_click2play && canvas->get_canvas()->get_cursor_over_window() ) { switch( get_buttonpress() ) { case LEFT_BUTTON: @@ -424,15 +418,26 @@ void CWindowGUI::zoom_canvas(double value, int update_menu) canvas->draw_refresh(); } - - void CWindowGUI::set_operation(int value) { - mwindow->edl->session->cwindow_operation = value; + switch( value ) { + case CWINDOW_TOOL_WINDOW: + mwindow->edl->session->tool_window = !mwindow->edl->session->tool_window; + composite_panel->operation[CWINDOW_TOOL_WINDOW]->update(mwindow->edl->session->tool_window); + tool_panel->update_show_window(); + return; + case CWINDOW_TITLESAFE: + mwindow->edl->session->safe_regions = !mwindow->edl->session->safe_regions; + composite_panel->operation[CWINDOW_TITLESAFE]->update(mwindow->edl->session->safe_regions); + value = mwindow->edl->session->cwindow_operation; + break; + default: + mwindow->edl->session->cwindow_operation = value; + composite_panel->set_operation(value); + break; + } - composite_panel->set_operation(value); edit_panel->update(); - tool_panel->start_tool(value); canvas->draw_refresh(); } @@ -452,6 +457,7 @@ int CWindowGUI::close_event() int CWindowGUI::keypress_event() { int result = 0; + int cwindow_operation = CWINDOW_NONE; switch(get_keypress()) { @@ -555,6 +561,23 @@ int CWindowGUI::keypress_event() } break; + case KEY_F1: cwindow_operation = CWINDOW_PROTECT; break; + case KEY_F2: cwindow_operation = CWINDOW_ZOOM; break; + case KEY_F3: cwindow_operation = CWINDOW_MASK; break; + case KEY_F4: cwindow_operation = CWINDOW_RULER; break; + case KEY_F5: cwindow_operation = CWINDOW_CAMERA; break; + case KEY_F6: cwindow_operation = CWINDOW_PROJECTOR; break; + case KEY_F7: cwindow_operation = CWINDOW_CROP; break; + case KEY_F8: cwindow_operation = CWINDOW_EYEDROP; break; + case KEY_F9: cwindow_operation = CWINDOW_TOOL_WINDOW; break; + case KEY_F10: cwindow_operation = CWINDOW_TITLESAFE; break; + case KEY_F11: canvas->reset_camera(); break; + case KEY_F12: canvas->reset_projector(); break; + } + + if( cwindow_operation >= 0 ) { + set_operation(cwindow_operation); + result = 1; } if(!result) result = transport->keypress_event(); @@ -712,28 +735,27 @@ void CWindowGUI::stop_transport(const char *lock_msg) CWindowEditing::CWindowEditing(MWindow *mwindow, CWindow *cwindow) - : EditPanel(mwindow, - cwindow->gui, - mwindow->theme->cedit_x, - mwindow->theme->cedit_y, + : EditPanel(mwindow, cwindow->gui, CWINDOW_ID, + mwindow->theme->cedit_x, mwindow->theme->cedit_y, mwindow->edl->session->editing_mode, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, + 0, // use_editing_mode + 1, // use_keyframe + 0, // use_splice + 0, // use_overwrite + 1, // use_lift + 1, // use_extract + 1, // use_copy + 1, // use_paste + 1, // use_undo + 0, // use_fit 0, // locklabels - 1, - 1, - 1, - 0, - 1, - 0) + 1, // use_labels + 1, // use_toclip + 1, // use_meters + 1, // use_cut + 0, // use_commerical + 0, // use_goto + 1) // use_clk2play { this->mwindow = mwindow; this->cwindow = cwindow; @@ -765,7 +787,7 @@ CWrapper_cut(next_edit) void CWindowEditing::to_clip() { - mwindow->to_clip(mwindow->edl, _("composer window: ")); + mwindow->to_clip(mwindow->edl, _("composer window: "), 0); } @@ -869,20 +891,9 @@ int CWindowSlider::handle_event() void CWindowSlider::set_position() { double new_length = mwindow->edl->tracks->total_length(); -// if(mwindow->edl->local_session->preview_end <= 0 || -// mwindow->edl->local_session->preview_end > new_length) -// mwindow->edl->local_session->preview_end = new_length; -// if(mwindow->edl->local_session->preview_start > -// mwindow->edl->local_session->preview_end) -// mwindow->edl->local_session->preview_start = 0; - - update(mwindow->theme->cslider_w, mwindow->edl->local_session->get_selectionstart(1), - 0, - new_length); -// mwindow->edl->local_session->preview_start, -// mwindow->edl->local_session->preview_end); + 0, new_length); } @@ -1080,12 +1091,13 @@ void CWindowCanvas::draw_refresh(int flush) (int)out_x1, (int)out_y1, (int)(out_x2 - out_x1), - (int)(out_y2 - out_y1), - (int)in_x1, - (int)in_y1, - (int)(in_x2 - in_x1), - (int)(in_y2 - in_y1), - 0); + (int)(out_y2 - out_y1)); +// if refresh_frame session geometry... +// (int)in_x1, +// (int)in_y1, +// (int)(in_x2 - in_x1), +// (int)(in_y2 - in_y1), +// 0); } } else @@ -1097,6 +1109,9 @@ void CWindowCanvas::draw_refresh(int flush) } draw_overlays(); +// allow last opengl write to complete before redraw +// tried sync_display, glFlush, glxMake*Current(0..) +usleep(20000); get_canvas()->flash(flush); } //printf("CWindowCanvas::draw_refresh 10\n"); @@ -2545,7 +2560,7 @@ int CWindowCanvas::test_crop(int button_press, int &redraw) redraw = 1; } } - else + else // Translate all 4 points if(gui->current_operation == CWINDOW_CROP && gui->crop_translate) {