X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=77c1eba14aa08c97aa73e8467273b4dc017c4333;hp=96016f5dfba07459d3b0596424019c543c3ad9e5;hb=e26fa8bc220d47d1c35618b6b6d971188afe7fdd;hpb=7742a5b086fb7dc60ffc75459b1d25f80fe47990 diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 96016f5d..77c1eba1 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), @@ -2901,6 +2903,27 @@ void MWindow::restore_windows() } 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) @@ -2956,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); @@ -3197,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"); @@ -3269,6 +3292,14 @@ void MWindow::hide_keyframe_gui(Plugin *plugin) keyframe_gui_lock->unlock(); } +int MWindow::get_title_color(Edit *edit) +{ + int color = edit->color; + if( color < 0 && preferences->autocolor_assets ) + color = edit->get_hash_color(); + return color; +} + void MWindow::update_keyframe_guis() { // Send new configuration to keyframe GUI's @@ -3528,7 +3559,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(); @@ -3988,6 +4019,8 @@ 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->close_view_popup(); + 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); @@ -4033,7 +4066,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 @@ -4045,16 +4078,16 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, void MWindow::remove_assets_from_disk() { + remove_assets_from_project(1, + 1, + session->drag_assets, + session->drag_clips); + // Remove from disk for(int i = 0; i < session->drag_assets->total; i++) { remove(session->drag_assets->get(i)->path); } - - remove_assets_from_project(1, - 1, - session->drag_assets, - session->drag_clips); } void MWindow::dump_plugins(FILE *fp) @@ -4359,7 +4392,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");