2 #include "cwindowgui.h"
3 #include "cwindowtool.h"
5 #include "edlsession.h"
12 #define _(String) gettext(String)
13 #define gettext_noop(String) String
14 #define N_(String) gettext_noop (String)
17 CPanel::CPanel(MWindow *mwindow,
18 CWindowGUI *subwindow,
24 this->mwindow = mwindow;
25 this->subwindow = subwindow;
36 int CPanel::create_objects()
38 int x = this->x, y = this->y;
39 subwindow->add_subwindow(operation[CWINDOW_PROTECT] = new CPanelProtect(mwindow, this, x, y));
40 y += operation[CWINDOW_PROTECT]->get_h();
41 subwindow->add_subwindow(operation[CWINDOW_ZOOM] = new CPanelMagnify(mwindow, this, x, y));
42 y += operation[CWINDOW_ZOOM]->get_h();
43 subwindow->add_subwindow(operation[CWINDOW_MASK] = new CPanelMask(mwindow, this, x, y));
44 y += operation[CWINDOW_MASK]->get_h();
45 subwindow->add_subwindow(operation[CWINDOW_CAMERA] = new CPanelCamera(mwindow, this, x, y));
46 y += operation[CWINDOW_CAMERA]->get_h();
47 subwindow->add_subwindow(operation[CWINDOW_PROJECTOR] = new CPanelProj(mwindow, this, x, y));
48 y += operation[CWINDOW_PROJECTOR]->get_h();
49 subwindow->add_subwindow(operation[CWINDOW_CROP] = new CPanelCrop(mwindow, this, x, y));
50 y += operation[CWINDOW_CROP]->get_h();
51 subwindow->add_subwindow(operation[CWINDOW_TOOL_WINDOW] = new CPanelToolWindow(mwindow, this, x, y));
52 y += operation[CWINDOW_TOOL_WINDOW]->get_h();
53 subwindow->add_subwindow(operation[CWINDOW_TITLESAFE] = new CPanelTitleSafe(mwindow, this, x, y));
57 void CPanel::reposition_buttons(int x, int y)
62 for(int i = 0; i < CPANEL_OPERATIONS; i++)
64 operation[i]->reposition_window(x, y);
65 y += operation[i]->get_h();
70 void CPanel::set_operation(int value)
72 for(int i = 0; i < CPANEL_OPERATIONS; i++)
74 if(i == CWINDOW_TOOL_WINDOW)
76 operation[i]->update(mwindow->edl->session->tool_window);
79 if(i == CWINDOW_TITLESAFE)
81 operation[i]->update(mwindow->edl->session->safe_regions);
84 // if(i == CWINDOW_SHOW_METERS)
86 // operation[i]->update(mwindow->edl->session->cwindow_meter);
91 operation[i]->update(0);
93 operation[i]->update(1);
102 CPanelProtect::CPanelProtect(MWindow *mwindow, CPanel *gui, int x, int y)
105 mwindow->theme->protect_data,
106 mwindow->edl->session->cwindow_operation == CWINDOW_PROTECT)
108 this->mwindow = mwindow;
110 set_tooltip(_("Protect video from changes"));
112 CPanelProtect::~CPanelProtect()
115 int CPanelProtect::handle_event()
117 gui->subwindow->set_operation(CWINDOW_PROTECT);
126 CPanelMask::CPanelMask(MWindow *mwindow, CPanel *gui, int x, int y)
129 mwindow->theme->mask_data,
130 mwindow->edl->session->cwindow_operation == CWINDOW_MASK)
132 this->mwindow = mwindow;
134 set_tooltip(_("Edit mask"));
136 CPanelMask::~CPanelMask()
139 int CPanelMask::handle_event()
141 gui->subwindow->set_operation(CWINDOW_MASK);
146 CPanelMagnify::CPanelMagnify(MWindow *mwindow, CPanel *gui, int x, int y)
149 mwindow->theme->magnify_data,
150 mwindow->edl->session->cwindow_operation == CWINDOW_ZOOM)
152 this->mwindow = mwindow;
154 set_tooltip(_("Zoom view"));
156 CPanelMagnify::~CPanelMagnify()
159 int CPanelMagnify::handle_event()
161 gui->subwindow->set_operation(CWINDOW_ZOOM);
166 CPanelCamera::CPanelCamera(MWindow *mwindow, CPanel *gui, int x, int y)
169 mwindow->theme->camera_data,
170 mwindow->edl->session->cwindow_operation == CWINDOW_CAMERA)
172 this->mwindow = mwindow;
174 set_tooltip(_("Adjust camera automation"));
176 CPanelCamera::~CPanelCamera()
179 int CPanelCamera::handle_event()
181 gui->subwindow->set_operation(CWINDOW_CAMERA);
186 CPanelProj::CPanelProj(MWindow *mwindow, CPanel *gui, int x, int y)
189 mwindow->theme->proj_data,
190 mwindow->edl->session->cwindow_operation == CWINDOW_PROJECTOR)
192 this->mwindow = mwindow;
194 set_tooltip(_("Adjust projector automation"));
196 CPanelProj::~CPanelProj()
199 int CPanelProj::handle_event()
201 gui->subwindow->set_operation(CWINDOW_PROJECTOR);
206 CPanelCrop::CPanelCrop(MWindow *mwindow, CPanel *gui, int x, int y)
209 mwindow->theme->crop_data,
210 mwindow->edl->session->cwindow_operation == CWINDOW_CROP)
212 this->mwindow = mwindow;
214 set_tooltip(_("Crop a layer or output"));
216 CPanelCrop::~CPanelCrop()
219 int CPanelCrop::handle_event()
221 gui->subwindow->set_operation(CWINDOW_CROP);
228 CPanelToolWindow::CPanelToolWindow(MWindow *mwindow, CPanel *gui, int x, int y)
231 mwindow->theme->tool_data,
232 mwindow->edl->session->tool_window)
234 this->mwindow = mwindow;
236 set_tooltip(_("Show tool info"));
238 CPanelToolWindow::~CPanelToolWindow()
241 int CPanelToolWindow::handle_event()
243 mwindow->edl->session->tool_window = get_value();
244 gui->subwindow->tool_panel->update_show_window();
249 CPanelTitleSafe::CPanelTitleSafe(MWindow *mwindow, CPanel *gui, int x, int y)
252 mwindow->theme->titlesafe_data,
253 mwindow->edl->session->safe_regions)
255 this->mwindow = mwindow;
257 set_tooltip(_("Show safe regions"));
259 CPanelTitleSafe::~CPanelTitleSafe()
262 int CPanelTitleSafe::handle_event()
264 mwindow->edl->session->safe_regions = get_value();
265 gui->subwindow->canvas->draw_refresh();