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