9 #include "recordlabel.inc"
10 #include "testobject.h"
11 #include "timebar.inc"
12 #include "vwindowgui.inc"
14 class TimeBarLeftArrow
;
15 class TimeBarRightArrow
;
20 class PresentationGUI
;
22 // Operations for cursor
23 #define TIMEBAR_NONE 0
24 #define TIMEBAR_DRAG 1
25 #define TIMEBAR_DRAG_LEFT 2
26 #define TIMEBAR_DRAG_RIGHT 3
27 #define TIMEBAR_DRAG_CENTER 4
29 class LabelGUI
: public BC_Toggle
32 LabelGUI(MWindow
*mwindow
,
40 static int translate_pixel(MWindow
*mwindow
, int pixel
);
41 virtual int handle_event();
42 static int get_y(MWindow
*mwindow
, TimeBar
*timebar
);
52 class TestPointGUI
: public LabelGUI
55 TestPointGUI(MWindow
*mwindow
,
61 class InPointGUI
: public LabelGUI
64 InPointGUI(MWindow
*mwindow
,
68 virtual ~InPointGUI();
69 static int get_y(MWindow
*mwindow
, TimeBar
*timebar
);
72 class OutPointGUI
: public LabelGUI
75 OutPointGUI(MWindow
*mwindow
,
79 virtual ~OutPointGUI();
80 static int get_y(MWindow
*mwindow
, TimeBar
*timebar
);
83 class PresentationGUI
: public LabelGUI
86 PresentationGUI(MWindow
*mwindow
,
93 class TimeBar
: public BC_SubWindow
96 TimeBar(MWindow
*mwindow
,
104 int create_objects();
105 int update_defaults();
106 int button_press_event();
107 int button_release_event();
108 int cursor_motion_event();
109 int repeat_event(int64_t duration
);
111 // Synchronize label, in/out, presentation display with master EDL
112 void update(int do_range
= 1, int do_others
= 1);
113 virtual void draw_time();
114 // Called by update and draw_time.
115 virtual void draw_range();
116 virtual void select_label(double position
);
117 virtual void stop_playback();
118 virtual EDL
* get_edl();
119 virtual int test_preview(int buttonpress
);
120 virtual void update_preview();
121 virtual int64_t position_to_pixel(double position
);
122 int move_preview(int &redraw
);
125 void update_labels();
126 void update_points();
127 void update_presentations();
128 // Make sure widgets are highlighted according to selection status
129 void update_highlights();
130 // Update highlight cursor during a drag
131 void update_cursor();
133 // ================================= file operations
135 int save(FileXML
*xml
);
136 int load(FileXML
*xml
, int undo_type
);
138 int delete_project(); // clear timebar of labels
140 int draw(); // draw everything over
141 int samplemovement();
142 int refresh_labels();
144 // ========================================= editing
146 int copy(int64_t start
, int64_t end
, FileXML
*xml
);
147 int paste(int64_t start
, int64_t end
, int64_t sample_length
, FileXML
*xml
);
148 int paste_output(int64_t startproject
, int64_t endproject
, int64_t startsource
, int64_t endsource
, RecordLabels
*new_labels
);
149 int clear(int64_t start
, int64_t end
);
150 int paste_silence(int64_t start
, int64_t end
);
151 int modify_handles(int64_t oldposition
, int64_t newposition
, int currentend
);
152 int select_region(double position
);
153 void get_edl_length();
157 int flip_vertical(int w
, int h
);
158 int delete_arrows(); // for flipping vertical
160 // Operation started by a buttonpress
161 int current_operation
;
165 int get_preview_pixels(int &x1
, int &x2
);
167 ArrayList
<LabelGUI
*> labels
;
168 InPointGUI
*in_point
;
169 OutPointGUI
*out_point
;
170 ArrayList
<PresentationGUI
*> presentations
;
173 // Records for dragging operations
174 double start_position
;
175 double starting_start_position
;
176 double starting_end_position
;
177 double time_per_pixel
;