4 * Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "awindowgui.h"
23 #include "bcsignals.h"
26 #include "cwindowgui.h"
28 #include "edlsession.h"
29 #include "keyframegui.h"
31 #include "levelwindowgui.h"
33 #include "localsession.h"
35 #include "mainsession.h"
37 #include "meterpanel.h"
38 #include "mwindowgui.h"
40 #include "overlayframe.h"
42 #include "playtransport.h"
43 //#include "presetsgui.h"
44 #include "recordgui.h"
45 #include "recordmonitor.h"
46 #include "resourcepixmap.h"
47 #include "statusbar.h"
50 #include "trackcanvas.h"
52 #include "vwindowgui.h"
60 new VFrame(default_data.get_w(), default_data.get_h(), BC_RGBA8888)
68 theme_title = _(DEFAULT_THEME);
70 mtransport_margin = 0;
73 timebar_cursor_color = RED;
75 BC_WindowBase::get_resources()->bg_color = BLOND;
76 BC_WindowBase::get_resources()->button_up = 0xffc000;
77 BC_WindowBase::get_resources()->button_highlighted = 0xffe000;
78 BC_WindowBase::get_resources()->recursive_resizing = 0;
87 clock_bg_color = BLACK;
88 clock_fg_color = GREEN;
89 assetedit_color = YELLOW;
90 const char *cp = getenv("BC_USE_COMMERCIALS");
91 use_commercials = !cp ? 0 : atoi(cp);
93 preferences_category_overlap = 0;
98 #include "data/about_png.h"
99 about_bg = new VFramePng(about_png);
102 drag_pane_color = WHITE;
104 appendasset_data = 0;
106 asset_append_data = 0;
108 asset_index_data = 0;
110 asset_project_data = 0;
113 camerakeyframe_data = 0;
117 channel_position_data = 0;
118 delete_all_indexes_data = 0;
122 deleteproject_data = 0;
127 edithandlein_data = 0;
128 edithandleout_data = 0;
137 maskkeyframe_data = 0;
138 modekeyframe_data = 0;
147 pankeyframe_data = 0;
151 presentation_data = 0;
152 presentation_loop = 0;
153 presentation_stop = 0;
154 projectorkeyframe_data = 0;
155 redrawindex_data = 0;
164 statusbar_cancel_data = 0;
165 timebar_view_data = 0;
169 vtimebar_bg_data = 0;
173 // Need to delete everything here
178 aspect_ratios.remove_all_objects();
179 frame_rates.remove_all_objects();
180 frame_sizes.remove_all_objects();
181 sample_rates.remove_all_objects();
182 zoom_values.remove_all_objects();
187 void Theme::flush_images()
191 void Theme::initialize()
193 message_normal = BLACK;
196 // Force to use local data for images
197 extern unsigned char _binary_theme_data_start[];
198 set_data(_binary_theme_data_start);
200 // Set images which weren't set by subclass
201 new_image("mode_normal", "mode_normal.png");
202 new_image("mode_add", "mode_add.png");
203 new_image("mode_subtract", "mode_subtract.png");
204 new_image("mode_multiply", "mode_multiply.png");
205 new_image("mode_divide", "mode_divide.png");
206 new_image("mode_replace", "mode_replace.png");
207 new_image("mode_max", "mode_max.png");
208 new_image("mode_min", "mode_min.png");
209 new_image("mode_darken", "mode_darken.png");
210 new_image("mode_lighten", "mode_lighten.png");
211 new_image("mode_dst", "mode_dst.png");
212 new_image("mode_dstatop", "mode_dstatop.png");
213 new_image("mode_dstin", "mode_dstin.png");
214 new_image("mode_dstout", "mode_dstout.png");
215 new_image("mode_dstover", "mode_dstover.png");
216 new_image("mode_src", "mode_src.png");
217 new_image("mode_srcatop", "mode_srcatop.png");
218 new_image("mode_srcin", "mode_srcin.png");
219 new_image("mode_srcout", "mode_srcout.png");
220 new_image("mode_srcover", "mode_srcover.png");
221 new_image("mode_and", "mode_and.png");
222 new_image("mode_or", "mode_or.png");
223 new_image("mode_xor", "mode_xor.png");
224 new_image("mode_overlay", "mode_overlay.png");
225 new_image("mode_screen", "mode_screen.png");
226 new_image("mode_burn", "mode_burn.png");
227 new_image("mode_dodge", "mode_dodge.png");
228 new_image("mode_hardlight", "mode_hardlight.png");
229 new_image("mode_softlight", "mode_softlight.png");
230 new_image("mode_difference", "mode_difference.png");
232 new_image_set("mode_popup", 3, "mode_up.png", "mode_hi.png", "mode_dn.png");
234 // Images all themes have
235 new_image("mwindow_icon", "heroine_icon.png");
236 new_image("vwindow_icon", "heroine_icon.png");
237 new_image("cwindow_icon", "heroine_icon.png");
238 new_image("awindow_icon", "heroine_icon.png");
239 new_image("record_icon", "heroine_icon.png");
240 new_image("clip_icon", "clip_icon.png");
241 new_image_set("mixpatch_data", 5, "mixpatch_up.png", "mixpatch_hi.png",
242 "mixpatch_checked.png", "mixpatch_dn.png", "mixpatch_checkedhi.png");
245 new_image("aeffect_icon", "aeffect_icon.png");
246 new_image("veffect_icon", "veffect_icon.png");
247 new_image("atransition_icon", "atransition_icon.png");
248 new_image("vtransition_icon", "atransition_icon.png");
256 void Theme::build_menus()
258 aspect_ratios.append(new BC_ListBoxItem("3:2"));
259 aspect_ratios.append(new BC_ListBoxItem("4:3"));
260 aspect_ratios.append(new BC_ListBoxItem("16:9"));
261 aspect_ratios.append(new BC_ListBoxItem("2.10:1"));
262 aspect_ratios.append(new BC_ListBoxItem("2.20:1"));
263 aspect_ratios.append(new BC_ListBoxItem("2.25:1"));
264 aspect_ratios.append(new BC_ListBoxItem("2.30:1"));
265 aspect_ratios.append(new BC_ListBoxItem("2.35:1"));
266 aspect_ratios.append(new BC_ListBoxItem("2.66:1"));
268 frame_sizes.append(new BC_ListBoxItem("128x96 "));
269 frame_sizes.append(new BC_ListBoxItem("160x120 "));
270 frame_sizes.append(new BC_ListBoxItem("320x240 "));
271 frame_sizes.append(new BC_ListBoxItem("360x240 "));
272 frame_sizes.append(new BC_ListBoxItem("400x300 "));
273 frame_sizes.append(new BC_ListBoxItem("640x360 nHD"));
274 frame_sizes.append(new BC_ListBoxItem("640x400 "));
275 frame_sizes.append(new BC_ListBoxItem("640x480 VGA"));
276 frame_sizes.append(new BC_ListBoxItem("720x480 NTSC"));
277 frame_sizes.append(new BC_ListBoxItem("720x576 PAL"));
278 frame_sizes.append(new BC_ListBoxItem("768x432 "));
279 frame_sizes.append(new BC_ListBoxItem("800x450 "));
280 frame_sizes.append(new BC_ListBoxItem("800x600 SVGA"));
281 frame_sizes.append(new BC_ListBoxItem("896x504 "));
282 frame_sizes.append(new BC_ListBoxItem("960x540 qHD"));
283 frame_sizes.append(new BC_ListBoxItem("1024x576 "));
284 frame_sizes.append(new BC_ListBoxItem("1024x768 XGA"));
285 frame_sizes.append(new BC_ListBoxItem("1152x648 "));
286 frame_sizes.append(new BC_ListBoxItem("1280x720 HD"));
287 frame_sizes.append(new BC_ListBoxItem("1280x1024 SXGA"));
288 frame_sizes.append(new BC_ListBoxItem("1366x768 WXGA"));
289 frame_sizes.append(new BC_ListBoxItem("1600x900 HD+"));
290 frame_sizes.append(new BC_ListBoxItem("1600x1200 UXGA"));
291 frame_sizes.append(new BC_ListBoxItem("1920x1080 Full HD"));
292 frame_sizes.append(new BC_ListBoxItem("2048x1152 "));
293 frame_sizes.append(new BC_ListBoxItem("2304x1296 "));
294 frame_sizes.append(new BC_ListBoxItem("2560x1440 QHD"));
295 frame_sizes.append(new BC_ListBoxItem("2880x1620 "));
296 frame_sizes.append(new BC_ListBoxItem("3200x1800 QHD+"));
297 frame_sizes.append(new BC_ListBoxItem("3520x1980 "));
298 frame_sizes.append(new BC_ListBoxItem("3840x2160 4K UHD"));
299 frame_sizes.append(new BC_ListBoxItem("4096x2304 Full 4K UHD"));
300 frame_sizes.append(new BC_ListBoxItem("4480x2520 "));
301 frame_sizes.append(new BC_ListBoxItem("5120x2880 5K UHD"));
302 frame_sizes.append(new BC_ListBoxItem("5760x3240 "));
303 frame_sizes.append(new BC_ListBoxItem("6400x3600 "));
304 frame_sizes.append(new BC_ListBoxItem("7040x3960 "));
305 frame_sizes.append(new BC_ListBoxItem("7680x4320 8K UHD"));
307 sample_rates.append(new BC_ListBoxItem("8000"));
308 sample_rates.append(new BC_ListBoxItem("16000"));
309 sample_rates.append(new BC_ListBoxItem("22050"));
310 sample_rates.append(new BC_ListBoxItem("32000"));
311 sample_rates.append(new BC_ListBoxItem("44100"));
312 sample_rates.append(new BC_ListBoxItem("48000"));
313 sample_rates.append(new BC_ListBoxItem("96000"));
314 sample_rates.append(new BC_ListBoxItem("192000"));
316 frame_rates.append(new BC_ListBoxItem("0.25"));
317 frame_rates.append(new BC_ListBoxItem("1"));
318 frame_rates.append(new BC_ListBoxItem("5"));
319 frame_rates.append(new BC_ListBoxItem("10"));
320 frame_rates.append(new BC_ListBoxItem("12"));
321 frame_rates.append(new BC_ListBoxItem("15"));
322 frame_rates.append(new BC_ListBoxItem("23.976"));
323 frame_rates.append(new BC_ListBoxItem("24"));
324 frame_rates.append(new BC_ListBoxItem("25"));
325 frame_rates.append(new BC_ListBoxItem("29.97"));
326 frame_rates.append(new BC_ListBoxItem("30"));
327 frame_rates.append(new BC_ListBoxItem("50"));
328 frame_rates.append(new BC_ListBoxItem("59.94"));
329 frame_rates.append(new BC_ListBoxItem("60"));
330 frame_rates.append(new BC_ListBoxItem("100"));
331 frame_rates.append(new BC_ListBoxItem("120"));
332 frame_rates.append(new BC_ListBoxItem("1000"));
334 char string[BCTEXTLEN];
335 for(int i = 1; i < 17; i++)
337 sprintf(string, "%d", (int)pow(2, i));
338 zoom_values.append(new BC_ListBoxItem(string));
343 void Theme::overlay(VFrame *dst, VFrame *src, int in_x1, int in_x2)
347 unsigned char **in_rows;
348 unsigned char **out_rows;
352 w = MIN(src->get_w(), dst->get_w());
353 h = MIN(dst->get_h(), src->get_h());
360 h = MIN(dst->get_h(), src->get_h());
362 in_rows = src->get_rows();
363 out_rows = dst->get_rows();
365 switch(src->get_color_model())
368 switch(dst->get_color_model())
371 for(int i = 0; i < h; i++)
373 unsigned char *in_row = in_rows[i] + in_x1 * 4;
374 unsigned char *out_row = out_rows[i];
375 for(int j = 0; j < w; j++)
377 int opacity = in_row[3];
378 int transparency = out_row[3] * (0xff - opacity) / 0xff;
379 out_row[0] = (in_row[0] * opacity + out_row[0] * transparency) / 0xff;
380 out_row[1] = (in_row[1] * opacity + out_row[1] * transparency) / 0xff;
381 out_row[2] = (in_row[2] * opacity + out_row[2] * transparency) / 0xff;
382 out_row[3] = MAX(in_row[3], out_row[3]);
389 for(int i = 0; i < h; i++)
391 unsigned char *in_row = in_rows[i] + in_x1 * 4;
392 unsigned char *out_row = out_rows[i];
393 for(int j = 0; j < w; j++)
395 int opacity = in_row[3];
396 int transparency = 0xff - opacity;
397 out_row[0] = (in_row[0] * opacity + out_row[0] * transparency) / 0xff;
398 out_row[1] = (in_row[1] * opacity + out_row[1] * transparency) / 0xff;
399 out_row[2] = (in_row[2] * opacity + out_row[2] * transparency) / 0xff;
410 void Theme::build_transport(char *title,
411 unsigned char *png_overlay,
415 if(!png_overlay) return;
416 VFramePng default_data(png_overlay);
418 data[0] = NEW_VFRAME;
419 data[1] = NEW_VFRAME;
420 data[2] = NEW_VFRAME;
421 data[0]->clear_frame();
422 data[1]->clear_frame();
423 data[2]->clear_frame();
425 for(int i = 0; i < 3; i++)
429 if(!bg_data[i]) break;
435 in_x2 = default_data.get_w();
439 in_x1 = (int)(bg_data[i]->get_w() * 0.33);
440 in_x2 = in_x1 + default_data.get_w();
444 in_x1 = bg_data[i]->get_w() - default_data.get_w();
445 in_x2 = in_x1 + default_data.get_w();
449 overlay(data[i], bg_data[i], in_x1, in_x2);
450 overlay(data[i], &default_data);
453 new_image_set_images(title, 3, data[0], data[1], data[2]);
464 void Theme::build_patches(VFrame** &data,
465 unsigned char *png_overlay,
469 if(!png_overlay || !bg_data) return;
470 VFramePng default_data(png_overlay);
471 data = new VFrame*[5];
472 data[0] = NEW_VFRAME;
473 data[1] = NEW_VFRAME;
474 data[2] = NEW_VFRAME;
475 data[3] = NEW_VFRAME;
476 data[4] = NEW_VFRAME;
478 for(int i = 0; i < 5; i++)
488 in_x2 = default_data.get_w();
492 in_x1 = (int)(bg_data[i]->get_w() * 0.33);
493 in_x2 = in_x1 + default_data.get_w();
497 in_x1 = bg_data[i]->get_w() - default_data.get_w();
498 in_x2 = in_x1 + default_data.get_w();
516 void Theme::build_button(VFrame** &data,
517 unsigned char *png_overlay,
522 if(!png_overlay) return;
523 VFramePng default_data(png_overlay);
525 if(!up_vframe || !hi_vframe || !dn_vframe) return;
526 data = new VFrame*[3];
527 data[0] = NEW_VFRAME;
528 data[1] = NEW_VFRAME;
529 data[2] = NEW_VFRAME;
530 data[0]->copy_from(up_vframe);
531 data[1]->copy_from(hi_vframe);
532 data[2]->copy_from(dn_vframe);
533 for(int i = 0; i < 3; i++)
538 void Theme::build_button(VFrame** &data,
539 unsigned char *png_overlay,
545 if(!png_overlay) return;
546 VFramePng default_data(png_overlay);
548 if(!up_vframe || !hi_vframe || !dn_vframe) return;
549 data = new VFrame*[4];
550 data[0] = NEW_VFRAME;
551 data[1] = NEW_VFRAME;
552 data[2] = NEW_VFRAME;
553 data[3] = NEW_VFRAME;
554 data[0]->copy_from(up_vframe);
555 data[1]->copy_from(hi_vframe);
556 data[2]->copy_from(dn_vframe);
557 data[2]->copy_from(at_vframe);
558 for(int i = 0; i < 4; i++)
563 void Theme::build_toggle(VFrame** &data,
564 unsigned char *png_overlay,
567 VFrame *checked_vframe,
569 VFrame *checkedhi_vframe)
576 !checkedhi_vframe) return;
577 VFramePng default_data(png_overlay);
578 data = new VFrame*[5];
579 data[0] = NEW_VFRAME;
580 data[1] = NEW_VFRAME;
581 data[2] = NEW_VFRAME;
582 data[3] = NEW_VFRAME;
583 data[4] = NEW_VFRAME;
584 data[0]->copy_from(up_vframe);
585 data[1]->copy_from(hi_vframe);
586 data[2]->copy_from(checked_vframe);
587 data[3]->copy_from(dn_vframe);
588 data[4]->copy_from(checkedhi_vframe);
589 for(int i = 0; i < 5; i++)
595 void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
598 mbuttons_y = gui->menu_h() + 1;
599 mbuttons_w = gui->menu_w();
600 mbuttons_h = get_image("mbutton_bg")->get_h();
601 mclock_x = window_border - 5;
602 mclock_y = mbuttons_y - 1 + mbuttons_h;
603 mclock_w = get_image("clock_bg")->get_w() - 20;
604 mclock_h = get_image("clock_bg")->get_h();
605 mtimebar_x = get_image("patchbay_bg")->get_w();
606 mtimebar_y = mbuttons_y - 1 + mbuttons_h;
607 mtimebar_w = w - mtimebar_x;
608 mtimebar_h = get_image("timebar_bg")->get_h();
611 mzoom_y = h - get_image("statusbar")->get_h();
614 mstatus_y = mzoom_y + mzoom_h;
616 mstatus_h = h - mstatus_y;
617 mstatus_message_x = 10;
618 mstatus_message_y = 5;
619 mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
620 mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - 3;
621 mstatus_progress_w = 230;
622 mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
623 mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
625 mcanvas_y = mbuttons_y - 1 + mbuttons_h;
627 mcanvas_h = mzoom_y - mtimebar_y;
628 control_pixels = (mcanvas_w * control_pixels) / 1000;
630 patchbay_y = mcanvas_y + mclock_h;
631 patchbay_w = get_image("patchbay_bg")->get_w();
632 patchbay_h = mcanvas_h - mclock_h;
633 pane_w = get_image_set("xpane")[0]->get_w();
634 pane_h = get_image_set("ypane")[0]->get_h();
635 pane_x = mcanvas_x + mcanvas_w;
636 pane_y = mcanvas_y + mcanvas_h;
638 mhscroll_y = mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ);
639 mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT);
640 mvscroll_x = mcanvas_x + mcanvas_w;
641 mvscroll_y = mcanvas_y;
642 mvscroll_h = mcanvas_h;
645 void Theme::get_pane_sizes(MWindowGUI *gui,
662 if(number == TOP_LEFT_PANE ||
663 number == BOTTOM_LEFT_PANE)
665 *view_x += patchbay_w;
666 *view_w -= patchbay_w;
670 if(number == TOP_LEFT_PANE ||
671 number == TOP_RIGHT_PANE)
673 *view_y += mtimebar_h;
674 *view_h -= mtimebar_h;
678 if(number == BOTTOM_LEFT_PANE ||
679 number == BOTTOM_RIGHT_PANE ||
680 gui->horizontal_panes() ||
681 gui->total_panes() == 1)
683 *view_h -= BC_ScrollBar::get_span(SCROLL_HORIZ);
687 if(number == TOP_RIGHT_PANE ||
688 number == BOTTOM_RIGHT_PANE ||
689 gui->vertical_panes() ||
690 gui->total_panes() == 1)
692 *view_w -= BC_ScrollBar::get_span(SCROLL_VERT);
696 void Theme::draw_mwindow_bg(MWindowGUI *gui)
701 void Theme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
703 int total_buttons = !use_commercials ? 15 : 16;
704 int edit_w = EditPanel::calculate_w(mwindow, 1, total_buttons);
705 int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
706 int zoom_w = ZoomPanel::calculate_w(czoom_w);
707 int status_w = get_image("cwindow_active")->get_w();
708 // Space between buttons & status icon
716 if(mwindow->edl->session->cwindow_meter)
718 cmeter_x = mwindow->session->cwindow_w -
719 MeterPanel::get_meters_width(this,
720 mwindow->edl->session->audio_channels,
721 mwindow->edl->session->cwindow_meter);
725 cmeter_x = mwindow->session->cwindow_w + widget_border;
732 transport_w + widget_border +
733 zoom_w + widget_border +
737 buttons_h = get_image("cbuttons_left")->get_h();
739 cedit_x = widget_border;
740 cedit_y = mwindow->session->cwindow_h -
745 ctransport_x = widget_border;
746 ctransport_y = mwindow->session->cwindow_h -
747 get_image_set("autokeyframe")[0]->get_h() -
750 czoom_x = ctransport_x + transport_w + widget_border;
751 czoom_y = ctransport_y + widget_border;
754 cstatus_y = mwindow->session->cwindow_h -
755 get_image("cwindow_active")->get_h() - 30;
759 buttons_h = ctimebar_h +
761 EditPanel::calculate_h(mwindow) +
763 ctransport_x = widget_border;
764 ctransport_y = mwindow->session->cwindow_h -
769 cedit_x = ctransport_x + transport_w + widget_border;
770 cedit_y = ctransport_y;
772 czoom_x = cedit_x + edit_w + widget_border;
773 czoom_y = cedit_y + widget_border;
774 //printf("Theme::get_cwindow_sizes %d %d %d\n", __LINE__, czoom_x, zoom_w);
775 cstatus_x = czoom_x + zoom_w + division_w;
776 cstatus_y = ctransport_y;
782 ccomposite_w = get_image("cpanel_bg")->get_w();
783 ccomposite_h = mwindow->session->cwindow_h - buttons_h;
791 ccanvas_x = ccomposite_x + ccomposite_w;
793 ccanvas_h = ccomposite_h;
796 ccanvas_w = cmeter_x - ccanvas_x - widget_border;
803 ccomposite_x = -get_image("cpanel_bg")->get_w();
805 ccomposite_w = get_image("cpanel_bg")->get_w();
806 ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h();
809 cedit_y = mwindow->session->cwindow_h + 17;
811 ctransport_y = cedit_y + 40;
814 ccanvas_w = mwindow->session->cwindow_w;
815 ccanvas_h = mwindow->session->cwindow_h;
816 cmeter_x = mwindow->session->cwindow_w;
817 cstatus_x = mwindow->session->cwindow_w;
818 cstatus_y = mwindow->session->cwindow_h;
819 czoom_x = mwindow->session->cwindow_w;
820 czoom_y = mwindow->session->cwindow_h;
827 cmeter_y = widget_border;
828 cmeter_h = mwindow->session->cwindow_h - cmeter_y - widget_border;
830 // ctimebar_x = ccanvas_x;
831 // ctimebar_y = ccanvas_y + ccanvas_h;
832 // ctimebar_w = ccanvas_w;
834 ctimebar_y = ccanvas_y + ccanvas_h;
835 ctimebar_w = mwindow->session->cwindow_w;
836 if(mwindow->edl->session->cwindow_meter)
838 ctimebar_w = cmeter_x - widget_border;
848 void Theme::draw_awindow_bg(AWindowGUI *gui)
850 gui->clear_box(0, 0, mwindow->session->awindow_w, mwindow->session->awindow_h);
854 void Theme::draw_vwindow_bg(VWindowGUI *gui)
858 // mwindow->session->vwindow_w,
859 // mwindow->session->vwindow_h);
861 // gui->draw_3segmenth(vtimebar_x,
870 void Theme::draw_cwindow_bg(CWindowGUI *gui)
872 gui->clear_box(0, 0, mwindow->session->cwindow_w, mwindow->session->cwindow_h);
876 void Theme::draw_lwindow_bg(LevelWindowGUI *gui)
878 gui->clear_box(0, 0, mwindow->session->lwindow_w, mwindow->session->lwindow_h);
883 void Theme::draw_rmonitor_bg(RecordMonitorGUI *gui)
885 gui->clear_box(0, 0, mwindow->session->rmonitor_w, mwindow->session->rmonitor_h);
890 void Theme::draw_rwindow_bg(RecordGUI *gui)
892 gui->clear_box(0, 0, mwindow->session->rwindow_w, mwindow->session->rwindow_h);
896 void Theme::draw_resource_bg(TrackCanvas *canvas,
897 ResourcePixmap *pixmap,
908 switch(mwindow->edl->local_session->zoom_track)
910 case 1024: image = get_image("resource1024"); break;
911 case 512: image = get_image("resource512"); break;
912 case 256: image = get_image("resource256"); break;
913 case 128: image = get_image("resource128"); break;
914 case 64: image = get_image("resource64"); break;
916 case 32: image = get_image("resource32"); break;
919 canvas->draw_3segmenth(x1,
929 void Theme::get_vwindow_sizes(VWindowGUI *gui)
931 int edit_w = EditPanel::calculate_w(mwindow, 0, 10);
932 int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
933 // Space between buttons & time
937 int vtime_border = 15;
939 vmeter_y = widget_border;
940 vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border;
943 if(mwindow->edl->session->vwindow_meter)
945 vmeter_x = mwindow->session->vwindow_w -
946 MeterPanel::get_meters_width(this,
947 mwindow->edl->session->audio_channels,
948 mwindow->edl->session->vwindow_meter);
952 vmeter_x = mwindow->session->vwindow_w + widget_border;
957 vcanvas_w = vmeter_x - vcanvas_x - widget_border;
961 transport_w + widget_border +
962 vtime_w + division_w +
963 vtime_border > vmeter_x)
965 buttons_h = get_image("vbuttons_left")->get_h();
966 vedit_x = widget_border;
967 vedit_y = mwindow->session->vwindow_h -
972 vtransport_x = widget_border;
973 vtransport_y = mwindow->session->vwindow_h -
974 get_image_set("autokeyframe")[0]->get_h() -
978 vtime_x = vedit_x + 20; //vdivision_x;
979 vtime_y = vedit_y + 30; //+ 20;
983 buttons_h = vtimebar_h +
985 EditPanel::calculate_h(mwindow) +
987 vtransport_x = widget_border;
988 vtransport_y = mwindow->session->vwindow_h -
993 vedit_x = vtransport_x + transport_w + widget_border;
994 vedit_y = vtransport_y;
996 vdivision_x = vedit_x + edit_w + division_w;
997 vtime_x = vdivision_x + vtime_border;
998 vtime_y = vedit_y + widget_border;
1002 // vtimebar_x = vcanvas_x;
1003 // vtimebar_y = vcanvas_y + vcanvas_h;
1004 // vtimebar_w = vcanvas_w;
1006 vcanvas_h = mwindow->session->vwindow_h - buttons_h;
1008 vtimebar_y = vcanvas_y + vcanvas_h;
1009 vtimebar_w = vmeter_x - widget_border;
1014 void Theme::get_awindow_sizes(AWindowGUI *gui)
1019 // afolders_y = deletedisk_data[0]->get_h();
1021 afolders_w = mwindow->session->afolders_w;
1022 afolders_h = mwindow->session->awindow_h - afolders_y;
1023 adivider_x = afolders_x + afolders_w;
1026 adivider_h = afolders_h;
1027 alist_x = afolders_x + afolders_w + 5;
1028 alist_y = afolders_y;
1029 alist_w = mwindow->session->awindow_w - alist_x;
1030 alist_h = afolders_h;
1033 void Theme::get_rmonitor_sizes(int do_audio,
1046 rmonitor_canvas_y = 30;
1052 rmonitor_canvas_y = 0;
1061 rmonitor_channel_x = x;
1062 rmonitor_channel_y = 5;
1064 rmonitor_canvas_y = 35;
1070 rmonitor_interlace_x = x;
1071 rmonitor_interlace_y = y;
1079 rmonitor_meter_x = mwindow->session->rmonitor_w -
1080 MeterPanel::get_meters_width(this, audio_channels, 1);
1081 rmonitor_meter_w = mwindow->session->rmonitor_w;
1085 rmonitor_meter_x = widget_border;
1086 rmonitor_meter_w = mwindow->session->rmonitor_w - widget_border * 2;
1089 rmonitor_meter_y = 40;
1090 rmonitor_meter_h = mwindow->session->rmonitor_h - 10 - rmonitor_meter_y;
1094 rmonitor_meter_x = mwindow->session->rmonitor_w;
1097 rmonitor_canvas_x = 0;
1098 rmonitor_canvas_w = rmonitor_meter_x - rmonitor_canvas_x;
1099 if(do_audio) rmonitor_canvas_w -= 10;
1100 rmonitor_canvas_h = mwindow->session->rmonitor_h - rmonitor_canvas_y;
1102 if(!do_video && do_audio)
1104 rmonitor_meter_y -= 30;
1105 rmonitor_meter_h += 30;
1110 void Theme::get_recordgui_sizes(RecordGUI *gui, int w, int h)
1114 void Theme::get_batchrender_sizes(BatchRenderGUI *gui,
1118 batchrender_x1 = 10;
1119 batchrender_x2 = 300;
1120 batchrender_x3 = 400;
1123 void Theme::get_plugindialog_sizes()
1126 plugindialog_new_x = x;
1127 plugindialog_new_y = y;
1128 plugindialog_shared_x = mwindow->session->plugindialog_w / 3;
1129 plugindialog_shared_y = y;
1130 plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3;
1131 plugindialog_module_y = y;
1133 plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10;
1134 plugindialog_new_h = mwindow->session->plugindialog_h - 100;
1135 plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10;
1136 plugindialog_shared_h = mwindow->session->plugindialog_h - 100;
1137 plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10;
1138 plugindialog_module_h = mwindow->session->plugindialog_h - 100;
1140 plugindialog_newattach_x = plugindialog_new_x + 20;
1141 plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10;
1142 plugindialog_sharedattach_x = plugindialog_shared_x + 20;
1143 plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10;
1144 plugindialog_moduleattach_x = plugindialog_module_x + 20;
1145 plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10;
1148 // void Theme::get_presetdialog_sizes(PresetsWindow *gui)
1150 // int x = window_border;
1151 // int y = window_border + BC_Title::calculate_h(gui, "P") + widget_border;
1153 // presets_list_x = x;
1154 // presets_list_y = y;
1155 // presets_list_w = mwindow->session->presetdialog_w / 2;
1156 // presets_list_h = mwindow->session->presetdialog_h -
1157 // BC_OKButton::calculate_h() -
1161 // presets_text_x = presets_list_x + presets_list_w + widget_border;
1162 // presets_text_y = y;
1163 // presets_text_w = mwindow->session->presetdialog_w - presets_text_x - window_border;
1164 // y += BC_TextBox::calculate_h(gui,
1167 // 1) + widget_border;
1169 // presets_delete_x = presets_text_x;
1170 // presets_delete_y = y;
1171 // y += BC_GenericButton::calculate_h() + widget_border;
1173 // presets_save_x = presets_text_x;
1174 // presets_save_y = y;
1175 // y += BC_GenericButton::calculate_h() + widget_border;
1177 // presets_apply_x = presets_text_x;
1178 // presets_apply_y = y;
1179 // y += BC_GenericButton::calculate_h();
1182 void Theme::get_keyframedialog_sizes(KeyFrameWindow *gui)
1184 int x = window_border;
1185 int y = window_border +
1186 BC_Title::calculate_h(gui, "P", LARGEFONT) +
1191 #ifdef EDIT_KEYFRAME
1192 presets_list_w = mwindow->session->keyframedialog_w / 2 -
1196 presets_list_w = mwindow->session->keyframedialog_w -
1200 presets_list_h = mwindow->session->keyframedialog_h -
1201 BC_OKButton::calculate_h() -
1205 BC_Title::calculate_h(gui, "P") -
1207 BC_TextBox::calculate_h(gui,
1212 (BC_GenericButton::calculate_h() + widget_border) * 3 -
1214 y += presets_list_h + widget_border + widget_border + BC_Title::calculate_h(gui, "P");
1217 presets_text_w = presets_list_w;
1218 y += BC_TextBox::calculate_h(gui,
1223 presets_delete_x = presets_text_x;
1224 presets_delete_y = y;
1225 y += BC_GenericButton::calculate_h() + widget_border;
1227 presets_save_x = presets_text_x;
1229 y += BC_GenericButton::calculate_h() + widget_border;
1231 presets_apply_x = presets_text_x;
1232 presets_apply_y = y;
1233 y += BC_GenericButton::calculate_h();
1235 #ifdef EDIT_KEYFRAME
1236 x = mwindow->session->keyframedialog_w / 2 + widget_border;
1238 BC_Title::calculate_h(gui, "P", LARGEFONT) +
1241 keyframe_list_x = x;
1242 keyframe_list_y = y;
1243 keyframe_list_w = mwindow->session->keyframedialog_w / 2 -
1246 keyframe_list_h = mwindow->session->keyframedialog_h -
1250 BC_Title::calculate_h(gui, "P") -
1252 BC_TextBox::calculate_h(gui,
1257 BC_Title::calculate_h(gui, "P") -
1259 BC_OKButton::calculate_h() -
1261 // keyframe_text_x = keyframe_list_x + keyframe_list_w + widget_border;
1262 // keyframe_text_y = y;
1263 // keyframe_text_w = mwindow->session->keyframedialog_w - keyframe_text_x - window_border;
1264 // y += BC_TextBox::calculate_h(gui,
1267 // 1) + widget_border;
1270 y += keyframe_list_h + BC_Title::calculate_h(gui, "P") + widget_border + widget_border;
1271 keyframe_value_x = keyframe_list_x;
1272 keyframe_value_y = y;
1273 keyframe_value_w = keyframe_list_w;
1274 y += BC_TextBox::calculate_h(gui,
1279 keyframe_all_x = keyframe_value_x;
1287 void Theme::get_menueffect_sizes(int use_list)
1291 menueffect_list_x = 10;
1292 menueffect_list_y = 10;
1293 menueffect_list_w = mwindow->session->menueffect_w - 400;
1294 menueffect_list_h = mwindow->session->menueffect_h -
1296 BC_OKButton::calculate_h() - 10;
1300 menueffect_list_x = 0;
1301 menueffect_list_y = 10;
1302 menueffect_list_w = 0;
1303 menueffect_list_h = 0;
1306 menueffect_file_x = menueffect_list_x + menueffect_list_w + 10;
1307 menueffect_file_y = 10;
1309 menueffect_tools_x = menueffect_file_x;
1310 menueffect_tools_y = menueffect_file_y + 20;
1313 void Theme::get_preferences_sizes()
1317 void Theme::draw_preferences_bg(PreferencesWindow *gui)
1321 void Theme::get_new_sizes(NewWindow *gui)
1325 void Theme::draw_new_bg(NewWindow *gui)
1329 void Theme::draw_setformat_bg(SetFormatWindow *window)