X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindowgui.C;h=6381fa077cce58769db42c5ad226686e68e88357;hp=34638e18480bafa4ff6d49ed50b77ded71301e16;hb=b4017f68039ef7e31eedee4a27580a28bee36fc5;hpb=84ac8a2bb3357c04a3f67cf763b0f61ddbbd021d diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 34638e18..6381fa07 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -56,6 +56,7 @@ #include "pluginpopup.h" #include "pluginset.h" #include "preferences.h" +#include "proxy.h" #include "record.h" #include "recordgui.h" #include "renderengine.h" @@ -299,14 +300,14 @@ void MWindowGUI::redraw_time_dependancies() int MWindowGUI::focus_in_event() { for(int i = 0; i < TOTAL_PANES; i++) - if(pane[i]) pane[i]->cursor->focus_in_event(); + if(pane[i] && pane[i]->cursor) pane[i]->cursor->focus_in_event(); return 1; } int MWindowGUI::focus_out_event() { for(int i = 0; i < TOTAL_PANES; i++) - if(pane[i]) pane[i]->cursor->focus_out_event(); + if(pane[i] && pane[i]->cursor) pane[i]->cursor->focus_out_event(); return 1; } @@ -512,7 +513,7 @@ void MWindowGUI::deactivate_timeline() { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->canvas) { pane[i]->canvas->deactivate(); } @@ -534,7 +535,7 @@ void MWindowGUI::draw_overlays(int flash_it) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->canvas) { pane[i]->canvas->draw_overlays(); if(flash_it) pane[i]->canvas->flash(); @@ -578,10 +579,9 @@ void MWindowGUI::update_patchbay() void MWindowGUI::update_proxy_toggle() { - int value = mwindow->edl->session->proxy_scale == 1 ? 1 : 0; + int value = mwindow->edl->session->proxy_state == PROXY_ACTIVE ? 0 : 1; proxy_toggle->set_value(value); - if( mwindow->edl->session->proxy_scale == 1 && - mwindow->edl->session->proxy_disabled_scale == 1 ) + if( mwindow->edl->session->proxy_state == PROXY_INACTIVE ) proxy_toggle->hide(); else proxy_toggle->show(); @@ -591,7 +591,7 @@ void MWindowGUI::update_plugintoggles() { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->canvas) { pane[i]->canvas->refresh_plugintoggles(); } @@ -603,7 +603,7 @@ void MWindowGUI::draw_indexes(Indexable *indexable) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->canvas) { pane[i]->canvas->draw_indexes(indexable); } @@ -613,8 +613,11 @@ void MWindowGUI::draw_indexes(Indexable *indexable) void MWindowGUI::draw_canvas(int redraw, int hide_cursor) { resource_thread->stop_draw(0); - - int mode = redraw ? FORCE_REDRAW : NORMAL_DRAW; + int mode = NORMAL_DRAW; + if( redraw ) { + mode = FORCE_REDRAW; + resource_pixmaps.remove_all_objects(); + } for(int i = 0; i < TOTAL_PANES; i++) { if( pane[i] ) pane[i]->canvas->draw(mode, hide_cursor); @@ -627,7 +630,7 @@ void MWindowGUI::flash_canvas(int flush) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->canvas) { pane[i]->canvas->flash(flush); } @@ -646,7 +649,7 @@ void MWindowGUI::draw_cursor(int do_plugintoggles) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->cursor) { pane[i]->cursor->draw(do_plugintoggles); } @@ -657,7 +660,7 @@ void MWindowGUI::show_cursor(int do_plugintoggles) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->cursor) { pane[i]->cursor->show(do_plugintoggles); } @@ -668,7 +671,7 @@ void MWindowGUI::hide_cursor(int do_plugintoggles) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->cursor) { pane[i]->cursor->hide(do_plugintoggles); } @@ -679,7 +682,7 @@ void MWindowGUI::update_cursor() { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->cursor) { pane[i]->cursor->update(); } @@ -690,7 +693,7 @@ void MWindowGUI::set_playing_back(int value) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->cursor) { pane[i]->cursor->playing_back = value; } @@ -746,7 +749,7 @@ void MWindowGUI::set_editing_mode(int flush) { for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) + if(pane[i] && pane[i]->canvas) { pane[i]->canvas->update_cursor(flush); } @@ -782,6 +785,9 @@ void MWindowGUI::update(int scrollbars, if( do_canvas != NO_DRAW && do_canvas != IGNORE_THREAD ) resource_thread->stop_draw(1); + if( do_canvas == FORCE_REDRAW ) + resource_pixmaps.remove_all_objects(); + for(int i = 0; i < TOTAL_PANES; i++) { if(pane[i]) pane[i]->update(scrollbars, @@ -882,11 +888,9 @@ int MWindowGUI::drag_motion() for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) pane[i]->canvas->drag_motion( - &over_track, - &over_edit, - &over_pluginset, - &over_plugin); + if(pane[i] && pane[i]->canvas) + pane[i]->canvas->drag_motion(&over_track, &over_edit, + &over_pluginset, &over_plugin); } if(mwindow->session->track_highlighted != over_track) @@ -943,8 +947,8 @@ int MWindowGUI::drag_stop() for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) result |= pane[i]->canvas->drag_stop( - &redraw); + if(pane[i] && pane[i]->canvas) + result |= pane[i]->canvas->drag_stop(&redraw); } mwindow->edl->optimize(); @@ -1038,6 +1042,7 @@ void MWindowGUI::default_positions() mwindow->cwindow->gui->unlock_window(); mwindow->awindow->gui->unlock_window(); //printf("MWindowGUI::default_positions 2\n"); + mwindow->tile_mixers(); } @@ -1048,7 +1053,8 @@ int MWindowGUI::repeat_event(int64_t duration) int result = 0; for(int i = 0; i < TOTAL_PANES; i++) { - if(pane[i]) result = pane[i]->cursor->repeat_event(duration); + if(pane[i] && pane[i]->cursor) + result = pane[i]->cursor->repeat_event(duration); } return result; } @@ -1079,27 +1085,32 @@ int MWindowGUI::keypress_event() if( result ) return result; Track *this_track = 0, *first_track = 0; - int collapse = 0, packed = 0, overwrite = 0, plugins = 0; + int packed = 0, overwrite = 0, plugins = 0; double position = 0; switch( get_keypress() ) { case 'A': - if( !alt_down() ) { - if( !ctrl_down() || !shift_down() ) break; + if( !alt_down() && ctrl_down() ) { mwindow->edl->tracks->clear_selected_edits(); draw_overlays(1); result = 1; - break; - } // fall thru + } + break; case 'a': - if( !alt_down() ) break; - stop_transport("MWindowGUI::keypress_event 1"); - mwindow->nearest_auto_keyframe(shift_down(), - !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); - result = 1; + if( !ctrl_down() && alt_down() ) { + stop_transport("MWindowGUI::keypress_event 1"); + mwindow->nearest_auto_keyframe(shift_down(), + !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); + result = 1; + } + else if( ctrl_down() && alt_down() ) { + mwindow->select_edits(1); + result = 1; + } break; case 'e': + if( ctrl_down() || alt_down() ) break; mwindow->toggle_editing_mode(); result = 1; break; @@ -1150,17 +1161,29 @@ int MWindowGUI::keypress_event() result = 1; break; case 'M': - collapse = 1; + mwindow->cut_selected_edits(0, 1); + result = 1; + break; case BACKSPACE: case 'm': - mwindow->cut_selected_edits(0, collapse); + mwindow->cut_selected_edits(0, 0); result = 1; break; case 'z': - collapse = 1; + if( !alt_down() ) { + // z and ctrl-z both are undo, z mainmenu item + if( mwindow->session->current_operation == NO_OPERATION ) + mwindow->undo_entry(this); + result = 1; + } + else if( ctrl_down() ) { + mwindow->cut_selected_edits(1, 1); + result = 1; + } + break; case 'x': if( !ctrl_down() || alt_down() ) break; - mwindow->cut_selected_edits(1, collapse); + mwindow->cut_selected_edits(1, 0); result = 1; break; @@ -2392,12 +2415,12 @@ ProxyToggle::ProxyToggle(MWindow *mwindow, MButtons *mbuttons, int x, int y) : BC_Toggle(x, y, ( !mwindow->edl->session->proxy_use_scaler ? mwindow->theme->proxy_p_toggle : mwindow->theme->proxy_s_toggle ), - mwindow->edl->session->proxy_disabled_scale != 1) + mwindow->edl->session->proxy_state == PROXY_DISABLED) { this->mwindow = mwindow; this->mbuttons = mbuttons; scaler_images = mwindow->edl->session->proxy_use_scaler; - set_tooltip(mwindow->edl->session->proxy_disabled_scale==1 ? + set_tooltip(mwindow->edl->session->proxy_state!=PROXY_DISABLED ? _("Disable proxy") : _("Enable proxy")); } @@ -2433,6 +2456,12 @@ int ProxyToggle::handle_event() mwindow->enable_proxy(); mwindow->gui->lock_window("ProxyToggle::handle_event"); set_tooltip(!disabled ? _("Disable proxy") : _("Enable proxy")); + ProxyDialog *dialog = mwindow->gui->mainmenu->proxy->dialog; + if( dialog && dialog->gui ) { + dialog->gui->lock_window("ProxyToggle::handle_event"); + dialog->gui->update(); + dialog->gui->unlock_window(); + } return 1; }