X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fkeyframegui.C;h=74356b54ff0a89aa6986333e19f7bd6b023fe7ea;hp=744106b9fd48b6598dcccb383813505fba9d521d;hb=b104b77f5296719bd5e6de8472eb71542ddaedec;hpb=0df48ad2d876409c5beeae2e21933a728ea76c33 diff --git a/cinelerra-5.1/cinelerra/keyframegui.C b/cinelerra-5.1/cinelerra/keyframegui.C index 744106b9..74356b54 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; @@ -357,9 +363,16 @@ void KeyFrameThread::apply_preset(const char *title, int is_factory) mwindow->undo->update_undo_before(); #ifdef USE_KEYFRAME_SPANNING - KeyFrame keyframe; - presets_db->load_preset(plugin_title, title, &keyframe, is_factory); - plugin->keyframes->update_parameter(&keyframe); + ArrayList &plugindb = *mwindow->plugindb; + int k = plugindb.size(); + while( --k>=0 && strcmp(plugindb[k]->title, plugin->title) ); + if( k >= 0 ) { + PluginServer server(*plugindb[k]); + server.open_plugin(0, mwindow->preferences, mwindow->edl, plugin); + KeyFrame keyframe(mwindow->edl, plugin->keyframes); + presets_db->load_preset(plugin_title, title, &keyframe, is_factory); + server.apply_keyframe(plugin, &keyframe); + } #else KeyFrame *keyframe = plugin->get_keyframe(); presets_db->load_preset(plugin_title, title, keyframe, is_factory); @@ -402,7 +415,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. @@ -461,6 +475,8 @@ KeyFrameWindow::KeyFrameWindow(MWindow *mwindow, KeyFrameThread *thread, { this->mwindow = mwindow; this->thread = thread; +// *** CONTEXT_HELP *** + context_help_set_keyword("Saved Plugin Presets"); } void KeyFrameWindow::create_objects() @@ -814,6 +830,6 @@ int KeyFramePresetsOK::keypress_event() } } } - return 0; + return context_help_check_and_show(); }