21df4abdc8365878c4a3b23323ff458674595590
[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         KeyframePopupShow *key_show;
60         KeyframePopupCopy *key_copy;
61         KeyframePopupEdit *key_edit;
62         KeyframePopupCurveMode *key_smooth;
63         KeyframePopupCurveMode *key_linear;
64         KeyframePopupCurveMode *key_free_t;
65         KeyframePopupCurveMode *key_free;
66         bool key_edit_displayed;
67         bool key_mode_displayed;
68
69         void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
70 };
71
72 class KeyframePopupDelete : public BC_MenuItem
73 {
74 public:
75         KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup);
76         ~KeyframePopupDelete();
77         int handle_event();
78         
79         MWindow *mwindow;
80         KeyframePopup *popup;
81 };
82
83 class KeyframePopupShow : public BC_MenuItem
84 {
85 public:
86         KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup);
87         ~KeyframePopupShow();
88         int handle_event();
89         
90         MWindow *mwindow;
91         KeyframePopup *popup;
92 };
93
94 class KeyframePopupCopy : public BC_MenuItem
95 {
96 public:
97         KeyframePopupCopy(MWindow *mwindow, KeyframePopup *popup);
98         ~KeyframePopupCopy();
99         int handle_event();
100         
101         MWindow *mwindow;
102         KeyframePopup *popup;
103 };
104
105 class KeyframePopupCurveMode : public BC_MenuItem
106 {
107 public:
108         KeyframePopupCurveMode(MWindow *mwindow, KeyframePopup *popup, int curve_mode);
109         ~KeyframePopupCurveMode();
110         int handle_event();
111
112 private:
113         MWindow *mwindow;
114         KeyframePopup *popup;
115         int curve_mode;
116         const char* get_labeltext(int);
117         void toggle_mode(FloatAuto*);
118     
119 friend class KeyframePopup;
120 };
121
122  
123 class KeyframePopupEdit : public BC_MenuItem
124 {
125 public:
126         KeyframePopupEdit(MWindow *mwindow, KeyframePopup *popup);
127         int handle_event();
128
129         MWindow *mwindow;
130         KeyframePopup *popup;
131 };
132
133 class KeyframeHidePopup : public BC_PopupMenu
134 {
135 public:
136         KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui);
137         ~KeyframeHidePopup();
138
139         void create_objects();
140         int update(Autos *autos);
141
142         MWindow *mwindow;
143         MWindowGUI *gui;
144         Autos *keyframe_autos;
145 };
146
147 class KeyframePopupHide : public BC_MenuItem
148 {
149 public:
150         KeyframePopupHide(MWindow *mwindow, KeyframeHidePopup *popup);
151         int handle_event();
152
153         MWindow *mwindow;
154         KeyframeHidePopup *popup;
155 };
156
157 #endif