7 // Output for all X11 video
13 class CanvasToggleControls
;
15 // The EDL arguments can be set to 0 if the canvas_w and canvas_h are used
19 Canvas(BC_WindowBase
*subwindow
,
29 int use_vwindow
= 0); // Use menu different options for different windows
33 // Get dimensions given a zoom
34 void calculate_sizes(float aspect_ratio
,
41 int create_objects(EDL
*edl
);
42 void set_cursor(int cursor
);
43 // Start video playback
47 // Start single frame processing. Causes the status indicator to update
51 // Processing or video playback changed.
52 virtual void status_event() {};
55 virtual void reset_camera() {};
56 virtual void reset_projector() {};
57 virtual void zoom_resize_window(float percentage
) {};
58 virtual int cursor_leave_event() { return 0; };
59 virtual int cursor_enter_event() { return 0; };
60 virtual int button_release_event() { return 0; };
61 virtual int button_press_event();
62 virtual int cursor_motion_event() { return 0; };
63 virtual void draw_overlays() { };
64 virtual void toggle_controls() { } ;
65 virtual int get_cwindow_controls() { return 0; };
66 // Provide canvas dimensions since a BC_Bitmap containing obsolete dimensions
67 // is often the output being transferred to
68 void get_transfers(EDL
*edl
, int &in_x
,
78 void reposition_window(EDL
*edl
, int x
, int y
, int w
, int h
);
79 virtual void reset_translation() {};
80 virtual void close_source() {};
82 virtual void update_zoom(int x
, int y
, float zoom
) {};
83 void check_boundaries(EDL
*edl
, int &x
, int &y
, float &zoom
);
84 void update_scrollbars();
85 // Get scrollbar positions relative to output.
86 // No correction is done if output is smaller than canvas
87 virtual int get_xscroll() { return 0; };
88 virtual int get_yscroll() { return 0; };
89 virtual float get_zoom() { return 0; };
91 virtual void draw_refresh() {};
93 // Get top left offset of canvas relative to output.
94 // Normally negative. Can be positive if output is smaller than canvas.
95 float get_x_offset(EDL
*edl
,
100 float get_y_offset(EDL
*edl
,
105 void get_zooms(EDL
*edl
,
113 // Convert coord from output to canvas position, including
114 // x and y scroll offsets
115 void output_to_canvas(EDL
*edl
, int single_channel
, float &x
, float &y
);
116 // Convert coord from canvas to output position
117 void canvas_to_output(EDL
*edl
, int single_channel
, float &x
, float &y
);
119 // Get dimensions of frame being sent to canvas
120 virtual int get_output_w(EDL
*edl
);
121 virtual int get_output_h(EDL
*edl
);
122 // Get if scrollbars exist
123 int scrollbars_exist();
124 // Get cursor locations relative to canvas and not offset by scrollbars
127 int get_buttonpress();
129 BC_WindowBase
*subwindow
;
130 CanvasOutput
*canvas
;
131 CanvasXScroll
*xscroll
;
132 CanvasYScroll
*yscroll
;
133 CanvasPopup
*canvas_menu
;
139 // Used in record monitor
140 int output_w
, output_h
;
141 // Store frame in native format after playback for refreshes
142 VFrame
*refresh_frame
;
143 // Results from last get_scrollbars
148 // For cases where video is not enabled on the canvas but processing is
149 // occurring for a single frame, this causes the status to update.
153 void get_scrollbars(EDL
*edl
,
161 class CanvasOutput
: public BC_SubWindow
164 CanvasOutput(EDL
*edl
,
173 int cursor_leave_event();
174 int cursor_enter_event();
175 int button_press_event();
176 int button_release_event();
177 int cursor_motion_event();
184 class CanvasXScroll
: public BC_ScrollBar
187 CanvasXScroll(EDL
*edl
,
203 class CanvasYScroll
: public BC_ScrollBar
206 CanvasYScroll(EDL
*edl
,
222 class CanvasPopup
: public BC_PopupMenu
225 CanvasPopup(Canvas
*canvas
);
228 void create_objects();
231 CanvasToggleControls
*toggle_controls
;
234 class CanvasPopupSize
: public BC_MenuItem
237 CanvasPopupSize(Canvas
*canvas
, char *text
, float percentage
);
244 class CanvasPopupResetCamera
: public BC_MenuItem
247 CanvasPopupResetCamera(Canvas
*canvas
);
252 class CanvasPopupResetProjector
: public BC_MenuItem
255 CanvasPopupResetProjector(Canvas
*canvas
);
260 class CanvasToggleControls
: public BC_MenuItem
263 CanvasToggleControls(Canvas
*canvas
);
265 static char* calculate_text(int cwindow_controls
);
269 class CanvasPopupResetTranslation
: public BC_MenuItem
272 CanvasPopupResetTranslation(Canvas
*canvas
);
278 class CanvasPopupRemoveSource
: public BC_MenuItem
281 CanvasPopupRemoveSource(Canvas
*canvas
);