fixes and upgrades to guicast
[goodguy/history.git] / cinelerra-5.0 / plugins / microtheme / microtheme.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #include "cwindowgui.h"
23 #include "edl.h"
24 #include "edlsession.h"
25 #include "loadmode.h"
26 #include "mainmenu.h"
27 #include "mainsession.h"
28 #include "microtheme.h"
29 #include "mwindow.h"
30 #include "mwindowgui.h"
31 #include "statusbar.h"
32 #include "timebar.h"
33 #include "trackcanvas.h"
34 #include "vframe.h"
35
36 PluginClient* new_plugin(PluginServer *server)
37 {
38         return new MicroThemeMain(server);
39 }
40
41
42 MicroThemeMain::MicroThemeMain(PluginServer *server)
43  : PluginTClient(server)
44 {
45 }
46
47 MicroThemeMain::~MicroThemeMain()
48 {
49         delete camerakeyframe_data;
50         delete channel_bg_data;
51         delete channel_position_data;
52         delete keyframe_data;
53         delete maskkeyframe_data;
54         delete modekeyframe_data;
55         delete pankeyframe_data;
56         delete projectorkeyframe_data;
57 }
58
59
60 char* MicroThemeMain::plugin_title() 
61 {
62         return _("Microscopic"); 
63 }
64
65 Theme* MicroThemeMain::new_theme()
66 {
67         return theme = new MicroTheme;
68 }
69
70
71
72
73
74 MicroTheme::MicroTheme()
75  : Theme()
76 {
77 }
78 MicroTheme::~MicroTheme()
79 {
80 }
81
82 void MicroTheme::initialize()
83 {
84 //printf("MicroTheme::initialize 1\n");
85         mwindow_icon = new VFramePng(get_image("mwindow_icon.png"));
86         vwindow_icon = new VFramePng(get_image("mwindow_icon.png"));
87         cwindow_icon = new VFramePng(get_image("mwindow_icon.png"));
88         awindow_icon = new VFramePng(get_image("mwindow_icon.png"));
89         record_icon = new VFramePng(get_image("mwindow_icon.png"));
90         clip_icon = new VFramePng(get_image("clip_icon.png"));
91
92
93         static VFrame *default_patchbay_bg = new VFramePng(get_image("patchbay_bg.png"));
94
95         BC_WindowBase::get_resources()->bg_color = WHITE;
96         BC_WindowBase::get_resources()->menu_light = WHITE;
97         BC_WindowBase::get_resources()->menu_highlighted = WHITE;
98         BC_WindowBase::get_resources()->menu_down = LTGREY;
99         BC_WindowBase::get_resources()->menu_up = WHITE;
100         BC_WindowBase::get_resources()->menu_shadow = MEGREY;
101         BC_WindowBase::get_resources()->medium_font = "-*-helvetica-medium-r-normal-*-10-*";
102         
103         static VFrame* default_listbox_bg = new VFramePng(get_image("patchbay_bg.png"));
104         BC_WindowBase::get_resources()->listbox_bg = default_listbox_bg;
105         BC_WindowBase::get_resources()->button_light = WHITE;
106         BC_WindowBase::get_resources()->button_up = WHITE;
107
108         
109         static VFrame *default_cancel_images[] = 
110         {
111                 new VFramePng(get_image("cancel_up.png")), new VFramePng(get_image("cancel_hi.png")), new VFramePng(get_image("cancel_dn.png"))
112         };
113         BC_WindowBase::get_resources()->cancel_images = default_cancel_images;
114
115         static VFrame *default_ok_images[] = 
116         {
117                 new VFramePng(get_image("ok_up.png")), new VFramePng(get_image("ok_hi.png")), new VFramePng(get_image("ok_dn.png"))
118         };
119         BC_WindowBase::get_resources()->ok_images = default_ok_images;
120
121         static VFrame *default_button_images[] = 
122         {
123                 new VFramePng(get_image("generic_up.png")), new VFramePng(get_image("generic_hi.png")), new VFramePng(get_image("generic_dn.png"))
124         };
125         BC_WindowBase::get_resources()->generic_button_images = default_button_images;
126
127         static VFrame *default_tumble_images[] = 
128         {
129                 new VFramePng(get_image("tumble_up.png")), new VFramePng(get_image("tumble_hi.png")), new VFramePng(get_image("tumble_bottomdn.png")), new VFramePng(get_image("tumble_topdn.png"))
130         };
131         BC_WindowBase::get_resources()->tumble_data = default_tumble_images;
132
133         static VFrame *default_checkbox_images[] = 
134         {
135                 new VFramePng(get_image("checkbox_up.png")), new VFramePng(get_image("checkbox_hi.png")), new VFramePng(get_image("checkbox_checked.png")), new VFramePng(get_image("checkbox_dn.png")), new VFramePng(get_image("checkbox_checkedhi.png"))
136         };
137         BC_WindowBase::get_resources()->checkbox_images = default_checkbox_images;
138         
139         static VFrame *default_radial_images[] = 
140         {
141                 new VFramePng(get_image("radial_up.png")), new VFramePng(get_image("radial_hi.png")), new VFramePng(get_image("radial_checked.png")), new VFramePng(get_image("radial_dn.png")), new VFramePng(get_image("radial_checkedhi.png"))
142         };
143         BC_WindowBase::get_resources()->radial_images = default_radial_images;
144
145         static VFrame* default_xmeter_data[] =
146         {
147                 new VFramePng(get_image("xmeter_normal.png")),
148                 new VFramePng(get_image("xmeter_green.png")),
149                 new VFramePng(get_image("xmeter_red.png")),
150                 new VFramePng(get_image("xmeter_yellow.png")),
151                 new VFramePng(get_image("over_horiz.png"))
152                 new VFramePng(get_image("downmix51_2.png"))
153         };
154
155         static VFrame* default_ymeter_data[] =
156         {
157                 new VFramePng(get_image("ymeter_normal.png")),
158                 new VFramePng(get_image("ymeter_green.png")),
159                 new VFramePng(get_image("ymeter_red.png")),
160                 new VFramePng(get_image("ymeter_yellow.png")),
161                 new VFramePng(get_image("over_vert.png"))
162                 new VFramePng(get_image("downmix51_2.png"))
163         };
164         BC_WindowBase::get_resources()->xmeter_images = default_xmeter_data;
165         BC_WindowBase::get_resources()->ymeter_images = default_ymeter_data;
166         BC_WindowBase::get_resources()->meter_font = SMALLFONT;
167         BC_WindowBase::get_resources()->meter_font_color = BLACK;
168         BC_WindowBase::get_resources()->meter_title_w = 25;
169         BC_WindowBase::get_resources()->meter_3d = 0;
170
171         static VFrame* default_pan_data[] = 
172         {
173                 new VFramePng(get_image("pan_up.png")), 
174                 new VFramePng(get_image("pan_hi.png")), 
175                 new VFramePng(get_image("pan_popup.png")), 
176                 new VFramePng(get_image("pan_channel.png")), 
177                 new VFramePng(get_image("pan_stick.png")), 
178                 new VFramePng(get_image("pan_channel_small.png")), 
179                 new VFramePng(get_image("pan_stick_small.png"))
180         };
181         BC_WindowBase::get_resources()->pan_data = default_pan_data;
182         BC_WindowBase::get_resources()->pan_text_color = BLACK;
183
184         static VFrame *default_hscroll_data[] = 
185         {
186                 new VFramePng(get_image("hscroll_handle_up.png")), 
187                 new VFramePng(get_image("hscroll_handle_hi.png")), 
188                 new VFramePng(get_image("hscroll_handle_dn.png")), 
189                 new VFramePng(get_image("hscroll_handle_bg.png")), 
190                 new VFramePng(get_image("hscroll_left_up.png")), 
191                 new VFramePng(get_image("hscroll_left_hi.png")), 
192                 new VFramePng(get_image("hscroll_left_dn.png")), 
193                 new VFramePng(get_image("hscroll_right_up.png")), 
194                 new VFramePng(get_image("hscroll_right_hi.png")), 
195                 new VFramePng(get_image("hscroll_right_dn.png"))
196         };
197         static VFrame *default_vscroll_data[] = 
198         {
199                 new VFramePng(get_image("vscroll_handle_up.png")), 
200                 new VFramePng(get_image("vscroll_handle_hi.png")), 
201                 new VFramePng(get_image("vscroll_handle_dn.png")), 
202                 new VFramePng(get_image("vscroll_handle_bg.png")), 
203                 new VFramePng(get_image("vscroll_left_up.png")), 
204                 new VFramePng(get_image("vscroll_left_hi.png")), 
205                 new VFramePng(get_image("vscroll_left_dn.png")), 
206                 new VFramePng(get_image("vscroll_right_up.png")), 
207                 new VFramePng(get_image("vscroll_right_hi.png")), 
208                 new VFramePng(get_image("vscroll_right_dn.png"))
209         };
210         BC_WindowBase::get_resources()->hscroll_data = default_hscroll_data;
211         BC_WindowBase::get_resources()->vscroll_data = default_vscroll_data;
212
213         channel_bg_data = new VFramePng(get_image("channel_bg.png"));
214         channel_position_data = new VFramePng(get_image("channel_position.png"));
215         channel_position_color = BLACK;
216         recordgui_fixed_color = BLACK;
217         recordgui_variable_color = RED;
218
219         patchbay_bg = default_patchbay_bg;
220         resource1024_bg_data = new VFramePng(get_image("resource1024.png"));
221         resource512_bg_data = new VFramePng(get_image("resource512.png"));
222         resource256_bg_data = new VFramePng(get_image("resource256.png"));
223         resource128_bg_data = new VFramePng(get_image("resource128.png"));
224         resource64_bg_data = new VFramePng(get_image("resource64.png"));
225         resource32_bg_data = new VFramePng(get_image("resource32.png"));
226         plugin_bg_data = new VFramePng(get_image("plugin_bg.png"));
227         title_bg_data = new VFramePng(get_image("title_bg.png"));
228         timebar_bg_data = new VFramePng(get_image("timebar_bg.png"));
229         vtimebar_bg_data = new VFramePng(get_image("vwindow_timebar.png"));
230         new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane");
231
232         keyframe_data = new VFramePng(get_image("keyframe3.png"));
233         camerakeyframe_data = new VFramePng(get_image("camerakeyframe.png"));
234         maskkeyframe_data = new VFramePng(get_image("maskkeyframe.png"));
235         modekeyframe_data = new VFramePng(get_image("modekeyframe.png"));
236         pankeyframe_data = new VFramePng(get_image("pankeyframe.png"));
237         projectorkeyframe_data = new VFramePng(get_image("projectorkeyframe.png"));
238
239         VFrame editpanel_up(get_image("editpanel_up.png"));
240         VFrame editpanel_hi(get_image("editpanel_hi.png"));
241         VFrame editpanel_dn(get_image("editpanel_dn.png"));
242         VFrame editpanel_checked(get_image("editpanel_checked.png"));
243         VFrame editpanel_checkedhi(get_image("editpanel_checkedhi.png"));
244
245         static VFrame *default_inpoint[] = { new VFramePng(get_image("out_up.png")), new VFramePng(get_image("out_hi.png")), new VFramePng(get_image("out_checked.png")), new VFramePng(get_image("out_dn.png")), new VFramePng(get_image("out_checkedhi.png")) };
246         static VFrame *default_labeltoggle[] = { new VFramePng(get_image("labeltoggle_up.png")), new VFramePng(get_image("labeltoggle_uphi.png")), new VFramePng(get_image("label_checked.png")), new VFramePng(get_image("labeltoggle_dn.png")), new VFramePng(get_image("label_checkedhi.png")) };
247         static VFrame *default_ffmpegtoggle[] = { new VFramePng(get_image("ff_up.png")), new VFramePng(get_image("ff_hi.png")), new VFramePng(get_image("ff_checked.png")), new VFramePng(get_image("ff_down.png")), new VFramePng(get_image("ff_checkedhi.png")) };
248         static VFrame *default_shbtndata[] = { new VFramePng(get_image("shbtn_up.png")), new VFramePng(get_image("shbtn_hi.png")), new VFramePng(get_image("shbtn_dn.png")), };
249         static VFrame *default_outpoint[] = { new VFramePng(get_image("in_up.png")), new VFramePng(get_image("in_hi.png")), new VFramePng(get_image("in_checked.png")), new VFramePng(get_image("in_dn.png")), new VFramePng(get_image("in_checkedhi.png")) };
250         static VFrame *transport_bg[] = { new VFramePng(get_image("transportup.png")), new VFramePng(get_image("transporthi.png")), new VFramePng(get_image("transportdn.png")) };
251         static VFrame *patches_bg[] = { new VFramePng(get_image("patches_up.png")), new VFramePng(get_image("patches_hi.png")), new VFramePng(get_image("patches_checked.png")), new VFramePng(get_image("patches_dn.png")), new VFramePng(get_image("patches_checkedhi.png")) };
252
253         build_button(BC_WindowBase::get_resources()->filebox_updir_images, get_image("filebox_updir.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
254         build_button(BC_WindowBase::get_resources()->filebox_newfolder_images, get_image("filebox_newfolder.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
255         build_button(BC_WindowBase::get_resources()->filebox_icons_images, get_image("filebox_icons.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
256         build_button(BC_WindowBase::get_resources()->filebox_text_images, get_image("filebox_text.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
257
258         build_button(BC_WindowBase::get_resources()->listbox_button, get_image("listbox_button.png"), &editpanel_up, &editpanel_hi, &editpanel_dn, &editpanel_hi);
259         build_button(bottom_justify, get_image("bottom_justify.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
260         build_button(center_justify, get_image("center_justify.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
261         build_button(copy_data, get_image("copy.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
262         build_button(cut_data, get_image("cut.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
263         build_button(fit_data, get_image("fit.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
264         build_button(in_data, get_image("outpoint.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
265         build_button(indelete_data, get_image("clearinpoint.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
266         build_button(labelbutton_data, get_image("label.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
267         build_button(left_justify, get_image("left_justify.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
268         build_button(magnify_button_data, get_image("magnify.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
269         build_button(middle_justify, get_image("middle_justify.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
270         build_button(nextlabel_data, get_image("nextlabel.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
271         build_button(out_data, get_image("inpoint.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
272         build_button(outdelete_data, get_image("clearoutpoint.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
273         build_button(over_button, get_image("over.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
274         build_button(overwrite_data, get_image("overwrite.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
275         build_button(paste_data, get_image("paste.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
276         build_button(prevlabel_data, get_image("prevlabel.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
277         build_button(redo_data, get_image("redo.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
278         build_button(right_justify, get_image("right_justify.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
279         build_button(splice_data, get_image("splice.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
280         build_button(statusbar_cancel_data, get_image("cancel_small.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
281         build_button(toclip_data, get_image("toclip.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
282         build_button(top_justify, get_image("top_justify.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
283         build_button(undo_data, get_image("undo.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
284         build_toggle(arrow_data, get_image("arrow.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
285         build_toggle(autokeyframe_data, get_image("autokeyframe.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
286         build_toggle(camera_data, get_image("camera.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
287         build_toggle(crop_data, get_image("crop.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
288         build_toggle(ibeam_data, get_image("ibeam.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
289         build_toggle(magnify_data, get_image("magnify.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
290         build_toggle(mask_data, get_image("mask.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
291         build_toggle(proj_data, get_image("projector.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
292         build_toggle(protect_data, get_image("protect.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
293         build_toggle(show_meters, get_image("show_meters.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
294         build_toggle(titlesafe_data, get_image("titlesafe.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
295         build_toggle(tool_data, get_image("toolwindow.png"), &editpanel_up, &editpanel_hi, &editpanel_checked, &editpanel_dn, &editpanel_checkedhi);
296         build_transport(duplex_data, get_image("duplex.png"), transport_bg, 1);
297         build_transport(end_data, get_image("end.png"), transport_bg, 2);
298         build_transport(fastfwd_data, get_image("fastfwd.png"), transport_bg, 1);
299         build_transport(fastrev_data, get_image("fastrev.png"), transport_bg, 1);
300         build_transport(forward_data, get_image("play.png"), transport_bg, 1);
301         build_transport(framefwd_data, get_image("framefwd.png"), transport_bg, 1);
302         build_transport(framefwd_data, get_image("framefwd.png"), transport_bg, 1);
303         build_transport(framerev_data, get_image("framerev.png"), transport_bg, 1);
304         build_transport(rec_data, get_image("record.png"), transport_bg, 1);
305         build_transport(recframe_data, get_image("singleframe.png"), transport_bg, 1);
306         build_transport(reverse_data, get_image("reverse.png"), transport_bg, 1);
307         build_transport(rewind_data, get_image("rewind.png"), transport_bg, 0);
308         build_transport(stop_data, get_image("stop.png"), transport_bg, 1);
309         build_transport(stoprec_data, get_image("stoprec.png"), transport_bg, 2);
310
311         build_patches(playpatch_data, get_image("playpatch.png"), patches_bg, 0);
312         build_patches(recordpatch_data, get_image("recordpatch.png"), patches_bg, 1);
313         build_patches(gangpatch_data, get_image("gangpatch.png"), patches_bg, 1);
314         build_patches(drawpatch_data, get_image("drawpatch.png"), patches_bg, 1);
315         build_patches(mutepatch_data, get_image("mutepatch.png"), patches_bg, 2);
316
317         static VFrame *default_expandpatch_data[] = 
318         {
319                 new VFramePng(get_image("expandpatch_up.png")), 
320                 new VFramePng(get_image("expandpatch_hi.png")), 
321                 new VFramePng(get_image("expandpatch_checked.png")), 
322                 new VFramePng(get_image("expandpatch_dn.png")), 
323                 new VFramePng(get_image("expandpatch_checkedhi.png"))
324         };
325         expandpatch_data = default_expandpatch_data;
326
327         build_button(channel_data, get_image("channel.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
328         build_button(wrench_data, get_image("wrench.png"), &editpanel_up, &editpanel_hi, &editpanel_dn);
329         in_point = default_inpoint;
330         label_toggle = default_labeltoggle;
331         ffmpeg_toggle = default_ffmpegtoggle;
332         shbtn_data = default_shbtndata;
333         out_point = default_outpoint;
334
335         fade_h = BC_WindowBase::get_resources()->horizontal_slider_data[0]->get_h();
336         mode_h = BC_WindowBase::get_resources()->generic_button_images[0]->get_h();
337         meter_h = BC_WindowBase::get_resources()->xmeter_images[0]->get_h();
338         pan_h = BC_WindowBase::get_resources()->pan_data[PAN_UP]->get_h();
339         play_h = playpatch_data[0]->get_h();
340         title_h = 18;
341         pan_x = 25;
342
343         title_font = MEDIUMFONT;
344         title_color = BLACK;
345
346         loadmode_w = 250;
347         flush_images();
348 //printf("MicroTheme::initialize 2\n");
349 }
350
351 void MicroTheme::draw_mwindow_bg(MWindowGUI *gui)
352 {
353         gui->clear_box(0, 0, gui->get_w(), gui->get_h());
354 }
355
356 void MicroTheme::get_cwindow_sizes(CWindowGUI *gui)
357 {
358 //printf("Theme::get_cwindow_sizes 1 %p\n", mwindow);
359         cauto_x = 0;
360         cauto_y = 0; 
361         cauto_w = 0;
362         cauto_h = 0;
363         ccomposite_x = 0;
364         ccomposite_y = 5;
365         ccomposite_w = protect_data[0]->get_w();
366         ccomposite_h = mwindow->session->cwindow_h - ccomposite_y;
367         ccanvas_x = ccomposite_x + ccomposite_w;
368         ccanvas_y = 0;
369 //printf("Theme::get_cwindow_sizes 1\n");
370
371
372         if(mwindow->edl->session->cwindow_meter)
373         {
374                 cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
375                         mwindow->edl->session->cwindow_meter);
376                 ccanvas_w = cmeter_x - ccanvas_x - 5;
377         }
378         else
379         {
380                 cmeter_x = mwindow->session->cwindow_w;
381                 ccanvas_w = cmeter_x - ccanvas_x;
382         }
383 //printf("Theme::get_cwindow_sizes 1\n");
384
385         cmeter_y = 10;
386         cmeter_h = mwindow->session->cwindow_h - cmeter_y;
387         cedit_x = 10;
388         cedit_y = mwindow->session->cwindow_h - autokeyframe_data[0]->get_h();
389 //printf("Theme::get_cwindow_sizes 1\n");
390         ctransport_x = 10;
391         ctransport_y = cedit_y - forward_data[0]->get_h();
392         ccanvas_h = ctransport_y - 5;
393 //printf("Theme::get_cwindow_sizes 1\n");
394         ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow);
395         ctime_y = ctransport_y;
396 //      czoom_x = ctime_x + 150;
397         czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20;
398 //printf("Theme::get_cwindow_sizes 1\n");
399         czoom_y = ctime_y;
400         cdest_x = czoom_x;
401         cdest_y = czoom_y + 30;
402 //printf("Theme::get_cwindow_sizes 2\n");
403 }
404
405
406 void MicroTheme::get_vwindow_sizes(VWindowGUI *gui)
407 {
408         vcanvas_x = 0;
409         vcanvas_y = 0;
410         if(mwindow->edl->session->vwindow_meter)
411         {
412                 vmeter_x = mwindow->session->vwindow_w - 
413                         MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
414                                 mwindow->edl->session->vwindow_meter);
415                 vcanvas_w = vmeter_x - vcanvas_x - 5;
416         }
417         else
418         {
419                 vmeter_x = mwindow->session->vwindow_w;
420                 vcanvas_w = mwindow->session->vwindow_w;
421         }
422
423         vedit_x = 5;
424         vedit_y = mwindow->session->vwindow_h - autokeyframe_data[0]->get_h();
425         vtransport_x = 5;
426         vtransport_y = vedit_y - forward_data[0]->get_h();
427         vslider_x = 5;
428         vslider_y = vtransport_y - 
429                 BC_WindowBase::get_resources()->horizontal_slider_data[0]->get_h();
430         vslider_w = vcanvas_w - vslider_x - 5;
431         vtimebar_x = 0;
432         vtimebar_y = vslider_y - 20;
433         vtimebar_w = vcanvas_w - vcanvas_x;
434
435
436         vcanvas_h = vtimebar_y;
437
438         vmeter_y = 5;
439         vmeter_h = mwindow->session->vwindow_h - cmeter_y;
440
441
442
443         vtime_x = vtransport_x + PlayTransport::get_transport_width(mwindow) + 5;
444         vtime_y = vtransport_y;
445         vtime_w = 150;
446         vzoom_x = vtime_x + 150;
447         vzoom_y = vtime_y;
448         vsource_x = vtime_x;
449         vsource_y = vedit_y;
450 }
451
452
453 #define PATCHBAY_W 100
454 #define ZOOM_H 20
455 void MicroTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
456 {
457         mbuttons_x = 0;
458         mbuttons_y = gui->mainmenu->get_h();
459         mbuttons_w = w;
460         mbuttons_h = arrow_data[0]->get_h() + 4;
461         mclock_x = 0;
462         mclock_y = mbuttons_y + mbuttons_h;
463         mclock_w = PATCHBAY_W - 10;
464         mclock_h = timebar_bg_data->get_h();
465         mtimebar_x = PATCHBAY_W;
466         mtimebar_y = mclock_y;
467         mtimebar_w = w - mtimebar_x;
468         mtimebar_h = timebar_bg_data->get_h();
469         mstatus_x = 0;
470         mstatus_y = h - statusbar_cancel_data[0]->get_h();
471         mstatus_w = w;
472         mstatus_h = statusbar_cancel_data[0]->get_h();
473         mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
474         mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h();
475         mstatus_progress_w = 230;
476         mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
477         mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
478         mzoom_x = 0;
479         mzoom_y = mstatus_y - ZOOM_H;
480         mzoom_h = ZOOM_H;
481         mzoom_w = w;
482         patchbay_x = 0;
483         patchbay_y = mtimebar_y + mtimebar_h;
484         patchbay_w = PATCHBAY_W;
485         patchbay_h = mzoom_y - patchbay_y;
486         mcanvas_x = patchbay_x + patchbay_w;
487         mcanvas_y = patchbay_y;
488         mcanvas_w = w - patchbay_w;
489         mcanvas_h = patchbay_h;
490 }
491
492 void MicroTheme::get_recordgui_sizes(RecordGUI *gui, int w, int h)
493 {
494         recordgui_status_x = 5;
495         recordgui_status_y = 5;
496         recordgui_status_x2 = 100;
497         recordgui_batch_x = 220;
498         recordgui_batch_y = 5;
499         recordgui_batchcaption_x = recordgui_batch_x + 70;
500
501
502         recordgui_transport_x = recordgui_batch_x;
503         recordgui_transport_y = recordgui_batch_y + 150;
504
505         recordgui_buttons_x = 220;
506         recordgui_buttons_y = recordgui_transport_y + 30;
507         recordgui_options_x = 220;
508         recordgui_options_y = recordgui_buttons_y + 30;
509
510         recordgui_batches_x = 10;
511         recordgui_batches_y = 250;
512         recordgui_batches_w = w - 20;
513         recordgui_batches_h = h - recordgui_batches_y - 70;
514         recordgui_loadmode_x = w / 2 - loadmode_w / 2;
515         recordgui_loadmode_y = h - 50;
516
517         recordgui_controls_x = 10;
518         recordgui_controls_y = h - 30;
519 }
520
521
522
523
524
525
526
527
528