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

setformat.h

Go to the documentation of this file.
00001 #ifndef SETFORMAT_H
00002 #define SETFORMAT_H
00003 
00004 
00005 #include "edl.inc"
00006 #include "formatpresets.h"
00007 #include "guicast.h"
00008 #include "mutex.inc"
00009 #include "mwindow.inc"
00010 #include "setformat.inc"
00011 #include "thread.h"
00012 
00013 
00014 class SetFormatPresets;
00015 
00016 
00017 
00018 class SetFormat : public BC_MenuItem
00019 {
00020 public:
00021         SetFormat(MWindow *mwindow);
00022         int handle_event();
00023         SetFormatThread *thread;
00024         MWindow *mwindow;
00025 };
00026 
00027 
00028 class SetFormatThread : public Thread
00029 {
00030 public:
00031         SetFormatThread(MWindow *mwindow);
00032 
00033         void run();
00034 
00035         void apply_changes();
00036 // Update image size based on ratio of dimensions to original.
00037         void update_window();
00038 // Update automatic aspect ratio based in image size
00039         void update_aspect();
00040 // Update all parameters from preset menu
00041         void update();
00042 
00043 
00044         Mutex *window_lock;
00045         SetFormatWindow *window;
00046         MWindow *mwindow;
00047         EDL *new_settings;
00048         float ratio[2];
00049         int dimension[2];
00050         int orig_dimension[2];
00051         int auto_aspect;
00052         int constrain_ratio;
00053 };
00054 
00055 
00056 class SetSampleRateTextBox : public BC_TextBox
00057 {
00058 public:
00059         SetSampleRateTextBox(SetFormatThread *thread, int x, int y);
00060         int handle_event();
00061         SetFormatThread *thread;
00062 };
00063 
00064 class SetChannelsTextBox : public BC_TextBox
00065 {
00066 public:
00067         SetChannelsTextBox(SetFormatThread *thread, int x, int y);
00068         
00069         int handle_event();
00070         
00071         SetFormatThread *thread;
00072         MWindow *mwindow;
00073 };
00074 
00075 
00076 class SetChannelsCanvas : public BC_SubWindow
00077 {
00078 public:
00079         SetChannelsCanvas(MWindow *mwindow, 
00080                 SetFormatThread *thread, 
00081                 int x, 
00082                 int y,
00083                 int w,
00084                 int h);
00085         ~SetChannelsCanvas();
00086         
00087         int draw(int angle = -1);
00088         int get_dimensions(int channel_position, int &x, int &y, int &w, int &h);
00089         int button_press_event();
00090         int button_release_event();
00091         int cursor_motion_event();
00092 
00093 private:        
00094         int active_channel;   // for selection
00095         int degree_offset;
00096         int box_r;
00097         
00098         int poltoxy(int &x, int &y, int r, int d);
00099         int xytopol(int &d, int x, int y);
00100         MWindow *mwindow;
00101         SetFormatThread *thread;
00102         VFrame *temp_picon;
00103         RotateFrame *rotater;
00104 };
00105 
00106 
00107 class SetFrameRateTextBox : public BC_TextBox
00108 {
00109 public:
00110         SetFrameRateTextBox(SetFormatThread *thread, int x, int y);
00111         int handle_event();
00112         SetFormatThread *thread;
00113 };
00114 
00115 class ScaleSizeText : public BC_TextBox
00116 {
00117 public:
00118         ScaleSizeText(int x, int y, SetFormatThread *thread, int *output);
00119         ~ScaleSizeText();
00120         int handle_event();
00121         SetFormatThread *thread;
00122         int *output;
00123 };
00124 
00125 
00126 class ScaleRatioText : public BC_TextBox
00127 {
00128 public:
00129         ScaleRatioText(int x, int y, SetFormatThread *thread, float *output);
00130         ~ScaleRatioText();
00131         int handle_event();
00132         SetFormatThread *thread;
00133         float *output;
00134 };
00135 
00136 class ScaleAspectAuto : public BC_CheckBox
00137 {
00138 public:
00139         ScaleAspectAuto(int x, int y, SetFormatThread *thread);
00140         ~ScaleAspectAuto();
00141         int handle_event();
00142         SetFormatThread *thread;
00143 };
00144 
00145 class ScaleAspectText : public BC_TextBox
00146 {
00147 public:
00148         ScaleAspectText(int x, int y, SetFormatThread *thread, float *output);
00149         ~ScaleAspectText();
00150         int handle_event();
00151         SetFormatThread *thread;
00152         float *output;
00153 };
00154 
00155 class SetFormatApply : public BC_GenericButton
00156 {
00157 public:
00158         SetFormatApply(int x, int y, SetFormatThread *thread);
00159         int handle_event();
00160         SetFormatThread *thread;
00161 };
00162 
00163 class SetFormatPresets : public FormatPresets
00164 {
00165 public:
00166         SetFormatPresets(MWindow *mwindow, SetFormatWindow *gui, int x, int y);
00167         ~SetFormatPresets();
00168         int handle_event();
00169         EDL* get_edl();
00170 };      
00171         
00172 class SetFormatWindow : public BC_Window
00173 {
00174 public:
00175         SetFormatWindow(MWindow *mwindow, 
00176                 SetFormatThread *thread,
00177                 int x,
00178                 int y);
00179 
00180         void create_objects();
00181         char* get_preset_text();
00182 
00183         MWindow *mwindow;
00184         SetFormatThread *thread;
00185         SetChannelsCanvas *canvas;
00186 // Screen size width, height
00187         ScaleSizeText* dimension[2];
00188 // Size ratio width, height
00189         ScaleRatioText* ratio[2];
00190 // Aspect ratio
00191         ScaleAspectText *aspect_w;
00192         ScaleAspectText *aspect_h;
00193         SetSampleRateTextBox *sample_rate;
00194         SetChannelsTextBox *channels;
00195         SetFrameRateTextBox *frame_rate;
00196         BC_TextBox *color_model;
00197         SetFormatPresets *presets;
00198         ScaleAspectAuto *auto_aspect;
00199 };
00200 
00201         
00202         
00203         
00204 
00205 
00206 
00207 
00208 #endif

Generated on Sun Jan 8 13:39:00 2006 for Cinelerra-svn by  doxygen 1.4.4