X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=e4e6f8370f243202d344d00d6292e37fda23d0ff;hp=323243afca9985b714a92232f1a9b862068e334e;hb=076da20a596fe698e1152ce2f3f2d75d2daddec8;hpb=505506bd554eff241bd0a5b5b84c220cb2c59971 diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 323243af..e4e6f837 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; @@ -1454,7 +1453,7 @@ void MWindow::tile_mixers() int bw = lt + BC_DisplayInfo::get_right_border(); // borders int bh = top + BC_DisplayInfo::get_bottom_border(); int zx = 0, zy = 0; // window origins - int mw = 10+10, mh = 10+10; // canvas margins + int mw = xS(10+10), mh = yS(10+10); // canvas margins int rsz = 0, n = 0, dz = 0; int ow = edl->session->output_w, oh = edl->session->output_h; for( int i=0; i mx ) xx = mx; if( yy > my ) yy = my; - xx += lt + dz; yy += top + dz; + xx += lt + xS(dz); yy += top + yS(dz); zwindow->reposition(xx,yy, ww,hh); if( zwindow->running() ) { ZWindowGUI *gui = (ZWindowGUI *)zwindow->get_gui(); @@ -1531,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. @@ -1546,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); } @@ -2284,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; @@ -2353,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 @@ -2644,7 +2635,7 @@ void MWindow::create_objects(int want_gui, if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - plugin_guis = new ArrayList; + plugin_guis = new PluginGUIs(this); dead_plugins = new ArrayList; keyframe_threads = new ArrayList; @@ -2998,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 ) @@ -3169,9 +3171,6 @@ void MWindow::show_keyframe_gui(Plugin *plugin) } - - - void MWindow::show_plugin(Plugin *plugin) { int done = 0; @@ -3427,7 +3426,6 @@ void MWindow::update_plugin_guis(int do_keyframe_guis) } if(!got_it) plugin->show = 0; - plugin = (Plugin*)plugin->next; } } @@ -3443,45 +3441,34 @@ void MWindow::update_plugin_guis(int do_keyframe_guis) int MWindow::plugin_gui_open(Plugin *plugin) { - int result = 0; + int gui_id = plugin->gui_id; + if( gui_id < 0 ) return 0; plugin_gui_lock->lock("MWindow::plugin_gui_open"); - for(int i = 0; i < plugin_guis->total; i++) - { - if(plugin_guis->get(i)->plugin->identical_location(plugin)) - { - result = 1; - break; - } - } + PluginServer *plugin_server = plugin_guis->gui_server(gui_id); + int result = plugin_server ? 1 : 0; plugin_gui_lock->unlock(); return result; } void MWindow::render_plugin_gui(void *data, Plugin *plugin) { + int gui_id = plugin->gui_id; + if( gui_id < 0 ) return; plugin_gui_lock->lock("MWindow::render_plugin_gui"); - for(int i = 0; i < plugin_guis->total; i++) - { - if(plugin_guis->get(i)->plugin->identical_location(plugin)) - { - plugin_guis->get(i)->render_gui(data); - break; - } - } + PluginServer *plugin_server = plugin_guis->gui_server(gui_id); + if( plugin_server ) + plugin_server->render_gui(data); plugin_gui_lock->unlock(); } void MWindow::render_plugin_gui(void *data, int size, Plugin *plugin) { + int gui_id = plugin->gui_id; + if( gui_id < 0 ) return; plugin_gui_lock->lock("MWindow::render_plugin_gui"); - for(int i = 0; i < plugin_guis->total; i++) - { - if(plugin_guis->get(i)->plugin->identical_location(plugin)) - { - plugin_guis->get(i)->render_gui(data, size); - break; - } - } + PluginServer *plugin_server = plugin_guis->gui_server(gui_id); + if( plugin_server ) + plugin_server->render_gui(data, size); plugin_gui_lock->unlock(); } @@ -4487,7 +4474,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)) && @@ -4497,7 +4484,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); @@ -4522,8 +4509,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) ?