00001 #ifndef PREFERENCESTHREAD_H
00002 #define PREFERENCESTHREAD_H
00003
00004 #include "edl.inc"
00005 #include "guicast.h"
00006 #include "mutex.inc"
00007 #include "mwindow.inc"
00008 #include "preferences.inc"
00009 #include "preferencesthread.inc"
00010 #include "thread.h"
00011
00012
00013 class PreferencesMenuitem : public BC_MenuItem
00014 {
00015 public:
00016 PreferencesMenuitem(MWindow *mwindow);
00017 ~PreferencesMenuitem();
00018
00019 int handle_event();
00020
00021 MWindow *mwindow;
00022 PreferencesThread *thread;
00023 };
00024
00025 class PreferencesThread : public Thread
00026 {
00027 public:
00028 PreferencesThread(MWindow *mwindow);
00029 ~PreferencesThread();
00030 void run();
00031
00032 int update_framerate();
00033 int apply_settings();
00034 char* category_to_text(int category);
00035 int text_to_category(char *category);
00036
00037 int current_dialog;
00038 int thread_running;
00039 int redraw_indexes;
00040 int redraw_meters;
00041 int redraw_times;
00042 int redraw_overlays;
00043 int rerender;
00044 int close_assets;
00045 int reload_plugins;
00046 PreferencesWindow *window;
00047 Mutex *window_lock;
00048 MWindow *mwindow;
00049
00050 Preferences *preferences;
00051 EDL *edl;
00052
00053
00054 #define CATEGORIES 5
00055 enum
00056 {
00057 PLAYBACK,
00058 RECORD,
00059 PERFORMANCE,
00060 INTERFACE,
00061 ABOUT
00062 };
00063 };
00064
00065 class PreferencesDialog : public BC_SubWindow
00066 {
00067 public:
00068 PreferencesDialog(MWindow *mwindow, PreferencesWindow *pwindow);
00069 virtual ~PreferencesDialog();
00070
00071 virtual int create_objects() { return 0; };
00072 virtual int draw_framerate() { return 0; };
00073 PreferencesWindow *pwindow;
00074 MWindow *mwindow;
00075 Preferences *preferences;
00076 };
00077
00078 class PreferencesCategory;
00079 class PreferencesButton;
00080
00081 class PreferencesWindow : public BC_Window
00082 {
00083 public:
00084 PreferencesWindow(MWindow *mwindow,
00085 PreferencesThread *thread,
00086 int x,
00087 int y);
00088 ~PreferencesWindow();
00089
00090 int create_objects();
00091 int delete_current_dialog();
00092 int set_current_dialog(int number);
00093 int update_framerate();
00094
00095 MWindow *mwindow;
00096 PreferencesThread *thread;
00097 ArrayList<BC_ListBoxItem*> categories;
00098 PreferencesCategory *category;
00099 PreferencesButton *category_button[CATEGORIES];
00100
00101 private:
00102 PreferencesDialog *dialog;
00103 };
00104
00105 class PreferencesButton : public BC_GenericButton
00106 {
00107 public:
00108 PreferencesButton(MWindow *mwindow,
00109 PreferencesThread *thread,
00110 int x,
00111 int y,
00112 int category,
00113 char *text,
00114 VFrame **images);
00115
00116 int handle_event();
00117
00118 MWindow *mwindow;
00119 PreferencesThread *thread;
00120 int category;
00121 };
00122
00123 class PreferencesCategory : public BC_PopupTextBox
00124 {
00125 public:
00126 PreferencesCategory(MWindow *mwindow, PreferencesThread *thread, int x, int y);
00127 ~PreferencesCategory();
00128 int handle_event();
00129 MWindow *mwindow;
00130 PreferencesThread *thread;
00131 };
00132
00133 class PreferencesApply : public BC_GenericButton
00134 {
00135 public:
00136 PreferencesApply(MWindow *mwindow, PreferencesThread *thread);
00137 int handle_event();
00138 MWindow *mwindow;
00139 PreferencesThread *thread;
00140 };
00141
00142 class PreferencesOK : public BC_GenericButton
00143 {
00144 public:
00145 PreferencesOK(MWindow *mwindow, PreferencesThread *thread);
00146 int keypress_event();
00147 int handle_event();
00148 MWindow *mwindow;
00149 PreferencesThread *thread;
00150 };
00151
00152 class PreferencesCancel : public BC_GenericButton
00153 {
00154 public:
00155 PreferencesCancel(MWindow *mwindow, PreferencesThread *thread);
00156 int keypress_event();
00157 int handle_event();
00158 MWindow *mwindow;
00159 PreferencesThread *thread;
00160 };
00161
00162
00163 #endif