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