8 #include "labeledit.inc"
10 #include "recordlabel.inc"
11 #include "testobject.h"
12 #include "timebar.inc"
13 #include "vwindowgui.inc"
15 class TimeBarLeftArrow
;
16 class TimeBarRightArrow
;
21 class PresentationGUI
;
23 // Operations for cursor
24 #define TIMEBAR_NONE 0
25 #define TIMEBAR_DRAG 1
26 #define TIMEBAR_DRAG_LEFT 2
27 #define TIMEBAR_DRAG_RIGHT 3
28 #define TIMEBAR_DRAG_CENTER 4
30 class LabelGUI
: public BC_Toggle
33 LabelGUI(MWindow
*mwindow
,
41 static int translate_pixel(MWindow
*mwindow
, int pixel
);
42 virtual int handle_event();
43 static int get_y(MWindow
*mwindow
, TimeBar
*timebar
);
47 int button_press_event();
55 class TestPointGUI
: public LabelGUI
58 TestPointGUI(MWindow
*mwindow
,
64 class InPointGUI
: public LabelGUI
67 InPointGUI(MWindow
*mwindow
,
71 virtual ~InPointGUI();
72 static int get_y(MWindow
*mwindow
, TimeBar
*timebar
);
75 class OutPointGUI
: public LabelGUI
78 OutPointGUI(MWindow
*mwindow
,
82 virtual ~OutPointGUI();
83 static int get_y(MWindow
*mwindow
, TimeBar
*timebar
);
86 class PresentationGUI
: public LabelGUI
89 PresentationGUI(MWindow
*mwindow
,
96 class TimeBar
: public BC_SubWindow
99 TimeBar(MWindow
*mwindow
,
107 int create_objects();
108 int update_defaults();
109 int button_press_event();
110 int button_release_event();
111 int cursor_motion_event();
112 int repeat_event(int64_t duration
);
114 LabelEdit
*label_edit
;
116 // Synchronize label, in/out, presentation display with master EDL
117 void update(int do_range
= 1, int do_others
= 1);
118 virtual void draw_time();
119 // Called by update and draw_time.
120 virtual void draw_range();
121 virtual void select_label(double position
);
122 virtual void stop_playback();
123 virtual EDL
* get_edl();
124 virtual int test_preview(int buttonpress
);
125 virtual void update_preview();
126 virtual int64_t position_to_pixel(double position
);
127 int move_preview(int &redraw
);
130 void update_labels();
131 void update_points();
132 void update_presentations();
133 // Make sure widgets are highlighted according to selection status
134 void update_highlights();
135 // Update highlight cursor during a drag
136 void update_cursor();
138 // ================================= file operations
140 int save(FileXML
*xml
);
141 int load(FileXML
*xml
, int undo_type
);
143 int delete_project(); // clear timebar of labels
145 int draw(); // draw everything over
146 int samplemovement();
147 int refresh_labels();
149 // ========================================= editing
151 int select_region(double position
);
152 void get_edl_length();
156 int flip_vertical(int w
, int h
);
157 int delete_arrows(); // for flipping vertical
159 // Operation started by a buttonpress
160 int current_operation
;
164 int get_preview_pixels(int &x1
, int &x2
);
166 ArrayList
<LabelGUI
*> labels
;
167 InPointGUI
*in_point
;
168 OutPointGUI
*out_point
;
169 ArrayList
<PresentationGUI
*> presentations
;
172 // Records for dragging operations
173 double start_position
;
174 double starting_start_position
;
175 double starting_end_position
;
176 double time_per_pixel
;
186 // c-file-style: "linux"