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