: BC_DialogThread()
{
this->mwindow = mwindow;
- plugin = 0;
+ plugin_id = -1;
keyframe = 0;
keyframe_data = new ArrayList<BC_ListBoxItem*>[KEYFRAME_COLUMNS];
plugin_title[0] = 0;
// 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;
}
{
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);
{
// 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;
}
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;
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;
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;
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<PluginServer*> &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);
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.