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