bcdd11dc146ba945c935e865670d9b5690d8ca87
[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 "keyframepopup.inc"
32 #include "automation.h" 
33 #include "floatauto.h"
34
35
36  
37 class KeyframePopup : public BC_PopupMenu
38 {
39 public:
40         KeyframePopup(MWindow *mwindow, MWindowGUI *gui);
41         ~KeyframePopup();
42
43         void create_objects();
44         int update(Plugin *plugin, KeyFrame *keyframe);
45         int update(Automation *automation, Autos *autos, Auto *auto_keyframe);
46
47         MWindow *mwindow;
48         MWindowGUI *gui;
49 // Acquired through the update command as the plugin currently being operated on
50         
51         Plugin *keyframe_plugin;
52         Autos *keyframe_autos;
53         Automation *keyframe_automation;
54         Auto *keyframe_auto;
55         BC_MenuItem *key_mbar;
56
57 private:        
58         KeyframePopupDelete *key_delete;
59         KeyframePopupHide *key_hide;
60         KeyframePopupShow *key_show;
61         KeyframePopupCopy *key_copy;
62         KeyframePopupEdit *key_edit;
63         KeyframePopupCurveMode *key_smooth;
64         KeyframePopupCurveMode *key_linear;
65         KeyframePopupCurveMode *key_free_t;
66         KeyframePopupCurveMode *key_free;
67         bool key_edit_displayed;
68         bool key_mode_displayed;
69
70         void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
71 };
72
73 class KeyframePopupDelete : public BC_MenuItem
74 {
75 public:
76         KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
77         ~KeyframePopupDelete();
78         int handle_event();
79
80         MWindow *mwindow;
81         KeyframePopup *popup;
82 };
83
84 class KeyframePopupHide : public BC_MenuItem
85 {
86 public:
87         KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup);
88         ~KeyframePopupHide();
89         int handle_event();
90         
91         MWindow *mwindow;
92         KeyframePopup *popup;
93 };
94
95 class KeyframePopupShow : public BC_MenuItem
96 {
97 public:
98         KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
99         ~KeyframePopupShow();
100         int handle_event();
101         
102         MWindow *mwindow;
103         KeyframePopup *popup;
104 };
105
106 class KeyframePopupCopy : public BC_MenuItem
107 {
108 public:
109         KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
110         ~KeyframePopupCopy();
111         int handle_event();
112         
113         MWindow *mwindow;
114         KeyframePopup *popup;
115 };
116
117 class KeyframePopupCurveMode : public BC_MenuItem
118 {
119 public:
120         KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
121         ~KeyframePopupCurveMode();
122         int handle_event();
123
124 private:
125         MWindow *mwindow;
126         KeyframePopup *popup;
127         int curve_mode;
128         const char* get_labeltext(int);
129         void toggle_mode(FloatAuto*);
130     
131 friend class KeyframePopup;
132 };
133
134  
135 class KeyframePopupEdit : public BC_MenuItem
136 {
137 public:
138         KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
139         int handle_event();
140
141         MWindow *mwindow;
142         KeyframePopup *popup;
143 };
144
145 class KeyframeHidePopup : public BC_PopupMenu
146 {
147 public:
148         KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
149         ~KeyframeHidePopup();
150
151         void create_objects();
152         int update(Autos *autos);
153
154         MWindow *mwindow;
155         MWindowGUI *gui;
156         Autos *keyframe_autos;
157 };
158
159 class KeyframeHideItem : public BC_MenuItem
160 {
161 public:
162         KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
163         int handle_event();
164
165         MWindow *mwindow;
166         KeyframeHidePopup *popup;
167 };
168
169 #endif