X-Git-Url: https://cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=c57c2ecf492e3943f0a7da3a0e5fc299f9a27685;hb=b4017f68039ef7e31eedee4a27580a28bee36fc5;hp=4179cc51dfad48f3492d1beabd3f8b5c54700b3f;hpb=b384d47608e07b9f5b6ce5fe1d0d76d9bda38202;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 4179cc51..c57c2ecf 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1469,6 +1469,26 @@ int MWindow::select_zwindow(ZWindow *zwindow) void MWindow::tile_mixers() { + int x1 = session->tile_mixers_x; + int y1 = session->tile_mixers_y; + int x2 = x1 + session->tile_mixers_w; + int y2 = y1 + session->tile_mixers_h; + tile_mixers(x1, y1, x2, y2); +} + +void MWindow::tile_mixers(int x1, int y1, int x2, int y2) +{ + if( x1 == x2 || y1 == y2 ) { +// use top left quadrent + int sw = gui->get_screen_w(1, -1); + int sh = gui->get_screen_w(1, -1); + x1 = 1; y1 = 1; + x2 = sw/2; y2 = sh/2; + } + else { + if( x1 > x2 ) { int t = x1; x1 = x2; x2 = t; } + if( y1 > y2 ) { int t = y1; y1 = y2; y2 = t; } + } int nz = 0; for( int i=0; iget_x(), x2 = cwindow->gui->get_x(); - int y1 = 1, y2 = gui->get_y(); int rw = gui->get_root_w(0), rh = gui->get_root_h(0); if( x1 < 0 ) x1 = 0; if( y1 < 0 ) y1 = 0; @@ -2302,6 +2320,7 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); load_mode == LOADMODE_REPLACE_CONCATENATE ) && (ftype != FILE_IS_XML || edl_mode != LOADMODE_EDL_CLIP) ) { select_asset(0, 0); + edl->session->proxy_state = PROXY_INACTIVE; edl->session->proxy_scale = 1; edl->session->proxy_disabled_scale = 1; edl->session->proxy_use_scaler = 0; @@ -2319,8 +2338,8 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); goto_start(); } - if( ( edl->session->proxy_auto_scale && edl->session->proxy_scale != 1 ) && - ( load_mode != LOADMODE_REPLACE && load_mode != LOADMODE_REPLACE_CONCATENATE ) ) { + if( edl->session->proxy_state != PROXY_INACTIVE && edl->session->proxy_auto_scale && + load_mode != LOADMODE_REPLACE && load_mode != LOADMODE_REPLACE_CONCATENATE ) { ArrayList orig_idxbls; for( int i=0; i &new_idxbls) int MWindow::enable_proxy() { int ret = 0; - if( edl->session->proxy_scale == 1 && - edl->session->proxy_disabled_scale != 1 ) { + if( edl->session->proxy_state == PROXY_DISABLED ) { int new_scale = edl->session->proxy_disabled_scale; int new_use_scaler = edl->session->proxy_use_scaler; Asset *asset = new Asset; @@ -2439,6 +2457,7 @@ int MWindow::enable_proxy() beep(2000., 1.5, gain); } edl->session->proxy_disabled_scale = 1; + edl->session->proxy_state = PROXY_ACTIVE; gui->lock_window("MWindow::to_proxy"); update_project(LOADMODE_REPLACE); gui->unlock_window(); @@ -2448,15 +2467,15 @@ int MWindow::enable_proxy() int MWindow::disable_proxy() { - if( edl->session->proxy_scale != 1 && - edl->session->proxy_disabled_scale == 1 ) { - int old_scale = edl->session->proxy_scale, new_scale = 1; + if( edl->session->proxy_state == PROXY_ACTIVE ) { + int old_scale = edl->session->proxy_scale, new_scale = 0; int new_use_scaler = edl->session->proxy_use_scaler; Asset *asset = new Asset; asset->format = FILE_FFMPEG; asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0); to_proxy(asset, new_scale, new_use_scaler); asset->remove_user(); + edl->session->proxy_state = PROXY_DISABLED; edl->session->proxy_disabled_scale = old_scale; gui->lock_window("MWindow::to_proxy"); update_project(LOADMODE_REPLACE); @@ -2473,7 +2492,7 @@ int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler) edl->Garbage::add_user(); save_backup(); undo_before(_("proxy"), this); - int asset_scale = new_scale == 1 ? 0 : + int asset_scale = !new_scale ? 0 : !new_use_scaler ? 1 : new_scale; ProxyRender proxy_render(this, asset, asset_scale); @@ -2481,7 +2500,7 @@ int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler) // remove all session proxy assets at the at the current proxy_scale int proxy_scale = edl->session->proxy_scale; - if( proxy_scale > 1 ) { + if( edl->session->proxy_state == PROXY_ACTIVE ) { Asset *orig_asset = edl->assets->first; for( ; orig_asset; orig_asset=orig_asset->next ) { char new_path[BCTEXTLEN]; @@ -2520,7 +2539,7 @@ int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler) } // convert from the proxy assets to the original assets - edl->set_proxy(1, 0, &proxy_assets, &orig_idxbls); + edl->set_proxy(0, 0, &proxy_assets, &orig_idxbls); // remove the references for( int i=0; iassets->first; for( ; orig; orig=orig->next ) { @@ -2569,7 +2588,10 @@ int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler) proxy_render.add_needed(orig_nested, proxy); } } + edl->session->proxy_state = PROXY_ACTIVE; } + else + edl->session->proxy_state = PROXY_INACTIVE; int result = 0; // test for existing files @@ -2578,13 +2600,13 @@ int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler) confirm_paths.remove_all_objects(); } - if( !result ) + if( !result && new_scale ) result = proxy_render.create_needed_proxies(new_scale); - if( !result ) // resize project + if( !result ) { // resize project edl->set_proxy(new_scale, new_use_scaler, &proxy_render.orig_idxbls, &proxy_render.orig_proxies); - + } undo_after(_("proxy"), LOAD_ALL); edl->Garbage::remove_user(); restart_brender(); @@ -3050,6 +3072,7 @@ void MWindow::restore_windows() else if( session->show_lwindow && lwindow->gui->is_hidden() ) show_lwindow(); + tile_mixers(); gui->lock_window("MWindow::restore_windows"); gui->focus(); } @@ -3437,8 +3460,9 @@ int MWindow::get_hash_color(Edit *edit) (Indexable*)edit->asset : (Indexable*)edit->nested_edl; if( !idxbl ) return 0; char path[BCTEXTLEN]; - if( !edit->asset || edit->track->data_type != TRACK_VIDEO || - edl->session->proxy_scale == 1 || +// map proxy colors to unproxy colors + if( edl->session->proxy_state != PROXY_ACTIVE || + !edit->asset || edit->track->data_type != TRACK_VIDEO || ProxyRender::from_proxy_path(path, (Asset*)idxbl, edl->session->proxy_scale) ) strcpy(path, idxbl->path); char *cp = strrchr(path, '/');