mixer
[goodguy/history.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 VFadePatch;
34 class VModePatch;
35
36 class VPatchGUI : public PatchGUI
37 {
38 public:
39         VPatchGUI(MWindow *mwindow,
40                 PatchBay *patchbay,
41                 VTrack *track,
42                 int x,
43                 int y);
44         ~VPatchGUI();
45
46         void create_objects();
47         int reposition(int x, int y);
48         int update(int x, int y);
49         void synchronize_fade(float value_change);
50
51         VTrack *vtrack;
52         VModePatch *mode;
53         VFadePatch *fade;
54 };
55
56 class VFadePatch : public BC_ISlider
57 {
58 public:
59         VFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y, int w);
60         int handle_event();
61         float update_edl();
62         MWindow *mwindow;
63         VPatchGUI *patch;
64 };
65
66 class VKeyFadePatch : public BC_SubWindow
67 {
68 public:
69         VKeyFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
70         void create_objects();
71
72         MWindow *mwindow;
73         VPatchGUI *patch;
74         VKeyFadeValue *vkey_fade_value;
75 };
76
77 class VKeyFadeValue : public VFadePatch
78 {
79 public:
80         VKeyFadeValue(VKeyFadePatch *vkey_fade_patch);
81         int button_release_event();
82         int handle_event();
83
84         VKeyFadePatch *vkey_fade_patch;
85 };
86
87 class VModePatch : public BC_PopupMenu
88 {
89 public:
90         VModePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
91         VModePatch(MWindow *mwindow, VPatchGUI *patch);
92
93         int handle_event();
94         void create_objects();         // add initial items
95         static const char* mode_to_text(int mode);
96         void update(int mode);
97
98         MWindow *mwindow;
99         VPatchGUI *patch;
100         int mode;
101 };
102
103 class VModePatchItem : public BC_MenuItem
104 {
105 public:
106         VModePatchItem(VModePatch *popup, const char *text, int mode);
107
108         int handle_event();
109         VModePatch *popup;
110         int mode;
111 };
112
113 class VModePatchSubMenu : public BC_SubMenu
114 {
115 public:
116         VModePatchSubMenu(VModePatchItem *mode_item);
117         ~VModePatchSubMenu();
118
119         VModePatchItem *mode_item;
120 };
121
122 class VModeSubMenuItem : public BC_MenuItem
123 {
124 public:
125         VModeSubMenuItem(VModePatchSubMenu *submenu, const char *text, int mode);
126         ~VModeSubMenuItem();
127
128         int handle_event();
129         VModePatchSubMenu *submenu;
130         int mode;
131 };
132
133 class VKeyModePatch : public VModePatch
134 {
135 public:
136         VKeyModePatch(MWindow *mwindow, VPatchGUI *patch);
137         int button_release_event();
138         int handle_event();
139 };
140
141 class VMixPatch : public MixPatch
142 {
143 public:
144         VMixPatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
145         ~VMixPatch();
146 };
147
148 #endif