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

timebar.h

Go to the documentation of this file.
00001 #ifndef TIMEBAR_H
00002 #define TIMEBAR_H
00003 
00004 #include "edl.inc"
00005 #include "guicast.h"
00006 #include "filexml.inc"
00007 #include "labels.inc"
00008 #include "mwindow.inc"
00009 #include "recordlabel.inc"
00010 #include "testobject.h"
00011 #include "timebar.inc"
00012 #include "vwindowgui.inc"
00013 
00014 class TimeBarLeftArrow;
00015 class TimeBarRightArrow;
00016 
00017 class LabelGUI;
00018 class InPointGUI;
00019 class OutPointGUI;
00020 class PresentationGUI;
00021 
00022 // Operations for cursor
00023 #define TIMEBAR_NONE        0
00024 #define TIMEBAR_DRAG        1
00025 #define TIMEBAR_DRAG_LEFT   2
00026 #define TIMEBAR_DRAG_RIGHT  3
00027 #define TIMEBAR_DRAG_CENTER 4
00028 
00029 class LabelGUI : public BC_Toggle
00030 {
00031 public:
00032         LabelGUI(MWindow *mwindow, 
00033                 TimeBar *timebar, 
00034                 int64_t pixel, 
00035                 int y, 
00036                 double position,
00037                 VFrame **data = 0);
00038         virtual ~LabelGUI();
00039 
00040         static int translate_pixel(MWindow *mwindow, int pixel);
00041         virtual int handle_event();
00042         static int get_y(MWindow *mwindow, TimeBar *timebar);
00043         void reposition();
00044 
00045         MWindow *mwindow;
00046         VWindowGUI *gui;
00047         TimeBar *timebar;
00048         int64_t pixel;
00049         double position;
00050 };
00051 
00052 class TestPointGUI : public LabelGUI
00053 {
00054 public:
00055         TestPointGUI(MWindow *mwindow, 
00056                 TimeBar *timebar, 
00057                 int64_t pixel, 
00058                 double position);
00059 };
00060 
00061 class InPointGUI : public LabelGUI
00062 {
00063 public:
00064         InPointGUI(MWindow *mwindow, 
00065                 TimeBar *timebar, 
00066                 int64_t pixel, 
00067                 double position);
00068         virtual ~InPointGUI();
00069         static int get_y(MWindow *mwindow, TimeBar *timebar);
00070 };
00071 
00072 class OutPointGUI : public LabelGUI
00073 {
00074 public:
00075         OutPointGUI(MWindow *mwindow, 
00076                 TimeBar *timebar, 
00077                 int64_t pixel, 
00078                 double position);
00079         virtual ~OutPointGUI();
00080         static int get_y(MWindow *mwindow, TimeBar *timebar);
00081 };
00082 
00083 class PresentationGUI : public LabelGUI
00084 {
00085 public:
00086         PresentationGUI(MWindow *mwindow, 
00087                 TimeBar *timebar, 
00088                 int64_t pixel, 
00089                 double position);
00090         ~PresentationGUI();
00091 };
00092 
00093 class TimeBar : public BC_SubWindow
00094 {
00095 public:
00096         TimeBar(MWindow *mwindow, 
00097                 BC_WindowBase *gui,
00098                 int x, 
00099                 int y,
00100                 int w,
00101                 int h);
00102         virtual ~TimeBar();
00103 
00104         int create_objects();
00105         int update_defaults();
00106         int button_press_event();
00107         int button_release_event();
00108         int cursor_motion_event();
00109         int repeat_event(int64_t duration);
00110 
00111 // Synchronize label, in/out, presentation display with master EDL
00112         void update(int do_range = 1, int do_others = 1);
00113         virtual void draw_time();
00114 // Called by update and draw_time.
00115         virtual void draw_range();
00116         virtual void select_label(double position);
00117         virtual void stop_playback();
00118         virtual EDL* get_edl();
00119         virtual int test_preview(int buttonpress);
00120         virtual void update_preview();
00121         virtual int64_t position_to_pixel(double position);
00122         int move_preview(int &redraw);
00123 
00124 
00125         void update_labels();
00126         void update_points();
00127         void update_presentations();
00128 // Make sure widgets are highlighted according to selection status
00129         void update_highlights();
00130 // Update highlight cursor during a drag
00131         void update_cursor();
00132 
00133 // ================================= file operations
00134 
00135         int save(FileXML *xml);
00136         int load(FileXML *xml, int undo_type);
00137 
00138         int delete_project();        // clear timebar of labels
00139 
00140         int draw();                  // draw everything over
00141         int samplemovement();
00142         int refresh_labels();
00143 
00144 // ========================================= editing
00145 
00146         int select_region(double position);
00147         void get_edl_length();
00148 
00149         MWindow *mwindow;
00150         BC_WindowBase *gui;
00151         int flip_vertical(int w, int h);
00152         int delete_arrows();    // for flipping vertical
00153 
00154 // Operation started by a buttonpress
00155         int current_operation;
00156 
00157 
00158 private:
00159         int get_preview_pixels(int &x1, int &x2);
00160         int draw_bevel();
00161         ArrayList<LabelGUI*> labels;
00162         InPointGUI *in_point;
00163         OutPointGUI *out_point;
00164         ArrayList<PresentationGUI*> presentations;
00165 
00166 
00167 // Records for dragging operations
00168         double start_position;
00169         double starting_start_position;
00170         double starting_end_position;
00171         double time_per_pixel;
00172         double edl_length;
00173         int start_cursor_x;
00174 };
00175 
00176 
00177 #endif

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