68676792a0c66d692a3ab52f9f0bd9df95007dec
[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 "apatchgui.h"
26 #include "guicast.h"
27 #include "mwindow.inc"
28 #include "mwindowgui.inc"
29 #include "patchgui.inc"
30 #include "plugin.inc"
31 #include "plugindialog.inc"
32 #include "keyframe.inc"
33 #include "keyframepopup.inc"
34 #include "automation.h"
35 #include "floatauto.h"
36
37
38
39 class KeyframePopup : public BC_PopupMenu
40 {
41 public:
42         KeyframePopup(MWindow *mwindow, MWindowGUI *gui);
43         ~KeyframePopup();
44
45         void create_objects();
46         int update(Plugin *plugin, KeyFrame *keyframe);
47         int update(Automation *automation, Autos *autos, Auto *auto_keyframe);
48
49         MWindow *mwindow;
50         MWindowGUI *gui;
51 // Acquired through the update command as the plugin currently being operated on
52
53         Plugin *keyframe_plugin;
54         Autos *keyframe_autos;
55         Automation *keyframe_automation;
56         Auto *keyframe_auto;
57         BC_MenuItem *key_mbar;
58
59 private:
60         KeyframePopupDelete *key_delete;
61         KeyframePopupHide *key_hide;
62         KeyframePopupShow *key_show;
63         KeyframePopupCopy *key_copy;
64         KeyframePopupEdit *key_edit;
65         KeyframePopupCurveMode *key_smooth;
66         KeyframePopupCurveMode *key_linear;
67         KeyframePopupCurveMode *key_free_t;
68         KeyframePopupCurveMode *key_free;
69         bool key_edit_displayed;
70         bool key_mode_displayed;
71
72         void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
73 };
74
75 class KeyframePopupDelete : public BC_MenuItem
76 {
77 public:
78         KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
79         ~KeyframePopupDelete();
80         int handle_event();
81
82         MWindow *mwindow;
83         KeyframePopup *popup;
84 };
85
86 class KeyframePopupHide : public BC_MenuItem
87 {
88 public:
89         KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup);
90         ~KeyframePopupHide();
91         int handle_event();
92
93         MWindow *mwindow;
94         KeyframePopup *popup;
95 };
96
97 class KeyframePopupShow : public BC_MenuItem
98 {
99 public:
100         KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
101         ~KeyframePopupShow();
102         PatchGUI *get_patchgui(Track *track);
103         int handle_event();
104
105         MWindow *mwindow;
106         KeyframePopup *popup;
107 };
108
109 class KeyframePopupCopy : public BC_MenuItem
110 {
111 public:
112         KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
113         ~KeyframePopupCopy();
114         int handle_event();
115
116         MWindow *mwindow;
117         KeyframePopup *popup;
118 };
119
120 class KeyframePopupCurveMode : public BC_MenuItem
121 {
122 public:
123         KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
124         ~KeyframePopupCurveMode();
125         int handle_event();
126
127 private:
128         MWindow *mwindow;
129         KeyframePopup *popup;
130         int curve_mode;
131         const char* get_labeltext(int);
132         void toggle_mode(FloatAuto*);
133
134 friend class KeyframePopup;
135 };
136
137
138 class KeyframePopupEdit : public BC_MenuItem
139 {
140 public:
141         KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
142         int handle_event();
143
144         MWindow *mwindow;
145         KeyframePopup *popup;
146 };
147
148 class KeyframeHidePopup : public BC_PopupMenu
149 {
150 public:
151         KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
152         ~KeyframeHidePopup();
153
154         void create_objects();
155         int update(Autos *autos);
156
157         MWindow *mwindow;
158         MWindowGUI *gui;
159         Autos *keyframe_autos;
160 };
161
162 class KeyframeHideItem : public BC_MenuItem
163 {
164 public:
165         KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup);
166         int handle_event();
167
168         MWindow *mwindow;
169         KeyframeHidePopup *popup;
170 };
171
172 class KeyMutePatch : public BC_SubWindow
173 {
174 public:
175         KeyMutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
176         void create_objects();
177
178         MWindow *mwindow;
179         PatchGUI *patch;
180         KeyMuteValue *key_mute_checkbox;
181 };
182
183 class KeyMuteValue : public BC_CheckBox
184 {
185 public:
186         KeyMuteValue(KeyMutePatch *key_mute_patch);
187         void update_edl();
188         int button_release_event();
189         int handle_event();
190
191         KeyMutePatch *key_mute_patch;
192 };
193
194 class KeySpeedPatch : public BC_SubWindow
195 {
196 public:
197         KeySpeedPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
198         void create_objects();
199
200         MWindow *mwindow;
201         PatchGUI *patch;
202         KeySpeedValue *key_speed_slider;
203 };
204
205 class KeySpeedValue : public BC_FSlider
206 {
207 public:
208         KeySpeedValue(KeySpeedPatch *key_speed_patch);
209         ~KeySpeedValue();
210
211         void update_edl();
212         int handle_event();
213         int button_release_event();
214
215         KeySpeedPatch *key_speed_patch;
216 };
217
218 #endif