: BC_DialogThread()
{
this->mwindow = mwindow;
- plugin = 0;
+ plugin_id = -1;
keyframe = 0;
keyframe_data = new ArrayList<BC_ListBoxItem*>[KEYFRAME_COLUMNS];
plugin_title[0] = 0;
#ifdef EDIT_KEYFRAME
+
void KeyFrameThread::update_values()
{
// Get the current selection before deleting the tables
// 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;
}
}
mwindow->gui->unlock_window();
}
-#endif
+#endif
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);
{
// 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);
}
#ifdef EDIT_KEYFRAME
+
void KeyFrameThread::apply_value()
{
const char *text = 0, *data = 0;
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.
get_gui()->lock_window("KeyFrameThread::apply_value");
delete hash;
}
-#endif
+#endif
-KeyFrameWindow::KeyFrameWindow(MWindow *mwindow,
- KeyFrameThread *thread,
- int x,
- int y,
- char *title_string)
- : BC_Window(title_string,
- x,
- y,
- mwindow->session->keyframedialog_w,
- mwindow->session->keyframedialog_h,
- 320,
- 240,
- 1,
- 0,
- 1)
+KeyFrameWindow::KeyFrameWindow(MWindow *mwindow, KeyFrameThread *thread,
+ int x, int y, char *title_string)
+ : BC_Window(title_string, x, y,
+ mwindow->session->keyframedialog_w,
+ mwindow->session->keyframedialog_h,
+ xS(320), yS(240), 1, 0, 1)
{
this->mwindow = mwindow;
this->thread = thread;
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("Saved Plugin Presets");
}
void KeyFrameWindow::create_objects()
#ifdef EDIT_KEYFRAME
-
- add_subwindow(title1 = new BC_Title(theme->keyframe_list_x,
- theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) -
- theme->widget_border, _("Keyframe parameters:"), LARGEFONT));
- add_subwindow(keyframe_list = new KeyFrameList(thread,
- this,
- theme->keyframe_list_x,
- theme->keyframe_list_y,
- theme->keyframe_list_w,
- theme->keyframe_list_h));
+ int ky = theme->keyframe_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ add_subwindow(title1 = new BC_Title(theme->keyframe_list_x, ky,
+ _("Keyframe parameters:"), LARGEFONT));
+ add_subwindow(keyframe_list = new KeyFrameList(thread, this,
+ theme->keyframe_list_x, theme->keyframe_list_y,
+ theme->keyframe_list_w, theme->keyframe_list_h));
// add_subwindow(title2 = new BC_Title(theme->keyframe_text_x,
-// theme->keyframe_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border,
-// _("Global Text:")));
-// add_subwindow(keyframe_text = new KeyFrameText(thread,
-// this,
-// theme->keyframe_text_x,
-// theme->keyframe_text_y,
+// theme->keyframe_text_y - theme->widget_border -
+// BC_Title::calculate_h(this, "P"), _("Global Text:")));
+// add_subwindow(keyframe_text = new KeyFrameText(thread, this,
+// theme->keyframe_text_x, theme->keyframe_text_y,
// theme->keyframe_text_w));
- add_subwindow(title3 = new BC_Title(theme->keyframe_value_x,
- theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") -
- theme->widget_border, _("Edit value:")));
+ int ey = theme->keyframe_value_y - theme->widget_border -
+ BC_Title::calculate_h(this, "P");
+ add_subwindow(title3 = new BC_Title(theme->keyframe_value_x, ey,
+ _("Edit value:")));
add_subwindow(value_text = new KeyFrameValue(thread, this,
theme->keyframe_value_x, theme->keyframe_value_y, theme->keyframe_value_w));
add_subwindow(all_toggle = new KeyFrameAll(thread, this,
theme->keyframe_all_x, theme->keyframe_all_y));
#endif
- add_subwindow(title4 = new BC_Title(theme->presets_list_x, theme->presets_list_y -
- BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) -
- theme->widget_border, _("Presets:"), LARGEFONT));
+ int ty = theme->presets_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ add_subwindow(title4 = new BC_Title(theme->presets_list_x, ty,
+ _("Presets:"), LARGEFONT));
add_subwindow(preset_list = new KeyFramePresetsList(thread, this,
theme->presets_list_x, theme->presets_list_y,
theme->presets_list_w, theme->presets_list_h));
- add_subwindow(title5 = new BC_Title(theme->presets_text_x,
- theme->presets_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border,
- _("Preset title:")));
+ int py = theme->presets_text_y - theme->widget_border -
+ BC_Title::calculate_h(this, "Py");
+ add_subwindow(title5 = new BC_Title(theme->presets_text_x, py,
+ _("Preset title:")));
add_subwindow(preset_text = new KeyFramePresetsText(thread, this,
theme->presets_text_x, theme->presets_text_y, theme->presets_text_w));
add_subwindow(delete_preset = new KeyFramePresetsDelete(thread, this,
}
}
-
-
int KeyFrameWindow::resize_event(int w, int h)
{
Theme *theme = mwindow->theme;
theme->get_keyframedialog_sizes(this);
#ifdef EDIT_KEYFRAME
-
- title1->reposition_window(theme->keyframe_list_x,
- theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
+ int ky = theme->keyframe_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ title1->reposition_window(theme->keyframe_list_x, ky);
// title2->reposition_window(theme->keyframe_text_x,
-// theme->keyframe_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
- title3->reposition_window(theme->keyframe_value_x,
- theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
- keyframe_list->reposition_window(theme->keyframe_list_x,
- theme->keyframe_list_y,
- theme->keyframe_list_w,
- theme->keyframe_list_h);
-// text->reposition_window(theme->keyframe_text_x,
-// theme->keyframe_text_y,
-// theme->keyframe_text_w);
+// theme->keyframe_text_y - theme->widget_border -;
+// BC_Title::calculate_h(this, (char*)"P"));
+ int ey = theme->keyframe_value_y - theme->widget_border -
+ BC_Title::calculate_h(this, "P");
+ title3->reposition_window(theme->keyframe_value_x, ey);
+ keyframe_list->reposition_window(theme->keyframe_list_x, theme->keyframe_list_y,
+ theme->keyframe_list_w, theme->keyframe_list_h);
+// text->reposition_window(theme->keyframe_text_x, theme->keyframe_text_y,
+// theme->keyframe_text_w);
value_text->reposition_window(theme->keyframe_value_x,
theme->keyframe_value_y,
theme->keyframe_value_w);
all_toggle->reposition_window(theme->keyframe_all_x,
theme->keyframe_all_y);
-#endif // EDIT_KEYFRAME
-
-
-
+ int ty = theme->presets_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ title4->reposition_window(theme->presets_list_x, ty);
+ int py = theme->presets_text_y - theme->widget_border -
+ BC_Title::calculate_h(this, "Py");
+ title5->reposition_window(theme->presets_text_x, py);
+#endif
- title4->reposition_window(theme->presets_list_x,
- theme->presets_list_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
- title5->reposition_window(theme->presets_text_x,
- theme->presets_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
preset_list->reposition_window(theme->presets_list_x,
theme->presets_list_y,
theme->presets_list_w,
#ifdef EDIT_KEYFRAME
-
KeyFrameList::KeyFrameList(KeyFrameThread *thread,
KeyFrameWindow *window, int x, int y, int w, int h)
: BC_ListBox(x, y, w, h, LISTBOX_TEXT, thread->keyframe_data,
}
-
-
// KeyFrameText::KeyFrameText(KeyFrameThread *thread,
// KeyFrameWindow *window,
// int x,
// return 0;
// }
-
-
KeyFrameValue::KeyFrameValue(KeyFrameThread *thread,
KeyFrameWindow *window,
int x,
return 0;
}
-
-
-
-
KeyFrameAll::KeyFrameAll(KeyFrameThread *thread,
- KeyFrameWindow *window,
- int x,
- int y)
- : BC_CheckBox(x,
- y,
+ KeyFrameWindow *window, int x, int y)
+ : BC_CheckBox(x, y,
thread->mwindow->session->keyframedialog_all,
_("Apply to all selected keyframes"))
{
#endif // EDIT_KEYFRAME
-
-
-
-
-
-
-
-
KeyFramePresetsList::KeyFramePresetsList(KeyFrameThread *thread,
- KeyFrameWindow *window,
- int x,
- int y,
- int w,
- int h)
- : BC_ListBox(x,
- y,
- w,
- h,
- LISTBOX_TEXT,
- thread->presets_data)
+ KeyFrameWindow *window, int x, int y, int w, int h)
+ : BC_ListBox(x, y, w, h, LISTBOX_TEXT, thread->presets_data)
{
this->thread = thread;
this->window = window;
}
-
-
-
-
-
-
KeyFramePresetsApply::KeyFramePresetsApply(KeyFrameThread *thread,
KeyFrameWindow *window,
int x,
}
}
}
- return 0;
+ return context_help_check_and_show();
}