add Autosave continuous backups by Andras Reuss and Andrew-R
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vpatchgui.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 VPATCHGUI_H
23 #define VPATCHGUI_H
24
25 #include "bcmenuitem.h"
26 #include "bcmenupopup.h"
27 #include "floatauto.inc"
28 #include "guicast.h"
29 #include "patchgui.h"
30 #include "vpatchgui.inc"
31 #include "vtrack.inc"
32
33 class VPatchGUI : public PatchGUI
34 {
35 public:
36         VPatchGUI(MWindow *mwindow,
37                 PatchBay *patchbay,
38                 VTrack *track,
39                 int x,
40                 int y);
41         ~VPatchGUI();
42
43         void create_objects();
44         int reposition(int x, int y);
45         int update(int x, int y);
46         void update_faders(float v);
47
48         VTrack *vtrack;
49         VModePatch *mode;
50         VFadePatch *fade;
51 };
52
53 class VFadePatch : public BC_ISlider
54 {
55 public:
56         VFadePatch(VPatchGUI *patch, int x, int y, int w, int64_t v);
57         int handle_event();
58         VPatchGUI *patch;
59 };
60
61 class VKeyFadePatch : public BC_SubWindow
62 {
63 public:
64         VKeyFadePatch(MWindow *mwindow, VPatchGUI *gui,
65                         int bump, int x, int y);
66         ~VKeyFadePatch();
67         void create_objects();
68         void set_edge(int edge);
69         void set_span(int span);
70         void update(int64_t v);
71
72         MWindow *mwindow;
73         VPatchGUI *gui;
74         VKeyFadeOK *vkey_fade_ok;
75         VKeyFadeText *vkey_fade_text;
76         VKeyFadeSlider *vkey_fade_slider;
77         VKeyPatchAutoEdge *auto_edge;
78         VKeyPatchAutoSpan *auto_span;
79 };
80
81 class VKeyFadeOK : public BC_Button
82 {
83 public:
84         VKeyFadeOK(VKeyFadePatch *vkey_fade_patch, int x, int y, VFrame **images);
85         int handle_event();
86
87         VKeyFadePatch *vkey_fade_patch;
88 };
89
90 class VKeyFadeText : public BC_TextBox
91 {
92 public:
93         VKeyFadeText(VKeyFadePatch *vkey_fade_patch, int x, int y, int w, int64_t v);
94         int handle_event();
95
96         VKeyFadePatch *vkey_fade_patch;
97 };
98
99 class VKeyFadeSlider : public VFadePatch
100 {
101 public:
102         VKeyFadeSlider(VKeyFadePatch *akey_fade_patch, int x, int y, int w, int64_t v);
103         int handle_event();
104
105         VKeyFadePatch *vkey_fade_patch;
106 };
107
108 class VModePatch : public BC_PopupMenu
109 {
110 public:
111         VModePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
112         VModePatch(MWindow *mwindow, VPatchGUI *patch);
113
114         int handle_event();
115         void create_objects();         // add initial items
116         static const char* mode_to_text(int mode);
117         void update(int mode);
118
119         MWindow *mwindow;
120         VPatchGUI *patch;
121         int mode;
122 };
123
124 class VModePatchItem : public BC_MenuItem
125 {
126 public:
127         VModePatchItem(VModePatch *popup, const char *text, int mode);
128
129         int handle_event();
130         VModePatch *popup;
131         int mode;
132 };
133
134 class VModePatchSubMenu : public BC_SubMenu
135 {
136 public:
137         VModePatchSubMenu(VModePatchItem *mode_item);
138         ~VModePatchSubMenu();
139
140         VModePatchItem *mode_item;
141 };
142
143 class VModeSubMenuItem : public BC_MenuItem
144 {
145 public:
146         VModeSubMenuItem(VModePatchSubMenu *submenu, const char *text, int mode);
147         ~VModeSubMenuItem();
148
149         int handle_event();
150         VModePatchSubMenu *submenu;
151         int mode;
152 };
153
154 class VKeyModePatch : public VModePatch
155 {
156 public:
157         VKeyModePatch(MWindow *mwindow, VPatchGUI *patch);
158         int handle_event();
159 };
160
161 class VMixPatch : public MixPatch
162 {
163 public:
164         VMixPatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
165         ~VMixPatch();
166 };
167
168 class VKeyPatchAutoEdge : public BC_Toggle
169 {
170 public:
171         VKeyPatchAutoEdge(MWindow *mwindow, VKeyFadePatch *patch, int x, int y);
172         int handle_event();
173         MWindow *mwindow;
174         VKeyFadePatch *patch;
175 };
176
177 class VKeyPatchAutoSpan : public BC_Toggle
178 {
179 public:
180         VKeyPatchAutoSpan(MWindow *mwindow, VKeyFadePatch *patch, int x, int y);
181         int handle_event();
182         MWindow *mwindow;
183         VKeyFadePatch *patch;
184 };
185
186 #endif