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