/*
* CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2017 Adam Williams <broadcast at earthling dot net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "bcdialog.h"
#include "guicast.h"
+#include "presets.inc"
class KeyFrameWindow;
+
+
#define KEYFRAME_COLUMNS 2
// Enable editing of detailed keyframe parameters.
+#define EDIT_KEYFRAME
+
class KeyFrameThread : public BC_DialogThread
{
public:
void handle_close_event(int result);
void update_values();
void save_value(char *value);
+ void save_preset(const char *title, int is_factory);
+ void delete_preset(const char *title, int is_factory);
+ void apply_preset(const char *title, int is_factory);
void apply_value();
+ void calculate_preset_list();
void update_gui(int update_value_text = 1);
+ void close_window();
ArrayList<BC_ListBoxItem*> *keyframe_data;
Plugin *plugin;
MWindow *mwindow;
char window_title[BCTEXTLEN];
char plugin_title[BCTEXTLEN];
- char *column_titles[KEYFRAME_COLUMNS];
+
+// the currently selected preset is a factory preset
+ int is_factory;
+// title of the currently selected preset from the DB
+ char preset_text[BCTEXTLEN];
+
+ const char *column_titles[KEYFRAME_COLUMNS];
int column_width[KEYFRAME_COLUMNS];
+// list of preset text to display
+ ArrayList<BC_ListBoxItem*> *presets_data;
+// flag for each preset shown
+ ArrayList<int> is_factories;
+// title of each preset shown
+ ArrayList<char*> preset_titles;
+ PresetsDB *presets_db;
};
+#ifdef EDIT_KEYFRAME
+
+
class KeyFrameList : public BC_ListBox
{
public:
KeyFrameList(KeyFrameThread *thread,
- KeyFrameWindow *window, int x, int y, int w, int h);
+ KeyFrameWindow *window,
+ int x,
+ int y,
+ int w,
+ int h);
int selection_changed();
int handle_event();
int column_resize_event();
KeyFrameThread *thread;
KeyFrameWindow *window;
};
+#endif
-class KeyFrameParamList : public BC_ListBox
+class KeyFramePresetsList : public BC_ListBox
{
public:
- KeyFrameParamList(KeyFrameThread *thread,
- KeyFrameWindow *window, int x, int y, int w, int h);
+ KeyFramePresetsList(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y,
+ int w,
+ int h);
int selection_changed();
int handle_event();
KeyFrameThread *thread;
KeyFrameWindow *window;
};
+class KeyFramePresetsText : public BC_TextBox
+{
+public:
+ KeyFramePresetsText(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y,
+ int w);
+ int handle_event();
+ KeyFrameThread *thread;
+ KeyFrameWindow *window;
+};
+
+
+class KeyFramePresetsDelete : public BC_GenericButton
+{
+public:
+ KeyFramePresetsDelete(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y);
+ int handle_event();
+ KeyFrameThread *thread;
+ KeyFrameWindow *window;
+};
+
+class KeyFramePresetsSave : public BC_GenericButton
+{
+public:
+ KeyFramePresetsSave(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y);
+ int handle_event();
+ KeyFrameThread *thread;
+ KeyFrameWindow *window;
+};
+
+class KeyFramePresetsApply : public BC_GenericButton
+{
+public:
+ KeyFramePresetsApply(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y);
+ int handle_event();
+ KeyFrameThread *thread;
+ KeyFrameWindow *window;
+};
+
+/*
+ * class KeyFrameText : public BC_TextBox
+ * {
+ * public:
+ * KeyFrameText(KeyFrameThread *thread,
+ * KeyFrameWindow *window,
+ * int x,
+ * int y,
+ * int w);
+ * int handle_event();
+ * KeyFrameThread *thread;
+ * KeyFrameWindow *window;
+ * };
+ */
+
+#ifdef EDIT_KEYFRAME
+
+
class KeyFrameValue : public BC_TextBox
{
public:
KeyFrameValue(KeyFrameThread *thread,
- KeyFrameWindow *window, int x, int y, int w);
+ KeyFrameWindow *window,
+ int x,
+ int y,
+ int w);
int handle_event();
KeyFrameThread *thread;
KeyFrameWindow *window;
{
public:
KeyFrameAll(KeyFrameThread *thread,
- KeyFrameWindow *window, int x, int y);
+ KeyFrameWindow *window,
+ int x,
+ int y);
int handle_event();
KeyFrameThread *thread;
KeyFrameWindow *window;
};
-class KeyFrameParamsOK : public BC_OKButton
+#endif
+
+
+class KeyFramePresetsOK : public BC_OKButton
{
public:
- KeyFrameParamsOK(KeyFrameThread *thread,
+ KeyFramePresetsOK(KeyFrameThread *thread,
KeyFrameWindow *window);
int keypress_event();
KeyFrameThread *thread;
KeyFrameWindow *window;
};
+
+
class KeyFrameWindow : public BC_Window
{
public:
KeyFrameWindow(MWindow *mwindow,
- KeyFrameThread *thread, int x, int y, char *title);
+ KeyFrameThread *thread,
+ int x,
+ int y,
+ char *title);
void create_objects();
int resize_event(int w, int h);
+ void update_editing();
+
+#ifdef EDIT_KEYFRAME
// List of parameters, values, & whether the parameter is defined by the current keyframe.
KeyFrameList *keyframe_list;
// Value text of the current parameter
KeyFrameValue *value_text;
KeyFrameAll *all_toggle;
- BC_Title *title1, *title3;
+#endif
+
+ KeyFramePresetsList *preset_list;
+ KeyFramePresetsText *preset_text;
+ KeyFramePresetsDelete *delete_preset;
+ KeyFramePresetsSave *save_preset;
+ KeyFramePresetsApply *apply_preset;
+
+#ifdef EDIT_KEYFRAME
+
+ BC_Title *title1;
+// BC_Title *title2;
+ BC_Title *title3;
+#endif
+
+ BC_Title *title4;
+ BC_Title *title5;
MWindow *mwindow;
KeyFrameThread *thread;
};
+
+
+
#endif
+
+
+
+
+