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