hard edges rework, add hard edge in gwdw, config.ac nv/cuda tweaks, message log warn...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / menueffects.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 MENUEFFECTS_H
23 #define MENUEFFECTS_H
24
25 #include "arraylist.h"
26 #include "asset.inc"
27 #include "bitspopup.h"
28 #include "browsebutton.h"
29 #include "compresspopup.h"
30 #include "formatpopup.h"
31 #include "formattools.h"
32 #include "loadmode.inc"
33 #include "mainmenu.inc"
34 #include "mwindow.inc"
35 #include "pluginarray.inc"
36 #include "pluginserver.inc"
37 #include "thread.h"
38
39 class MenuEffectThread;
40 class MenuEffects : public BC_MenuItem
41 {
42 public:
43         MenuEffects(MWindow *mwindow);
44         virtual ~MenuEffects();
45
46         int handle_event();
47
48         MWindow *mwindow;
49         MenuEffectThread *thread;
50 };
51
52
53
54 class MenuEffectPacket
55 {
56 public:
57         MenuEffectPacket(char *path, int64_t start, int64_t end);
58         ~MenuEffectPacket();
59
60 // Path of output without remote prefix
61         char path[BCTEXTLEN];
62
63         int64_t start;
64         int64_t end;
65 };
66
67
68 class MenuEffectThread : public Thread
69 {
70 public:
71         MenuEffectThread(MWindow *mwindow, MenuEffects *menu_item);
72         virtual ~MenuEffectThread();
73
74         void run();
75         int set_title(const char *text);  // set the effect to be run by a menuitem
76         virtual int get_recordable_tracks(Asset *asset) { return 0; };
77         virtual int get_derived_attributes(Asset *asset, BC_Hash *defaults) { return 0; };
78         virtual int save_derived_attributes(Asset *asset, BC_Hash *defaults) { return 0; };
79         virtual PluginArray* create_plugin_array() { return 0; };
80         virtual int64_t to_units(double position, int round) { return 0; };
81         virtual int fix_menu(char *title) { return 0; };
82         int test_existence(Asset *asset);
83
84         MWindow *mwindow;
85         MenuEffects *menu_item;
86         char title[BCTEXTLEN];
87         int realtime, load_mode;
88         int use_labels;
89 // GUI Plugins to delete
90         ArrayList<PluginServer*> *dead_plugins;
91
92 };
93
94
95 class MenuEffectItem : public BC_MenuItem
96 {
97 public:
98         MenuEffectItem(MenuEffects *menueffect, const char *string);
99         virtual ~MenuEffectItem() {};
100         int handle_event();
101         MenuEffects *menueffect;
102 };
103
104
105
106
107
108
109 class MenuEffectWindowOK;
110 class MenuEffectWindowCancel;
111 class MenuEffectWindowList;
112 class MenuEffectWindowToTracks;
113
114
115 class MenuEffectWindow : public BC_Window
116 {
117 public:
118         MenuEffectWindow(MWindow *mwindow,
119                 MenuEffectThread *menueffects,
120                 ArrayList<BC_ListBoxItem*> *plugin_list,
121                 Asset *asset);
122         virtual ~MenuEffectWindow();
123
124         void create_objects();
125         int resize_event(int w, int h);
126
127         BC_Title *list_title;
128         MenuEffectWindowList *list;
129         LoadMode *loadmode;
130         BC_Title *file_title;
131         FormatTools *format_tools;
132         MenuEffectThread *menueffects;
133         MWindow *mwindow;
134         ArrayList<BC_ListBoxItem*> *plugin_list;
135         Asset *asset;
136
137         int result;
138 };
139
140 class MenuEffectWindowOK : public BC_OKButton
141 {
142 public:
143         MenuEffectWindowOK(MenuEffectWindow *window);
144
145         int handle_event();
146         int keypress_event();
147
148         MenuEffectWindow *window;
149 };
150
151 class MenuEffectWindowCancel : public BC_CancelButton
152 {
153 public:
154         MenuEffectWindowCancel(MenuEffectWindow *window);
155
156         int handle_event();
157         int keypress_event();
158
159         MenuEffectWindow *window;
160 };
161
162 class MenuEffectWindowList : public BC_ListBox
163 {
164 public:
165         MenuEffectWindowList(MenuEffectWindow *window,
166                 int x,
167                 int y,
168                 int w,
169                 int h,
170                 ArrayList<BC_ListBoxItem*> *plugin_list);
171
172         int handle_event();
173         MenuEffectWindow *window;
174 };
175
176
177 class MenuEffectPromptOK;
178 class MenuEffectPromptCancel;
179
180
181 class MenuEffectPrompt : public BC_Window
182 {
183 public:
184         MenuEffectPrompt(MWindow *mwindow);
185
186         static int calculate_w(BC_WindowBase *gui);
187         static int calculate_h(BC_WindowBase *gui);
188         void create_objects();
189
190         MenuEffectPromptOK *ok;
191         MenuEffectPromptCancel *cancel;
192 };
193
194
195 #endif