X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ftheme.C;h=d89c789f76cb95018e954fc1f0d65002c16e0d7c;hp=5a1d95d6d5a83f72eca472f10f1e7ddc16a7b6ca;hb=1529091cdf16df199a901aabe6e8fa1813a933af;hpb=258d9cb69d560f40961acdd20866e12e940c2f93 diff --git a/cinelerra-5.1/cinelerra/theme.C b/cinelerra-5.1/cinelerra/theme.C index 5a1d95d6..d89c789f 100644 --- a/cinelerra-5.1/cinelerra/theme.C +++ b/cinelerra-5.1/cinelerra/theme.C @@ -24,6 +24,7 @@ #include "clip.h" #include "bccolors.h" #include "cwindowgui.h" +#include "edit.h" #include "edl.h" #include "edlsession.h" #include "keyframegui.h" @@ -46,6 +47,7 @@ #include "resourcepixmap.h" #include "statusbar.h" #include "theme.h" +#include "track.h" #include "timebar.h" #include "trackcanvas.h" #include "vframe.h" @@ -62,14 +64,15 @@ new VFrame(default_data.get_w(), default_data.get_h(), BC_RGBA8888) Theme::Theme() : BC_Theme() { - window_border = 10; - widget_border = 5; + window_border = xS(10); + widget_border = xS(5); this->mwindow = 0; theme_title = _(DEFAULT_THEME); last_image = 0; mtransport_margin = 0; toggle_margin = 0; - control_pixels = 50; + control_pixels = xS(50); + stack_button_w = xS(32); timebar_cursor_color = RED; BC_WindowBase::get_resources()->bg_color = BLOND; @@ -77,14 +80,21 @@ Theme::Theme() BC_WindowBase::get_resources()->button_highlighted = 0xffe000; BC_WindowBase::get_resources()->recursive_resizing = 0; audio_color = BLACK; - fade_h = 22; + zero_crossing_color = 0xc03545; + graph_active_color = GRAPH_ACTIVE_COLOR; + graph_inactive_color = GRAPH_INACTIVE_COLOR; + graph_grid_color = GRAPH_GRID_COLOR; + graph_bg_color = GRAPH_BG_COLOR; + graph_border1_color = GRAPH_BORDER1_COLOR; + graph_border2_color = GRAPH_BORDER2_COLOR; + fade_h = yS(22); inout_highlight_color = GREEN; - meter_h = 17; - mode_h = 30; - pan_h = 32; - pan_x = 50; - play_h = 22; - title_h = 23; + meter_h = yS(17); + mode_h = yS(30); + pan_h = yS(32); + pan_x = xS(50); + play_h = yS(22); + title_h = yS(23); clock_bg_color = BLACK; clock_fg_color = GREEN; assetedit_color = YELLOW; @@ -93,8 +103,8 @@ Theme::Theme() preferences_category_overlap = 0; - loadmode_w = 350; - czoom_w = 80; + loadmode_w = xS(350); + czoom_w = xS(110); #include "data/about_bg_png.h" about_bg = new VFramePng(about_bg_png); @@ -131,6 +141,7 @@ Theme::Theme() ffmpeg_toggle = 0; proxy_s_toggle = 0; proxy_p_toggle = 0; + mask_mode_toggle = 0; infoasset_data = 0; in_point = 0; insert_data = 0; @@ -139,6 +150,7 @@ Theme::Theme() lift_data = 0; maskkeyframe_data = 0; modekeyframe_data = 0; + hardedge_data = 0; movedn_data = 0; moveup_data = 0; newbin_data = 0; @@ -167,6 +179,7 @@ Theme::Theme() statusbar_cancel_data = 0; timebar_view_data = 0; transition_data = 0; + tumblepatch_data = 0; uptriangle_data = 0; viewasset_data = 0; vtimebar_bg_data = 0; @@ -598,18 +611,20 @@ void Theme::build_toggle(VFrame** &data, void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) { mbuttons_x = 0; - mbuttons_y = gui->menu_h() + 1; - mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+2); + mbuttons_y = gui->menu_h() + yS(1); + mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+xS(2) + + proxy_p_toggle[0]->get_w()+xS(2) + + stack_button_w); mbuttons_h = get_image("mbutton_bg")->get_h(); - mclock_x = window_border - 5; - mclock_y = mbuttons_y - 1 + mbuttons_h; - mclock_w = get_image("clock_bg")->get_w() - 20; + mclock_x = window_border - xS(5); + mclock_y = mbuttons_y-1 + mbuttons_h; + mclock_w = get_image("clock_bg")->get_w() - xS(20); mclock_h = get_image("clock_bg")->get_h(); mtimebar_x = get_image("patchbay_bg")->get_w(); mtimebar_y = mbuttons_y - 1 + mbuttons_h; mtimebar_w = w - mtimebar_x; mtimebar_h = get_image("timebar_bg")->get_h(); - mzoom_h = 25; + mzoom_h = yS(25); mzoom_x = 0; mzoom_y = h - get_image("statusbar")->get_h(); mzoom_w = w; @@ -617,15 +632,15 @@ void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) mstatus_y = mzoom_y + mzoom_h; mstatus_w = w; mstatus_h = h - mstatus_y; - mstatus_message_x = 10; - mstatus_message_y = 5; - mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240; - mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - 3; - mstatus_progress_w = 230; + mstatus_message_x = xS(10); + mstatus_message_y = yS(5); + mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - xS(240); + mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - yS(3); + mstatus_progress_w = xS(230); mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w(); mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h(); mcanvas_x = 0; - mcanvas_y = mbuttons_y - 1 + mbuttons_h; + mcanvas_y = mbuttons_y-1 + mbuttons_h; mcanvas_w = w; mcanvas_h = mzoom_y - mtimebar_y; control_pixels = (mcanvas_w * control_pixels) / 1000; @@ -646,15 +661,8 @@ void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) } void Theme::get_pane_sizes(MWindowGUI *gui, - int *view_x, - int *view_y, - int *view_w, - int *view_h, - int number, - int x, - int y, - int w, - int h) + int *view_x, int *view_y, int *view_w, int *view_h, + int number, int x, int y, int w, int h) { *view_x = x; *view_y = y; @@ -703,15 +711,15 @@ void Theme::draw_mwindow_bg(MWindowGUI *gui) void Theme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls) { - int total_buttons = !use_commercials ? 15 : 16; + int total_buttons = !use_commercials ? 16 : 17; int edit_w = EditPanel::calculate_w(mwindow, 1, total_buttons); int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin; int zoom_w = ZoomPanel::calculate_w(czoom_w); int status_w = get_image("cwindow_active")->get_w(); // Space between buttons & status icon - int division_w = 24; + int division_w = xS(24); - ctimebar_h = 16; + ctimebar_h = yS(16); if(cwindow_controls) { @@ -725,77 +733,47 @@ SET_TRACE } else { - cmeter_x = mwindow->session->cwindow_w + widget_border; + cmeter_x = mwindow->session->cwindow_w; } - int buttons_h; - - if(edit_w + - widget_border * 2 + - transport_w + widget_border + - zoom_w + widget_border + - division_w + - status_w > cmeter_x) - { - buttons_h = get_image("cbuttons_left")->get_h(); - - cedit_x = widget_border; - cedit_y = mwindow->session->cwindow_h - - buttons_h + - ctimebar_h + - widget_border; - - ctransport_x = widget_border; - ctransport_y = mwindow->session->cwindow_h - - get_image_set("autokeyframe")[0]->get_h() - - widget_border; + int buttons_h = get_image("rewind")->get_h() + widget_border; + int panel_y = mwindow->session->cwindow_h - buttons_h + yS(4); + ctransport_x = widget_border; + if( ctransport_x + transport_w + widget_border + + edit_w + widget_border + zoom_w + widget_border + + division_w + status_w > cmeter_x ) { + ctransport_y = panel_y; czoom_x = ctransport_x + transport_w + widget_border; - czoom_y = ctransport_y + widget_border; - - cstatus_x = 426; - cstatus_y = mwindow->session->cwindow_h - - get_image("cwindow_active")->get_h() - 30; + czoom_y = panel_y; + cstatus_x = xS(440); + cstatus_y = panel_y - yS(2); + int edit_h = EditPanel::calculate_h(mwindow) + widget_border; + buttons_h += edit_h; panel_y -= edit_h; + cedit_x = widget_border; + cedit_y = panel_y; } - else - { - buttons_h = ctimebar_h + - widget_border + - EditPanel::calculate_h(mwindow) + - widget_border; + else { ctransport_x = widget_border; - ctransport_y = mwindow->session->cwindow_h - - buttons_h + - ctimebar_h + - widget_border; - + ctransport_y = panel_y; cedit_x = ctransport_x + transport_w + widget_border; - cedit_y = ctransport_y; - + cedit_y = panel_y; czoom_x = cedit_x + edit_w + widget_border; - czoom_y = cedit_y + widget_border; -//printf("Theme::get_cwindow_sizes %d %d %d\n", __LINE__, czoom_x, zoom_w); + czoom_y = panel_y; cstatus_x = czoom_x + zoom_w + division_w; - cstatus_y = ctransport_y; + cstatus_y = panel_y; } + buttons_h += ctimebar_h; - - ccomposite_x = 0; - ccomposite_y = 5; + ccomposite_x = xS(0); + ccomposite_y = yS(5); ccomposite_w = get_image("cpanel_bg")->get_w(); ccomposite_h = mwindow->session->cwindow_h - buttons_h; - - - - - - ccanvas_x = ccomposite_x + ccomposite_w; ccanvas_y = 0; ccanvas_h = ccomposite_h; - ccanvas_w = cmeter_x - ccanvas_x - widget_border; SET_TRACE } @@ -808,10 +786,10 @@ SET_TRACE ccomposite_w = get_image("cpanel_bg")->get_w(); ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h(); - cedit_x = 10; - cedit_y = mwindow->session->cwindow_h + 17; - ctransport_x = 10; - ctransport_y = cedit_y + 40; + cedit_x = xS(10); + cedit_y = mwindow->session->cwindow_h + yS(17); + ctransport_x = xS(10); + ctransport_y = cedit_y + yS(40); ccanvas_x = 0; ccanvas_y = 0; ccanvas_w = mwindow->session->cwindow_w; @@ -896,53 +874,51 @@ void Theme::draw_rwindow_bg(RecordGUI *gui) } -void Theme::draw_resource_bg(TrackCanvas *canvas, - ResourcePixmap *pixmap, - int edit_x, - int edit_w, - int pixmap_x, - int x1, - int y1, - int x2, - int y2) +void Theme::draw_resource_bg(TrackCanvas *canvas, ResourcePixmap *pixmap, + int color, Edit *edit, int edit_x, int edit_w, + int pixmap_x, int x1, int y1, int x2, int y2) { - VFrame *image; - - switch(mwindow->edl->local_session->zoom_track) - { + VFrame *image = 0; + int data_h = edit->track->data_h; + switch( data_h ) { case 1024: image = get_image("resource1024"); break; case 512: image = get_image("resource512"); break; case 256: image = get_image("resource256"); break; case 128: image = get_image("resource128"); break; case 64: image = get_image("resource64"); break; - default: - case 32: image = get_image("resource32"); break; } - - canvas->draw_3segmenth(x1, - y1, - x2 - x1, - edit_x - pixmap_x, - edit_w, - image, - pixmap); + if( !image ) + image = get_image("resource32"); + + VFrame *frame = image; + int bg_color = canvas->get_bg_color(); + if( color ) { + int alpha = (~color >> 24) & 0xff; + frame = pixmap->change_picon_alpha(image, alpha); + canvas->set_bg_color(color & 0xffffff); + } + canvas->draw_3segmenth(x1, y1, x2 - x1, + edit_x - pixmap_x, edit_w, frame, pixmap); + if( frame != image ) { + delete frame; + canvas->set_bg_color(bg_color); + } } void Theme::get_vwindow_sizes(VWindowGUI *gui) { - int edit_w = EditPanel::calculate_w(mwindow, 0, 10); + int edit_w = EditPanel::calculate_w(mwindow, 0, 12); int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin; // Space between buttons & time - int division_w = 30; - vtime_w = 150; - vtimebar_h = 16; - int vtime_border = 15; + int division_w = xS(30); + vtime_w = xS(120); + vtimebar_h = yS(16); + int vtime_border = xS(15); vmeter_y = widget_border; vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border; - int buttons_h; if(mwindow->edl->session->vwindow_meter) { vmeter_x = mwindow->session->vwindow_w - @@ -952,55 +928,39 @@ void Theme::get_vwindow_sizes(VWindowGUI *gui) } else { - vmeter_x = mwindow->session->vwindow_w + widget_border; + vmeter_x = mwindow->session->vwindow_w; } vcanvas_x = 0; vcanvas_y = 0; vcanvas_w = vmeter_x - vcanvas_x - widget_border; - if(edit_w + - widget_border * 2 + - transport_w + widget_border + - vtime_w + division_w + - vtime_border > vmeter_x) - { - buttons_h = get_image("vbuttons_left")->get_h(); + int buttons_h = get_image("rewind")->get_h() + widget_border; + int panel_y = mwindow->session->vwindow_h - buttons_h + yS(4); + vtransport_x = widget_border; + if( vtransport_x + transport_w + widget_border + + edit_w + widget_border + vtime_w + xS(40) + widget_border > vmeter_x ) { + vtransport_y = panel_y; + vzoom_x = vtransport_x + transport_w + widget_border; + vzoom_y = panel_y; + vdivision_x = xS(320); + vtime_x = vdivision_x; + vtime_y = panel_y; + int edit_h = EditPanel::calculate_h(mwindow) + widget_border; + buttons_h += edit_h; panel_y -= edit_h; vedit_x = widget_border; - vedit_y = mwindow->session->vwindow_h - - buttons_h + - vtimebar_h + - widget_border; - - vtransport_x = widget_border; - vtransport_y = mwindow->session->vwindow_h - - get_image_set("autokeyframe")[0]->get_h() - - widget_border; - - vdivision_x = 280; - vtime_x = vedit_x + 20; //vdivision_x; - vtime_y = vedit_y + 30; //+ 20; + vedit_y = panel_y; } - else - { - buttons_h = vtimebar_h + - widget_border + - EditPanel::calculate_h(mwindow) + - widget_border; + else { vtransport_x = widget_border; - vtransport_y = mwindow->session->vwindow_h - - buttons_h + - vtimebar_h + - widget_border; - + vtransport_y = panel_y; vedit_x = vtransport_x + transport_w + widget_border; - vedit_y = vtransport_y; - + vedit_y = panel_y; vdivision_x = vedit_x + edit_w + division_w; vtime_x = vdivision_x + vtime_border; - vtime_y = vedit_y + widget_border; + vtime_y = panel_y; } - + buttons_h += vtimebar_h; // vtimebar_x = vcanvas_x; // vtimebar_y = vcanvas_y + vcanvas_h; @@ -1010,7 +970,6 @@ void Theme::get_vwindow_sizes(VWindowGUI *gui) vtimebar_x = 0; vtimebar_y = vcanvas_y + vcanvas_h; vtimebar_w = vmeter_x - widget_border; - } @@ -1024,10 +983,10 @@ void Theme::get_awindow_sizes(AWindowGUI *gui) afolders_w = mwindow->session->afolders_w; afolders_h = mwindow->session->awindow_h - afolders_y; adivider_x = afolders_x + afolders_w; - adivider_y = 0; - adivider_w = 5; + adivider_y = xS(0); + adivider_w = yS(5); adivider_h = afolders_h; - alist_x = afolders_x + afolders_w + 5; + alist_x = afolders_x + afolders_w + xS(5); alist_y = afolders_y; alist_w = mwindow->session->awindow_w - alist_x; alist_h = afolders_h; @@ -1040,14 +999,14 @@ void Theme::get_rmonitor_sizes(int do_audio, int do_avc, int audio_channels) { - int x = 10; - int y = 3; + int x = xS(10); + int y = yS(3); if(do_avc) { - rmonitor_canvas_y = 30; - rmonitor_tx_x = 10; + rmonitor_canvas_y = yS(30); + rmonitor_tx_x = xS(10); rmonitor_tx_y = 0; } else @@ -1060,16 +1019,16 @@ void Theme::get_rmonitor_sizes(int do_audio, if(do_channel) { - y = 5; + y = yS(5); rmonitor_channel_x = x; - rmonitor_channel_y = 5; - x += 280; - rmonitor_canvas_y = 35; + rmonitor_channel_y = yS(5); + x += xS(280); + rmonitor_canvas_y = yS(35); } if(do_interlace) { - y = 4; + y = yS(4); rmonitor_interlace_x = x; rmonitor_interlace_y = y; } @@ -1089,8 +1048,8 @@ void Theme::get_rmonitor_sizes(int do_audio, rmonitor_meter_w = mwindow->session->rmonitor_w - widget_border * 2; } - rmonitor_meter_y = 40; - rmonitor_meter_h = mwindow->session->rmonitor_h - 10 - rmonitor_meter_y; + rmonitor_meter_y = yS(40); + rmonitor_meter_h = mwindow->session->rmonitor_h - yS(10) - rmonitor_meter_y; } else { @@ -1099,13 +1058,13 @@ void Theme::get_rmonitor_sizes(int do_audio, rmonitor_canvas_x = 0; rmonitor_canvas_w = rmonitor_meter_x - rmonitor_canvas_x; - if(do_audio) rmonitor_canvas_w -= 10; + if(do_audio) rmonitor_canvas_w -= xS(10); rmonitor_canvas_h = mwindow->session->rmonitor_h - rmonitor_canvas_y; if(!do_video && do_audio) { - rmonitor_meter_y -= 30; - rmonitor_meter_h += 30; + rmonitor_meter_y -= yS(30); + rmonitor_meter_h += yS(30); } } @@ -1118,14 +1077,16 @@ void Theme::get_batchrender_sizes(BatchRenderGUI *gui, int w, int h) { - batchrender_x1 = 10; - batchrender_x2 = 300; - batchrender_x3 = 400; + batchrender_x1 = xS(10); + batchrender_x2 = xS(300); + batchrender_x3 = xS(400); } void Theme::get_plugindialog_sizes() { - int x = 10, y = 30; + int xs10 = xS(10), ys10 = yS(10); + int xs20 = xS(20), ys100 = yS(100); + int x = xs10, y = yS(30); plugindialog_new_x = x; plugindialog_new_y = y; plugindialog_shared_x = mwindow->session->plugindialog_w / 3; @@ -1133,19 +1094,19 @@ void Theme::get_plugindialog_sizes() plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3; plugindialog_module_y = y; - plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10; - plugindialog_new_h = mwindow->session->plugindialog_h - 100; - plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10; - plugindialog_shared_h = mwindow->session->plugindialog_h - 100; - plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10; - plugindialog_module_h = mwindow->session->plugindialog_h - 100; - - plugindialog_newattach_x = plugindialog_new_x + 20; - plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10; - plugindialog_sharedattach_x = plugindialog_shared_x + 20; - plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10; - plugindialog_moduleattach_x = plugindialog_module_x + 20; - plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10; + plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - xs10; + plugindialog_new_h = mwindow->session->plugindialog_h - ys100; + plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - xs10; + plugindialog_shared_h = mwindow->session->plugindialog_h - ys100; + plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - xs10; + plugindialog_module_h = mwindow->session->plugindialog_h - ys100; + + plugindialog_newattach_x = plugindialog_new_x + xs20; + plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + ys10; + plugindialog_sharedattach_x = plugindialog_shared_x + xs20; + plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + ys10; + plugindialog_moduleattach_x = plugindialog_module_x + xs20; + plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + ys10; } // void Theme::get_presetdialog_sizes(PresetsWindow *gui) @@ -1291,26 +1252,26 @@ void Theme::get_menueffect_sizes(int use_list) { if(use_list) { - menueffect_list_x = 10; - menueffect_list_y = 10; - menueffect_list_w = mwindow->session->menueffect_w - 400; + menueffect_list_x = xS(10); + menueffect_list_y = yS(10); + menueffect_list_w = mwindow->session->menueffect_w - xS(400); menueffect_list_h = mwindow->session->menueffect_h - menueffect_list_y - - BC_OKButton::calculate_h() - 10; + BC_OKButton::calculate_h() - yS(10); } else { menueffect_list_x = 0; - menueffect_list_y = 10; + menueffect_list_y = yS(10); menueffect_list_w = 0; menueffect_list_h = 0; } - menueffect_file_x = menueffect_list_x + menueffect_list_w + 10; - menueffect_file_y = 10; + menueffect_file_x = menueffect_list_x + menueffect_list_w + xS(10); + menueffect_file_y = yS(10); menueffect_tools_x = menueffect_file_x; - menueffect_tools_y = menueffect_file_y + 20; + menueffect_tools_y = menueffect_file_y + yS(20); } void Theme::get_preferences_sizes()