add master/armed_gang track operations, tweak appearanceprefs layout, fix vicon video...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / patchgui.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 PATCHGUI_H
23 #define PATCHGUI_H
24
25 #include "guicast.h"
26 #include "mwindow.inc"
27 #include "patchbay.inc"
28 #include "intauto.inc"
29 #include "track.inc"
30
31
32
33
34 class TitlePatch;
35 class PlayPatch;
36 class RecordPatch;
37 class AutoPatch;
38 class GangPatch;
39 class DrawPatch;
40 class MutePatch;
41 class ZoomPatch;
42 class MasterPatch;
43 class ExpandPatch;
44 class NudgePatch;
45 class MixPatch;
46
47 class PatchGUI
48 {
49 public:
50         PatchGUI(MWindow *mwindow,
51                 PatchBay *patchbay,
52                 Track *track,
53                 int x,
54                 int y);
55         virtual ~PatchGUI();
56
57         virtual void create_objects();
58         virtual int reposition(int x, int y);
59         void toggle_behavior(int type,
60                 int value,
61                 BC_Toggle *toggle,
62                 int *output);
63         virtual int update(int x, int y);
64         virtual void synchronize_fade(float change) {};
65         void synchronize_faders(float change, int audio, int video);
66         char* calculate_nudge_text(int *changed);
67         int64_t calculate_nudge(const char *string);
68
69         MWindow *mwindow;
70         PatchBay *patchbay;
71         Track *track;
72 // Used by update routines so non-existent track doesn't need to be dereferenced
73 // to know it doesn't match the current EDL.
74         int track_id;
75         int data_type, mixer;
76         int x, y;
77 // Don't synchronize the fader if this is true.
78         int change_source;
79
80         TitlePatch *title;
81         RecordPatch *record;
82         PlayPatch *play;
83 //      AutoPatch *automate;
84         GangPatch *gang;
85         DrawPatch *draw;
86         MutePatch *mute;
87         ZoomPatch *zoom;
88         MasterPatch *master;
89         ExpandPatch *expand;
90         NudgePatch *nudge;
91         MixPatch *mix;
92         char string_return[BCTEXTLEN];
93 };
94
95
96
97 class PlayPatch : public BC_Toggle
98 {
99 public:
100         PlayPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
101         int button_press_event();
102         int button_release_event();
103         MWindow *mwindow;
104         PatchGUI *patch;
105 };
106
107 class RecordPatch : public BC_Toggle
108 {
109 public:
110         RecordPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
111         int button_press_event();
112         int button_release_event();
113         MWindow *mwindow;
114         PatchGUI *patch;
115 };
116
117 class TitlePatch : public BC_TextBox
118 {
119 public:
120         TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w);
121         int handle_event();
122         void update(const char *text);
123         MWindow *mwindow;
124         PatchGUI *patch;
125 };
126
127 class AutoPatch : public BC_Toggle
128 {
129 public:
130         AutoPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
131         int button_press_event();
132         int button_release_event();
133         MWindow *mwindow;
134         PatchGUI *patch;
135 };
136
137 class GangPatch : public BC_Toggle
138 {
139 public:
140         GangPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
141         int button_press_event();
142         int button_release_event();
143         MWindow *mwindow;
144         PatchGUI *patch;
145 };
146
147 class DrawPatch : public BC_Toggle
148 {
149 public:
150         DrawPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
151         int button_press_event();
152         int button_release_event();
153         MWindow *mwindow;
154         PatchGUI *patch;
155 };
156
157 class MutePatch : public BC_Toggle
158 {
159 public:
160         MutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
161         int button_press_event();
162         int button_release_event();
163         MWindow *mwindow;
164         PatchGUI *patch;
165 };
166
167 class ZoomPatch : public BC_Tumbler
168 {
169 public:
170         ZoomPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
171         int handle_up_event();
172         int handle_down_event();
173         MWindow *mwindow;
174         PatchGUI *patch;
175 };
176
177 class MasterPatch : public BC_Toggle
178 {
179 public:
180         MasterPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
181         int handle_event();
182         MWindow *mwindow;
183         PatchGUI *patch;
184 };
185
186 class ExpandPatch : public BC_Toggle
187 {
188 public:
189         ExpandPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
190         int button_press_event();
191         int button_release_event();
192         MWindow *mwindow;
193         PatchGUI *patch;
194 };
195
196 class NudgePatch : public BC_TextBox
197 {
198 public:
199         NudgePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w);
200         int handle_event();
201         int button_press_event();
202         void update();
203         void set_value(int64_t value);
204         int64_t calculate_increment();
205
206         MWindow *mwindow;
207         PatchGUI *patch;
208 };
209
210 class MixPatch : public BC_Toggle
211 {
212 public:
213         MixPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
214         ~MixPatch();
215         int handle_event();
216         void update(int v);
217
218         MWindow *mwindow;
219         PatchGUI *patch;
220 };
221
222
223 #endif