X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindowgui.C;h=f27896434edf87f15a9e511f2d98937690bb1093;hb=08284a3a20b2cc8606dd90c3c147e2c31d301a61;hp=f7cd97cd94accae12af1451d1c5a0b7df7d21714;hpb=9d8694b7d2e0f4202e025eaf78d096340184b4e6;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index f7cd97cd..f2789643 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -277,7 +277,10 @@ void MWindowGUI::create_objects() add_subwindow(mbuttons = new MButtons(mwindow, this)); mbuttons->create_objects(); - add_subwindow(ffmpeg_toggle = new FFMpegToggle(mwindow, mbuttons, menu_w(), menu_h()+2)); + int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+2; + add_subwindow(proxy_toggle = new ProxyToggle(mwindow, mbuttons, x1, y1)); + x1 += proxy_toggle->get_w() + 3; + add_subwindow(ffmpeg_toggle = new FFMpegToggle(mwindow, mbuttons, x1, y1)); pane[TOP_LEFT_PANE] = new TimelinePane(mwindow, TOP_LEFT_PANE, @@ -356,7 +359,9 @@ void MWindowGUI::create_objects() #ifdef HAVE_DVB channel_info = new ChannelInfo(mwindow); #endif +#ifdef HAVE_COMMERCIAL db_window = new DbWindow(mwindow); +#endif swindow = new SWindow(mwindow); if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__); @@ -401,10 +406,13 @@ int MWindowGUI::resize_event(int w, int h) int x = w - MainShBtns::calculate_w(0); mainmenu->resize_event(x, mainmenu->get_h()); mainshbtns->reposition_window(x, -1); - ffmpeg_toggle->reposition_window(menu_w(), menu_h()+2); mwindow->theme->get_mwindow_sizes(this, w, h); mwindow->theme->draw_mwindow_bg(this); mbuttons->resize_event(); + int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+2; + proxy_toggle->reposition_window(x1, y1); + x1 += proxy_toggle->get_w() + 3; + ffmpeg_toggle->reposition_window(x1, y1); statusbar->resize_event(); zoombar->resize_event(); @@ -700,6 +708,17 @@ void MWindowGUI::flash_canvas(int flush) } } +int MWindowGUI::show_window(int flush) +{ + int ret = BC_WindowBase::show_window(flush); + if( mwindow->edl->session->proxy_scale == 1 && + mwindow->edl->session->proxy_disabled_scale == 1 ) + proxy_toggle->hide_window(); + else + proxy_toggle->show_window(); + return ret; +} + void MWindowGUI::draw_cursor(int do_plugintoggles) { for(int i = 0; i < TOTAL_PANES; i++) @@ -1303,6 +1322,8 @@ int MWindowGUI::keypress_event() case KEY_F8: case KEY_F9: case KEY_F10: + case KEY_F11: + case KEY_F12: resend_event(mwindow->cwindow->gui); return 1; } @@ -1381,6 +1402,14 @@ int MWindowGUI::menu_h() return mainmenu->get_h(); } +int MWindowGUI::mbuttons_w() +{ + int w = get_w(); + w -= mwindow->theme->ffmpeg_toggle[0]->get_w()+2; + w -= mwindow->theme->ffmpeg_toggle[0]->get_w()+2; + return w; +} + void MWindowGUI::start_x_pane_drag() { if(!x_pane_drag) @@ -2328,7 +2357,8 @@ int PaneButton::cursor_motion_event() int PaneButton::button_release_event() { - mwindow->gui->stop_pane_drag(); + if( get_buttonpress() != WHEEL_DOWN && get_buttonpress() != WHEEL_UP ) + mwindow->gui->stop_pane_drag(); int result = BC_Button::button_release_event(); return result; } @@ -2360,3 +2390,41 @@ int FFMpegToggle::handle_event() } +ProxyToggle::ProxyToggle(MWindow *mwindow, MButtons *mbuttons, int x, int y) + : BC_Toggle(x, y, mwindow->theme->proxy_toggle, + mwindow->edl->session->proxy_disabled_scale != 1) +{ + this->mwindow = mwindow; + this->mbuttons = mbuttons; + set_tooltip(mwindow->edl->session->proxy_disabled_scale==1 ? + _("Disable proxy") : _("Enable proxy")); +} + +ProxyToggle::~ProxyToggle() +{ +} + +int ProxyToggle::handle_event() +{ + int disabled = get_value(); + if( disabled ) + mwindow->disable_proxy(); + else + mwindow->enable_proxy(); + set_tooltip(!disabled ? _("Disable proxy") : _("Enable proxy")); + return 1; +} + +int ProxyToggle::keypress_event() +{ + if( ctrl_down() && !shift_down() && !alt_down() ) { + int key = get_keypress(); + if( key == 'r' ) { + int value = get_value() ? 0 : 1; + set_value(value); + return handle_event(); + } + } + return 0; +} +