X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fappearanceprefs.C;h=4ca46b2d8b24c04b63e88fda55a99aa8e9981d66;hb=cdb8b00f2f7ecf0b4910a40e1d90a87540d2891d;hp=94c4b34641f8a8587c816045ab111fc11e9c54f9;hpb=debf38f78ae5ce154f54183b1638278bf8a24736;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.C b/cinelerra-5.1/cinelerra/appearanceprefs.C index 94c4b346..4ca46b2d 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.C +++ b/cinelerra-5.1/cinelerra/appearanceprefs.C @@ -66,11 +66,12 @@ void AppearancePrefs::create_objects() char string[BCTEXTLEN]; int x0 = mwindow->theme->preferencesoptions_x; int y0 = mwindow->theme->preferencesoptions_y; - int x = x0, y = y0, x1 = x + 100, x2 = x + 160; + int x = x0, y = y0, x1 = x + 100; add_subwindow(new BC_Title(x, y, _("Layout:"), LARGEFONT, resources->text_default)); y += 35; + int y1 = y; ViewTheme *theme; add_subwindow(new BC_Title(x, y, _("Theme:"))); @@ -84,11 +85,23 @@ void AppearancePrefs::create_objects() add_subwindow(plugin_icons = new ViewPluginIcons(x1, y, pwindow)); plugin_icons->create_objects(); y += plugin_icons->get_h() + 15; + x1 = get_w()/2; - add_subwindow(new BC_Title(x, y, _("View Thumbnail size:"))); + int x2 = x1 + 160, y2 = y; + y = y1; + add_subwindow(new BC_Title(x1, y, _("View thumbnail size:"))); thumbnail_size = new ViewThumbnailSize(pwindow, this, x2, y); thumbnail_size->create_objects(); y += thumbnail_size->get_h() + 5; + add_subwindow(new BC_Title(x1, y, _("Vicon quality:"))); + vicon_size = new ViewViconSize(pwindow, this, x2, y); + vicon_size->create_objects(); + y += vicon_size->get_h() + 5; + add_subwindow(new BC_Title(x1, y, _("Vicon color mode:"))); + add_subwindow(vicon_color_mode = new ViewViconColorMode(pwindow, x2, y)); + vicon_color_mode->create_objects(); + y += vicon_color_mode->get_h() + 5; + y = bmax(y, y2); y += 10; add_subwindow(new BC_Bar(5, y, get_w() - 10)); @@ -97,13 +110,12 @@ void AppearancePrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Time Format:"), LARGEFONT, resources->text_default)); - x1 = get_w()/2; add_subwindow(new BC_Title(x1, y, _("Flags:"), LARGEFONT, resources->text_default)); y += get_text_height(LARGEFONT) + 5; y += 10; - int y1 = y; + y1 = y; add_subwindow(hms = new TimeFormatHMS(pwindow, this, pwindow->thread->edl->session->time_format == TIME_HMS, @@ -153,6 +165,15 @@ void AppearancePrefs::create_objects() char hex_color[BCSTRLEN]; sprintf(hex_color, "%06x", preferences->highlight_inverse); add_subwindow(new HighlightInverseColor(pwindow, x, y, hex_color)); + x2 = x; x = x0; + y += 35; + add_subwindow(title = new BC_Title(x, y, _("Composer BG Color:"))); + int clr_color = pwindow->thread->edl->session->cwindow_clear_color; + int clr_alpha = pwindow->thread->edl->session->cwindow_clear_alpha; + add_subwindow(cwdw_bg_color = new Composer_BG_Color(pwindow, + x2, y, 80, 24, clr_color, clr_alpha)); + draw_3d_border(x2-2,y-2, 80+4,24+4, 1); + cwdw_bg_color->create_objects(); y += 35; x = x0; @@ -172,6 +193,9 @@ void AppearancePrefs::create_objects() UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1); add_subwindow(tip_win); y1 += tip_win->get_h() + 5; + AutocolorAssets *autocolor_assets = new AutocolorAssets(pwindow, x1, y1); + add_subwindow(autocolor_assets); + y1 += autocolor_assets->get_h() + 5; UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1); add_subwindow(idx_win); y1 += idx_win->get_h() + 5; @@ -201,6 +225,12 @@ void AppearancePrefs::create_objects() PerpetualSession *perpetual = new PerpetualSession(x1, y1, pwindow); add_subwindow(perpetual); y1 += perpetual->get_h() + 5; + CtrlToggle *ctrl_toggle = new CtrlToggle(x1, y1, pwindow); + add_subwindow(ctrl_toggle); + y1 += ctrl_toggle->get_h() + 5; + RectifyAudioToggle *rect_toggle = new RectifyAudioToggle(x1, y1, pwindow); + add_subwindow(rect_toggle); + y1 += rect_toggle->get_h() + 5; if( y < y1 ) y = y1; } @@ -426,6 +456,68 @@ int ViewThumbnailSize::handle_event() return 1; } +ViewViconSize::ViewViconSize(PreferencesWindow *pwindow, + AppearancePrefs *aprefs, int x, int y) + : BC_TumbleTextBox(aprefs, + pwindow->thread->preferences->vicon_size, + 16, 512, x, y, 80) + +{ + this->pwindow = pwindow; + this->aprefs = aprefs; +} + +int ViewViconSize::handle_event() +{ + int v = atoi(get_text()); + bclamp(v, 16,512); + pwindow->thread->preferences->vicon_size = v; + return 1; +} + +ViewViconColorMode::ViewViconColorMode(PreferencesWindow *pwindow, int x, int y) + : BC_PopupMenu(x, y, 100, + _(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]), 1) +{ + this->pwindow = pwindow; +} +ViewViconColorMode::~ViewViconColorMode() +{ +} + +const char *ViewViconColorMode::vicon_color_modes[] = { + N_("Low"), + N_("Med"), + N_("High"), +}; + +void ViewViconColorMode::create_objects() +{ + for( int id=0,nid=sizeof(vicon_color_modes)/sizeof(vicon_color_modes[0]); idthread->preferences->vicon_color_mode])); + return 1; +} + +ViewViconColorModeItem::ViewViconColorModeItem(ViewViconColorMode *popup, const char *text, int id) + : BC_MenuItem(text) +{ + this->popup = popup; + this->id = id; +} + +int ViewViconColorModeItem::handle_event() +{ + popup->set_text(get_text()); + popup->pwindow->thread->preferences->vicon_color_mode = id; + return popup->handle_event(); +} + UseTipWindow::UseTipWindow(PreferencesWindow *pwindow, int x, int y) : BC_CheckBox(x, @@ -552,6 +644,19 @@ int ForwardRenderDisplacement::handle_event() return 1; } +AutocolorAssets::AutocolorAssets(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, pwindow->thread->preferences->autocolor_assets, + _("Autocolor assets")) +{ + this->pwindow = pwindow; +} + +int AutocolorAssets::handle_event() +{ + pwindow->thread->preferences->autocolor_assets = get_value(); + return 1; +} + HighlightInverseColor::HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex) : BC_TextBox(x, y, 80, 1, hex) { @@ -597,7 +702,7 @@ void YuvColorSpace::create_objects() int YuvColorSpace::handle_event() { - set_text(color_space[pwindow->thread->preferences->yuv_color_space]); + set_text(_(color_space[pwindow->thread->preferences->yuv_color_space])); return 1; } @@ -671,3 +776,57 @@ int PerpetualSession::handle_event() return 1; } +CtrlToggle::CtrlToggle(int x, int y, PreferencesWindow *pwindow) + : BC_CheckBox(x, y, + pwindow->thread->preferences->ctrl_toggle, _("Clears before toggle")) +{ + this->pwindow = pwindow; +} + +int CtrlToggle::handle_event() +{ + pwindow->thread->preferences->ctrl_toggle = get_value(); + return 1; +} + +RectifyAudioToggle::RectifyAudioToggle(int x, int y, PreferencesWindow *pwindow) + : BC_CheckBox(x, y, + pwindow->thread->preferences->rectify_audio, _("Timeline Rectify Audio")) +{ + this->pwindow = pwindow; +} + +int RectifyAudioToggle::handle_event() +{ + pwindow->thread->preferences->rectify_audio = get_value(); + return 1; +} + +Composer_BG_Color::Composer_BG_Color(PreferencesWindow *pwindow, + int x, int y, int w, int h, int color, int alpha) + : ColorBoxButton(_("Composer BG color"), x, y, w, h, color, alpha, 1) +{ + this->pwindow = pwindow; +} + +Composer_BG_Color::~Composer_BG_Color() +{ +} + +void Composer_BG_Color::handle_done_event(int result) +{ + if( result ) { + pwindow->lock_window("Composer_BG_Color::handle_done_event"); + update_gui(orig_color, orig_alpha); + pwindow->unlock_window(); + handle_new_color(orig_color, orig_alpha); + } +} + +int Composer_BG_Color::handle_new_color(int color, int alpha) +{ + pwindow->thread->edl->session->cwindow_clear_color = color; + pwindow->thread->edl->session->cwindow_clear_alpha = alpha; + return 1; +} +