X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=03e013099b61f2a919bdc33e52dc58e96b8eb19c;hb=b89feee3b26be17a08bf1598618d4d7709a73cb9;hp=f072467e39a6c3475a4aacb2ca72be2026c80d53;hpb=9a75aafbc51be29b49351a51e9084bb34d255c0d;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index f072467e..03e01309 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -349,8 +349,9 @@ MWindow::~MWindow() delete gui; gui = 0; delete mainindexes; mainindexes = 0; delete mainprogress; mainprogress = 0; - delete audio_cache; audio_cache = 0; // delete the cache after the assets - delete video_cache; video_cache = 0; // delete the cache after the assets + // delete the caches after the assets + if( audio_cache ) { audio_cache->remove_user(); audio_cache = 0; } + if( video_cache ) { video_cache->remove_user(); video_cache = 0; } delete frame_cache; frame_cache = 0; delete wave_cache; wave_cache = 0; delete plugin_guis; plugin_guis = 0; @@ -2283,6 +2284,8 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); // Start examining next batch of index files if(got_indexes) mainindexes->start_build(); +// reload renderengine edl or the plugin guis will flip out + sync_parameters(CHANGE_ALL); // Open plugin GUIs show_plugins(); @@ -2492,8 +2495,6 @@ int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler) for( int i=0,n=edl->nested_edls.size(); inested_edls[i]; char new_path[BCTEXTLEN]; - if( !ProxyRender::from_proxy_path(new_path, orig_nested, proxy_scale) ) - continue; proxy_render.to_proxy_path(new_path, orig_nested, proxy_scale); // test if proxy asset was already added to proxy_assets int got_it = 0; @@ -3431,7 +3432,7 @@ int MWindow::get_hash_color(Edit *edit) char path[BCTEXTLEN]; if( !edit->asset || edit->track->data_type != TRACK_VIDEO || edl->session->proxy_scale == 1 || - ProxyRender::from_proxy_path(path, idxbl, edl->session->proxy_scale) ) + ProxyRender::from_proxy_path(path, (Asset*)idxbl, edl->session->proxy_scale) ) strcpy(path, idxbl->path); char *cp = strrchr(path, '/'); cp = !cp ? path : cp+1; @@ -3732,6 +3733,7 @@ void MWindow::update_project(int load_mode) if( load_mode == LOADMODE_REPLACE || load_mode == LOADMODE_REPLACE_CONCATENATE ) { + edl->session->timecode_offset = 0; delete gui->keyvalue_popup; gui->keyvalue_popup = 0; gui->load_panes(); @@ -3953,6 +3955,7 @@ int MWindow::save(int save_as) for( int i=stack.size(); --i>=0; ) { StackItem &item = stack[i]; Indexable *idxbl = item.idxbl; + if( !idxbl ) continue; if( idxbl->is_asset ) { Asset *asset = (Asset *)idxbl; if( asset->format == FILE_REF ) { @@ -3960,8 +3963,8 @@ int MWindow::save(int save_as) return 1; } } - else if( item.new_edl != item.idxbl ) - item.new_edl->overwrite_clip((EDL*)item.idxbl); + else if( item.new_edl != idxbl ) + item.new_edl->overwrite_clip((EDL*)idxbl); } EDL *new_edl = stack.size() ? stack[0].edl : edl; save(new_edl, path, 1); @@ -4004,7 +4007,7 @@ void MWindow::clip_to_media() char *bp = strrchr(clip->local_session->clip_title, '/'); bp = bp ? bp+1 : clip->local_session->clip_title; cp += snprintf(cp, ep-cp, "%s", bp); - EDL *nested = edl->new_nested_edl(clip, path); + EDL *nested = edl->new_nested_clip(clip, path); edl->clips.remove(clip); clip->remove_user(); mainindexes->add_indexable(nested); @@ -4467,7 +4470,9 @@ int MWindow::create_aspect_ratio(float &w, float &h, int width, int height) void MWindow::reset_caches() { - awindow->gui->stop_vicon_drawing(); + int locked = gui->get_window_lock(); + if( locked ) gui->unlock_window(); + awindow->gui->stop_vicon_drawing(1); frame_cache->remove_all(); wave_cache->remove_all(); audio_cache->remove_all(); @@ -4487,11 +4492,12 @@ void MWindow::reset_caches() if( vwindow->playback_engine->video_cache ) vwindow->playback_engine->video_cache->remove_all(); } + if( locked ) gui->lock_window("MWindow::reset_caches"); } void MWindow::remove_from_caches(Indexable *idxbl) { - awindow->gui->stop_vicon_drawing(); + awindow->gui->stop_vicon_drawing(1); frame_cache->remove_item(idxbl); wave_cache->remove_item(idxbl); if( gui->render_engine && @@ -4531,7 +4537,7 @@ void MWindow::remove_from_caches(Indexable *idxbl) void MWindow::remove_assets_from_project(int push_undo, int redraw, int delete_indexes, ArrayList *drag_assets, ArrayList *drag_clips) { - awindow->gui->stop_vicon_drawing(); + awindow->gui->stop_vicon_drawing(1); // Remove from VWindow. if( drag_clips ) { @@ -4777,31 +4783,30 @@ int MWindow::interrupt_indexes() void MWindow::next_time_format() { - switch(edl->session->time_format) - { - case TIME_HMS: edl->session->time_format = TIME_HMSF; break; - case TIME_HMSF: edl->session->time_format = TIME_SAMPLES; break; - case TIME_SAMPLES: edl->session->time_format = TIME_SAMPLES_HEX; break; - case TIME_SAMPLES_HEX: edl->session->time_format = TIME_FRAMES; break; - case TIME_FRAMES: edl->session->time_format = TIME_FEET_FRAMES; break; - case TIME_FEET_FRAMES: edl->session->time_format = TIME_SECONDS; break; - case TIME_SECONDS: edl->session->time_format = TIME_HMS; break; + switch( edl->session->time_format ) { + case TIME_HMS: edl->session->time_format = TIME_HMSF; break; + case TIME_HMSF: edl->session->time_format = TIME_TIMECODE; break; + case TIME_TIMECODE: edl->session->time_format = TIME_FRAMES; break; + case TIME_FRAMES: edl->session->time_format = TIME_SAMPLES; break; + case TIME_SAMPLES: edl->session->time_format = TIME_SAMPLES_HEX; break; + case TIME_SAMPLES_HEX: edl->session->time_format = TIME_SECONDS; break; + case TIME_SECONDS: edl->session->time_format = TIME_FEET_FRAMES; break; + case TIME_FEET_FRAMES: edl->session->time_format = TIME_HMS; break; } - time_format_common(); } void MWindow::prev_time_format() { - switch(edl->session->time_format) - { - case TIME_HMS: edl->session->time_format = TIME_SECONDS; break; - case TIME_SECONDS: edl->session->time_format = TIME_FEET_FRAMES; break; - case TIME_FEET_FRAMES: edl->session->time_format = TIME_FRAMES; break; - case TIME_FRAMES: edl->session->time_format = TIME_SAMPLES_HEX; break; - case TIME_SAMPLES_HEX: edl->session->time_format = TIME_SAMPLES; break; - case TIME_SAMPLES: edl->session->time_format = TIME_HMSF; break; - case TIME_HMSF: edl->session->time_format = TIME_HMS; break; + switch( edl->session->time_format ) { + case TIME_HMS: edl->session->time_format = TIME_FEET_FRAMES; break; + case TIME_HMSF: edl->session->time_format = TIME_HMS; break; + case TIME_TIMECODE: edl->session->time_format = TIME_HMSF; break; + case TIME_FRAMES: edl->session->time_format = TIME_TIMECODE; break; + case TIME_SAMPLES: edl->session->time_format = TIME_FRAMES; break; + case TIME_SAMPLES_HEX: edl->session->time_format = TIME_SAMPLES; break; + case TIME_SECONDS: edl->session->time_format = TIME_SAMPLES_HEX; break; + case TIME_FEET_FRAMES: edl->session->time_format = TIME_SECONDS; break; } time_format_common();