Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / cinelerra / keyframepopup.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #ifndef KEYFRAMEPOPUP_H
23 #define KEYFRAMEPOPUP_H
24
25 #include "guicast.h"
26 #include "mwindow.inc"
27 #include "mwindowgui.inc"
28 #include "plugin.inc"
29 #include "plugindialog.inc"
30 #include "keyframe.inc"
31 #include "automation.h" 
32 #include "floatauto.h"
33
34
35 class KeyframePopupDelete;
36 class KeyframePopupShow;
37 class KeyframePopupCopy;
38 class KeyframePopupCurveMode;
39 class KeyframePopupEdit;
40  
41  
42 class KeyframePopup : public BC_PopupMenu
43 {
44 public:
45         KeyframePopup(MWindow *mwindow, MWindowGUI *gui);
46         ~KeyframePopup();
47
48         void create_objects();
49         int update(Plugin *plugin, KeyFrame *keyframe);
50         int update(Automation *automation, Autos *autos, Auto *auto_keyframe);
51
52         MWindow *mwindow;
53         MWindowGUI *gui;
54 // Acquired through the update command as the plugin currently being operated on
55         
56         Plugin *keyframe_plugin;
57         Autos *keyframe_autos;
58         Automation *keyframe_automation;
59         Auto *keyframe_auto;
60         BC_MenuItem *key_mbar;
61
62 private:        
63         KeyframePopupDelete *key_delete;
64         KeyframePopupShow *key_show;
65         KeyframePopupCopy *key_copy;
66         KeyframePopupEdit *key_edit;
67         KeyframePopupCurveMode *key_smooth;
68         KeyframePopupCurveMode *key_linear;
69         KeyframePopupCurveMode *key_free_t;
70         KeyframePopupCurveMode *key_free;
71         bool key_mode_displayed;
72
73         void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
74 };
75
76 class KeyframePopupDelete : public BC_MenuItem
77 {
78 public:
79         KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
80         ~KeyframePopupDelete();
81         int handle_event();
82         
83         MWindow *mwindow;
84         KeyframePopup *popup;
85 };
86
87 class KeyframePopupShow : public BC_MenuItem
88 {
89 public:
90         KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
91         ~KeyframePopupShow();
92         int handle_event();
93         
94         MWindow *mwindow;
95         KeyframePopup *popup;
96 };
97
98 class KeyframePopupCopy : public BC_MenuItem
99 {
100 public:
101         KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
102         ~KeyframePopupCopy();
103         int handle_event();
104         
105         MWindow *mwindow;
106         KeyframePopup *popup;
107 };
108
109 class KeyframePopupCurveMode : public BC_MenuItem
110 {
111 public:
112         KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
113         ~KeyframePopupCurveMode();
114         int handle_event();
115
116 private:
117         MWindow *mwindow;
118         KeyframePopup *popup;
119         int curve_mode;
120         const char* get_labeltext(int);
121         void toggle_mode(FloatAuto*);
122     
123 friend class KeyframePopup;
124 };
125
126  
127 class KeyframePopupEdit : public BC_MenuItem
128 {
129 public:
130         KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
131         int handle_event();
132
133         MWindow *mwindow;
134         KeyframePopup *popup;
135 };
136
137 #endif