4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "arraylist.h"
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"
39 class MenuEffectThread;
40 class MenuEffects : public BC_MenuItem
43 MenuEffects(MWindow *mwindow);
44 virtual ~MenuEffects();
49 MenuEffectThread *thread;
54 class MenuEffectPacket
57 MenuEffectPacket(char *path, int64_t start, int64_t end);
60 // Path of output without remote prefix
68 class MenuEffectThread : public Thread
71 MenuEffectThread(MWindow *mwindow, MenuEffects *menu_item);
72 virtual ~MenuEffectThread();
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);
85 MenuEffects *menu_item;
86 char title[BCTEXTLEN];
87 int realtime, load_mode;
89 // GUI Plugins to delete
90 ArrayList<PluginServer*> *dead_plugins;
95 class MenuEffectItem : public BC_MenuItem
98 MenuEffectItem(MenuEffects *menueffect, const char *string);
99 virtual ~MenuEffectItem() {};
101 MenuEffects *menueffect;
109 class MenuEffectWindowOK;
110 class MenuEffectWindowCancel;
111 class MenuEffectWindowList;
112 class MenuEffectWindowToTracks;
115 class MenuEffectWindow : public BC_Window
118 MenuEffectWindow(MWindow *mwindow,
119 MenuEffectThread *menueffects,
120 ArrayList<BC_ListBoxItem*> *plugin_list,
122 virtual ~MenuEffectWindow();
124 void create_objects();
125 int resize_event(int w, int h);
127 BC_Title *list_title;
128 MenuEffectWindowList *list;
130 BC_Title *file_title;
131 FormatTools *format_tools;
132 MenuEffectThread *menueffects;
134 ArrayList<BC_ListBoxItem*> *plugin_list;
140 class MenuEffectWindowOK : public BC_OKButton
143 MenuEffectWindowOK(MenuEffectWindow *window);
146 int keypress_event();
148 MenuEffectWindow *window;
151 class MenuEffectWindowCancel : public BC_CancelButton
154 MenuEffectWindowCancel(MenuEffectWindow *window);
157 int keypress_event();
159 MenuEffectWindow *window;
162 class MenuEffectWindowList : public BC_ListBox
165 MenuEffectWindowList(MenuEffectWindow *window,
170 ArrayList<BC_ListBoxItem*> *plugin_list);
173 MenuEffectWindow *window;
177 class MenuEffectPromptOK;
178 class MenuEffectPromptCancel;
181 class MenuEffectPrompt : public BC_Window
184 MenuEffectPrompt(MWindow *mwindow);
186 static int calculate_w(BC_WindowBase *gui);
187 static int calculate_h(BC_WindowBase *gui);
188 void create_objects();
190 MenuEffectPromptOK *ok;
191 MenuEffectPromptCancel *cancel;