r784: Fix to bug 250 by Dan Streetman
[cinelerra_cv/mob.git] / plugins / suv / suv.C
blobc06cf83f6cc655387166497e602d2af88e4a60c0
1 #include "bcsignals.h"
2 #include "clip.h"
3 #include "cwindowgui.h"
4 #include "suv.h"
5 #include "edl.h"
6 #include "edlsession.h"
7 #include "mainmenu.h"
8 #include "mainsession.h"
9 #include "mbuttons.h"
10 #include "meterpanel.h"
11 #include "mwindow.h"
12 #include "mwindowgui.h"
13 #include "new.h"
14 #include "patchbay.h"
15 #include "preferencesthread.h"
16 #include "recordgui.h"
17 #include "recordmonitor.h"
18 #include "setformat.h"
19 #include "statusbar.h"
20 #include "timebar.h"
21 #include "trackcanvas.h"
22 #include "vframe.h"
23 #include "vwindowgui.h"
28 PluginClient* new_plugin(PluginServer *server)
30         return new SUVMain(server);
39 SUVMain::SUVMain(PluginServer *server)
40  : PluginTClient(server)
44 SUVMain::~SUVMain()
48 char* SUVMain::plugin_title()
50         return "S.U.V.";
53 Theme* SUVMain::new_theme()
55         theme = new SUV;
56         extern unsigned char _binary_suv_data_start[];
57         theme->set_data(_binary_suv_data_start);
58         return theme;
68 SUV::SUV()
69  : Theme()
73 SUV::~SUV()
77 void SUV::initialize()
79         BC_Resources *resources = BC_WindowBase::get_resources();
82         resources->text_default = 0xbfbfbf;
83         resources->text_background = 0x373737;
84         resources->text_border1 = 0x202020;
85         resources->text_border2 = 0x373737;
86         resources->text_border3 = 0x373737;
87         resources->text_border4 = 0x969696;
88         resources->text_inactive_highlight = 0x707070;
90         resources->bg_color = 0x484848;
91         resources->default_text_color = 0xbfbfbf;
92         resources->menu_title_text = 0xbfbfbf;
93         resources->popup_title_text = 0xbfbfbf;
94         resources->menu_item_text = 0xbfbfbf;
95         resources->menu_highlighted_fontcolor = WHITE;
96         resources->generic_button_margin = 30;
97         resources->pot_needle_color = resources->text_default;
98         resources->pot_offset = 1;
99         resources->progress_text = resources->text_default;
100         resources->meter_font_color = resources->default_text_color;
102         resources->menu_light = 0xababab;
103         resources->menu_highlighted = 0x6f6f6f;
104         resources->menu_down = 0x4b4b4b;
105         resources->menu_up = 0x4b4b4b;
106         resources->menu_shadow = 0x202020;
107         resources->popupmenu_margin = 10;
108         resources->popupmenu_triangle_margin = 15;
110         resources->listbox_title_color = 0xbfbfbf;
112         resources->listbox_title_margin = 20;
113         resources->listbox_title_hotspot = 20;
114         resources->listbox_border1 = 0x1a1a1a;
115         resources->listbox_border2 = 0x373737;
116         resources->listbox_border3 = 0x373737;
117         resources->listbox_border4 = 0x646464;
118         resources->listbox_highlighted = 0x505050;
119         resources->listbox_inactive = 0x373737;
120         resources->listbox_bg = 0;
121         resources->listbox_text = 0xbfbfbf;
123         resources->filebox_margin = 130;
124         resources->file_color = 0xbfbfbf;
125         resources->directory_color = 0xa0a0ff;
128         
130         resources->filebox_icons_images = new_button("icons.png",
131                 "fileboxbutton_up.png",
132                 "fileboxbutton_hi.png",
133                 "fileboxbutton_dn.png");
135         resources->filebox_text_images = new_button("text.png",
136                 "fileboxbutton_up.png",
137                 "fileboxbutton_hi.png",
138                 "fileboxbutton_dn.png");
140         resources->filebox_newfolder_images = new_button("folder.png",
141                 "fileboxbutton_up.png",
142                 "fileboxbutton_hi.png",
143                 "fileboxbutton_dn.png");
145         resources->filebox_updir_images = new_button("updir.png",
146                 "fileboxbutton_up.png",
147                 "fileboxbutton_hi.png",
148                 "fileboxbutton_dn.png");
150         resources->filebox_delete_images = new_button("delete.png",
151                 "fileboxbutton_up.png",
152                 "fileboxbutton_hi.png",
153                 "fileboxbutton_dn.png");
155         resources->filebox_reload_images = new_button("reload.png",
156                 "fileboxbutton_up.png",
157                 "fileboxbutton_hi.png",
158                 "fileboxbutton_dn.png");
161         resources->filebox_descend_images = new_button("openfolder.png",
162                 "filebox_bigbutton_up.png", 
163                 "filebox_bigbutton_hi.png", 
164                 "filebox_bigbutton_dn.png");
166         resources->usethis_button_images = 
167                 resources->ok_images = new_button("ok.png",
168                 "filebox_bigbutton_up.png", 
169                 "filebox_bigbutton_hi.png", 
170                 "filebox_bigbutton_dn.png");
172         new_button("ok.png",
173                 "new_bigbutton_up.png", 
174                 "new_bigbutton_hi.png", 
175                 "new_bigbutton_dn.png",
176                 "new_ok_images");
178         resources->cancel_images = new_button("cancel.png",
179                 "filebox_bigbutton_up.png", 
180                 "filebox_bigbutton_hi.png", 
181                 "filebox_bigbutton_dn.png");
183         new_button("cancel.png",
184                 "new_bigbutton_up.png", 
185                 "new_bigbutton_hi.png", 
186                 "new_bigbutton_dn.png",
187                 "new_cancel_images");
189         resources->bar_data = new_image("bar", "bar.png");
192         resources->min_menu_w = 96;
193         resources->menu_popup_bg = new_image("menu_popup_bg.png");
194         resources->menu_item_bg = new_image_set(3,
195                 "menuitem_up.png",
196                 "menuitem_hi.png",
197                 "menuitem_dn.png");
198         resources->menu_bar_bg = new_image("menubar_bg.png");
199         resources->menu_title_bg = new_image_set(3, 
200                 "menubar_up.png",
201                 "menubar_hi.png",
202                 "menubar_dn.png");
205         resources->popupmenu_images = 0;
206 //              new_image_set(3, 
207 //              "menupopup_up.png",
208 //              "menupopup_hi.png",
209 //              "menupopup_dn.png");
211         resources->toggle_highlight_bg = new_image("toggle_highlight_bg",
212                 "text_highlight.png");
214         resources->generic_button_images = new_image_set(3, 
215                         "generic_up.png", 
216                         "generic_hi.png", 
217                         "generic_dn.png");
218         resources->horizontal_slider_data = new_image_set(6,
219                         "hslider_fg_up.png",
220                         "hslider_fg_hi.png",
221                         "hslider_fg_dn.png",
222                         "hslider_bg_up.png",
223                         "hslider_bg_hi.png",
224                         "hslider_bg_dn.png");
225         resources->progress_images = new_image_set(2,
226                         "progress_bg.png",
227                         "progress_hi.png");
228         resources->tumble_data = new_image_set(4,
229                 "tumble_up.png",
230                 "tumble_hi.png",
231                 "tumble_bottom.png",
232                 "tumble_top.png");
233         resources->listbox_button = new_button4("listbox_button.png",
234                 "editpanel_up.png",
235                 "editpanel_hi.png",
236                 "editpanel_dn.png",
237                 "editpanel_hi.png");
238         resources->listbox_column = new_image_set(3,
239                 "column_up.png",
240                 "column_hi.png",
241                 "column_dn.png");
242         resources->listbox_up = new_image("listbox_up.png");
243         resources->listbox_dn = new_image("listbox_dn.png");
244         resources->pan_data = new_image_set(7,
245                         "pan_up.png", 
246                         "pan_hi.png", 
247                         "pan_popup.png", 
248                         "pan_channel.png", 
249                         "pan_stick.png", 
250                         "pan_channel_small.png", 
251                         "pan_stick_small.png");
252         resources->pan_text_color = WHITE;
254         resources->pot_images = new_image_set(3,
255                 "pot_up.png",
256                 "pot_hi.png",
257                 "pot_dn.png");
259         resources->checkbox_images = new_image_set(5,
260                 "checkbox_up.png",
261                 "checkbox_hi.png",
262                 "checkbox_checked.png",
263                 "checkbox_dn.png",
264                 "checkbox_checkedhi.png");
266         resources->radial_images = new_image_set(5,
267                 "radial_up.png",
268                 "radial_hi.png",
269                 "radial_checked.png",
270                 "radial_dn.png",
271                 "radial_checkedhi.png");
273         resources->xmeter_images = new_image_set(6, 
274                 "xmeter_normal.png",
275                 "xmeter_green.png",
276                 "xmeter_red.png",
277                 "xmeter_yellow.png",
278                 "xmeter_white.png",
279                 "xmeter_over.png");
280         resources->ymeter_images = new_image_set(6, 
281                 "ymeter_normal.png",
282                 "ymeter_green.png",
283                 "ymeter_red.png",
284                 "ymeter_yellow.png",
285                 "ymeter_white.png",
286                 "ymeter_over.png");
288         resources->hscroll_data = new_image_set(10,
289                         "hscroll_handle_up.png",
290                         "hscroll_handle_hi.png",
291                         "hscroll_handle_dn.png",
292                         "hscroll_handle_bg.png",
293                         "hscroll_left_up.png",
294                         "hscroll_left_hi.png",
295                         "hscroll_left_dn.png",
296                         "hscroll_right_up.png",
297                         "hscroll_right_hi.png",
298                         "hscroll_right_dn.png");
300         resources->vscroll_data = new_image_set(10,
301                         "vscroll_handle_up.png",
302                         "vscroll_handle_hi.png",
303                         "vscroll_handle_dn.png",
304                         "vscroll_handle_bg.png",
305                         "vscroll_left_up.png",
306                         "vscroll_left_hi.png",
307                         "vscroll_left_dn.png",
308                         "vscroll_right_up.png",
309                         "vscroll_right_hi.png",
310                         "vscroll_right_dn.png");
313         new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip");
314         new_button("nexttip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "next_tip");
315         new_button("closetip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "close_tip");
318 // Record windows
319         rgui_batch = new_image("recordgui_batch.png");
320         rgui_controls = new_image("recordgui_controls.png");
321         rgui_list = new_image("recordgui_list.png");
322         rmonitor_panel = new_image("recordmonitor_panel.png");
323         rmonitor_meters = new_image("recordmonitor_meters.png");
326         preferencescategory_x = 5;
327         preferencescategory_y = 5;
328         preferencestitle_x = 5;
329         preferencestitle_y = 10;
330         preferencesoptions_x = 5;
331         preferencesoptions_y = 40;
333 // MWindow
334         message_normal = resources->text_default;
335         audio_color = GREEN;
336         mtransport_margin = 30;
337         toggle_margin = 30;
339         new_image("mbutton_bg", "mbutton_bg.png");
340         new_image("timebar_bg", "timebar_bg_flat.png");
341         new_image("timebar_brender", "timebar_brender.png");
342         new_image("clock_bg", "mclock_flat.png");
343         new_image("patchbay_bg", "patchbay_bg.png");
344         new_image("statusbar", "statusbar.png");
345         new_image("mscroll_filler", "mscroll_filler.png");
347         new_image_set("zoombar_menu", 3, "zoompopup_up.png", "zoompopup_hi.png", "zoompopup_dn.png");
348         new_image_set("zoombar_tumbler", 4, "zoomtumble_up.png", "zoomtumble_hi.png", "zoomtumble_bottom.png", "zoomtumble_top.png");
350         new_image_set("mode_popup", 3, "mode_up.png", "mode_hi.png", "mode_dn.png");
351         new_image("mode_add", "mode_add.png");
352         new_image("mode_divide", "mode_divide.png");
353         new_image("mode_multiply", "mode_multiply.png");
354         new_image("mode_normal", "mode_normal.png");
355         new_image("mode_replace", "mode_replace.png");
356         new_image("mode_subtract", "mode_subtract.png");
358 // CWindow
359         new_image("cpanel_bg", "cpanel_bg.png");
360         new_image("cbuttons_left", "cbuttons_left.png");
361         new_image("cbuttons_right", "cbuttons_right.png");
362         new_image("cmeter_bg", "cmeter_bg.png");
364 // VWindow
365         new_image("vbuttons_left", "vbuttons_left.png");
366         new_image("vclock", "vclock.png");
368         new_image("preferences_bg", "preferences_bg.png");
371         new_image("new_bg", "new_bg.png");
372         new_image("setformat_bg", "setformat_bg.png");
375         timebar_view_data = new_image("timebar_view.png");
377         setformat_w = get_image("setformat_bg")->get_w();
378         setformat_h = get_image("setformat_bg")->get_h();
379         setformat_x1 = 15;
380         setformat_x2 = 100;
382         setformat_x3 = 315;
383         setformat_x4 = 415;
384         setformat_y1 = 20;
385         setformat_y2 = 85;
386         setformat_y3 = 125;
387         setformat_margin = 30;
388         setformat_channels_x = 25;
389         setformat_channels_y = 242;
390         setformat_channels_w = 250;
391         setformat_channels_h = 250;
393         loadfile_pad = 50;
394         browse_pad = 20;
397         new_toggle("playpatch.png", 
398                 "patch_up.png",
399                 "patch_hi.png",
400                 "patch_checked.png",
401                 "patch_dn.png",
402                 "patch_checkedhi.png",
403                 "playpatch_data");
405         new_toggle("recordpatch.png", 
406                 "patch_up.png",
407                 "patch_hi.png",
408                 "patch_checked.png",
409                 "patch_dn.png",
410                 "patch_checkedhi.png",
411                 "recordpatch_data");
413         new_toggle("gangpatch.png", 
414                 "patch_up.png",
415                 "patch_hi.png",
416                 "patch_checked.png",
417                 "patch_dn.png",
418                 "patch_checkedhi.png",
419                 "gangpatch_data");
421         new_toggle("drawpatch.png", 
422                 "patch_up.png",
423                 "patch_hi.png",
424                 "patch_checked.png",
425                 "patch_dn.png",
426                 "patch_checkedhi.png",
427                 "drawpatch_data");
430         new_image_set("mutepatch_data", 
431                 5,
432                 "mutepatch_up.png",
433                 "mutepatch_hi.png",
434                 "mutepatch_checked.png",
435                 "mutepatch_dn.png",
436                 "mutepatch_checkedhi.png");
438         new_image_set("expandpatch_data", 
439                 5,
440                 "expandpatch_up.png",
441                 "expandpatch_hi.png",
442                 "expandpatch_checked.png",
443                 "expandpatch_dn.png",
444                 "expandpatch_checkedhi.png");
446         build_icons();
447         build_bg_data();
448         build_overlays();
453         out_point = new_image_set(5,
454                 "out_up.png", 
455                 "out_hi.png", 
456                 "out_checked.png", 
457                 "out_dn.png", 
458                 "out_checkedhi.png");
459         in_point = new_image_set(5,
460                 "in_up.png", 
461                 "in_hi.png", 
462                 "in_checked.png", 
463                 "in_dn.png", 
464                 "in_checkedhi.png");
466         label_toggle = new_image_set(5,
467                 "labeltoggle_up.png", 
468                 "labeltoggle_uphi.png", 
469                 "label_checked.png", 
470                 "labeltoggle_dn.png", 
471                 "label_checkedhi.png");
474         statusbar_cancel_data = new_image_set(3,
475                 "statusbar_cancel_up.png",
476                 "statusbar_cancel_hi.png",
477                 "statusbar_cancel_dn.png");
480         VFrame *editpanel_up = new_image("editpanel_up.png");
481         VFrame *editpanel_hi = new_image("editpanel_hi.png");
482         VFrame *editpanel_dn = new_image("editpanel_dn.png");
483         VFrame *editpanel_checked = new_image("editpanel_checked.png");
484         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
486         new_image("panel_divider", "panel_divider.png");
487         new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify");
488         new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify");
489         new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel");
492         new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
493         new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
494         new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
495         new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
496         new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
497         new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
498         new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "left_justify");
499         new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn, "magnify_button");
500         new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "middle_justify");
501         new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
502         new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
503         over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
504         overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
505         new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
506         new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
507         new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
508         new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "right_justify");
509         splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
510         new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
511         new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "top_justify");
512         new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
513         new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
516         VFrame *transport_up = new_image("transportup.png");
517         VFrame *transport_hi = new_image("transporthi.png");
518         VFrame *transport_dn = new_image("transportdn.png");
520         new_button("end.png", transport_up, transport_hi, transport_dn, "end");
521         new_button("fastfwd.png", transport_up, transport_hi, transport_dn, "fastfwd");
522         new_button("fastrev.png", transport_up, transport_hi, transport_dn, "fastrev");
523         new_button("play.png", transport_up, transport_hi, transport_dn, "play");
524         new_button("framefwd.png", transport_up, transport_hi, transport_dn, "framefwd");
525         new_button("framerev.png", transport_up, transport_hi, transport_dn, "framerev");
526         new_button("pause.png", transport_up, transport_hi, transport_dn, "pause");
527         new_button("record.png", transport_up, transport_hi, transport_dn, "record");
528         new_button("singleframe.png", transport_up, transport_hi, transport_dn, "recframe");
529         new_button("reverse.png", transport_up, transport_hi, transport_dn, "reverse");
530         new_button("rewind.png", transport_up, transport_hi, transport_dn, "rewind");
531         new_button("stop.png", transport_up, transport_hi, transport_dn, "stop");
532         new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec");
536 // CWindow icons
537         new_image("cwindow_inactive", "cwindow_inactive.png");
538         new_image("cwindow_active", "cwindow_active.png");
541         new_image_set("batch_render_start",
542                 3,
543                 "batchstart_up.png",
544                 "batchstart_hi.png",
545                 "batchstart_dn.png");
546         new_image_set("batch_render_stop",
547                 3,
548                 "batchstop_up.png",
549                 "batchstop_hi.png",
550                 "batchstop_dn.png");
551         new_image_set("batch_render_cancel",
552                 3,
553                 "batchcancel_up.png",
554                 "batchcancel_hi.png",
555                 "batchcancel_dn.png");
557         new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
558         new_toggle("autokeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
559         new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
560         new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "meters");
562         VFrame *cpanel_up = new_image("cpanel_up.png");
563         VFrame *cpanel_hi = new_image("cpanel_hi.png");
564         VFrame *cpanel_dn = new_image("cpanel_dn.png");
565         VFrame *cpanel_checked = new_image("cpanel_checked.png");
566         VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
569         new_toggle("camera.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "camera");
570         new_toggle("crop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "crop");
571         new_toggle("eyedrop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "eyedrop");
572         new_toggle("magnify.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "magnify");
573         new_toggle("mask.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "mask");
574         new_toggle("projector.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "projector");
575         new_toggle("protect.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "protect");
576         new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe");
577         new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool");
581         flush_images();
583         title_font = MEDIUMFONT_3D;
584         title_color = WHITE;
585         recordgui_fixed_color = YELLOW;
586         recordgui_variable_color = RED;
588         channel_position_color = MEYELLOW;
589         resources->meter_title_w = 25;
592 #define CWINDOW_METER_MARGIN 5
593 #define VWINDOW_METER_MARGIN 5
595 void SUV::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
597         mbuttons_x = 0;
598         mbuttons_y = gui->mainmenu->get_h() + 1;
599         mbuttons_w = w;
600         mbuttons_h = get_image("mbutton_bg")->get_h();
601         mclock_x = 10;
602         mclock_y = mbuttons_y - 1 + mbuttons_h + CWINDOW_METER_MARGIN;
603         mclock_w = get_image("clock_bg")->get_w() - 40;
604         mclock_h = get_image("clock_bg")->get_h();
605         mtimebar_x = get_image("patchbay_bg")->get_w();
606         mtimebar_y = mbuttons_y - 1 + mbuttons_h;
607         mtimebar_w = w - mtimebar_x;
608         mtimebar_h = get_image("timebar_bg")->get_h();
609         mzoom_h = 25;
610         mzoom_x = 0;
611         mzoom_y = h - get_image("statusbar")->get_h();
612         mzoom_w = w;
613         mstatus_x = 0;
614         mstatus_y = mzoom_y + mzoom_h;
615         mstatus_w = w;
616         mstatus_h = h - mstatus_y;
617         mstatus_message_x = 10;
618         mstatus_message_y = 5;
619         mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
620         mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - 3;
621         mstatus_progress_w = 230;
622         mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
623         mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
624         patchbay_x = 0;
625         patchbay_y = mtimebar_y + mtimebar_h;
626         patchbay_w = get_image("patchbay_bg")->get_w();
627         patchbay_h = mzoom_y - patchbay_y - BC_ScrollBar::get_span(SCROLL_HORIZ);
628         mcanvas_x = patchbay_x + patchbay_w;
629         mcanvas_y = mtimebar_y + mtimebar_h;
630         mcanvas_w = w - patchbay_w - BC_ScrollBar::get_span(SCROLL_VERT);
631         mcanvas_h = patchbay_h;
632         mhscroll_x = 0;
633         mhscroll_y = mcanvas_y + mcanvas_h;
634         mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT);
635         mvscroll_x = mcanvas_x + mcanvas_w;
636         mvscroll_y = mcanvas_y;
637         mvscroll_h = mcanvas_h;
640 void SUV::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
642         if(cwindow_controls)
643         {
644 SET_TRACE
645                 ccomposite_x = 0;
646                 ccomposite_y = 5;
647                 ccomposite_w = get_image("cpanel_bg")->get_w();
648                 ccomposite_h = mwindow->session->cwindow_h - 
649                         get_image("cbuttons_left")->get_h();
650                 cslider_x = 5;
651                 cslider_y = ccomposite_h + 20;
652                 cedit_x = 10;
653                 cedit_y = cslider_y + BC_Slider::get_span(0);
654                 ctransport_x = 10;
655                 ctransport_y = mwindow->session->cwindow_h - 
656                         get_image_set("autokeyframe")[0]->get_h() - 5;
657                 ccanvas_x = ccomposite_x + ccomposite_w;
658                 ccanvas_y = 0;
659                 ccanvas_h = ccomposite_h;
660                 cstatus_x = 420;
661                 cstatus_y = mwindow->session->cwindow_h - 
662                         get_image("cwindow_active")->get_h() - 30;
663                 if(mwindow->edl->session->cwindow_meter)
664                 {
665                         cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
666                                 mwindow->edl->session->cwindow_meter);
667                         ccanvas_w = cmeter_x - ccanvas_x - 5;
668                 }
669                 else
670                 {
671                         cmeter_x = mwindow->session->cwindow_w;
672                         ccanvas_w = cmeter_x - ccanvas_x;
673                 }
674 SET_TRACE
675         }
676         else
677         {
678 SET_TRACE
679                 ccomposite_x = -get_image("cpanel_bg")->get_w();
680                 ccomposite_y = 0;
681                 ccomposite_w = get_image("cpanel_bg")->get_w();
682                 ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h();
684                 cslider_x = 5;
685                 cslider_y = mwindow->session->cwindow_h;
686                 cedit_x = 10;
687                 cedit_y = cslider_y + 17;
688                 ctransport_x = 10;
689                 ctransport_y = cedit_y + 40;
690                 ccanvas_x = 0;
691                 ccanvas_y = 0;
692                 ccanvas_w = mwindow->session->cwindow_w;
693                 ccanvas_h = mwindow->session->cwindow_h;
694                 cmeter_x = mwindow->session->cwindow_w;
695                 cstatus_x = mwindow->session->cwindow_w;
696                 cstatus_y = mwindow->session->cwindow_h;
697 SET_TRACE
698         }
700 SET_TRACE
702         czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20;
703         czoom_y = ctransport_y + 5;
706         cmeter_y = 5;
707         cmeter_h = mwindow->session->cwindow_h - cmeter_y;
709         cslider_w = ccanvas_x + ccanvas_w - cslider_x - 5;
710         ctimebar_x = ccanvas_x;
711         ctimebar_y = ccanvas_y + ccanvas_h;
712         ctimebar_w = ccanvas_w;
713         ctimebar_h = 16;
716 // Not used
717         ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow);
718         ctime_y = ctransport_y;
719         cdest_x = czoom_x;
720         cdest_y = czoom_y + 30;
721 SET_TRACE
726 void SUV::get_recordgui_sizes(RecordGUI *gui, int w, int h)
728         
731 void SUV::get_rmonitor_sizes(int do_audio, 
732         int do_video,
733         int do_channel,
734         int do_interlace,
735         int do_avc,
736         int audio_channels)
738         Theme::get_rmonitor_sizes(do_audio, 
739                 do_video,
740                 do_channel,
741                 do_interlace,
742                 do_avc,
743                 audio_channels);
744         if(!do_video && do_audio)
745         {
746                 rmonitor_meter_y -= 30;
747                 rmonitor_meter_h += 30;
748         }
752 void SUV::get_vwindow_sizes(VWindowGUI *gui)
754         vmeter_y = 5;
755         vmeter_h = mwindow->session->vwindow_h - cmeter_y;
756         vcanvas_x = 0;
757         vcanvas_y = 0;
758         vcanvas_h = mwindow->session->vwindow_h - get_image("vbuttons_left")->get_h();
760         if(mwindow->edl->session->vwindow_meter)
761         {
762                 vmeter_x = mwindow->session->vwindow_w - 
763                         VWINDOW_METER_MARGIN - 
764                         MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
765                         mwindow->edl->session->vwindow_meter);
766                 vcanvas_w = vmeter_x - vcanvas_x - VWINDOW_METER_MARGIN;
767         }
768         else
769         {
770                 vmeter_x = mwindow->session->vwindow_w;
771                 vcanvas_w = mwindow->session->vwindow_w;
772         }
774         vtimebar_x = vcanvas_x;
775         vtimebar_y = vcanvas_y + vcanvas_h;
776         vtimebar_w = vcanvas_w;
777         vtimebar_h = 16;
779         vslider_x = 10;
780         vslider_y = vtimebar_y + 20;
781         vslider_w = vtimebar_w - vslider_x;
782         vedit_x = 10;
783         vedit_y = vslider_y + BC_Slider::get_span(0);
784         vtransport_x = 10;
785         vtransport_y = mwindow->session->vwindow_h - 
786                 get_image_set("autokeyframe")[0]->get_h() - 5;
787         vtime_x = 303;
788         vtime_y = vedit_y + 20;
789         vtime_w = 150;
794         vzoom_x = vtime_x + 150;
795         vzoom_y = vtime_y;
796         vsource_x = vtime_x + 50;
797         vsource_y = vtransport_y + 5;
804 void SUV::build_icons()
806         new_image("mwindow_icon", "heroine_icon.png");
807         new_image("vwindow_icon", "heroine_icon.png");
808         new_image("cwindow_icon", "heroine_icon.png");
809         new_image("awindow_icon", "heroine_icon.png");
810         new_image("record_icon", "heroine_icon.png");
811         new_image("clip_icon", "clip_icon.png");
816 void SUV::build_bg_data()
818 // Audio settings
819         channel_bg_data = new VFrame(get_image_data("channel_bg.png"));
820         channel_position_data = new VFrame(get_image_data("channel_position.png"));
822 // Track bitmaps
823         new_image("resource1024", "resource1024.png");
824         new_image("resource512", "resource512.png");
825         new_image("resource256", "resource256.png");
826         new_image("resource128", "resource128.png");
827         new_image("resource64", "resource64.png");
828         new_image("resource32", "resource32.png");
829         plugin_bg_data = new VFrame(get_image_data("plugin_bg.png"));
830         title_bg_data = new VFrame(get_image_data("title_bg.png"));
831         vtimebar_bg_data = new VFrame(get_image_data("vwindow_timebar.png"));
836 void SUV::build_overlays()
838         keyframe_data = new VFrame(get_image_data("keyframe3.png"));
839         camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png"));
840         maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png"));
841         modekeyframe_data = new VFrame(get_image_data("modekeyframe.png"));
842         pankeyframe_data = new VFrame(get_image_data("pankeyframe.png"));
843         projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png"));
854 void SUV::draw_rwindow_bg(RecordGUI *gui)
856 //      int y;
857 //      int margin = 50;
858 //      int margin2 = 80;
859 //      gui->draw_9segment(recordgui_batch_x - margin,
860 //              0,
861 //              mwindow->session->rwindow_w - recordgui_status_x + margin,
862 //              recordgui_buttons_y,
863 //              rgui_batch);
864 //      gui->draw_3segmenth(recordgui_options_x - margin2,
865 //              recordgui_buttons_y - 5,
866 //              mwindow->session->rwindow_w - recordgui_options_x + margin2,
867 //              rgui_controls);
868 //      y = recordgui_buttons_y - 5 + rgui_controls->get_h();
869 //      gui->draw_9segment(0,
870 //              y,
871 //              mwindow->session->rwindow_w,
872 //              mwindow->session->rwindow_h - y,
873 //              rgui_list);
876 void SUV::draw_rmonitor_bg(RecordMonitorGUI *gui)
878 //      int margin = 45;
879 //      int panel_w = 300;
880 //      int x = rmonitor_meter_x - margin;
881 //      int w = mwindow->session->rmonitor_w - x;
882 //      if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
883 //      gui->clear_box(0, 
884 //              0, 
885 //              mwindow->session->rmonitor_w, 
886 //              mwindow->session->rmonitor_h);
887 //      gui->draw_9segment(x,
888 //              0,
889 //              w,
890 //              mwindow->session->rmonitor_h,
891 //              rmonitor_meters);
899 void SUV::draw_mwindow_bg(MWindowGUI *gui)
901 // Button bar
902         gui->draw_3segmenth(mbuttons_x, 
903                 mbuttons_y - 1, 
904                 mwindow->session->mwindow_w, 
905                 get_image("mbutton_bg"));
907         gui->draw_vframe(get_image("panel_divider"),
908                 mbuttons_x + 238,
909                 mbuttons_y - 1);
911         gui->draw_vframe(get_image("panel_divider"),
912                 mbuttons_x + 337,
913                 mbuttons_y - 1);
915 // Clock
916         gui->draw_3segmenth(0, 
917                 mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
918                 get_image("patchbay_bg")->get_w(), 
919                 get_image("clock_bg"));
921 // Patchbay
922         gui->draw_3segmentv(patchbay_x, 
923                 patchbay_y, 
924                 patchbay_h, 
925                 get_image("patchbay_bg"));
927 // Track canvas
928         gui->set_color(BLACK);
929         gui->draw_box(mcanvas_x, 
930                 mcanvas_y, 
931                 mcanvas_w, 
932                 patchbay_h);
934 // Timebar
935         gui->draw_3segmenth(mtimebar_x, 
936                 mtimebar_y, 
937                 mtimebar_w, 
938                 get_image("timebar_bg"));
940 // Zoombar
941         gui->set_color(0x373737);
942         gui->draw_box(mzoom_x, 
943                 mzoom_y,
944                 mwindow->session->mwindow_w,
945                 25);
947 // Scrollbar filler
948         gui->draw_vframe(get_image("mscroll_filler"), 
949                 mhscroll_x + mhscroll_w,
950                 mvscroll_y + mvscroll_h);
952 // Status
953         gui->draw_3segmenth(mzoom_x,
954                 mzoom_y,
955                 mzoom_w,
956                 get_image("statusbar"));
961 void SUV::draw_cwindow_bg(CWindowGUI *gui)
963         const int button_division = 450;
964         gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
965         gui->draw_3segmenth(0, ccomposite_h, button_division, get_image("cbuttons_left"));
966         if(mwindow->edl->session->cwindow_meter)
967         {
968                 gui->draw_3segmenth(button_division, 
969                         ccomposite_h, 
970                         cmeter_x - CWINDOW_METER_MARGIN - button_division, 
971                         get_image("cbuttons_right"));
972                 gui->draw_9segment(cmeter_x - CWINDOW_METER_MARGIN, 
973                         0, 
974                         mwindow->session->cwindow_w - cmeter_x + CWINDOW_METER_MARGIN, 
975                         mwindow->session->cwindow_h, 
976                         get_image("cmeter_bg"));
977         }
978         else
979         {
980                 gui->draw_3segmenth(button_division, 
981                         ccomposite_h, 
982                         cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, 
983                         get_image("cbuttons_right"));
984         }
987 void SUV::draw_vwindow_bg(VWindowGUI *gui)
989         const int button_division = 325;
990         gui->draw_3segmenth(0, 
991                 vcanvas_h, 
992                 button_division, 
993                 get_image("vbuttons_left"));
994         if(mwindow->edl->session->vwindow_meter)
995         {
996                 gui->draw_3segmenth(button_division, 
997                         vcanvas_h, 
998                         vmeter_x - VWINDOW_METER_MARGIN - button_division, 
999                         get_image("cbuttons_right"));
1000                 gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN,
1001                         0,
1002                         mwindow->session->vwindow_w - vmeter_x + VWINDOW_METER_MARGIN, 
1003                         mwindow->session->vwindow_h, 
1004                         get_image("cmeter_bg"));
1005         }
1006         else
1007         {
1008                 gui->draw_3segmenth(button_division, 
1009                         vcanvas_h, 
1010                         vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, 
1011                         get_image("cbuttons_right"));
1012         }
1014 // Clock border
1015         gui->draw_3segmenth(vtime_x - 20, 
1016                 vtime_y - 1, 
1017                 vtime_w + 40,
1018                 get_image("vclock"));
1021 void SUV::get_preferences_sizes()
1026 void SUV::draw_preferences_bg(PreferencesWindow *gui)
1028         gui->draw_vframe(get_image("preferences_bg"), 0, 0);
1031 void SUV::get_new_sizes(NewWindow *gui)
1035 void SUV::draw_new_bg(NewWindow *gui)
1037         gui->draw_vframe(get_image("new_bg"), 0, 0);
1040 void SUV::draw_setformat_bg(SetFormatWindow *gui)
1042         gui->draw_vframe(get_image("setformat_bg"), 0, 0);
1046 void SUV::get_plugindialog_sizes()
1048         int x = 10, y = 30;
1049         plugindialog_new_x = x;
1050         plugindialog_new_y = y;
1051         plugindialog_shared_x = mwindow->session->plugindialog_w / 3;
1052         plugindialog_shared_y = y;
1053         plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3;
1054         plugindialog_module_y = y;
1056         plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10;
1057         plugindialog_new_h = mwindow->session->plugindialog_h - 120;
1058         plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10;
1059         plugindialog_shared_h = mwindow->session->plugindialog_h - 120;
1060         plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10;
1061         plugindialog_module_h = mwindow->session->plugindialog_h - 120;
1063         plugindialog_newattach_x = plugindialog_new_x + 20;
1064         plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10;
1065         plugindialog_sharedattach_x = plugindialog_shared_x + 20;
1066         plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10;
1067         plugindialog_moduleattach_x = plugindialog_module_x + 20;
1068         plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10;