X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fkeyframegui.C;h=61a0b052aa3cdf34f74eebedfa76984b61dd4a2d;hp=744106b9fd48b6598dcccb383813505fba9d521d;hb=1529091cdf16df199a901aabe6e8fa1813a933af;hpb=0df48ad2d876409c5beeae2e21933a728ea76c33 diff --git a/cinelerra-5.1/cinelerra/keyframegui.C b/cinelerra-5.1/cinelerra/keyframegui.C index 744106b9..61a0b052 100644 --- a/cinelerra-5.1/cinelerra/keyframegui.C +++ b/cinelerra-5.1/cinelerra/keyframegui.C @@ -46,7 +46,7 @@ KeyFrameThread::KeyFrameThread(MWindow *mwindow) : BC_DialogThread() { this->mwindow = mwindow; - plugin = 0; + plugin_id = -1; keyframe = 0; keyframe_data = new ArrayList[KEYFRAME_COLUMNS]; plugin_title[0] = 0; @@ -92,7 +92,8 @@ void KeyFrameThread::update_values() // Must lock main window to read keyframe mwindow->gui->lock_window("KeyFrameThread::update_values"); - if( !plugin || !mwindow->edl->tracks->plugin_exists(plugin) ) { + Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id); + if( !plugin ) { mwindow->gui->unlock_window(); return; } @@ -147,9 +148,9 @@ void KeyFrameThread::start_window(Plugin *plugin, KeyFrame *keyframe) { if( !BC_DialogThread::is_running() ) { - if( !mwindow->edl->tracks->plugin_exists(plugin) ) return; + if( !mwindow->edl->tracks->plugin_exists(plugin->orig_id) ) return; this->keyframe = keyframe; - this->plugin = plugin; + this->plugin_id = plugin->orig_id; this->preset_text[0] = 0; plugin->calculate_title(plugin_title, 0); sprintf(window_title, _("%s: %s Keyframe"), _(PROGRAM_NAME), plugin_title); @@ -207,13 +208,15 @@ void KeyFrameThread::handle_done_event(int result) { // Apply the preset if( !result ) { + get_gui()->lock_window("KeyFrameThread::handle_done_event"); apply_preset(preset_text, is_factory); + get_gui()->unlock_window(); } } void KeyFrameThread::handle_close_event(int result) { - plugin = 0; + plugin_id = -1; keyframe = 0; } @@ -292,7 +295,8 @@ void KeyFrameThread::save_preset(const char *title, int is_factory) mwindow->gui->lock_window("KeyFrameThread::save_preset"); // Test EDL for plugin existence - if( !mwindow->edl->tracks->plugin_exists(plugin) ) { + Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id); + if( !plugin ) { mwindow->gui->unlock_window(); get_gui()->lock_window("KeyFrameThread::save_preset 2"); return; @@ -323,7 +327,8 @@ void KeyFrameThread::delete_preset(const char *title, int is_factory) mwindow->gui->lock_window("KeyFrameThread::save_preset"); // Test EDL for plugin existence - if( !mwindow->edl->tracks->plugin_exists(plugin) ) { + Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id); + if( !plugin ) { mwindow->gui->unlock_window(); get_gui()->lock_window("KeyFrameThread::delete_preset 1"); return; @@ -348,7 +353,8 @@ void KeyFrameThread::apply_preset(const char *title, int is_factory) mwindow->gui->lock_window("KeyFrameThread::apply_preset"); // Test EDL for plugin existence - if( !mwindow->edl->tracks->plugin_exists(plugin) ) { + Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id); + if( !plugin ) { mwindow->gui->unlock_window(); get_gui()->lock_window("KeyFrameThread::apply_preset 1"); return; @@ -402,7 +408,8 @@ void KeyFrameThread::apply_value() get_gui()->unlock_window(); mwindow->gui->lock_window("KeyFrameThread::apply_value"); - if( plugin && mwindow->edl->tracks->plugin_exists(plugin) ) { + Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id); + if( plugin ) { mwindow->undo->update_undo_before(); if( mwindow->session->keyframedialog_all ) { // Search for all keyframes in selection but don't create a new one.