fix editpanel wdw lock issues, use undo bracketing to avoid stop playback deadlocks
[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 *patch, int x, int y);
65         void create_objects();
66         void update(int64_t v);
67
68         MWindow *mwindow;
69         VPatchGUI *patch;
70         VKeyFadeOK *vkey_fade_ok;
71         VKeyFadeText *vkey_fade_text;
72         VKeyFadeSlider *vkey_fade_slider;
73 };
74
75 class VKeyFadeOK : public BC_Button
76 {
77 public:
78         VKeyFadeOK(VKeyFadePatch *vkey_fade_patch, int x, int y, VFrame **images);
79         int handle_event();
80
81         VKeyFadePatch *vkey_fade_patch;
82 };
83
84 class VKeyFadeText : public BC_TextBox
85 {
86 public:
87         VKeyFadeText(VKeyFadePatch *vkey_fade_patch, int x, int y, int w, int64_t v);
88         int handle_event();
89
90         VKeyFadePatch *vkey_fade_patch;
91 };
92
93 class VKeyFadeSlider : public VFadePatch
94 {
95 public:
96         VKeyFadeSlider(VKeyFadePatch *akey_fade_patch, int x, int y, int w, int64_t v);
97         int handle_event();
98
99         VKeyFadePatch *vkey_fade_patch;
100 };
101
102 class VModePatch : public BC_PopupMenu
103 {
104 public:
105         VModePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
106         VModePatch(MWindow *mwindow, VPatchGUI *patch);
107
108         int handle_event();
109         void create_objects();         // add initial items
110         static const char* mode_to_text(int mode);
111         void update(int mode);
112
113         MWindow *mwindow;
114         VPatchGUI *patch;
115         int mode;
116 };
117
118 class VModePatchItem : public BC_MenuItem
119 {
120 public:
121         VModePatchItem(VModePatch *popup, const char *text, int mode);
122
123         int handle_event();
124         VModePatch *popup;
125         int mode;
126 };
127
128 class VModePatchSubMenu : public BC_SubMenu
129 {
130 public:
131         VModePatchSubMenu(VModePatchItem *mode_item);
132         ~VModePatchSubMenu();
133
134         VModePatchItem *mode_item;
135 };
136
137 class VModeSubMenuItem : public BC_MenuItem
138 {
139 public:
140         VModeSubMenuItem(VModePatchSubMenu *submenu, const char *text, int mode);
141         ~VModeSubMenuItem();
142
143         int handle_event();
144         VModePatchSubMenu *submenu;
145         int mode;
146 };
147
148 class VKeyModePatch : public VModePatch
149 {
150 public:
151         VKeyModePatch(MWindow *mwindow, VPatchGUI *patch);
152         int handle_event();
153 };
154
155 class VMixPatch : public MixPatch
156 {
157 public:
158         VMixPatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
159         ~VMixPatch();
160 };
161
162 #endif