bd7a163fb284c2af2a53a1cc39fe2305f6e93994
[goodguy/history.git] / cinelerra-5.1 / plugins / theme_suv / suv.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #include "bcsignals.h"
23 #include "clip.h"
24 #include "cwindowgui.h"
25 #include "suv.h"
26 #include "edl.h"
27 #include "edlsession.h"
28 #include "mainmenu.h"
29 #include "mainsession.h"
30 #include "mbuttons.h"
31 #include "meterpanel.h"
32 #include "mwindow.h"
33 #include "mwindowgui.h"
34 #include "new.h"
35 #include "patchbay.h"
36 #include "preferencesthread.h"
37 #include "recordgui.h"
38 #include "recordmonitor.h"
39 #include "setformat.h"
40 #include "statusbar.h"
41 #include "timebar.h"
42 #include "trackcanvas.h"
43 #include "vframe.h"
44 #include "vwindowgui.h"
45
46
47
48
49 PluginClient* new_plugin(PluginServer *server)
50 {
51         return new SUVMain(server);
52 }
53
54
55
56
57
58
59
60 SUVMain::SUVMain(PluginServer *server)
61  : PluginTClient(server)
62 {
63 }
64
65 SUVMain::~SUVMain()
66 {
67 }
68
69 const char* SUVMain::plugin_title()
70 {
71         return _("S.U.V.");
72 }
73
74 Theme* SUVMain::new_theme()
75 {
76         theme = new SUV;
77         extern unsigned char _binary_theme_suv_data_start[];
78         theme->set_data(_binary_theme_suv_data_start);
79         return theme;
80 }
81
82
83
84
85
86
87
88
89 SUV::SUV()
90  : Theme()
91 {
92 }
93
94 SUV::~SUV()
95 {
96         delete camerakeyframe_data;
97         delete channel_position_data;
98         delete keyframe_data;
99         delete maskkeyframe_data;
100         delete modekeyframe_data;
101         delete pankeyframe_data;
102         delete projectorkeyframe_data;
103 }
104
105 void SUV::initialize()
106 {
107         BC_Resources *resources = BC_WindowBase::get_resources();
108
109
110         resources->text_default = 0xbfbfbf;
111         resources->text_background = 0x373737;
112         resources->text_border1 = 0x202020;
113         resources->text_border2 = 0x373737;
114         resources->text_border3 = 0x373737;
115         resources->text_border4 = 0x969696;
116         resources->text_inactive_highlight = 0x707070;
117
118         resources->bg_color = 0x484848;
119         resources->border_light2 = resources->bg_color;
120         resources->border_shadow2 = resources->bg_color;
121         resources->default_text_color = 0xbfbfbf;
122         resources->menu_title_text = 0xbfbfbf;
123         resources->popup_title_text = 0xbfbfbf;
124         resources->menu_item_text = 0xbfbfbf;
125         resources->menu_highlighted_fontcolor = WHITE;
126         resources->generic_button_margin = 30;
127         resources->pot_needle_color = resources->text_default;
128         resources->pot_offset = 1;
129         resources->progress_text = resources->text_default;
130         resources->meter_font_color = resources->default_text_color;
131
132         resources->menu_light = 0xababab;
133         resources->menu_highlighted = 0x6f6f6f;
134         resources->menu_down = 0x4b4b4b;
135         resources->menu_up = 0x4b4b4b;
136         resources->menu_shadow = 0x202020;
137         resources->popupmenu_margin = 15;
138         resources->popupmenu_triangle_margin = 15;
139
140         resources->listbox_title_color = 0xbfbfbf;
141
142         resources->listbox_title_margin = 20;
143         resources->listbox_title_hotspot = 20;
144         resources->listbox_border1 = 0x1a1a1a;
145         resources->listbox_border2 = 0x373737;
146         resources->listbox_border3 = 0x373737;
147         resources->listbox_border4 = 0x646464;
148         resources->listbox_highlighted = 0x505050;
149         resources->listbox_inactive = 0x373737;
150         resources->listbox_bg = 0;
151         resources->listbox_text = 0xbfbfbf;
152
153         resources->filebox_margin = 130;
154         resources->file_color = 0xbfbfbf;
155         resources->directory_color = 0xa0a0ff;
156
157
158         new_toggle("loadmode_new.png",
159                 "loadmode_up.png",
160                 "loadmode_hi.png",
161                 "loadmode_checked.png",
162                 "loadmode_dn.png",
163                 "loadmode_checkedhi.png",
164                 "loadmode_new");
165         new_toggle("loadmode_none.png",
166                 "loadmode_up.png",
167                 "loadmode_hi.png",
168                 "loadmode_checked.png",
169                 "loadmode_dn.png",
170                 "loadmode_checkedhi.png",
171                 "loadmode_none");
172         new_toggle("loadmode_newcat.png",
173                 "loadmode_up.png",
174                 "loadmode_hi.png",
175                 "loadmode_checked.png",
176                 "loadmode_dn.png",
177                 "loadmode_checkedhi.png",
178                 "loadmode_newcat");
179         new_toggle("loadmode_cat.png",
180                 "loadmode_up.png",
181                 "loadmode_hi.png",
182                 "loadmode_checked.png",
183                 "loadmode_dn.png",
184                 "loadmode_checkedhi.png",
185                 "loadmode_cat");
186         new_toggle("loadmode_newtracks.png",
187                 "loadmode_up.png",
188                 "loadmode_hi.png",
189                 "loadmode_checked.png",
190                 "loadmode_dn.png",
191                 "loadmode_checkedhi.png",
192                 "loadmode_newtracks");
193         new_toggle("loadmode_paste.png",
194                 "loadmode_up.png",
195                 "loadmode_hi.png",
196                 "loadmode_checked.png",
197                 "loadmode_dn.png",
198                 "loadmode_checkedhi.png",
199                 "loadmode_paste");
200         new_toggle("loadmode_resource.png",
201                 "loadmode_up.png",
202                 "loadmode_hi.png",
203                 "loadmode_checked.png",
204                 "loadmode_dn.png",
205                 "loadmode_checkedhi.png",
206                 "loadmode_resource");
207         new_toggle("loadmode_nested.png",
208                 "loadmode_up.png",
209                 "loadmode_hi.png",
210                 "loadmode_checked.png",
211                 "loadmode_dn.png",
212                 "loadmode_checkedhi.png",
213                 "loadmode_nested");
214
215
216
217         resources->filebox_icons_images = new_button("icons.png",
218                 "fileboxbutton_up.png",
219                 "fileboxbutton_hi.png",
220                 "fileboxbutton_dn.png");
221
222         resources->filebox_text_images = new_button("text.png",
223                 "fileboxbutton_up.png",
224                 "fileboxbutton_hi.png",
225                 "fileboxbutton_dn.png");
226
227         resources->filebox_newfolder_images = new_button("folder.png",
228                 "fileboxbutton_up.png",
229                 "fileboxbutton_hi.png",
230                 "fileboxbutton_dn.png");
231
232         resources->filebox_rename_images = new_button("rename.png",
233                 "fileboxbutton_up.png",
234                 "fileboxbutton_hi.png",
235                 "fileboxbutton_dn.png");
236
237         resources->filebox_updir_images = new_button("updir.png",
238                 "fileboxbutton_up.png",
239                 "fileboxbutton_hi.png",
240                 "fileboxbutton_dn.png");
241
242         resources->filebox_delete_images = new_button("delete.png",
243                 "fileboxbutton_up.png",
244                 "fileboxbutton_hi.png",
245                 "fileboxbutton_dn.png");
246
247         resources->filebox_reload_images = new_button("reload.png",
248                 "fileboxbutton_up.png",
249                 "fileboxbutton_hi.png",
250                 "fileboxbutton_dn.png");
251
252
253         resources->filebox_descend_images = new_button("openfolder.png",
254                 "filebox_bigbutton_up.png",
255                 "filebox_bigbutton_hi.png",
256                 "filebox_bigbutton_dn.png");
257
258         resources->usethis_button_images =
259                 resources->ok_images = new_button("ok.png",
260                 "filebox_bigbutton_up.png",
261                 "filebox_bigbutton_hi.png",
262                 "filebox_bigbutton_dn.png");
263
264         new_button("ok.png",
265                 "new_bigbutton_up.png",
266                 "new_bigbutton_hi.png",
267                 "new_bigbutton_dn.png",
268                 "new_ok_images");
269
270         resources->cancel_images = new_button("cancel.png",
271                 "filebox_bigbutton_up.png",
272                 "filebox_bigbutton_hi.png",
273                 "filebox_bigbutton_dn.png");
274
275         new_button("cancel.png",
276                 "new_bigbutton_up.png",
277                 "new_bigbutton_hi.png",
278                 "new_bigbutton_dn.png",
279                 "new_cancel_images");
280
281         resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
282                 "0.png",
283                 "1.png",
284                 "2.png",
285                 "3.png",
286                 "4.png",
287                 "5.png",
288                 "6.png",
289                 "7.png",
290                 "8.png",
291                 "9.png",
292                 "colon.png",
293                 "period.png",
294                 "a.png",
295                 "b.png",
296                 "c.png",
297                 "d.png",
298                 "e.png",
299                 "f.png",
300                 "space.png",
301                 "dash.png");
302
303         resources->bar_data = new_image("bar", "bar.png");
304         resources->check = new_image("check", "check.png");
305
306         resources->min_menu_w = 96;
307         resources->menu_popup_bg = new_image("menu_popup_bg.png");
308         resources->menu_item_bg = new_image_set(3,
309                 "menuitem_up.png",
310                 "menuitem_hi.png",
311                 "menuitem_dn.png");
312         resources->menu_bar_bg = new_image("menubar_bg.png");
313         resources->menu_title_bg = new_image_set(3,
314                 "menubar_up.png",
315                 "menubar_hi.png",
316                 "menubar_dn.png");
317
318
319         resources->popupmenu_images = 0;
320 //              new_image_set(3,
321 //              "menupopup_up.png",
322 //              "menupopup_hi.png",
323 //              "menupopup_dn.png");
324
325         resources->toggle_highlight_bg = new_image("toggle_highlight_bg",
326                 "text_highlight.png");
327
328         resources->generic_button_images = new_image_set(3,
329                         "generic_up.png",
330                         "generic_hi.png",
331                         "generic_dn.png");
332         resources->horizontal_slider_data = new_image_set(6,
333                         "hslider_fg_up.png",
334                         "hslider_fg_hi.png",
335                         "hslider_fg_dn.png",
336                         "hslider_bg_up.png",
337                         "hslider_bg_hi.png",
338                         "hslider_bg_dn.png");
339         resources->vertical_slider_data = new_image_set(6,
340                         "hslider_fg_up.png",
341                         "hslider_fg_hi.png",
342                         "hslider_fg_dn.png",
343                         "hslider_bg_up.png",
344                         "hslider_bg_hi.png",
345                         "hslider_bg_dn.png");
346         for( int i=0; i<6; ++i )
347                 resources->vertical_slider_data[i]->rotate90();
348
349         resources->progress_images = new_image_set(2,
350                         "progress_bg.png",
351                         "progress_hi.png");
352         resources->tumble_data = new_image_set(4,
353                 "tumble_up.png",
354                 "tumble_hi.png",
355                 "tumble_bottom.png",
356                 "tumble_top.png");
357         resources->listbox_button = new_button4("listbox_button.png",
358                 "editpanel_up.png",
359                 "editpanel_hi.png",
360                 "editpanel_dn.png",
361                 "editpanel_hi.png");
362         resources->listbox_column = new_image_set(3,
363                 "column_up.png",
364                 "column_hi.png",
365                 "column_dn.png");
366         resources->listbox_up = new_image("listbox_up.png");
367         resources->listbox_dn = new_image("listbox_dn.png");
368         resources->pan_data = new_image_set(7,
369                         "pan_up.png",
370                         "pan_hi.png",
371                         "pan_popup.png",
372                         "pan_channel.png",
373                         "pan_stick.png",
374                         "pan_channel_small.png",
375                         "pan_stick_small.png");
376         resources->pan_text_color = WHITE;
377
378         resources->pot_images = new_image_set(3,
379                 "pot_up.png",
380                 "pot_hi.png",
381                 "pot_dn.png");
382
383         resources->checkbox_images = new_image_set(5,
384                 "checkbox_up.png",
385                 "checkbox_hi.png",
386                 "checkbox_checked.png",
387                 "checkbox_dn.png",
388                 "checkbox_checkedhi.png");
389
390         resources->radial_images = new_image_set(5,
391                 "radial_up.png",
392                 "radial_hi.png",
393                 "radial_checked.png",
394                 "radial_dn.png",
395                 "radial_checkedhi.png");
396
397         resources->xmeter_images = new_image_set(7,
398                 "xmeter_normal.png",
399                 "xmeter_green.png",
400                 "xmeter_red.png",
401                 "xmeter_yellow.png",
402                 "xmeter_white.png",
403                 "xmeter_over.png",
404                 "downmix51_2.png");
405         resources->ymeter_images = new_image_set(7,
406                 "ymeter_normal.png",
407                 "ymeter_green.png",
408                 "ymeter_red.png",
409                 "ymeter_yellow.png",
410                 "ymeter_white.png",
411                 "ymeter_over.png",
412                 "downmix51_2.png");
413
414         resources->hscroll_data = new_image_set(10,
415                         "hscroll_handle_up.png",
416                         "hscroll_handle_hi.png",
417                         "hscroll_handle_dn.png",
418                         "hscroll_handle_bg.png",
419                         "hscroll_left_up.png",
420                         "hscroll_left_hi.png",
421                         "hscroll_left_dn.png",
422                         "hscroll_right_up.png",
423                         "hscroll_right_hi.png",
424                         "hscroll_right_dn.png");
425
426         resources->vscroll_data = new_image_set(10,
427                         "vscroll_handle_up.png",
428                         "vscroll_handle_hi.png",
429                         "vscroll_handle_dn.png",
430                         "vscroll_handle_bg.png",
431                         "vscroll_left_up.png",
432                         "vscroll_left_hi.png",
433                         "vscroll_left_dn.png",
434                         "vscroll_right_up.png",
435                         "vscroll_right_hi.png",
436                         "vscroll_right_dn.png");
437         resources->scroll_minhandle = 20;
438
439
440         new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip");
441         new_button("nexttip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "next_tip");
442         new_button("closetip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "close_tip");
443         new_button("swap_extents.png",
444                 "editpanel_up.png",
445                 "editpanel_hi.png",
446                 "editpanel_dn.png",
447                 "swap_extents");
448
449
450 // Record windows
451
452
453         preferences_category_overlap = 0;
454         preferencescategory_x = 0;
455         preferencescategory_y = 5;
456         preferencestitle_x = 5;
457         preferencestitle_y = 10;
458         preferencesoptions_x = 5;
459         preferencesoptions_y = 0;
460
461 // MWindow
462         message_normal = resources->text_default;
463         audio_color = GREEN;
464         mtransport_margin = 16;
465         toggle_margin = 16;
466
467         new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane");
468         new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png");
469         new_image_set("ypane", 3, "ypane_up.png", "ypane_hi.png", "ypane_dn.png");
470
471         new_image("mbutton_bg", "mbutton_bg.png");
472         new_image("timebar_bg", "timebar_bg_flat.png");
473         new_image("timebar_brender", "timebar_brender.png");
474         new_image("clock_bg", "mclock_flat.png");
475         new_image("patchbay_bg", "patchbay_bg.png");
476         new_image("statusbar", "statusbar.png");
477 //      new_image("mscroll_filler", "mscroll_filler.png");
478
479         new_image_set("zoombar_menu", 3, "zoompopup_up.png", "zoompopup_hi.png", "zoompopup_dn.png");
480         new_image_set("zoombar_tumbler", 4, "zoomtumble_up.png", "zoomtumble_hi.png", "zoomtumble_bottom.png", "zoomtumble_top.png");
481         new_image_set("plugin_on", 5, "plugin_on.png", "plugin_onhi.png", "plugin_onselect.png", "plugin_ondn.png", "plugin_onselecthi.png");
482         new_image_set("plugin_show", 5, "plugin_show.png", "plugin_showhi.png", "plugin_showselect.png", "plugin_showdn.png", "plugin_showselecthi.png");
483
484 // CWindow
485         new_image("cpanel_bg", "cpanel_bg.png");
486         new_image("cbuttons_left", "cbuttons_left.png");
487         new_image("cbuttons_right", "cbuttons_right.png");
488         new_image("cmeter_bg", "cmeter_bg.png");
489
490 // VWindow
491         new_image("vbuttons_left", "vbuttons_left.png");
492         new_image("vclock", "vclock.png");
493
494         new_image("preferences_bg", "preferences_bg.png");
495
496
497         new_image("new_bg", "new_bg.png");
498         new_image("setformat_bg", "setformat_bg.png");
499
500
501         timebar_view_data = new_image("timebar_view.png");
502
503         setformat_w = get_image("setformat_bg")->get_w();
504         setformat_h = get_image("setformat_bg")->get_h();
505         setformat_x1 = 15;
506         setformat_x2 = 100;
507
508         setformat_x3 = 315;
509         setformat_x4 = 415;
510         setformat_y1 = 20;
511         setformat_y2 = 85;
512         setformat_y3 = 125;
513         setformat_margin = 30;
514         setformat_channels_x = 25;
515         setformat_channels_y = 242;
516         setformat_channels_w = 250;
517         setformat_channels_h = 250;
518
519         loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10;
520         browse_pad = 20;
521
522
523         new_toggle("playpatch.png",
524                 "patch_up.png",
525                 "patch_hi.png",
526                 "patch_checked.png",
527                 "patch_dn.png",
528                 "patch_checkedhi.png",
529                 "playpatch_data");
530
531         new_toggle("recordpatch.png",
532                 "patch_up.png",
533                 "patch_hi.png",
534                 "patch_checked.png",
535                 "patch_dn.png",
536                 "patch_checkedhi.png",
537                 "recordpatch_data");
538
539         new_toggle("gangpatch.png",
540                 "patch_up.png",
541                 "patch_hi.png",
542                 "patch_checked.png",
543                 "patch_dn.png",
544                 "patch_checkedhi.png",
545                 "gangpatch_data");
546
547         new_toggle("drawpatch.png",
548                 "patch_up.png",
549                 "patch_hi.png",
550                 "patch_checked.png",
551                 "patch_dn.png",
552                 "patch_checkedhi.png",
553                 "drawpatch_data");
554
555
556         new_image_set("mutepatch_data",
557                 5,
558                 "mutepatch_up.png",
559                 "mutepatch_hi.png",
560                 "mutepatch_checked.png",
561                 "mutepatch_dn.png",
562                 "mutepatch_checkedhi.png");
563
564         new_image_set("expandpatch_data",
565                 5,
566                 "expandpatch_up.png",
567                 "expandpatch_hi.png",
568                 "expandpatch_checked.png",
569                 "expandpatch_dn.png",
570                 "expandpatch_checkedhi.png");
571
572         build_bg_data();
573         build_overlays();
574
575
576
577
578         out_point = new_image_set(5,
579                 "out_up.png",
580                 "out_hi.png",
581                 "out_checked.png",
582                 "out_dn.png",
583                 "out_checkedhi.png");
584         in_point = new_image_set(5,
585                 "in_up.png",
586                 "in_hi.png",
587                 "in_checked.png",
588                 "in_dn.png",
589                 "in_checkedhi.png");
590
591         label_toggle = new_image_set(5,
592                 "labeltoggle_up.png",
593                 "labeltoggle_uphi.png",
594                 "label_checked.png",
595                 "labeltoggle_dn.png",
596                 "label_checkedhi.png");
597
598         ffmpeg_toggle = new_image_set(5,
599                 "ff_up.png",
600                 "ff_hi.png",
601                 "ff_checked.png",
602                 "ff_down.png",
603                 "ff_checkedhi.png");
604
605         shbtn_data = new_image_set(3,
606                 "shbtn_up.png",
607                 "shbtn_hi.png",
608                 "shbtn_dn.png");
609
610         new_image_set("histogram_carrot",
611                 5,
612                 "histogram_carrot_up.png",
613                 "histogram_carrot_hi.png",
614                 "histogram_carrot_checked.png",
615                 "histogram_carrot_dn.png",
616                 "histogram_carrot_checkedhi.png");
617
618
619         statusbar_cancel_data = new_image_set(3,
620                 "statusbar_cancel_up.png",
621                 "statusbar_cancel_hi.png",
622                 "statusbar_cancel_dn.png");
623
624
625         VFrame *editpanel_up = new_image("editpanel_up.png");
626         VFrame *editpanel_hi = new_image("editpanel_hi.png");
627         VFrame *editpanel_dn = new_image("editpanel_dn.png");
628         VFrame *editpanel_checked = new_image("editpanel_checked.png");
629         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
630
631         new_image("panel_divider", "panel_divider.png");
632         new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify");
633         new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify");
634         new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel");
635
636         new_toggle("histogram.png",
637                 editpanel_up,
638                 editpanel_hi,
639                 editpanel_checked,
640                 editpanel_dn,
641                 editpanel_checkedhi,
642                 "histogram_toggle");
643         new_toggle("histogram_rgb.png",
644                 editpanel_up,
645                 editpanel_hi,
646                 editpanel_checked,
647                 editpanel_dn,
648                 editpanel_checkedhi,
649                 "histogram_rgb_toggle");
650         new_toggle("waveform.png",
651                 editpanel_up,
652                 editpanel_hi,
653                 editpanel_checked,
654                 editpanel_dn,
655                 editpanel_checkedhi,
656                 "waveform_toggle");
657         new_toggle("waveform_rgb.png",
658                 editpanel_up,
659                 editpanel_hi,
660                 editpanel_checked,
661                 editpanel_dn,
662                 editpanel_checkedhi,
663                 "waveform_rgb_toggle");
664         new_toggle("scope.png",
665                 editpanel_up,
666                 editpanel_hi,
667                 editpanel_checked,
668                 editpanel_dn,
669                 editpanel_checkedhi,
670                 "scope_toggle");
671
672         new_button("picture.png", editpanel_up, editpanel_hi, editpanel_dn, "picture");
673         new_button("histogram.png", editpanel_up, editpanel_hi, editpanel_dn, "histogram");
674
675
676         new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
677         new_button("commercial.png", editpanel_up, editpanel_hi, editpanel_dn, "commercial");
678         new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
679         new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
680         new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
681         new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
682         new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
683         new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "left_justify");
684         new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn, "magnify_button");
685         new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "middle_justify");
686         new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
687         new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
688         new_button("nextedit.png", editpanel_up, editpanel_hi, editpanel_dn, "nextedit");
689         new_button("prevedit.png", editpanel_up, editpanel_hi, editpanel_dn, "prevedit");
690         new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
691         over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
692         overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
693         new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
694         new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
695         new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "right_justify");
696         splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
697         new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
698         new_button("goto.png", editpanel_up, editpanel_hi, editpanel_dn, "goto");
699         new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "top_justify");
700         new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
701         new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
702
703
704         VFrame *transport_up = new_image("transportup.png");
705         VFrame *transport_hi = new_image("transporthi.png");
706         VFrame *transport_dn = new_image("transportdn.png");
707
708         new_button("end.png", transport_up, transport_hi, transport_dn, "end");
709         new_button("fastfwd.png", transport_up, transport_hi, transport_dn, "fastfwd");
710         new_button("fastrev.png", transport_up, transport_hi, transport_dn, "fastrev");
711         new_button("play.png", transport_up, transport_hi, transport_dn, "play");
712         new_button("framefwd.png", transport_up, transport_hi, transport_dn, "framefwd");
713         new_button("framerev.png", transport_up, transport_hi, transport_dn, "framerev");
714         new_button("pause.png", transport_up, transport_hi, transport_dn, "pause");
715         new_button("record.png", transport_up, transport_hi, transport_dn, "record");
716         new_button("singleframe.png", transport_up, transport_hi, transport_dn, "recframe");
717         new_button("reverse.png", transport_up, transport_hi, transport_dn, "reverse");
718         new_button("rewind.png", transport_up, transport_hi, transport_dn, "rewind");
719         new_button("stop.png", transport_up, transport_hi, transport_dn, "stop");
720         new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec");
721
722
723
724 // CWindow icons
725         new_image("cwindow_inactive", "cwindow_inactive.png");
726         new_image("cwindow_active", "cwindow_active.png");
727
728
729
730         new_image_set("category_button",
731                 3,
732                 "preferencesbutton_dn.png",
733                 "preferencesbutton_dnhi.png",
734                 "preferencesbutton_dnlo.png");
735
736         new_image_set("category_button_checked",
737                 3,
738                 "preferencesbutton_up.png",
739                 "preferencesbutton_uphi.png",
740                 "preferencesbutton_dnlo.png");
741
742
743
744
745
746         new_image_set("color3way_point",
747                 3,
748                 "color3way_up.png",
749                 "color3way_hi.png",
750                 "color3way_dn.png");
751
752         new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
753         new_toggle("autokeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
754         new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
755         new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "meters");
756         new_toggle("blank30x30.png",
757                    new_image("locklabels_locked.png"),
758                    new_image("locklabels_lockedhi.png"),
759                    new_image("locklabels_unlocked.png"),
760                    new_image("locklabels_dn.png"), // can't have seperate down for each!!??
761                    new_image("locklabels_unlockedhi.png"),
762                    "locklabels");
763
764         VFrame *cpanel_up = new_image("cpanel_up.png");
765         VFrame *cpanel_hi = new_image("cpanel_hi.png");
766         VFrame *cpanel_dn = new_image("cpanel_dn.png");
767         VFrame *cpanel_checked = new_image("cpanel_checked.png");
768         VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
769
770
771         new_toggle("camera.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "camera");
772         new_toggle("crop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "crop");
773         new_toggle("eyedrop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "eyedrop");
774         new_toggle("magnify.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "magnify");
775         new_toggle("mask.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "mask");
776         new_toggle("ruler.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "ruler");
777         new_toggle("projector.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "projector");
778         new_toggle("protect.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "protect");
779         new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe");
780         new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool");
781
782         // toggle for tangent mode (compositor/tool window)
783         new_toggle("tan_smooth.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_smooth");
784         new_toggle("tan_linear.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_linear");
785
786
787         flush_images();
788
789         title_font = MEDIUMFONT_3D;
790         title_color = 0xbfbfbf;
791         recordgui_fixed_color = YELLOW;
792         recordgui_variable_color = RED;
793
794         channel_position_color = MEYELLOW;
795         resources->meter_title_w = 25;
796
797         // (asset) edit info text color
798         edit_font_color = YELLOW;
799 }
800
801 #define VWINDOW_METER_MARGIN 5
802
803
804
805
806
807
808
809
810
811
812
813 void SUV::build_bg_data()
814 {
815 // Audio settings
816         channel_position_data = new VFramePng(get_image_data("channel_position.png"));
817
818 // Track bitmaps
819         new_image("resource1024", "resource1024.png");
820         new_image("resource512", "resource512.png");
821         new_image("resource256", "resource256.png");
822         new_image("resource128", "resource128.png");
823         new_image("resource64", "resource64.png");
824         new_image("resource32", "resource32.png");
825         new_image("plugin_bg_data", "plugin_bg.png");
826         new_image("title_bg_data", "title_bg.png");
827         new_image("vtimebar_bg_data", "vwindow_timebar.png");
828 }
829
830
831
832 void SUV::build_overlays()
833 {
834         keyframe_data = new VFramePng(get_image_data("keyframe3.png"));
835         camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
836         maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
837         modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
838         pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
839         projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
840 }
841
842
843
844
845
846
847
848
849
850 void SUV::draw_rwindow_bg(RecordGUI *gui)
851 {
852 //      int y;
853 //      int margin = 50;
854 //      int margin2 = 80;
855 //      gui->draw_9segment(recordgui_batch_x - margin,
856 //              0,
857 //              mwindow->session->rwindow_w - recordgui_status_x + margin,
858 //              recordgui_buttons_y,
859 //              rgui_batch);
860 //      gui->draw_3segmenth(recordgui_options_x - margin2,
861 //              recordgui_buttons_y - 5,
862 //              mwindow->session->rwindow_w - recordgui_options_x + margin2,
863 //              rgui_controls);
864 //      y = recordgui_buttons_y - 5 + rgui_controls->get_h();
865 //      gui->draw_9segment(0,
866 //              y,
867 //              mwindow->session->rwindow_w,
868 //              mwindow->session->rwindow_h - y,
869 //              rgui_list);
870 }
871
872 void SUV::draw_rmonitor_bg(RecordMonitorGUI *gui)
873 {
874 //      int margin = 45;
875 //      int panel_w = 300;
876 //      int x = rmonitor_meter_x - margin;
877 //      int w = mwindow->session->rmonitor_w - x;
878 //      if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
879 //      gui->clear_box(0,
880 //              0,
881 //              mwindow->session->rmonitor_w,
882 //              mwindow->session->rmonitor_h);
883 //      gui->draw_9segment(x,
884 //              0,
885 //              w,
886 //              mwindow->session->rmonitor_h,
887 //              rmonitor_meters);
888 }
889
890
891
892
893
894
895 void SUV::draw_mwindow_bg(MWindowGUI *gui)
896 {
897 // Button bar
898         gui->draw_3segmenth(mbuttons_x, mbuttons_y - 1,
899                 gui->menu_w(), get_image("mbutton_bg"));
900
901         int pdw = get_image("panel_divider")->get_w();
902         int x = mbuttons_x;
903         x += 9 * get_image("play")->get_w();
904         x += mtransport_margin;                                       // the control buttons
905
906         gui->draw_vframe(get_image("panel_divider"),
907                 x - toggle_margin / 2 - pdw / 2 + 2,
908                 mbuttons_y - 1);
909         x += 2 * get_image("arrow")->get_w() + toggle_margin;           // the mode buttons
910
911         gui->draw_vframe(get_image("panel_divider"),
912                 x - toggle_margin / 2 - pdw / 2 + 2,
913                 mbuttons_y - 1);
914         x += 2 * get_image("autokeyframe")->get_w() + toggle_margin;    // the state toggle buttons
915
916         gui->draw_vframe(get_image("panel_divider"),
917                 x - toggle_margin / 2 - pdw / 2 + 2,
918                 mbuttons_y - 1);
919
920 // Clock
921         gui->draw_3segmenth(0,
922                 mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
923                 get_image("patchbay_bg")->get_w(),
924                 get_image("clock_bg"));
925
926 // Patchbay
927 //printf("SUV::draw_mwindow_bg %d %d %d\n", __LINE__,
928 //mclock_h,
929 //mtimebar_h);
930         gui->draw_3segmentv(patchbay_x,
931                 patchbay_y,
932                 patchbay_h,
933                 get_image("patchbay_bg"));
934
935 // Track canvas
936         gui->set_color(BLACK);
937         gui->draw_box(mcanvas_x + get_image("patchbay_bg")->get_w(),
938                 mcanvas_y + mtimebar_h,
939                 mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
940                 mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h);
941
942 // Timebar
943         gui->draw_3segmenth(mtimebar_x,
944                 mtimebar_y,
945                 mtimebar_w,
946                 get_image("timebar_bg"));
947
948 // Zoombar
949         gui->set_color(0x373737);
950         gui->draw_box(mzoom_x,
951                 mzoom_y,
952                 mwindow->session->mwindow_w,
953                 25);
954
955 // Scrollbar filler
956 //      gui->draw_vframe(get_image("mscroll_filler"),
957 //              mcanvas_x + mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
958 //              mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ));
959
960 // Status
961         gui->draw_3segmenth(mzoom_x,
962                 mzoom_y,
963                 mzoom_w,
964                 get_image("statusbar"));
965
966
967 }
968
969 void SUV::draw_cwindow_bg(CWindowGUI *gui)
970 {
971         gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
972
973         gui->draw_3segmenth(0, ccomposite_h, cstatus_x, get_image("cbuttons_left"));
974
975         if(mwindow->edl->session->cwindow_meter)
976         {
977                 gui->draw_3segmenth(cstatus_x,
978                         ccomposite_h,
979                         cmeter_x - widget_border - cstatus_x,
980                         get_image("cbuttons_right"));
981                 gui->draw_9segment(cmeter_x - widget_border,
982                         0,
983                         mwindow->session->cwindow_w - cmeter_x + widget_border,
984                         mwindow->session->cwindow_h,
985                         get_image("cmeter_bg"));
986         }
987         else
988         {
989                 gui->draw_3segmenth(cstatus_x,
990                         ccomposite_h,
991                         cmeter_x - widget_border - cstatus_x + 100,
992                         get_image("cbuttons_right"));
993         }
994 }
995
996 void SUV::draw_vwindow_bg(VWindowGUI *gui)
997 {
998         gui->draw_3segmenth(0,
999                 vcanvas_h,
1000                 vdivision_x,
1001                 get_image("vbuttons_left"));
1002         if(mwindow->edl->session->vwindow_meter)
1003         {
1004                 gui->draw_3segmenth(vdivision_x,
1005                         vcanvas_h,
1006                         vmeter_x - widget_border - vdivision_x,
1007                         get_image("cbuttons_right"));
1008                 gui->draw_9segment(vmeter_x - widget_border,
1009                         0,
1010                         mwindow->session->vwindow_w - vmeter_x + widget_border,
1011                         mwindow->session->vwindow_h,
1012                         get_image("cmeter_bg"));
1013         }
1014         else
1015         {
1016                 gui->draw_3segmenth(vdivision_x,
1017                         vcanvas_h,
1018                         vmeter_x - widget_border - vdivision_x + 100,
1019                         get_image("cbuttons_right"));
1020         }
1021
1022 // Clock border
1023         gui->draw_3segmenth(vtime_x - 20,
1024                 vtime_y - 1,
1025                 vtime_w + 40,
1026                 get_image("vclock"));
1027 }
1028
1029
1030 void SUV::draw_preferences_bg(PreferencesWindow *gui)
1031 {
1032         gui->draw_vframe(get_image("preferences_bg"), 0, 0);
1033 }
1034
1035 void SUV::draw_new_bg(NewWindow *gui)
1036 {
1037         gui->draw_vframe(get_image("new_bg"), 0, 0);
1038 }
1039
1040 void SUV::draw_setformat_bg(SetFormatWindow *gui)
1041 {
1042         gui->draw_vframe(get_image("setformat_bg"), 0, 0);
1043 }
1044
1045
1046
1047
1048
1049
1050