2 #include "cwindowgui.h"
3 #include "cwindowtool.h"
5 #include "edlsession.h"
14 CPanel::CPanel(MWindow *mwindow,
15 CWindowGUI *subwindow,
21 this->mwindow = mwindow;
22 this->subwindow = subwindow;
33 int CPanel::create_objects()
35 int x = this->x, y = this->y;
36 subwindow->add_subwindow(operation[CWINDOW_PROTECT] = new CPanelProtect(mwindow, this, x, y));
37 y += operation[CWINDOW_PROTECT]->get_h();
38 subwindow->add_subwindow(operation[CWINDOW_ZOOM] = new CPanelMagnify(mwindow, this, x, y));
39 y += operation[CWINDOW_ZOOM]->get_h();
40 subwindow->add_subwindow(operation[CWINDOW_MASK] = new CPanelMask(mwindow, this, x, y));
41 y += operation[CWINDOW_MASK]->get_h();
42 subwindow->add_subwindow(operation[CWINDOW_CAMERA] = new CPanelCamera(mwindow, this, x, y));
43 y += operation[CWINDOW_CAMERA]->get_h();
44 subwindow->add_subwindow(operation[CWINDOW_PROJECTOR] = new CPanelProj(mwindow, this, x, y));
45 y += operation[CWINDOW_PROJECTOR]->get_h();
46 subwindow->add_subwindow(operation[CWINDOW_CROP] = new CPanelCrop(mwindow, this, x, y));
47 y += operation[CWINDOW_CROP]->get_h();
48 subwindow->add_subwindow(operation[CWINDOW_TOOL_WINDOW] = new CPanelToolWindow(mwindow, this, x, y));
49 y += operation[CWINDOW_TOOL_WINDOW]->get_h();
50 subwindow->add_subwindow(operation[CWINDOW_TITLESAFE] = new CPanelTitleSafe(mwindow, this, x, y));
54 void CPanel::reposition_buttons(int x, int y)
59 for(int i = 0; i < CPANEL_OPERATIONS; i++)
61 operation[i]->reposition_window(x, y);
62 y += operation[i]->get_h();
67 void CPanel::set_operation(int value)
69 for(int i = 0; i < CPANEL_OPERATIONS; i++)
71 if(i == CWINDOW_TOOL_WINDOW)
73 operation[i]->update(mwindow->edl->session->tool_window);
76 if(i == CWINDOW_TITLESAFE)
78 operation[i]->update(mwindow->edl->session->safe_regions);
81 // if(i == CWINDOW_SHOW_METERS)
83 // operation[i]->update(mwindow->edl->session->cwindow_meter);
88 operation[i]->update(0);
90 operation[i]->update(1);
99 CPanelProtect::CPanelProtect(MWindow *mwindow, CPanel *gui, int x, int y)
102 mwindow->theme->protect_data,
103 mwindow->edl->session->cwindow_operation == CWINDOW_PROTECT)
105 this->mwindow = mwindow;
107 set_tooltip(_("Protect video from changes"));
109 CPanelProtect::~CPanelProtect()
112 int CPanelProtect::handle_event()
114 gui->subwindow->set_operation(CWINDOW_PROTECT);
123 CPanelMask::CPanelMask(MWindow *mwindow, CPanel *gui, int x, int y)
126 mwindow->theme->mask_data,
127 mwindow->edl->session->cwindow_operation == CWINDOW_MASK)
129 this->mwindow = mwindow;
131 set_tooltip(_("Edit mask"));
133 CPanelMask::~CPanelMask()
136 int CPanelMask::handle_event()
138 gui->subwindow->set_operation(CWINDOW_MASK);
143 CPanelMagnify::CPanelMagnify(MWindow *mwindow, CPanel *gui, int x, int y)
146 mwindow->theme->magnify_data,
147 mwindow->edl->session->cwindow_operation == CWINDOW_ZOOM)
149 this->mwindow = mwindow;
151 set_tooltip(_("Zoom view"));
153 CPanelMagnify::~CPanelMagnify()
156 int CPanelMagnify::handle_event()
158 gui->subwindow->set_operation(CWINDOW_ZOOM);
163 CPanelCamera::CPanelCamera(MWindow *mwindow, CPanel *gui, int x, int y)
166 mwindow->theme->camera_data,
167 mwindow->edl->session->cwindow_operation == CWINDOW_CAMERA)
169 this->mwindow = mwindow;
171 set_tooltip(_("Adjust camera automation"));
173 CPanelCamera::~CPanelCamera()
176 int CPanelCamera::handle_event()
178 gui->subwindow->set_operation(CWINDOW_CAMERA);
183 CPanelProj::CPanelProj(MWindow *mwindow, CPanel *gui, int x, int y)
186 mwindow->theme->proj_data,
187 mwindow->edl->session->cwindow_operation == CWINDOW_PROJECTOR)
189 this->mwindow = mwindow;
191 set_tooltip(_("Adjust projector automation"));
193 CPanelProj::~CPanelProj()
196 int CPanelProj::handle_event()
198 gui->subwindow->set_operation(CWINDOW_PROJECTOR);
203 CPanelCrop::CPanelCrop(MWindow *mwindow, CPanel *gui, int x, int y)
206 mwindow->theme->crop_data,
207 mwindow->edl->session->cwindow_operation == CWINDOW_CROP)
209 this->mwindow = mwindow;
211 set_tooltip(_("Crop a layer or output"));
213 CPanelCrop::~CPanelCrop()
216 int CPanelCrop::handle_event()
218 gui->subwindow->set_operation(CWINDOW_CROP);
225 CPanelToolWindow::CPanelToolWindow(MWindow *mwindow, CPanel *gui, int x, int y)
228 mwindow->theme->tool_data,
229 mwindow->edl->session->tool_window)
231 this->mwindow = mwindow;
233 set_tooltip(_("Show tool info"));
235 CPanelToolWindow::~CPanelToolWindow()
238 int CPanelToolWindow::handle_event()
240 mwindow->edl->session->tool_window = get_value();
241 gui->subwindow->tool_panel->update_show_window();
245 int CPanelToolWindow::set_shown(int shown)
248 mwindow->edl->session->tool_window = shown;
249 gui->subwindow->tool_panel->update_show_window();
254 CPanelTitleSafe::CPanelTitleSafe(MWindow *mwindow, CPanel *gui, int x, int y)
257 mwindow->theme->titlesafe_data,
258 mwindow->edl->session->safe_regions)
260 this->mwindow = mwindow;
262 set_tooltip(_("Show safe regions"));
264 CPanelTitleSafe::~CPanelTitleSafe()
267 int CPanelTitleSafe::handle_event()
269 mwindow->edl->session->safe_regions = get_value();
270 gui->subwindow->canvas->draw_refresh();