Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

channeledit.h

Go to the documentation of this file.
00001 #ifndef CHANNELEDIT_H
00002 #define CHANNELEDIT_H
00003 
00004 #include "bcdialog.h"
00005 #include "guicast.h"
00006 #include "channel.inc"
00007 #include "channeldb.inc"
00008 #include "channelpicker.inc"
00009 #include "condition.inc"
00010 #include "mainprogress.inc"
00011 #include "mutex.inc"
00012 #include "mwindow.inc"
00013 #include "picture.inc"
00014 #include "record.h"
00015 
00016 class ChannelEditWindow;
00017 class ScanThread;
00018 
00019 class ChannelEditThread : public Thread
00020 {
00021 public:
00022         ChannelEditThread(MWindow *mwindow, 
00023                 ChannelPicker *channel_picker,
00024                 ChannelDB *channeldb,
00025                 Record *Record);
00026         ~ChannelEditThread();
00027         void run();
00028         int close_threads();
00029         char* value_to_freqtable(int value);
00030         char* value_to_norm(int value);
00031         char* value_to_input(int value);
00032 
00033         Condition *completion;
00034         int in_progress;
00035         int current_channel;
00036         Channel scan_params;
00037         ChannelPicker *channel_picker;
00038         ChannelDB *channeldb;
00039         ChannelDB *new_channels;
00040         ChannelEditWindow *window;
00041         ScanThread *scan_thread;
00042         MWindow *mwindow;
00043         Record *record;
00044 };
00045 
00046 class ChannelEditList;
00047 class ChannelEditEditThread;
00048 class ChannelEditPictureThread;
00049 class ConfirmScanThread;
00050 
00051 class  ChannelEditWindow : public BC_Window
00052 {
00053 public:
00054         ChannelEditWindow(MWindow *mwindow, ChannelEditThread *thread, ChannelPicker *channel_picker);
00055         ~ChannelEditWindow();
00056 
00057         int create_objects();
00058         int close_event();
00059         int add_channel();  // Start the thread for adding a channel
00060         int delete_channel(int channel);
00061         int delete_channel(Channel *channel);
00062         int edit_channel();
00063         int edit_picture();
00064         int update_list();  // Synchronize the list box with the channel arrays
00065         int update_list(Channel *channel);  // Synchronize the list box and the channel
00066         int update_output();
00067         int move_channel_up();
00068         int move_channel_down();
00069         int change_channel_from_list(int channel_number);
00070         void sort();
00071         void scan_confirm();
00072         void scan();
00073 
00074 
00075         ArrayList<BC_ListBoxItem*> channel_list;
00076         ChannelEditList *list_box;
00077         ChannelEditThread *thread;
00078         ChannelPicker *channel_picker;
00079         ChannelEditEditThread *edit_thread;
00080         ChannelEditPictureThread *picture_thread;
00081         MWindow *mwindow;
00082         ConfirmScanThread *scan_confirm_thread;
00083 };
00084 
00085 class ChannelEditSelect : public BC_GenericButton
00086 {
00087 public:
00088         ChannelEditSelect(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00089         ~ChannelEditSelect();
00090         int handle_event();
00091         ChannelEditWindow *window;
00092 };
00093 
00094 
00095 class ChannelEditAdd : public BC_GenericButton
00096 {
00097 public:
00098         ChannelEditAdd(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00099         ~ChannelEditAdd();
00100         int handle_event();
00101         ChannelEditWindow *window;
00102 };
00103 
00104 class ChannelEditList : public BC_ListBox
00105 {
00106 public:
00107         ChannelEditList(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00108         ~ChannelEditList();
00109         int handle_event();
00110         ChannelEditWindow *window;
00111         static char *column_titles[2];
00112 };
00113 
00114 class ChannelEditMoveUp : public BC_GenericButton
00115 {
00116 public:
00117         ChannelEditMoveUp(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00118         ~ChannelEditMoveUp();
00119         int handle_event();
00120         ChannelEditWindow *window;
00121 };
00122 
00123 class ChannelEditMoveDown : public BC_GenericButton
00124 {
00125 public:
00126         ChannelEditMoveDown(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00127         ~ChannelEditMoveDown();
00128         int handle_event();
00129         ChannelEditWindow *window;
00130 };
00131 
00132 class ChannelEditSort : public BC_GenericButton
00133 {
00134 public:
00135         ChannelEditSort(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00136         int handle_event();
00137         ChannelEditWindow *window;
00138 };
00139 
00140 class ChannelEditScan : public BC_GenericButton
00141 {
00142 public:
00143         ChannelEditScan(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00144         int handle_event();
00145         ChannelEditWindow *window;
00146 };
00147 
00148 class ChannelEditDel : public BC_GenericButton
00149 {
00150 public:
00151         ChannelEditDel(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00152         ~ChannelEditDel();
00153         int handle_event();
00154         ChannelEditWindow *window;
00155 };
00156 
00157 class ChannelEdit : public BC_GenericButton
00158 {
00159 public:
00160         ChannelEdit(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00161         ~ChannelEdit();
00162         int handle_event();
00163         ChannelEditWindow *window;
00164 };
00165 
00166 class ChannelEditPicture : public BC_GenericButton
00167 {
00168 public:
00169         ChannelEditPicture(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
00170         ~ChannelEditPicture();
00171         int handle_event();
00172         ChannelEditWindow *window;
00173 };
00174 
00175 
00176 
00177 
00178 
00179 
00180 
00181 // ============================== Confirm overwrite with scanning
00182 
00183 class ConfirmScan : public BC_Window
00184 {
00185 public:
00186         ConfirmScan(ChannelEditWindow *gui, int x, int y);
00187         void create_objects();
00188         ChannelEditWindow *gui;
00189 };
00190 
00191 class ConfirmScanThread : public BC_DialogThread
00192 {
00193 public:
00194         ConfirmScanThread(ChannelEditWindow *gui);
00195         void handle_done_event(int result);
00196         BC_Window* new_gui();
00197         ChannelEditWindow *gui;
00198 };
00199 
00200 
00201 
00202 
00203 
00204 // ============================= Scan 
00205 
00206 class ScanThread : public Thread
00207 {
00208 public:
00209         ScanThread(ChannelEditThread *edit);
00210         ~ScanThread();
00211 
00212         void start();
00213         void run();
00214 
00215         ChannelEditThread *edit;
00216         int interrupt;
00217         MainProgressBar *progress;
00218 };
00219 
00220 
00221 
00222 
00223 
00224 
00225 
00226 // ============================= Edit a single channel
00227 
00228 class ChannelEditEditSource;
00229 class ChannelEditEditWindow;
00230 
00231 class ChannelEditEditThread : public Thread
00232 {
00233 public:
00234         ChannelEditEditThread(ChannelEditWindow *window, 
00235                 ChannelPicker *channel_picker,
00236                 Record *record);
00237         ~ChannelEditEditThread();
00238 
00239         void run();
00240         int edit_channel(Channel *channel, int editing);
00241         void set_device();       // Set the device to the new channel
00242         int change_source(char *source_name);   // Change to the source matching the name
00243         int source_up();
00244         int source_down();
00245         int set_input(int value);
00246         int set_norm(int value);
00247         int set_freqtable(int value);
00248         int close_threads();
00249 
00250         Channel new_channel;
00251         Channel *output_channel;
00252         ChannelPicker *channel_picker;
00253         ChannelEditWindow *window;
00254         ChannelEditEditSource *source_text;
00255         ChannelEditEditWindow *edit_window;
00256         Record *record;
00257         int editing;   // Tells whether or not to delete the channel on cancel
00258         int in_progress;   // Allow only 1 thread at a time
00259         int user_title;
00260         Condition *completion;
00261 };
00262 
00263 class ChannelEditEditTitle;
00264 
00265 
00266 class ChannelEditEditWindow : public BC_Window
00267 {
00268 public:
00269         ChannelEditEditWindow(ChannelEditEditThread *thread, 
00270                 ChannelEditWindow *window,
00271                 ChannelPicker *channel_picker);
00272         ~ChannelEditEditWindow();
00273         int create_objects(Channel *channel);
00274 
00275         ChannelEditEditThread *thread;
00276         ChannelEditWindow *window;
00277         ChannelEditEditTitle *title_text;
00278         Channel *new_channel;
00279         ChannelPicker *channel_picker;
00280 };
00281 
00282 class ChannelEditEditTitle : public BC_TextBox
00283 {
00284 public:
00285         ChannelEditEditTitle(int x, int y, ChannelEditEditThread *thread);
00286         ~ChannelEditEditTitle();
00287         int handle_event();
00288         ChannelEditEditThread *thread;
00289 };
00290 
00291 class ChannelEditEditSource : public BC_TextBox
00292 {
00293 public:
00294         ChannelEditEditSource(int x, int y, ChannelEditEditThread *thread);
00295         ~ChannelEditEditSource();
00296         int handle_event();
00297         ChannelEditEditThread *thread;
00298 };
00299 
00300 class ChannelEditEditSourceTumbler : public BC_Tumbler
00301 {
00302 public:
00303         ChannelEditEditSourceTumbler(int x, int y, ChannelEditEditThread *thread);
00304         ~ChannelEditEditSourceTumbler();
00305         int handle_up_event();
00306         int handle_down_event();
00307         ChannelEditEditThread *thread;
00308 };
00309 
00310 class ChannelEditEditInput : public BC_PopupMenu
00311 {
00312 public:
00313         ChannelEditEditInput(int x, 
00314                 int y, 
00315                 ChannelEditEditThread *thread, 
00316                 ChannelEditThread *edit);
00317         ~ChannelEditEditInput();
00318         int add_items();
00319         int handle_event();
00320         ChannelEditEditThread *thread;
00321         ChannelEditThread *edit;
00322 };
00323 
00324 class ChannelEditEditInputItem : public BC_MenuItem
00325 {
00326 public:
00327         ChannelEditEditInputItem(ChannelEditEditThread *thread, 
00328                 ChannelEditThread *edit,
00329                 char *text, 
00330                 int value);
00331         ~ChannelEditEditInputItem();
00332         int handle_event();
00333         ChannelEditEditThread *thread;
00334         ChannelEditThread *edit;
00335         int value;
00336 };
00337 
00338 class ChannelEditEditNorm : public BC_PopupMenu
00339 {
00340 public:
00341         ChannelEditEditNorm(int x, 
00342                 int y, 
00343                 ChannelEditEditThread *thread,
00344                 ChannelEditThread *edit);
00345         ~ChannelEditEditNorm();
00346         int add_items();
00347         ChannelEditEditThread *thread;
00348         ChannelEditThread *edit;
00349 };
00350 
00351 class ChannelEditEditNormItem : public BC_MenuItem
00352 {
00353 public:
00354         ChannelEditEditNormItem(ChannelEditEditThread *thread, 
00355                 ChannelEditThread *edit,
00356                 char *text, 
00357                 int value);
00358         ~ChannelEditEditNormItem();
00359         int handle_event();
00360         ChannelEditEditThread *thread;
00361         ChannelEditThread *edit;
00362         int value;
00363 };
00364 
00365 class ChannelEditEditFreqtable : public BC_PopupMenu
00366 {
00367 public:
00368         ChannelEditEditFreqtable(int x, 
00369                 int y, 
00370                 ChannelEditEditThread *thread,
00371                 ChannelEditThread *edit);
00372         ~ChannelEditEditFreqtable();
00373 
00374         int add_items();
00375 
00376         ChannelEditEditThread *thread;
00377         ChannelEditThread *edit;
00378 };
00379 
00380 class ChannelEditEditFreqItem : public BC_MenuItem
00381 {
00382 public:
00383         ChannelEditEditFreqItem(ChannelEditEditThread *thread, 
00384                 ChannelEditThread *edit,
00385                 char *text, 
00386                 int value);
00387         ~ChannelEditEditFreqItem();
00388 
00389         int handle_event();
00390         ChannelEditEditThread *thread;
00391         ChannelEditThread *edit;
00392         int value;
00393 };
00394 
00395 class ChannelEditEditFine : public BC_ISlider
00396 {
00397 public:
00398         ChannelEditEditFine(int x, int y, ChannelEditEditThread *thread);
00399         ~ChannelEditEditFine();
00400         int handle_event();
00401         ChannelEditEditThread *thread;
00402 };
00403 
00404 // =================== Edit the picture quality
00405 
00406 
00407 class ChannelEditPictureWindow;
00408 
00409 class ChannelEditPictureThread : public Thread
00410 {
00411 public:
00412         ChannelEditPictureThread(ChannelPicker *channel_picker, ChannelEditWindow *window);
00413         ~ChannelEditPictureThread();
00414 
00415         void run();
00416         int close_threads();
00417         int edit_picture();
00418 
00419         int in_progress;   // Allow only 1 thread at a time
00420         Condition *completion;
00421         ChannelPicker *channel_picker;
00422         ChannelEditWindow *window;
00423         ChannelEditPictureWindow *edit_window;
00424 };
00425 
00426 class ChannelEditPictureWindow : public BC_Window
00427 {
00428 public:
00429         ChannelEditPictureWindow(ChannelEditPictureThread *thread, 
00430                 ChannelPicker *channel_picker);
00431         ~ChannelEditPictureWindow();
00432 
00433         int calculate_h(ChannelPicker *channel_picker);
00434         int create_objects();
00435 
00436         ChannelEditPictureThread *thread;
00437         ChannelPicker *channel_picker;
00438 };
00439 
00440 class ChannelEditBright : public BC_IPot
00441 {
00442 public:
00443         ChannelEditBright(int x, int y, ChannelPicker *channel_picker, int value);
00444         ~ChannelEditBright();
00445         int handle_event();
00446         int button_release_event();
00447         ChannelPicker *channel_picker;
00448 };
00449 
00450 class ChannelEditContrast : public BC_IPot
00451 {
00452 public:
00453         ChannelEditContrast(int x, int y, ChannelPicker *channel_picker, int value);
00454         ~ChannelEditContrast();
00455         int handle_event();
00456         int button_release_event();
00457         ChannelPicker *channel_picker;
00458 };
00459 
00460 class ChannelEditColor : public BC_IPot
00461 {
00462 public:
00463         ChannelEditColor(int x, int y, ChannelPicker *channel_picker, int value);
00464         ~ChannelEditColor();
00465         int handle_event();
00466         int button_release_event();
00467         ChannelPicker *channel_picker;
00468 };
00469 
00470 class ChannelEditHue : public BC_IPot
00471 {
00472 public:
00473         ChannelEditHue(int x, int y, ChannelPicker *channel_picker, int value);
00474         ~ChannelEditHue();
00475         int handle_event();
00476         int button_release_event();
00477         ChannelPicker *channel_picker;
00478 };
00479 
00480 class ChannelEditWhiteness : public BC_IPot
00481 {
00482 public:
00483         ChannelEditWhiteness(int x, int y, ChannelPicker *channel_picker, int value);
00484         ~ChannelEditWhiteness();
00485         int handle_event();
00486         int button_release_event();
00487         ChannelPicker *channel_picker;
00488 };
00489 
00490 
00491 
00492 class ChannelEditCommon : public BC_IPot
00493 {
00494 public:;
00495         ChannelEditCommon(int x, 
00496                 int y, 
00497                 ChannelPicker *channel_picker,
00498                 PictureItem *item);
00499         ~ChannelEditCommon();
00500         int handle_event();
00501         int button_release_event();
00502         ChannelPicker *channel_picker;
00503         int device_id;
00504 };
00505 
00506 
00507 
00508 #endif

Generated on Sun Jan 8 13:38:51 2006 for Cinelerra-svn by  doxygen 1.4.4