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