X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fkeyframegui.h;h=c6cdb85c0c4e4660cce7a8bc8c56335a17616119;hp=9f98c06838cdf04afda36df3adb74a6e54f83413;hb=9d832a1fff11b11aaa1108c460690ed05e2bdc05;hpb=4fedf98530b3a6ff1ada6d2b9fbbc470e3df300c diff --git a/cinelerra-5.1/cinelerra/keyframegui.h b/cinelerra-5.1/cinelerra/keyframegui.h index 9f98c068..c6cdb85c 100644 --- a/cinelerra-5.1/cinelerra/keyframegui.h +++ b/cinelerra-5.1/cinelerra/keyframegui.h @@ -1,22 +1,22 @@ /* * CINELERRA - * Copyright (C) 2008 Adam Williams - * + * Copyright (C) 2017 Adam Williams + * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #ifndef KEYFRAMEGUI_H @@ -25,12 +25,17 @@ #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: @@ -44,8 +49,13 @@ 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 *keyframe_data; Plugin *plugin; @@ -53,38 +63,134 @@ public: 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 *presets_data; +// flag for each preset shown + ArrayList is_factories; +// title of each preset shown + ArrayList 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; @@ -94,29 +200,42 @@ class KeyFrameAll : public BC_CheckBox { 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; @@ -125,10 +244,34 @@ public: // 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 + + + + +