r1053: Add Russian translation.
[cinelerra_cv.git] / plugins / suv / suv.C
blob99c462242d1718b9898719e06a6b67cec1155f5f
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");
316         new_button("swap_extents.png",
317                 "editpanel_up.png",
318                 "editpanel_hi.png",
319                 "editpanel_dn.png",
320                 "swap_extents");
323 // Record windows
324         rgui_batch = new_image("recordgui_batch.png");
325         rgui_controls = new_image("recordgui_controls.png");
326         rgui_list = new_image("recordgui_list.png");
327         rmonitor_panel = new_image("recordmonitor_panel.png");
328         rmonitor_meters = new_image("recordmonitor_meters.png");
331         preferences_category_overlap = 0;
332         preferencescategory_x = 0;
333         preferencescategory_y = 5;
334         preferencestitle_x = 5;
335         preferencestitle_y = 10;
336         preferencesoptions_x = 5;
337         preferencesoptions_y = 0;
339 // MWindow
340         message_normal = resources->text_default;
341         audio_color = GREEN;
342         mtransport_margin = 10;
343         toggle_margin = 10;
345         new_image("mbutton_bg", "mbutton_bg.png");
346         new_image("timebar_bg", "timebar_bg_flat.png");
347         new_image("timebar_brender", "timebar_brender.png");
348         new_image("clock_bg", "mclock_flat.png");
349         new_image("patchbay_bg", "patchbay_bg.png");
350         new_image("statusbar", "statusbar.png");
351         new_image("mscroll_filler", "mscroll_filler.png");
353         new_image_set("zoombar_menu", 3, "zoompopup_up.png", "zoompopup_hi.png", "zoompopup_dn.png");
354         new_image_set("zoombar_tumbler", 4, "zoomtumble_up.png", "zoomtumble_hi.png", "zoomtumble_bottom.png", "zoomtumble_top.png");
356         new_image_set("mode_popup", 3, "mode_up.png", "mode_hi.png", "mode_dn.png");
357         new_image("mode_add", "mode_add.png");
358         new_image("mode_divide", "mode_divide.png");
359         new_image("mode_multiply", "mode_multiply.png");
360         new_image("mode_normal", "mode_normal.png");
361         new_image("mode_replace", "mode_replace.png");
362         new_image("mode_subtract", "mode_subtract.png");
363         new_image("mode_max", "mode_max.png");
365         new_image_set("plugin_on", 5, "plugin_on.png", "plugin_onhi.png", "plugin_onselect.png", "plugin_ondn.png", "plugin_onselecthi.png");
366         new_image_set("plugin_show", 5, "plugin_show.png", "plugin_showhi.png", "plugin_showselect.png", "plugin_showdn.png", "plugin_showselecthi.png");
368 // CWindow
369         new_image("cpanel_bg", "cpanel_bg.png");
370         new_image("cbuttons_left", "cbuttons_left.png");
371         new_image("cbuttons_right", "cbuttons_right.png");
372         new_image("cmeter_bg", "cmeter_bg.png");
374 // VWindow
375         new_image("vbuttons_left", "vbuttons_left.png");
376         new_image("vclock", "vclock.png");
378         new_image("preferences_bg", "preferences_bg.png");
381         new_image("new_bg", "new_bg.png");
382         new_image("setformat_bg", "setformat_bg.png");
385         timebar_view_data = new_image("timebar_view.png");
387         setformat_w = get_image("setformat_bg")->get_w();
388         setformat_h = get_image("setformat_bg")->get_h();
389         setformat_x1 = 15;
390         setformat_x2 = 100;
392         setformat_x3 = 315;
393         setformat_x4 = 415;
394         setformat_y1 = 20;
395         setformat_y2 = 85;
396         setformat_y3 = 125;
397         setformat_margin = 30;
398         setformat_channels_x = 25;
399         setformat_channels_y = 242;
400         setformat_channels_w = 250;
401         setformat_channels_h = 250;
403         loadfile_pad = 50;
404         browse_pad = 20;
407         new_toggle("playpatch.png", 
408                 "patch_up.png",
409                 "patch_hi.png",
410                 "patch_checked.png",
411                 "patch_dn.png",
412                 "patch_checkedhi.png",
413                 "playpatch_data");
415         new_toggle("recordpatch.png", 
416                 "patch_up.png",
417                 "patch_hi.png",
418                 "patch_checked.png",
419                 "patch_dn.png",
420                 "patch_checkedhi.png",
421                 "recordpatch_data");
423         new_toggle("gangpatch.png", 
424                 "patch_up.png",
425                 "patch_hi.png",
426                 "patch_checked.png",
427                 "patch_dn.png",
428                 "patch_checkedhi.png",
429                 "gangpatch_data");
431         new_toggle("drawpatch.png", 
432                 "patch_up.png",
433                 "patch_hi.png",
434                 "patch_checked.png",
435                 "patch_dn.png",
436                 "patch_checkedhi.png",
437                 "drawpatch_data");
440         new_image_set("mutepatch_data", 
441                 5,
442                 "mutepatch_up.png",
443                 "mutepatch_hi.png",
444                 "mutepatch_checked.png",
445                 "mutepatch_dn.png",
446                 "mutepatch_checkedhi.png");
448         new_image_set("expandpatch_data", 
449                 5,
450                 "expandpatch_up.png",
451                 "expandpatch_hi.png",
452                 "expandpatch_checked.png",
453                 "expandpatch_dn.png",
454                 "expandpatch_checkedhi.png");
456         build_icons();
457         build_bg_data();
458         build_overlays();
463         out_point = new_image_set(5,
464                 "out_up.png", 
465                 "out_hi.png", 
466                 "out_checked.png", 
467                 "out_dn.png", 
468                 "out_checkedhi.png");
469         in_point = new_image_set(5,
470                 "in_up.png", 
471                 "in_hi.png", 
472                 "in_checked.png", 
473                 "in_dn.png", 
474                 "in_checkedhi.png");
476         label_toggle = new_image_set(5,
477                 "labeltoggle_up.png", 
478                 "labeltoggle_uphi.png", 
479                 "label_checked.png", 
480                 "labeltoggle_dn.png", 
481                 "label_checkedhi.png");
484         statusbar_cancel_data = new_image_set(3,
485                 "statusbar_cancel_up.png",
486                 "statusbar_cancel_hi.png",
487                 "statusbar_cancel_dn.png");
490         VFrame *editpanel_up = new_image("editpanel_up.png");
491         VFrame *editpanel_hi = new_image("editpanel_hi.png");
492         VFrame *editpanel_dn = new_image("editpanel_dn.png");
493         VFrame *editpanel_checked = new_image("editpanel_checked.png");
494         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
496         new_image("panel_divider", "panel_divider.png");
497         new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify");
498         new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify");
499         new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel");
502         new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
503         new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
504         new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
505         new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
506         new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
507         new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
508         new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "left_justify");
509         new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn, "magnify_button");
510         new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "middle_justify");
511         new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
512         new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
513         over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
514         overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
515         new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
516         new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
517         new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
518         new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "right_justify");
519         splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
520         new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
521         new_button("goto.png", editpanel_up, editpanel_hi, editpanel_dn, "goto");
522         new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "top_justify");
523         new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
524         new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
527         VFrame *transport_up = new_image("transportup.png");
528         VFrame *transport_hi = new_image("transporthi.png");
529         VFrame *transport_dn = new_image("transportdn.png");
531         new_button("end.png", transport_up, transport_hi, transport_dn, "end");
532         new_button("fastfwd.png", transport_up, transport_hi, transport_dn, "fastfwd");
533         new_button("fastrev.png", transport_up, transport_hi, transport_dn, "fastrev");
534         new_button("play.png", transport_up, transport_hi, transport_dn, "play");
535         new_button("framefwd.png", transport_up, transport_hi, transport_dn, "framefwd");
536         new_button("framerev.png", transport_up, transport_hi, transport_dn, "framerev");
537         new_button("pause.png", transport_up, transport_hi, transport_dn, "pause");
538         new_button("record.png", transport_up, transport_hi, transport_dn, "record");
539         new_button("singleframe.png", transport_up, transport_hi, transport_dn, "recframe");
540         new_button("reverse.png", transport_up, transport_hi, transport_dn, "reverse");
541         new_button("rewind.png", transport_up, transport_hi, transport_dn, "rewind");
542         new_button("stop.png", transport_up, transport_hi, transport_dn, "stop");
543         new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec");
547 // CWindow icons
548         new_image("cwindow_inactive", "cwindow_inactive.png");
549         new_image("cwindow_active", "cwindow_active.png");
552         new_image_set("batch_render_start",
553                 3,
554                 "batchstart_up.png",
555                 "batchstart_hi.png",
556                 "batchstart_dn.png");
557         new_image_set("batch_render_stop",
558                 3,
559                 "batchstop_up.png",
560                 "batchstop_hi.png",
561                 "batchstop_dn.png");
562         new_image_set("batch_render_cancel",
563                 3,
564                 "batchcancel_up.png",
565                 "batchcancel_hi.png",
566                 "batchcancel_dn.png");
568         new_image_set("category_button",
569                 3,
570                 "preferencesbutton_dn.png",
571                 "preferencesbutton_dnhi.png",
572                 "preferencesbutton_dnlo.png");
574         new_image_set("category_button_checked",
575                 3,
576                 "preferencesbutton_up.png",
577                 "preferencesbutton_uphi.png",
578                 "preferencesbutton_dnlo.png");
585         new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
586         new_toggle("autokeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
587         new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
588         new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "meters");
589         new_toggle("blank30x30.png", 
590                    new_image("locklabels_locked.png"),
591                    new_image("locklabels_lockedhi.png"),
592                    new_image("locklabels_unlocked.png"),
593                    new_image("locklabels_dn.png"), // can't have seperate down for each!!??
594                    new_image("locklabels_unlockedhi.png"),
595                    "locklabels");
597         VFrame *cpanel_up = new_image("cpanel_up.png");
598         VFrame *cpanel_hi = new_image("cpanel_hi.png");
599         VFrame *cpanel_dn = new_image("cpanel_dn.png");
600         VFrame *cpanel_checked = new_image("cpanel_checked.png");
601         VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
604         new_toggle("camera.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "camera");
605         new_toggle("crop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "crop");
606         new_toggle("eyedrop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "eyedrop");
607         new_toggle("magnify.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "magnify");
608         new_toggle("mask.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "mask");
609         new_toggle("projector.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "projector");
610         new_toggle("protect.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "protect");
611         new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe");
612         new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool");
616         flush_images();
618         title_font = MEDIUMFONT_3D;
619         title_color = 0xbfbfbf;
620         recordgui_fixed_color = YELLOW;
621         recordgui_variable_color = RED;
623         channel_position_color = MEYELLOW;
624         resources->meter_title_w = 25;
627 #define CWINDOW_METER_MARGIN 5
628 #define VWINDOW_METER_MARGIN 5
630 void SUV::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
632         mbuttons_x = 0;
633         mbuttons_y = gui->mainmenu->get_h() + 1;
634         mbuttons_w = w;
635         mbuttons_h = get_image("mbutton_bg")->get_h();
636         mclock_x = 10;
637         mclock_y = mbuttons_y - 1 + mbuttons_h + CWINDOW_METER_MARGIN;
638         mclock_w = get_image("clock_bg")->get_w() - 40;
639         mclock_h = get_image("clock_bg")->get_h();
640         mtimebar_x = get_image("patchbay_bg")->get_w();
641         mtimebar_y = mbuttons_y - 1 + mbuttons_h;
642         mtimebar_w = w - mtimebar_x;
643         mtimebar_h = get_image("timebar_bg")->get_h();
644         mzoom_h = 25;
645         mzoom_x = 0;
646         mzoom_y = h - get_image("statusbar")->get_h();
647         mzoom_w = w;
648         mstatus_x = 0;
649         mstatus_y = mzoom_y + mzoom_h;
650         mstatus_w = w;
651         mstatus_h = h - mstatus_y;
652         mstatus_message_x = 10;
653         mstatus_message_y = 5;
654         mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
655         mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - 3;
656         mstatus_progress_w = 230;
657         mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
658         mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
659         patchbay_x = 0;
660         patchbay_y = mtimebar_y + mtimebar_h;
661         patchbay_w = get_image("patchbay_bg")->get_w();
662         patchbay_h = mzoom_y - patchbay_y - BC_ScrollBar::get_span(SCROLL_HORIZ);
663         mcanvas_x = patchbay_x + patchbay_w;
664         mcanvas_y = mtimebar_y + mtimebar_h;
665         mcanvas_w = w - patchbay_w - BC_ScrollBar::get_span(SCROLL_VERT);
666         mcanvas_h = patchbay_h;
667         mhscroll_x = 0;
668         mhscroll_y = mcanvas_y + mcanvas_h;
669         mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT);
670         mvscroll_x = mcanvas_x + mcanvas_w;
671         mvscroll_y = mcanvas_y;
672         mvscroll_h = mcanvas_h;
675 void SUV::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
677         if(cwindow_controls)
678         {
679 SET_TRACE
680                 ccomposite_x = 0;
681                 ccomposite_y = 5;
682                 ccomposite_w = get_image("cpanel_bg")->get_w();
683                 ccomposite_h = mwindow->session->cwindow_h - 
684                         get_image("cbuttons_left")->get_h();
685                 cslider_x = 5;
686                 cslider_y = ccomposite_h + 20;
687                 cedit_x = 10;
688                 cedit_y = cslider_y + BC_Slider::get_span(0);
689                 ctransport_x = 10;
690                 ctransport_y = mwindow->session->cwindow_h - 
691                         get_image_set("autokeyframe")[0]->get_h() - 5;
692                 ccanvas_x = ccomposite_x + ccomposite_w;
693                 ccanvas_y = 0;
694                 ccanvas_h = ccomposite_h;
695                 cstatus_x = 420;
696                 cstatus_y = mwindow->session->cwindow_h - 
697                         get_image("cwindow_active")->get_h() - 30;
698                 if(mwindow->edl->session->cwindow_meter)
699                 {
700                         cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
701                                 mwindow->edl->session->cwindow_meter);
702                         ccanvas_w = cmeter_x - ccanvas_x - 5;
703                 }
704                 else
705                 {
706                         cmeter_x = mwindow->session->cwindow_w;
707                         ccanvas_w = cmeter_x - ccanvas_x;
708                 }
709 SET_TRACE
710         }
711         else
712         {
713 SET_TRACE
714                 ccomposite_x = -get_image("cpanel_bg")->get_w();
715                 ccomposite_y = 0;
716                 ccomposite_w = get_image("cpanel_bg")->get_w();
717                 ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h();
719                 cslider_x = 5;
720                 cslider_y = mwindow->session->cwindow_h;
721                 cedit_x = 10;
722                 cedit_y = cslider_y + 17;
723                 ctransport_x = 10;
724                 ctransport_y = cedit_y + 40;
725                 ccanvas_x = 0;
726                 ccanvas_y = 0;
727                 ccanvas_w = mwindow->session->cwindow_w;
728                 ccanvas_h = mwindow->session->cwindow_h;
729                 cmeter_x = mwindow->session->cwindow_w;
730                 cstatus_x = mwindow->session->cwindow_w;
731                 cstatus_y = mwindow->session->cwindow_h;
732 SET_TRACE
733         }
735 SET_TRACE
737         czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20;
738         czoom_y = ctransport_y + 5;
741         cmeter_y = 5;
742         cmeter_h = mwindow->session->cwindow_h - cmeter_y;
744         cslider_w = ccanvas_x + ccanvas_w - cslider_x - 5;
745         ctimebar_x = ccanvas_x;
746         ctimebar_y = ccanvas_y + ccanvas_h;
747         ctimebar_w = ccanvas_w;
748         ctimebar_h = 16;
751 // Not used
752         ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow);
753         ctime_y = ctransport_y;
754         cdest_x = czoom_x;
755         cdest_y = czoom_y + 30;
756 SET_TRACE
761 void SUV::get_recordgui_sizes(RecordGUI *gui, int w, int h)
763         
766 void SUV::get_rmonitor_sizes(int do_audio, 
767         int do_video,
768         int do_channel,
769         int do_interlace,
770         int do_avc,
771         int audio_channels)
773         Theme::get_rmonitor_sizes(do_audio, 
774                 do_video,
775                 do_channel,
776                 do_interlace,
777                 do_avc,
778                 audio_channels);
779         if(!do_video && do_audio)
780         {
781                 rmonitor_meter_y -= 30;
782                 rmonitor_meter_h += 30;
783         }
787 void SUV::get_vwindow_sizes(VWindowGUI *gui)
789         vmeter_y = 5;
790         vmeter_h = mwindow->session->vwindow_h - cmeter_y;
791         vcanvas_x = 0;
792         vcanvas_y = 0;
793         vcanvas_h = mwindow->session->vwindow_h - get_image("vbuttons_left")->get_h();
795         if(mwindow->edl->session->vwindow_meter)
796         {
797                 vmeter_x = mwindow->session->vwindow_w - 
798                         VWINDOW_METER_MARGIN - 
799                         MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
800                         mwindow->edl->session->vwindow_meter);
801                 vcanvas_w = vmeter_x - vcanvas_x - VWINDOW_METER_MARGIN;
802         }
803         else
804         {
805                 vmeter_x = mwindow->session->vwindow_w;
806                 vcanvas_w = mwindow->session->vwindow_w;
807         }
809         vtimebar_x = vcanvas_x;
810         vtimebar_y = vcanvas_y + vcanvas_h;
811         vtimebar_w = vcanvas_w;
812         vtimebar_h = 16;
814         vslider_x = 10;
815         vslider_y = vtimebar_y + 20;
816         vslider_w = vtimebar_w - vslider_x;
817         vedit_x = 10;
818         vedit_y = vslider_y + BC_Slider::get_span(0);
819         vtransport_x = 10;
820         vtransport_y = mwindow->session->vwindow_h - 
821                 get_image_set("autokeyframe")[0]->get_h() - 5;
822         vtime_x = 303;
823         vtime_y = vedit_y + 20;
824         vtime_w = 150;
829         vzoom_x = vtime_x + 150;
830         vzoom_y = vtime_y;
831         vsource_x = vtime_x + 50;
832         vsource_y = vtransport_y + 5;
839 void SUV::build_icons()
841         new_image("mwindow_icon", "heroine_icon.png");
842         new_image("vwindow_icon", "heroine_icon.png");
843         new_image("cwindow_icon", "heroine_icon.png");
844         new_image("awindow_icon", "heroine_icon.png");
845         new_image("record_icon", "heroine_icon.png");
846         new_image("clip_icon", "clip_icon.png");
851 void SUV::build_bg_data()
853 // Audio settings
854         channel_bg_data = new VFrame(get_image_data("channel_bg.png"));
855         channel_position_data = new VFrame(get_image_data("channel_position.png"));
857 // Track bitmaps
858         new_image("resource1024", "resource1024.png");
859         new_image("resource512", "resource512.png");
860         new_image("resource256", "resource256.png");
861         new_image("resource128", "resource128.png");
862         new_image("resource64", "resource64.png");
863         new_image("resource32", "resource32.png");
864         new_image("plugin_bg_data", "plugin_bg.png");
865         new_image("title_bg_data", "title_bg.png");
866         new_image("vtimebar_bg_data", "vwindow_timebar.png");
871 void SUV::build_overlays()
873         keyframe_data = new VFrame(get_image_data("keyframe3.png"));
874         camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png"));
875         maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png"));
876         modekeyframe_data = new VFrame(get_image_data("modekeyframe.png"));
877         pankeyframe_data = new VFrame(get_image_data("pankeyframe.png"));
878         projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png"));
889 void SUV::draw_rwindow_bg(RecordGUI *gui)
891 //      int y;
892 //      int margin = 50;
893 //      int margin2 = 80;
894 //      gui->draw_9segment(recordgui_batch_x - margin,
895 //              0,
896 //              mwindow->session->rwindow_w - recordgui_status_x + margin,
897 //              recordgui_buttons_y,
898 //              rgui_batch);
899 //      gui->draw_3segmenth(recordgui_options_x - margin2,
900 //              recordgui_buttons_y - 5,
901 //              mwindow->session->rwindow_w - recordgui_options_x + margin2,
902 //              rgui_controls);
903 //      y = recordgui_buttons_y - 5 + rgui_controls->get_h();
904 //      gui->draw_9segment(0,
905 //              y,
906 //              mwindow->session->rwindow_w,
907 //              mwindow->session->rwindow_h - y,
908 //              rgui_list);
911 void SUV::draw_rmonitor_bg(RecordMonitorGUI *gui)
913 //      int margin = 45;
914 //      int panel_w = 300;
915 //      int x = rmonitor_meter_x - margin;
916 //      int w = mwindow->session->rmonitor_w - x;
917 //      if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
918 //      gui->clear_box(0, 
919 //              0, 
920 //              mwindow->session->rmonitor_w, 
921 //              mwindow->session->rmonitor_h);
922 //      gui->draw_9segment(x,
923 //              0,
924 //              w,
925 //              mwindow->session->rmonitor_h,
926 //              rmonitor_meters);
934 void SUV::draw_mwindow_bg(MWindowGUI *gui)
936 // Button bar
937         gui->draw_3segmenth(mbuttons_x, 
938                 mbuttons_y - 1, 
939                 mwindow->session->mwindow_w, 
940                 get_image("mbutton_bg"));
942         int pdw = get_image("panel_divider")->get_w();
943         int x = mbuttons_x;
944         x += 9 * get_image("play")->get_w();
945         x += mtransport_margin;                                       // the control buttons
947         gui->draw_vframe(get_image("panel_divider"),
948                 x - toggle_margin / 2 - pdw / 2 + 2,
949                 mbuttons_y - 1);
950         x += 2 * get_image("arrow")->get_w() + toggle_margin;           // the mode buttons
952         gui->draw_vframe(get_image("panel_divider"),
953                 x - toggle_margin / 2 - pdw / 2 + 2,
954                 mbuttons_y - 1);
956         x += 2 * get_image("autokeyframe")->get_w() + toggle_margin;    // the state toggle buttons
957         gui->draw_vframe(get_image("panel_divider"),
958                 x - toggle_margin / 2 - pdw / 2 + 2,
959                 mbuttons_y - 1);
961 // Clock
962         gui->draw_3segmenth(0, 
963                 mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
964                 get_image("patchbay_bg")->get_w(), 
965                 get_image("clock_bg"));
967 // Patchbay
968         gui->draw_3segmentv(patchbay_x, 
969                 patchbay_y, 
970                 patchbay_h, 
971                 get_image("patchbay_bg"));
973 // Track canvas
974         gui->set_color(BLACK);
975         gui->draw_box(mcanvas_x, 
976                 mcanvas_y, 
977                 mcanvas_w, 
978                 patchbay_h);
980 // Timebar
981         gui->draw_3segmenth(mtimebar_x, 
982                 mtimebar_y, 
983                 mtimebar_w, 
984                 get_image("timebar_bg"));
986 // Zoombar
987         gui->set_color(0x373737);
988         gui->draw_box(mzoom_x, 
989                 mzoom_y,
990                 mwindow->session->mwindow_w,
991                 25);
993 // Scrollbar filler
994         gui->draw_vframe(get_image("mscroll_filler"), 
995                 mhscroll_x + mhscroll_w,
996                 mvscroll_y + mvscroll_h);
998 // Status
999         gui->draw_3segmenth(mzoom_x,
1000                 mzoom_y,
1001                 mzoom_w,
1002                 get_image("statusbar"));
1007 void SUV::draw_cwindow_bg(CWindowGUI *gui)
1009         const int button_division = 450;
1010         gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
1011         gui->draw_3segmenth(0, ccomposite_h, button_division, get_image("cbuttons_left"));
1012         if(mwindow->edl->session->cwindow_meter)
1013         {
1014                 gui->draw_3segmenth(button_division, 
1015                         ccomposite_h, 
1016                         cmeter_x - CWINDOW_METER_MARGIN - button_division, 
1017                         get_image("cbuttons_right"));
1018                 gui->draw_9segment(cmeter_x - CWINDOW_METER_MARGIN, 
1019                         0, 
1020                         mwindow->session->cwindow_w - cmeter_x + CWINDOW_METER_MARGIN, 
1021                         mwindow->session->cwindow_h, 
1022                         get_image("cmeter_bg"));
1023         }
1024         else
1025         {
1026                 gui->draw_3segmenth(button_division, 
1027                         ccomposite_h, 
1028                         cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, 
1029                         get_image("cbuttons_right"));
1030         }
1033 void SUV::draw_vwindow_bg(VWindowGUI *gui)
1035         const int button_division = 325;
1036         gui->draw_3segmenth(0, 
1037                 vcanvas_h, 
1038                 button_division, 
1039                 get_image("vbuttons_left"));
1040         if(mwindow->edl->session->vwindow_meter)
1041         {
1042                 gui->draw_3segmenth(button_division, 
1043                         vcanvas_h, 
1044                         vmeter_x - VWINDOW_METER_MARGIN - button_division, 
1045                         get_image("cbuttons_right"));
1046                 gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN,
1047                         0,
1048                         mwindow->session->vwindow_w - vmeter_x + VWINDOW_METER_MARGIN, 
1049                         mwindow->session->vwindow_h, 
1050                         get_image("cmeter_bg"));
1051         }
1052         else
1053         {
1054                 gui->draw_3segmenth(button_division, 
1055                         vcanvas_h, 
1056                         vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, 
1057                         get_image("cbuttons_right"));
1058         }
1060 // Clock border
1061         gui->draw_3segmenth(vtime_x - 20, 
1062                 vtime_y - 1, 
1063                 vtime_w + 40,
1064                 get_image("vclock"));
1067 void SUV::get_preferences_sizes()
1072 void SUV::draw_preferences_bg(PreferencesWindow *gui)
1074         gui->draw_vframe(get_image("preferences_bg"), 0, 0);
1077 void SUV::get_new_sizes(NewWindow *gui)
1081 void SUV::draw_new_bg(NewWindow *gui)
1083         gui->draw_vframe(get_image("new_bg"), 0, 0);
1086 void SUV::draw_setformat_bg(SetFormatWindow *gui)
1088         gui->draw_vframe(get_image("setformat_bg"), 0, 0);
1092 void SUV::get_plugindialog_sizes()
1094         int x = 10, y = 30;
1095         plugindialog_new_x = x;
1096         plugindialog_new_y = y;
1097         plugindialog_shared_x = mwindow->session->plugindialog_w / 3;
1098         plugindialog_shared_y = y;
1099         plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3;
1100         plugindialog_module_y = y;
1102         plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10;
1103         plugindialog_new_h = mwindow->session->plugindialog_h - 100;
1104         plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10;
1105         plugindialog_shared_h = mwindow->session->plugindialog_h - 100;
1106         plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10;
1107         plugindialog_module_h = mwindow->session->plugindialog_h - 100;
1109         plugindialog_newattach_x = plugindialog_new_x + 20;
1110         plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10;
1111         plugindialog_sharedattach_x = plugindialog_shared_x + 20;
1112         plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10;
1113         plugindialog_moduleattach_x = plugindialog_module_x + 20;
1114         plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10;