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(0, -1, default_data.get_w(), default_data.get_h(), BC_RGBA8888, -1)
68 theme_title = DEFAULT_THEME;
72 mtransport_margin = 0;
75 timebar_cursor_color = RED;
77 BC_WindowBase::get_resources()->bg_color = BLOND;
78 BC_WindowBase::get_resources()->button_up = 0xffc000;
79 BC_WindowBase::get_resources()->button_highlighted = 0xffe000;
80 BC_WindowBase::get_resources()->recursive_resizing = 0;
89 clock_bg_color = BLACK;
90 assetedit_color = YELLOW;
91 const char *cp = getenv("BC_USE_COMMERCIALS");
92 use_commercials = !cp ? 0 : atoi(cp);
94 preferences_category_overlap = 0;
99 #include "data/about_png.h"
100 about_bg = new VFramePng(about_png);
103 drag_pane_color = WHITE;
105 appendasset_data = 0;
107 asset_append_data = 0;
109 asset_index_data = 0;
111 asset_project_data = 0;
114 camerakeyframe_data = 0;
118 channel_position_data = 0;
119 delete_all_indexes_data = 0;
123 deleteproject_data = 0;
128 edithandlein_data = 0;
129 edithandleout_data = 0;
138 maskkeyframe_data = 0;
139 modekeyframe_data = 0;
148 pankeyframe_data = 0;
152 presentation_data = 0;
153 presentation_loop = 0;
154 presentation_stop = 0;
155 projectorkeyframe_data = 0;
156 redrawindex_data = 0;
165 statusbar_cancel_data = 0;
166 timebar_view_data = 0;
170 vtimebar_bg_data = 0;
174 // Need to delete everything here
179 aspect_ratios.remove_all_objects();
180 frame_rates.remove_all_objects();
181 frame_sizes.remove_all_objects();
182 sample_rates.remove_all_objects();
183 zoom_values.remove_all_objects();
188 void Theme::flush_images()
190 if(data_buffer) delete [] data_buffer;
191 if(contents_buffer) delete [] contents_buffer;
194 contents.remove_all();
197 void Theme::initialize()
199 message_normal = BLACK;
202 // Force to use local data for images
203 extern unsigned char _binary_theme_data_start[];
204 set_data(_binary_theme_data_start);
206 // Set images which weren't set by subclass
207 new_image("mode_normal", "mode_normal.png");
208 new_image("mode_add", "mode_add.png");
209 new_image("mode_subtract", "mode_subtract.png");
210 new_image("mode_multiply", "mode_multiply.png");
211 new_image("mode_divide", "mode_divide.png");
212 new_image("mode_replace", "mode_replace.png");
213 new_image("mode_max", "mode_max.png");
214 new_image("mode_min", "mode_min.png");
215 new_image("mode_darken", "mode_darken.png");
216 new_image("mode_lighten", "mode_lighten.png");
217 new_image("mode_dst", "mode_dst.png");
218 new_image("mode_dstatop", "mode_dstatop.png");
219 new_image("mode_dstin", "mode_dstin.png");
220 new_image("mode_dstout", "mode_dstout.png");
221 new_image("mode_dstover", "mode_dstover.png");
222 new_image("mode_src", "mode_src.png");
223 new_image("mode_srcatop", "mode_srcatop.png");
224 new_image("mode_srcin", "mode_srcin.png");
225 new_image("mode_srcout", "mode_srcout.png");
226 new_image("mode_srcover", "mode_srcover.png");
227 new_image("mode_and", "mode_and.png");
228 new_image("mode_or", "mode_or.png");
229 new_image("mode_xor", "mode_xor.png");
230 new_image("mode_overlay", "mode_overlay.png");
231 new_image("mode_screen", "mode_screen.png");
232 new_image("mode_burn", "mode_burn.png");
233 new_image("mode_dodge", "mode_dodge.png");
234 new_image("mode_hardlight", "mode_hardlight.png");
235 new_image("mode_softlight", "mode_softlight.png");
236 new_image("mode_difference", "mode_difference.png");
238 new_image_set("mode_popup", 3, "mode_up.png", "mode_hi.png", "mode_dn.png");
240 // Images all themes have
241 new_image("mwindow_icon", "heroine_icon.png");
242 new_image("vwindow_icon", "heroine_icon.png");
243 new_image("cwindow_icon", "heroine_icon.png");
244 new_image("awindow_icon", "heroine_icon.png");
245 new_image("record_icon", "heroine_icon.png");
246 new_image("clip_icon", "clip_icon.png");
249 new_image("aeffect_icon", "aeffect_icon.png");
250 new_image("veffect_icon", "veffect_icon.png");
251 new_image("atransition_icon", "atransition_icon.png");
252 new_image("vtransition_icon", "atransition_icon.png");
260 void Theme::build_menus()
262 aspect_ratios.append(new BC_ListBoxItem("3:2"));
263 aspect_ratios.append(new BC_ListBoxItem("4:3"));
264 aspect_ratios.append(new BC_ListBoxItem("16:9"));
265 aspect_ratios.append(new BC_ListBoxItem("2.10:1"));
266 aspect_ratios.append(new BC_ListBoxItem("2.20:1"));
267 aspect_ratios.append(new BC_ListBoxItem("2.25:1"));
268 aspect_ratios.append(new BC_ListBoxItem("2.30:1"));
269 aspect_ratios.append(new BC_ListBoxItem("2.35:1"));
270 aspect_ratios.append(new BC_ListBoxItem("2.66:1"));
272 frame_sizes.append(new BC_ListBoxItem("128x96"));
273 frame_sizes.append(new BC_ListBoxItem("160x120"));
274 frame_sizes.append(new BC_ListBoxItem("176x144"));
275 frame_sizes.append(new BC_ListBoxItem("240x180"));
276 frame_sizes.append(new BC_ListBoxItem("320x200"));
277 frame_sizes.append(new BC_ListBoxItem("320x240"));
278 frame_sizes.append(new BC_ListBoxItem("352x288"));
279 frame_sizes.append(new BC_ListBoxItem("360x240"));
280 frame_sizes.append(new BC_ListBoxItem("400x300"));
281 frame_sizes.append(new BC_ListBoxItem("424x318"));
282 frame_sizes.append(new BC_ListBoxItem("512x384"));
283 frame_sizes.append(new BC_ListBoxItem("640x350"));
284 frame_sizes.append(new BC_ListBoxItem("640x480"));
285 frame_sizes.append(new BC_ListBoxItem("704x576"));
286 frame_sizes.append(new BC_ListBoxItem("720x480"));
287 frame_sizes.append(new BC_ListBoxItem("720x576"));
288 frame_sizes.append(new BC_ListBoxItem("800x600"));
289 frame_sizes.append(new BC_ListBoxItem("852x480"));
290 frame_sizes.append(new BC_ListBoxItem("852x480"));
291 frame_sizes.append(new BC_ListBoxItem("960x540"));
292 frame_sizes.append(new BC_ListBoxItem("960x1080"));
293 frame_sizes.append(new BC_ListBoxItem("1024x768"));
294 frame_sizes.append(new BC_ListBoxItem("1280x720"));
295 frame_sizes.append(new BC_ListBoxItem("1280x1024"));
296 frame_sizes.append(new BC_ListBoxItem("1368x768"));
297 frame_sizes.append(new BC_ListBoxItem("1408x1152"));
298 frame_sizes.append(new BC_ListBoxItem("1600x1024"));
299 frame_sizes.append(new BC_ListBoxItem("1600x1200"));
300 frame_sizes.append(new BC_ListBoxItem("1920x1080"));
301 frame_sizes.append(new BC_ListBoxItem("1920x1088"));
302 frame_sizes.append(new BC_ListBoxItem("1920x1200"));
303 frame_sizes.append(new BC_ListBoxItem("2048x1536"));
304 frame_sizes.append(new BC_ListBoxItem("2560x1600"));
305 frame_sizes.append(new BC_ListBoxItem("2560x2048"));
306 frame_sizes.append(new BC_ListBoxItem("3200x2048"));
307 frame_sizes.append(new BC_ListBoxItem("3840x2400"));
308 frame_sizes.append(new BC_ListBoxItem("5120x4096"));
309 frame_sizes.append(new BC_ListBoxItem("6400x4096"));
310 frame_sizes.append(new BC_ListBoxItem("7680x4800"));
312 sample_rates.append(new BC_ListBoxItem("8000"));
313 sample_rates.append(new BC_ListBoxItem("16000"));
314 sample_rates.append(new BC_ListBoxItem("22050"));
315 sample_rates.append(new BC_ListBoxItem("32000"));
316 sample_rates.append(new BC_ListBoxItem("44100"));
317 sample_rates.append(new BC_ListBoxItem("48000"));
318 sample_rates.append(new BC_ListBoxItem("96000"));
319 sample_rates.append(new BC_ListBoxItem("192000"));
321 frame_rates.append(new BC_ListBoxItem("1"));
322 frame_rates.append(new BC_ListBoxItem("5"));
323 frame_rates.append(new BC_ListBoxItem("10"));
324 frame_rates.append(new BC_ListBoxItem("12"));
325 frame_rates.append(new BC_ListBoxItem("15"));
326 frame_rates.append(new BC_ListBoxItem("23.976"));
327 frame_rates.append(new BC_ListBoxItem("24"));
328 frame_rates.append(new BC_ListBoxItem("25"));
329 frame_rates.append(new BC_ListBoxItem("29.97"));
330 frame_rates.append(new BC_ListBoxItem("30"));
331 frame_rates.append(new BC_ListBoxItem("50"));
332 frame_rates.append(new BC_ListBoxItem("59.94"));
333 frame_rates.append(new BC_ListBoxItem("60"));
335 char string[BCTEXTLEN];
336 for(int i = 1; i < 17; i++)
338 sprintf(string, "%d", (int)pow(2, i));
339 zoom_values.append(new BC_ListBoxItem(string));
344 void Theme::overlay(VFrame *dst, VFrame *src, int in_x1, int in_x2)
348 unsigned char **in_rows;
349 unsigned char **out_rows;
353 w = MIN(src->get_w(), dst->get_w());
354 h = MIN(dst->get_h(), src->get_h());
361 h = MIN(dst->get_h(), src->get_h());
363 in_rows = src->get_rows();
364 out_rows = dst->get_rows();
366 switch(src->get_color_model())
369 switch(dst->get_color_model())
372 for(int i = 0; i < h; i++)
374 unsigned char *in_row = in_rows[i] + in_x1 * 4;
375 unsigned char *out_row = out_rows[i];
376 for(int j = 0; j < w; j++)
378 int opacity = in_row[3];
379 int transparency = out_row[3] * (0xff - opacity) / 0xff;
380 out_row[0] = (in_row[0] * opacity + out_row[0] * transparency) / 0xff;
381 out_row[1] = (in_row[1] * opacity + out_row[1] * transparency) / 0xff;
382 out_row[2] = (in_row[2] * opacity + out_row[2] * transparency) / 0xff;
383 out_row[3] = MAX(in_row[3], out_row[3]);
390 for(int i = 0; i < h; i++)
392 unsigned char *in_row = in_rows[i] + in_x1 * 4;
393 unsigned char *out_row = out_rows[i];
394 for(int j = 0; j < w; j++)
396 int opacity = in_row[3];
397 int transparency = 0xff - opacity;
398 out_row[0] = (in_row[0] * opacity + out_row[0] * transparency) / 0xff;
399 out_row[1] = (in_row[1] * opacity + out_row[1] * transparency) / 0xff;
400 out_row[2] = (in_row[2] * opacity + out_row[2] * transparency) / 0xff;
411 void Theme::build_transport(char *title,
412 unsigned char *png_overlay,
416 if(!png_overlay) return;
417 VFramePng default_data(png_overlay);
419 data[0] = NEW_VFRAME;
420 data[1] = NEW_VFRAME;
421 data[2] = NEW_VFRAME;
422 data[0]->clear_frame();
423 data[1]->clear_frame();
424 data[2]->clear_frame();
426 for(int i = 0; i < 3; i++)
430 if(!bg_data[i]) break;
436 in_x2 = default_data.get_w();
440 in_x1 = (int)(bg_data[i]->get_w() * 0.33);
441 in_x2 = in_x1 + default_data.get_w();
445 in_x1 = bg_data[i]->get_w() - default_data.get_w();
446 in_x2 = in_x1 + default_data.get_w();
450 overlay(data[i], bg_data[i], in_x1, in_x2);
451 overlay(data[i], &default_data);
454 new_image_set_images(title, 3, data[0], data[1], data[2]);
465 void Theme::build_patches(VFrame** &data,
466 unsigned char *png_overlay,
470 if(!png_overlay || !bg_data) return;
471 VFramePng default_data(png_overlay);
472 data = new VFrame*[5];
473 data[0] = NEW_VFRAME;
474 data[1] = NEW_VFRAME;
475 data[2] = NEW_VFRAME;
476 data[3] = NEW_VFRAME;
477 data[4] = NEW_VFRAME;
479 for(int i = 0; i < 5; i++)
489 in_x2 = default_data.get_w();
493 in_x1 = (int)(bg_data[i]->get_w() * 0.33);
494 in_x2 = in_x1 + default_data.get_w();
498 in_x1 = bg_data[i]->get_w() - default_data.get_w();
499 in_x2 = in_x1 + default_data.get_w();
517 void Theme::build_button(VFrame** &data,
518 unsigned char *png_overlay,
523 if(!png_overlay) return;
524 VFramePng default_data(png_overlay);
526 if(!up_vframe || !hi_vframe || !dn_vframe) return;
527 data = new VFrame*[3];
528 data[0] = NEW_VFRAME;
529 data[1] = NEW_VFRAME;
530 data[2] = NEW_VFRAME;
531 data[0]->copy_from(up_vframe);
532 data[1]->copy_from(hi_vframe);
533 data[2]->copy_from(dn_vframe);
534 for(int i = 0; i < 3; i++)
539 void Theme::build_button(VFrame** &data,
540 unsigned char *png_overlay,
546 if(!png_overlay) return;
547 VFramePng default_data(png_overlay);
549 if(!up_vframe || !hi_vframe || !dn_vframe) return;
550 data = new VFrame*[4];
551 data[0] = NEW_VFRAME;
552 data[1] = NEW_VFRAME;
553 data[2] = NEW_VFRAME;
554 data[3] = NEW_VFRAME;
555 data[0]->copy_from(up_vframe);
556 data[1]->copy_from(hi_vframe);
557 data[2]->copy_from(dn_vframe);
558 data[2]->copy_from(at_vframe);
559 for(int i = 0; i < 4; i++)
564 void Theme::build_toggle(VFrame** &data,
565 unsigned char *png_overlay,
568 VFrame *checked_vframe,
570 VFrame *checkedhi_vframe)
577 !checkedhi_vframe) return;
578 VFramePng default_data(png_overlay);
579 data = new VFrame*[5];
580 data[0] = NEW_VFRAME;
581 data[1] = NEW_VFRAME;
582 data[2] = NEW_VFRAME;
583 data[3] = NEW_VFRAME;
584 data[4] = NEW_VFRAME;
585 data[0]->copy_from(up_vframe);
586 data[1]->copy_from(hi_vframe);
587 data[2]->copy_from(checked_vframe);
588 data[3]->copy_from(dn_vframe);
589 data[4]->copy_from(checkedhi_vframe);
590 for(int i = 0; i < 5; i++)
596 void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
599 mbuttons_y = gui->menu_h() + 1;
600 mbuttons_w = gui->menu_w();
601 mbuttons_h = get_image("mbutton_bg")->get_h();
603 mclock_y = mbuttons_y - 1 + mbuttons_h + widget_border;
604 mclock_w = get_image("clock_bg")->get_w() - 40;
605 mclock_h = get_image("clock_bg")->get_h();
606 mtimebar_x = get_image("patchbay_bg")->get_w();
607 mtimebar_y = mbuttons_y - 1 + mbuttons_h;
608 mtimebar_w = w - mtimebar_x;
609 mtimebar_h = get_image("timebar_bg")->get_h();
612 mzoom_y = h - get_image("statusbar")->get_h();
615 mstatus_y = mzoom_y + mzoom_h;
617 mstatus_h = h - mstatus_y;
618 mstatus_message_x = 10;
619 mstatus_message_y = 5;
620 mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
621 mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - 3;
622 mstatus_progress_w = 230;
623 mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
624 mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
626 mcanvas_y = mbuttons_y - 1 + mbuttons_h;
628 mcanvas_h = mzoom_y - mtimebar_y;
629 control_pixels = (mcanvas_w * control_pixels) / 1000;
631 patchbay_y = mcanvas_y + mclock_h;
632 patchbay_w = get_image("patchbay_bg")->get_w();
633 patchbay_h = mcanvas_h - mclock_h;
634 pane_w = get_image_set("xpane")[0]->get_w();
635 pane_h = get_image_set("ypane")[0]->get_h();
636 pane_x = mcanvas_x + mcanvas_w;
637 pane_y = mcanvas_y + mcanvas_h;
639 mhscroll_y = mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ);
640 mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT);
641 mvscroll_x = mcanvas_x + mcanvas_w;
642 mvscroll_y = mcanvas_y;
643 mvscroll_h = mcanvas_h;
646 void Theme::get_pane_sizes(MWindowGUI *gui,
663 if(number == TOP_LEFT_PANE ||
664 number == BOTTOM_LEFT_PANE)
666 *view_x += patchbay_w;
667 *view_w -= patchbay_w;
671 if(number == TOP_LEFT_PANE ||
672 number == TOP_RIGHT_PANE)
674 *view_y += mtimebar_h;
675 *view_h -= mtimebar_h;
679 if(number == BOTTOM_LEFT_PANE ||
680 number == BOTTOM_RIGHT_PANE ||
681 gui->horizontal_panes() ||
682 gui->total_panes() == 1)
684 *view_h -= BC_ScrollBar::get_span(SCROLL_HORIZ);
688 if(number == TOP_RIGHT_PANE ||
689 number == BOTTOM_RIGHT_PANE ||
690 gui->vertical_panes() ||
691 gui->total_panes() == 1)
693 *view_w -= BC_ScrollBar::get_span(SCROLL_VERT);
697 void Theme::draw_mwindow_bg(MWindowGUI *gui)
702 void Theme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
704 int total_buttons = !use_commercials ? 15 : 16;
705 int edit_w = EditPanel::calculate_w(mwindow, 1, total_buttons);
706 int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
707 int zoom_w = ZoomPanel::calculate_w(czoom_w);
708 int status_w = get_image("cwindow_active")->get_w();
709 // Space between buttons & status icon
717 if(mwindow->edl->session->cwindow_meter)
719 cmeter_x = mwindow->session->cwindow_w -
720 MeterPanel::get_meters_width(this,
721 mwindow->edl->session->audio_channels,
722 mwindow->edl->session->cwindow_meter);
726 cmeter_x = mwindow->session->cwindow_w + widget_border;
733 transport_w + widget_border +
734 zoom_w + widget_border +
738 buttons_h = get_image("cbuttons_left")->get_h();
740 cedit_x = widget_border;
741 cedit_y = mwindow->session->cwindow_h -
746 ctransport_x = widget_border;
747 ctransport_y = mwindow->session->cwindow_h -
748 get_image_set("autokeyframe")[0]->get_h() -
751 czoom_x = ctransport_x + transport_w + widget_border;
752 czoom_y = ctransport_y + widget_border;
755 cstatus_y = mwindow->session->cwindow_h -
756 get_image("cwindow_active")->get_h() - 30;
760 buttons_h = ctimebar_h +
762 EditPanel::calculate_h(mwindow) +
764 ctransport_x = widget_border;
765 ctransport_y = mwindow->session->cwindow_h -
770 cedit_x = ctransport_x + transport_w + widget_border;
771 cedit_y = ctransport_y;
773 czoom_x = cedit_x + edit_w + widget_border;
774 czoom_y = cedit_y + widget_border;
775 //printf("Theme::get_cwindow_sizes %d %d %d\n", __LINE__, czoom_x, zoom_w);
776 cstatus_x = czoom_x + zoom_w + division_w;
777 cstatus_y = ctransport_y;
783 ccomposite_w = get_image("cpanel_bg")->get_w();
784 ccomposite_h = mwindow->session->cwindow_h - buttons_h;
792 ccanvas_x = ccomposite_x + ccomposite_w;
794 ccanvas_h = ccomposite_h;
797 ccanvas_w = cmeter_x - ccanvas_x - widget_border;
804 ccomposite_x = -get_image("cpanel_bg")->get_w();
806 ccomposite_w = get_image("cpanel_bg")->get_w();
807 ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h();
810 cedit_y = mwindow->session->cwindow_h + 17;
812 ctransport_y = cedit_y + 40;
815 ccanvas_w = mwindow->session->cwindow_w;
816 ccanvas_h = mwindow->session->cwindow_h;
817 cmeter_x = mwindow->session->cwindow_w;
818 cstatus_x = mwindow->session->cwindow_w;
819 cstatus_y = mwindow->session->cwindow_h;
820 czoom_x = mwindow->session->cwindow_w;
821 czoom_y = mwindow->session->cwindow_h;
828 cmeter_y = widget_border;
829 cmeter_h = mwindow->session->cwindow_h - cmeter_y - widget_border;
831 // ctimebar_x = ccanvas_x;
832 // ctimebar_y = ccanvas_y + ccanvas_h;
833 // ctimebar_w = ccanvas_w;
835 ctimebar_y = ccanvas_y + ccanvas_h;
836 ctimebar_w = mwindow->session->cwindow_w;
837 if(mwindow->edl->session->cwindow_meter)
839 ctimebar_w = cmeter_x - widget_border;
849 void Theme::draw_awindow_bg(AWindowGUI *gui)
851 gui->clear_box(0, 0, mwindow->session->awindow_w, mwindow->session->awindow_h);
855 void Theme::draw_vwindow_bg(VWindowGUI *gui)
859 // mwindow->session->vwindow_w,
860 // mwindow->session->vwindow_h);
862 // gui->draw_3segmenth(vtimebar_x,
871 void Theme::draw_cwindow_bg(CWindowGUI *gui)
873 gui->clear_box(0, 0, mwindow->session->cwindow_w, mwindow->session->cwindow_h);
877 void Theme::draw_lwindow_bg(LevelWindowGUI *gui)
879 gui->clear_box(0, 0, mwindow->session->lwindow_w, mwindow->session->lwindow_h);
884 void Theme::draw_rmonitor_bg(RecordMonitorGUI *gui)
886 gui->clear_box(0, 0, mwindow->session->rmonitor_w, mwindow->session->rmonitor_h);
891 void Theme::draw_rwindow_bg(RecordGUI *gui)
893 gui->clear_box(0, 0, mwindow->session->rwindow_w, mwindow->session->rwindow_h);
897 void Theme::draw_resource_bg(TrackCanvas *canvas,
898 ResourcePixmap *pixmap,
909 switch(mwindow->edl->local_session->zoom_track)
911 case 1024: image = get_image("resource1024"); break;
912 case 512: image = get_image("resource512"); break;
913 case 256: image = get_image("resource256"); break;
914 case 128: image = get_image("resource128"); break;
915 case 64: image = get_image("resource64"); break;
917 case 32: image = get_image("resource32"); break;
920 canvas->draw_3segmenth(x1,
930 void Theme::get_vwindow_sizes(VWindowGUI *gui)
932 int edit_w = EditPanel::calculate_w(mwindow, 0, 10);
933 int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
934 // Space between buttons & time
938 int vtime_border = 15;
940 vmeter_y = widget_border;
941 vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border;
944 if(mwindow->edl->session->vwindow_meter)
946 vmeter_x = mwindow->session->vwindow_w -
947 MeterPanel::get_meters_width(this,
948 mwindow->edl->session->audio_channels,
949 mwindow->edl->session->vwindow_meter);
953 vmeter_x = mwindow->session->vwindow_w + widget_border;
958 vcanvas_w = vmeter_x - vcanvas_x - widget_border;
962 transport_w + widget_border +
963 vtime_w + division_w +
964 vtime_border > vmeter_x)
966 buttons_h = get_image("vbuttons_left")->get_h();
967 vedit_x = widget_border;
968 vedit_y = mwindow->session->vwindow_h -
973 vtransport_x = widget_border;
974 vtransport_y = mwindow->session->vwindow_h -
975 get_image_set("autokeyframe")[0]->get_h() -
979 vtime_x = vdivision_x;
980 vtime_y = vedit_y + 20;
984 buttons_h = vtimebar_h +
986 EditPanel::calculate_h(mwindow) +
988 vtransport_x = widget_border;
989 vtransport_y = mwindow->session->vwindow_h -
994 vedit_x = vtransport_x + transport_w + widget_border;
995 vedit_y = vtransport_y;
997 vdivision_x = vedit_x + edit_w + division_w;
998 vtime_x = vdivision_x + vtime_border;
999 vtime_y = vedit_y + widget_border;
1003 // vtimebar_x = vcanvas_x;
1004 // vtimebar_y = vcanvas_y + vcanvas_h;
1005 // vtimebar_w = vcanvas_w;
1007 vcanvas_h = mwindow->session->vwindow_h - buttons_h;
1009 vtimebar_y = vcanvas_y + vcanvas_h;
1010 vtimebar_w = vmeter_x - widget_border;
1015 void Theme::get_awindow_sizes(AWindowGUI *gui)
1020 // afolders_y = deletedisk_data[0]->get_h();
1022 afolders_w = mwindow->session->afolders_w;
1023 afolders_h = mwindow->session->awindow_h - afolders_y;
1024 adivider_x = afolders_x + afolders_w;
1027 adivider_h = afolders_h;
1028 alist_x = afolders_x + afolders_w + 5;
1029 alist_y = afolders_y;
1030 alist_w = mwindow->session->awindow_w - alist_x;
1031 alist_h = afolders_h;
1034 void Theme::get_rmonitor_sizes(int do_audio,
1047 rmonitor_canvas_y = 30;
1053 rmonitor_canvas_y = 0;
1062 rmonitor_channel_x = x;
1063 rmonitor_channel_y = 5;
1065 rmonitor_canvas_y = 35;
1071 rmonitor_interlace_x = x;
1072 rmonitor_interlace_y = y;
1080 rmonitor_meter_x = mwindow->session->rmonitor_w -
1081 MeterPanel::get_meters_width(this, audio_channels, 1);
1082 rmonitor_meter_w = mwindow->session->rmonitor_w;
1086 rmonitor_meter_x = widget_border;
1087 rmonitor_meter_w = mwindow->session->rmonitor_w - widget_border * 2;
1090 rmonitor_meter_y = 40;
1091 rmonitor_meter_h = mwindow->session->rmonitor_h - 10 - rmonitor_meter_y;
1095 rmonitor_meter_x = mwindow->session->rmonitor_w;
1098 rmonitor_canvas_x = 0;
1099 rmonitor_canvas_w = rmonitor_meter_x - rmonitor_canvas_x;
1100 if(do_audio) rmonitor_canvas_w -= 10;
1101 rmonitor_canvas_h = mwindow->session->rmonitor_h - rmonitor_canvas_y;
1103 if(!do_video && do_audio)
1105 rmonitor_meter_y -= 30;
1106 rmonitor_meter_h += 30;
1111 void Theme::get_recordgui_sizes(RecordGUI *gui, int w, int h)
1115 void Theme::get_batchrender_sizes(BatchRenderGUI *gui,
1119 batchrender_x1 = 10;
1120 batchrender_x2 = 300;
1121 batchrender_x3 = 400;
1124 void Theme::get_plugindialog_sizes()
1127 plugindialog_new_x = x;
1128 plugindialog_new_y = y;
1129 plugindialog_shared_x = mwindow->session->plugindialog_w / 3;
1130 plugindialog_shared_y = y;
1131 plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3;
1132 plugindialog_module_y = y;
1134 plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10;
1135 plugindialog_new_h = mwindow->session->plugindialog_h - 100;
1136 plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10;
1137 plugindialog_shared_h = mwindow->session->plugindialog_h - 100;
1138 plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10;
1139 plugindialog_module_h = mwindow->session->plugindialog_h - 100;
1141 plugindialog_newattach_x = plugindialog_new_x + 20;
1142 plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10;
1143 plugindialog_sharedattach_x = plugindialog_shared_x + 20;
1144 plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10;
1145 plugindialog_moduleattach_x = plugindialog_module_x + 20;
1146 plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10;
1149 // void Theme::get_presetdialog_sizes(PresetsWindow *gui)
1151 // int x = window_border;
1152 // int y = window_border + BC_Title::calculate_h(gui, "P") + widget_border;
1154 // presets_list_x = x;
1155 // presets_list_y = y;
1156 // presets_list_w = mwindow->session->presetdialog_w / 2;
1157 // presets_list_h = mwindow->session->presetdialog_h -
1158 // BC_OKButton::calculate_h() -
1162 // presets_text_x = presets_list_x + presets_list_w + widget_border;
1163 // presets_text_y = y;
1164 // presets_text_w = mwindow->session->presetdialog_w - presets_text_x - window_border;
1165 // y += BC_TextBox::calculate_h(gui,
1168 // 1) + widget_border;
1170 // presets_delete_x = presets_text_x;
1171 // presets_delete_y = y;
1172 // y += BC_GenericButton::calculate_h() + widget_border;
1174 // presets_save_x = presets_text_x;
1175 // presets_save_y = y;
1176 // y += BC_GenericButton::calculate_h() + widget_border;
1178 // presets_apply_x = presets_text_x;
1179 // presets_apply_y = y;
1180 // y += BC_GenericButton::calculate_h();
1183 void Theme::get_keyframedialog_sizes(KeyFrameWindow *gui)
1185 int x = widget_border;
1186 int y = window_border +
1187 BC_Title::calculate_h(gui, "P", LARGEFONT) +
1190 keyframe_list_x = x;
1191 keyframe_list_y = y;
1192 keyframe_list_w = mwindow->session->keyframedialog_w - widget_border * 2;
1193 keyframe_list_h = mwindow->session->keyframedialog_h - widget_border -
1194 widget_border - keyframe_list_y - BC_Title::calculate_h(gui, "P") -
1195 widget_border - BC_TextBox::calculate_h(gui, MEDIUMFONT, 1, 1) -
1196 widget_border - BC_Title::calculate_h(gui, "P") -
1197 widget_border - BC_OKButton::calculate_h() -
1199 // keyframe_text_x = keyframe_list_x + keyframe_list_w + widget_border;
1200 // keyframe_text_y = y;
1201 // keyframe_text_w = mwindow->session->keyframedialog_w - keyframe_text_x - window_border;
1202 // y += BC_TextBox::calculate_h(gui,
1205 // 1) + widget_border;
1208 y += keyframe_list_h + BC_Title::calculate_h(gui, "P") + widget_border + widget_border;
1209 keyframe_value_x = keyframe_list_x;
1210 keyframe_value_y = y;
1211 keyframe_value_w = keyframe_list_w;
1212 y += BC_TextBox::calculate_h(gui,
1217 keyframe_all_x = keyframe_value_x;
1222 void Theme::get_menueffect_sizes(int use_list)
1226 menueffect_list_x = 10;
1227 menueffect_list_y = 10;
1228 menueffect_list_w = mwindow->session->menueffect_w - 400;
1229 menueffect_list_h = mwindow->session->menueffect_h -
1231 BC_OKButton::calculate_h() - 10;
1235 menueffect_list_x = 0;
1236 menueffect_list_y = 10;
1237 menueffect_list_w = 0;
1238 menueffect_list_h = 0;
1241 menueffect_file_x = menueffect_list_x + menueffect_list_w + 10;
1242 menueffect_file_y = 10;
1244 menueffect_tools_x = menueffect_file_x;
1245 menueffect_tools_y = menueffect_file_y + 20;
1248 void Theme::get_preferences_sizes()
1252 void Theme::draw_preferences_bg(PreferencesWindow *gui)
1256 void Theme::get_new_sizes(NewWindow *gui)
1260 void Theme::draw_new_bg(NewWindow *gui)
1264 void Theme::draw_setformat_bg(SetFormatWindow *window)