X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=5fde46cc777d3ecf986554ba31354881e8af0591;hp=601f5c24e0fdfd7a01c26078bd35d01fbf25cd81;hb=24d62aadcd7a6188aff573aaec22f31e3bba4a57;hpb=e41864cf7931bfb86f68c5d35d4578dfe161d386 diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 601f5c24..5fde46cc 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -120,6 +120,7 @@ #include "vframe.h" #include "vtrack.h" #include "versioninfo.h" +#include "vicon.h" #include "videodevice.inc" #include "videowindow.h" #include "vplayback.h" @@ -1388,7 +1389,7 @@ void MWindow::create_mixers() save_backup(); undo->update_undo_after(_("create mixers"), LOAD_ALL); restart_brender(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); sync_parameters(CHANGE_ALL); } @@ -2007,6 +2008,7 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); break; } if( strcmp(cin_version, CINELERRA_VERSION) && + strcmp(cin_version, "Unify") && strcmp(cin_version, "5.1") ) { char string[BCTEXTLEN]; snprintf(string, sizeof(string), @@ -2861,32 +2863,67 @@ void MWindow::restore_windows() if( !session->show_vwindow ) { for( int i=0, n=vwindows.size(); igui->close(0); + if( !vwindow || !vwindow->is_running() ) continue; + vwindow->gui->lock_window("MWindow::restore_windows"); + vwindow->gui->close(1); + vwindow->gui->unlock_window(); } } else show_vwindow(); - if( !session->show_awindow ) - awindow->gui->close(0); - else + if( !session->show_awindow && !awindow->gui->is_hidden() ) { + awindow->gui->lock_window("MWindow::restore_windows"); + awindow->gui->close_event(); + awindow->gui->unlock_window(); + } + else if( session->show_awindow && awindow->gui->is_hidden() ) show_awindow(); - if( !session->show_cwindow ) - cwindow->gui->close(0); - else - show_cwindow(); + if( !session->show_cwindow && !cwindow->gui->is_hidden() ) { + cwindow->gui->lock_window("MWindow::restore_windows"); + cwindow->hide_window(); + cwindow->gui->unlock_window(); + } + else if( session->show_cwindow && cwindow->gui->is_hidden() ) + cwindow->show_window(); - if( !session->show_gwindow ) - gwindow->gui->close(0); - else + if( !session->show_gwindow && !gwindow->gui->is_hidden() ) { + gwindow->gui->lock_window("MWindow::restore_windows"); + gwindow->gui->close_event(); + gwindow->gui->unlock_window(); + } + else if( session->show_gwindow && gwindow->gui->is_hidden() ) show_gwindow(); - if( !session->show_lwindow ) - lwindow->gui->close(0); - else + if( !session->show_lwindow && !lwindow->gui->is_hidden() ) { + lwindow->gui->lock_window("MWindow::restore_windows"); + lwindow->gui->close_event(); + lwindow->gui->unlock_window(); + } + else if( session->show_lwindow && lwindow->gui->is_hidden() ) show_lwindow(); + + gui->focus(); +} + +void MWindow::save_layout(int no) +{ + char layout_path[BCTEXTLEN]; + snprintf(layout_path, sizeof(layout_path), "%s/" LAYOUT_FILE, + File::get_config_path(), no); + session->save_file(layout_path); +} + +void MWindow::load_layout(int no) +{ + char layout_path[BCTEXTLEN]; + snprintf(layout_path, sizeof(layout_path), "%s/" LAYOUT_FILE, + File::get_config_path(), no); + session->load_file(layout_path); + restore_windows(); + gui->default_positions(); + save_defaults(); } int MWindow::tile_windows(int window_config) @@ -2942,7 +2979,7 @@ void MWindow::set_auto_visibility(Autos *autos, int value) else return; - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->mainmenu->update_toggles(1); gui->unlock_window(); gwindow->gui->update_toggles(1); @@ -3183,7 +3220,7 @@ void MWindow::hide_plugin(Plugin *plugin, int lock) plugin->show = 0; // Update the toggle gui->lock_window("MWindow::hide_plugin"); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->unlock_window(); if(lock) plugin_gui_lock->lock("MWindow::hide_plugin"); @@ -3514,7 +3551,7 @@ void MWindow::update_project(int load_mode) gui->load_panes(); } - gui->update(1, 1, 1, 1, 1, 1, 1); + gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 1); if(debug) PRINT_TRACE gui->unlock_window(); init_brender(); @@ -3974,6 +4011,10 @@ void MWindow::remove_asset_from_caches(Asset *asset) void MWindow::remove_assets_from_project(int push_undo, int redraw, ArrayList *drag_assets, ArrayList *drag_clips) { + awindow->gui->vicon_thread->stop_drawing(); + awindow->gui->vicon_thread->drawing_started(); // waits for draw lock + awindow->gui->vicon_thread->drawing_stopped(); + for(int i = 0; i < drag_assets->total; i++) { Indexable *indexable = drag_assets->get(i); if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable); @@ -4019,7 +4060,7 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, restart_brender(); gui->lock_window("MWindow::remove_assets_from_project 3"); - gui->update(1, 1, 1, 1, 0, 1, 0); + gui->update(1, NORMAL_DRAW, 1, 1, 0, 1, 0); gui->unlock_window(); // Removes from playback here @@ -4345,7 +4386,7 @@ void MWindow::resync_guis() // Update GUIs restart_brender(); gui->lock_window("MWindow::resync_guis"); - gui->update(1, 1, 1, 1, 1, 1, 0); + gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); gui->unlock_window(); cwindow->gui->lock_window("MWindow::resync_guis");