X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=a99d30982ba1e837ba052ca7c6dafedea4533574;hp=14d06c93d7ce38e60a5ec28eb9f4cb9384071367;hb=ac8f3979437fb45effb135a1bb6bee871f52d635;hpb=a70cf593410cada9f0ca8bc515534c635a9cb495 diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 14d06c93..a99d3098 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -361,7 +361,6 @@ MWindow::~MWindow() colormodels.remove_all_objects(); interlace_project_modes.remove_all_objects(); interlace_asset_modes.remove_all_objects(); - interlace_asset_fixmethods.remove_all_objects(); sighandler->terminate(); delete sighandler; delete run_lock; @@ -939,7 +938,7 @@ void MWindow::init_preferences() { preferences = new Preferences; preferences->load_defaults(defaults); - File::setenv_path("LV2_PATH",preferences->lv2_path, 0); + File::setenv_path("LV2_PATH",preferences->lv2_path, 1); session = new MainSession(this); session->load_defaults(defaults); // set x11_host, screens, window_config @@ -1182,8 +1181,12 @@ ZWindow *MWindow::get_mixer(Mixer *&mixer) zwindows_lock->lock("MWindow::get_mixer"); if( !mixer ) mixer = edl->mixers.new_mixer(); ZWindow *zwindow = 0; - for( int i=0; !zwindow && iidx < 0 ) zwindow = zwindows[i]; + for( int i=0; !zwindow && irunning() ) continue; + if( zwdw->idx >= 0 ) continue; + zwindow = zwindows[i]; + } if( !zwindow ) zwindows.append(zwindow = new ZWindow(this)); zwindow->idx = mixer->idx; @@ -1313,6 +1316,7 @@ void MWindow::close_mixers(int destroy) for( int i=zwindows.size(); --i>=0; ) { ZWindow *zwindow = zwindows[i]; if( zwindow->idx < 0 ) continue; + zwindow->idx = -1; zwindow->destroy = destroy; ZWindowGUI *zgui = zwindow->zgui; zgui->lock_window("MWindow::select_zwindow 0"); @@ -1332,7 +1336,7 @@ ZWindow *MWindow::create_mixer(Indexable *indexable, double position) ArrayList new_assets; new_assets.append(indexable); Track *track = edl->tracks->last; - load_assets(&new_assets, position, LOADMODE_NEW_TRACKS, 0, 0, 0, 0, 0, 0); + load_assets(&new_assets, position, LOADMODE_NEW_TRACKS, 0, 0, 0, 0, 0, 1); track = !track ? edl->tracks->first : track->next; Mixer *mixer = 0; ZWindow *zwindow = get_mixer(mixer); @@ -1526,9 +1530,6 @@ void MWindow::init_menus() #define ILACEASSETMODELISTADD(x) ilacemode_to_text(string, x); \ interlace_asset_modes.append(new InterlacemodeItem(string, x)); -#define ILACEFIXMETHODLISTADD(x) ilacefixmethod_to_text(string, x); \ - interlace_asset_fixmethods.append(new InterlacefixmethodItem(string, x)); - // Interlacing Modes ILACEASSETMODELISTADD(ILACE_MODE_UNDETECTED); // Not included in the list for the project options. @@ -1541,11 +1542,6 @@ void MWindow::init_menus() ILACEASSETMODELISTADD(ILACE_MODE_NOTINTERLACED); ILACEPROJECTMODELISTADD(ILACE_MODE_NOTINTERLACED); - // Interlacing Fixing Methods - ILACEFIXMETHODLISTADD(ILACE_FIXMETHOD_NONE); - ILACEFIXMETHODLISTADD(ILACE_FIXMETHOD_UPONE); - ILACEFIXMETHODLISTADD(ILACE_FIXMETHOD_DOWNONE); - mixers_align = new MixersAlign(this); } @@ -2194,6 +2190,8 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); edl->local_session->loop_playback = 0; edl->local_session->set_selectionstart(0); edl->local_session->set_selectionend(0); + edl->local_session->unset_inpoint(); + edl->local_session-> unset_outpoint(); set_brender_active(0, 0); fit_selection(); goto_start(); @@ -2277,9 +2275,8 @@ int MWindow::render_proxy(ArrayList &new_idxbls) Asset *format_asset = new Asset; format_asset->format = FILE_FFMPEG; format_asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0); - ProxyRender proxy_render(this, format_asset); int new_scale = edl->session->proxy_scale; - int use_scaler = edl->session->proxy_use_scaler; + ProxyRender proxy_render(this, format_asset, new_scale); for( int i=0; i &new_idxbls) // render needed proxies int result = proxy_render.create_needed_proxies(new_scale); if( !result ) { - add_proxy(use_scaler, - &proxy_render.orig_idxbls, &proxy_render.orig_proxies); + add_proxy(&proxy_render.orig_idxbls, &proxy_render.orig_proxies); } format_asset->remove_user(); return !result ? proxy_render.needed_proxies.size() : -1; @@ -2346,7 +2342,9 @@ int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler) edl->Garbage::add_user(); save_backup(); undo_before(_("proxy"), this); - ProxyRender proxy_render(this, asset); + int asset_scale = new_scale == 1 ? 0 : + !new_use_scaler ? 1 : new_scale; + ProxyRender proxy_render(this, asset, asset_scale); // revert project to original size from current size // remove all session proxy assets at the at the current proxy_scale @@ -2711,7 +2709,9 @@ void MWindow::create_objects(int want_gui, gui->show_window(); gui->raise_window(); gui->unlock_window(); - + cwindow->gui->lock_window("MWindow::create_objects 1"); + cwindow->gui->tool_panel->raise_tool(); + cwindow->gui->unlock_window(); if(debug) PRINT_TRACE if(preferences->use_tipwindow) @@ -2730,6 +2730,12 @@ void MWindow::create_objects(int want_gui, BC_WindowBase::get_resources()->vframe_shm = 1; } +int MWindow::uses_opengl() +{ + if( !playback_3d || !playback_3d->running() ) return 0; + PlaybackConfig *playback_config = edl->session->playback_config; + return playback_config->vconfig->driver == PLAYBACK_X11_GL ? 1 : 0; +} void MWindow::show_splash() { @@ -2983,6 +2989,17 @@ void MWindow::set_auto_keyframes(int value) cwindow->gui->unlock_window(); } +void MWindow::set_span_keyframes(int value) +{ + edl->session->span_keyframes = value; + gui->mbuttons->edit_panel->span_keyframe->update(value); + gui->flush(); + cwindow->gui->lock_window("MWindow::set_span_keyframes"); + cwindow->gui->edit_panel->span_keyframe->update(value); + cwindow->gui->flush(); + cwindow->gui->unlock_window(); +} + void MWindow::set_auto_visibility(Autos *autos, int value) { if( autos->type == Autos::AUTOMATION_TYPE_PLUGIN ) @@ -3589,6 +3606,7 @@ if(debug) printf("MWindow::asset_to_edl %d\n", __LINE__); //printf("MWindow::asset_to_edl 4 %s\n", string); if(debug) printf("MWindow::asset_to_edl %d\n", __LINE__); + new_edl->local_session->asset2edl = 1; return 0; } @@ -3616,9 +3634,7 @@ void MWindow::update_project(int load_mode) gui->unlock_window(); init_brender(); - cwindow->gui->lock_window("MWindow::update_project 1"); cwindow->update(0, 0, 1, 1, 1); - cwindow->gui->unlock_window(); if(debug) PRINT_TRACE @@ -3661,6 +3677,9 @@ void MWindow::update_project(int load_mode) if(debug) PRINT_TRACE cwindow->gui->lock_window("MWindow::update_project 2"); cwindow->gui->timebar->update(0); + Track *track = cwindow->calculate_affected_track(); + cwindow->mask_track_id = track ? track->get_id() : -1; + cwindow->gui->tool_panel->raise_tool(); cwindow->gui->unlock_window(); if(debug) PRINT_TRACE @@ -4470,7 +4489,7 @@ void MWindow::resync_guis() lwindow->gui->panel->set_meters(channels, 1); lwindow->gui->flush(); lwindow->gui->unlock_window(); - +#ifdef GLx4 // Warn user if(((edl->session->output_w % 4) || (edl->session->output_h % 4)) && @@ -4480,7 +4499,7 @@ void MWindow::resync_guis() _("This project's dimensions are not multiples of 4 so\n" "it can't be rendered by OpenGL.")); } - +#endif // Flash frame sync_parameters(CHANGE_ALL); @@ -4505,8 +4524,10 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra double framerate = asset->get_frame_rate(); int width = asset->get_w(); int height = asset->get_h(); +#ifdef GLx4 // must be multiple of 4 for opengl width = (width+3) & ~3; height = (height+3) & ~3; +#endif int driver = session->playback_config->vconfig->driver; int color_model = file->get_best_colormodel(asset, driver); // color_model = BC_CModels::is_yuv(color_model) ?