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