tweak ffmpeg mpeg hw probe, update bld prepare, insert tracer source
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / tracer / tracerwindow.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21 #ifndef __TRACERWINDOW_H__
22 #define __TRACERWINDOW_H__
23
24 #include "guicast.h"
25
26 class Tracer;
27 class TracerWindow;
28 class TracerNum;
29 class TracerPointX;
30 class TracerPointY;
31 class TracerDrag;
32 class TracerDraw;
33 class TracerFill;
34 class TracerRadius;
35 class TracerScale;
36 class TracerPointList;
37 class TracerNewPoint;
38 class TracerDelPoint;
39 class TracerPointUp;
40 class TracerPointDn;
41 class TracerReset;
42
43
44 class TracerNum : public BC_TumbleTextBox
45 {
46 public:
47         TracerWindow *gui;
48
49         TracerNum(TracerWindow *gui, int x, int y, float output);
50         ~TracerNum();
51 };
52 class TracerPointX : public TracerNum
53 {
54 public:
55         TracerPointX(TracerWindow *gui, int x, int y, float output)
56          : TracerNum(gui, x, y, output) {}
57         ~TracerPointX() {}
58
59         int handle_event();
60 };
61 class TracerPointY : public TracerNum
62 {
63 public:
64         TracerPointY(TracerWindow *gui, int x, int y, float output)
65          : TracerNum(gui, x, y, output) {}
66         ~TracerPointY() {}
67
68         int handle_event();
69 };
70
71 class TracerThreshold : public BC_FSlider
72 {
73 public:
74         TracerThreshold(TracerWindow *gui, int x, int y, int w);
75         int handle_event();
76         int wheel_event(int v);
77         TracerWindow *gui;
78 };
79
80 class TracerDrag : public BC_CheckBox
81 {
82 public:
83         TracerDrag(TracerWindow *gui, int x, int y);
84
85         int handle_event();
86         TracerWindow *gui;
87 };
88
89 class TracerDraw : public BC_CheckBox
90 {
91 public:
92         TracerDraw(TracerWindow *gui, int x, int y);
93
94         int handle_event();
95         TracerWindow *gui;
96 };
97
98 class TracerFill : public BC_CheckBox
99 {
100 public:
101         TracerFill(TracerWindow *gui, int x, int y);
102
103         int handle_event();
104         TracerWindow *gui;
105 };
106
107 class TracerRadius : public BC_ISlider
108 {
109 public:
110         TracerRadius(TracerWindow *gui, int x, int y, int w);
111
112         int handle_event();
113         TracerWindow *gui;
114 };
115
116 class TracerScale : public BC_FSlider
117 {
118 public:
119         TracerScale(TracerWindow *gui, int x, int y, int w);
120
121         int handle_event();
122         TracerWindow *gui;
123 };
124
125 class TracerPointList : public BC_ListBox
126 {
127 public:
128         TracerPointList(TracerWindow *gui, Tracer *plugin, int x, int y);
129         ~TracerPointList();
130
131         int handle_event();
132         int selection_changed();
133         int column_resize_event();
134         ArrayList<BC_ListBoxItem*> cols[PT_SZ];
135         void clear();
136         void new_point(const char *xp, const char *yp);
137         void del_point(int i);
138         void set_point(int i, int c, float v);
139         void set_point(int i, int c, const char *cp);
140         int set_selected(int k);
141         void update(int k);
142         void update_list(int k);
143
144
145         TracerWindow *gui;
146         Tracer *plugin;
147         const char *titles[PT_SZ];
148         int widths[PT_SZ];
149 };
150
151 class TracerNewPoint : public BC_GenericButton
152 {
153 public:
154         TracerNewPoint(TracerWindow *gui, Tracer *plugin, int x, int y);
155         ~TracerNewPoint();
156
157         int handle_event();
158
159         TracerWindow *gui;
160         Tracer *plugin;
161 };
162
163 class TracerDelPoint : public BC_GenericButton
164 {
165 public:
166         TracerDelPoint(TracerWindow *gui, Tracer *plugin, int x, int y);
167         ~TracerDelPoint();
168
169         int handle_event();
170
171         Tracer *plugin;
172         TracerWindow *gui;
173 };
174
175 class TracerPointUp : public BC_GenericButton
176 {
177 public:
178         TracerPointUp(TracerWindow *gui, int x, int y);
179         ~TracerPointUp();
180
181         int handle_event();
182
183         TracerWindow *gui;
184 };
185
186 class TracerPointDn : public BC_GenericButton
187 {
188 public:
189         TracerPointDn(TracerWindow *gui, int x, int y);
190         ~TracerPointDn();
191
192         int handle_event();
193
194         TracerWindow *gui;
195 };
196
197 class TracerReset : public BC_GenericButton
198 {
199 public:
200         TracerReset(TracerWindow *gui, Tracer *plugin, int x, int y);
201         ~TracerReset();
202
203         int handle_event();
204
205         Tracer *plugin;
206         TracerWindow *gui;
207 };
208
209
210 class TracerWindow : public PluginClientWindow
211 {
212 public:
213         TracerWindow(Tracer *plugin);
214         ~TracerWindow();
215
216         void create_objects();
217         void update_gui();
218         void start_color_thread();
219         int grab_event(XEvent *event);
220         int do_grab_event(XEvent *event);
221         void done_event(int result);
222         void send_configure_change();
223
224         Tracer *plugin;
225         BC_Title *title_x, *title_y;
226         TracerPointX *point_x;
227         TracerPointY *point_y;
228         TracerNewPoint *new_point;
229         TracerDelPoint *del_point;
230         TracerPointUp *point_up;
231         TracerPointDn *point_dn;
232         int dragging, pending_config;
233         float last_x, last_y;
234         TracerDrag *drag;
235         TracerDraw *draw;
236         TracerFill *fill;
237         BC_Title *title_r, *title_s;
238         TracerRadius *radius;
239         TracerScale *scale;
240         TracerPointList *point_list;
241         TracerReset *reset;
242 };
243
244 #endif
245