add binfolder path relative filters, fix gbrp color model, vwdw timebar tweaks, title...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / gwindowgui.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 GWINDOWGUI_H
23 #define GWINDOWGUI_H
24
25 #include "automation.inc"
26 #include "condition.inc"
27 #include "colorpicker.h"
28 #include "guicast.h"
29 #include "gwindowgui.inc"
30 #include "mwindow.inc"
31
32 enum {
33         NONAUTOTOGGLES_ASSETS,
34         NONAUTOTOGGLES_TITLES,
35         NONAUTOTOGGLES_TRANSITIONS,
36         NONAUTOTOGGLES_PLUGIN_AUTOS,
37         NONAUTOTOGGLES_BAR1,
38         NONAUTOTOGGLES_BAR2,
39         NONAUTOTOGGLES_COUNT
40 };
41
42 struct toggleinfo {
43         int isauto, ref;
44 };
45
46 class GWindowGUI : public BC_Window
47 {
48 public:
49         GWindowGUI(MWindow *mwindow, int w, int h);
50         ~GWindowGUI();
51         static void calculate_extents(BC_WindowBase *gui, int *w, int *h);
52         void create_objects();
53         int translation_event();
54         int close_event();
55         int keypress_event();
56         void start_color_thread(GWindowColorButton *color_button);
57         void update_toggles(int use_lock);
58         void update_mwindow();
59         void load_defaults();
60         void save_defaults();
61
62         static const char *other_text[];
63         static const char *auto_text[];
64         static int auto_colors[];
65
66         MWindow *mwindow;
67         GWindowToggle *toggles[NONAUTOTOGGLES_COUNT + AUTOMATION_TOTAL];
68         GWindowColorThread *color_thread;
69 };
70
71 class GWindowToggle : public BC_CheckBox
72 {
73 public:
74         GWindowToggle(GWindowGUI *gui, int x, int y,
75                 const char *text, int color, toggleinfo *info);
76         ~GWindowToggle();
77
78         int handle_event();
79         void update();
80         void update_gui(int color);
81
82         static int* get_main_value(MWindow *mwindow, toggleinfo *info);
83
84         int color;
85         toggleinfo *info;
86         GWindowGUI *gui;
87         GWindowColorButton *color_button;
88 };
89
90 class GWindowColorButton : public BC_Button
91 {
92 public:
93         GWindowColorButton(GWindowToggle *auto_toggle, int x, int y, int w);
94         ~GWindowColorButton();
95
96         void set_color(int color);
97         void update_gui(int color);
98         int handle_event();
99
100         int color;
101         VFrame *vframes[3];
102         GWindowToggle *auto_toggle;
103 };
104
105 class GWindowColorThread : public ColorPicker
106 {
107 public:
108         GWindowColorThread(GWindowGUI *gui, GWindowColorButton *color_button);
109         ~GWindowColorThread();
110         void start(int color);
111         int handle_new_color(int color, int alpha);
112         void update_gui();
113         void handle_done_event(int result);
114
115         GWindowGUI *gui;
116         int color;
117         GWindowColorButton *color_button;
118         GWindowColorUpdate *color_update;
119 };
120
121 class GWindowColorUpdate : public Thread
122 {
123 public:
124         GWindowColorUpdate(GWindowColorThread *color_thread);
125         ~GWindowColorUpdate();
126
127         void start();
128         void stop();
129         void run();
130
131         int done;
132         Condition *update_lock;
133         GWindowColorThread *color_thread;
134 };
135
136 #endif