X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fappearanceprefs.C;h=766cf6ce2c9fd3f61e4ec48a1ee4cd6bc945b0a7;hp=a865db1ea5927353570486a86fbbe074eca265f1;hb=HEAD;hpb=a985e771ecfb00f01c6405c7aa4fb958a780e558 diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.C b/cinelerra-5.1/cinelerra/appearanceprefs.C index a865db1e..766cf6ce 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.C +++ b/cinelerra-5.1/cinelerra/appearanceprefs.C @@ -33,12 +33,6 @@ #include "theme.h" -#define MOVE_ALL_EDITS_TITLE N_("Drag all following edits") -#define MOVE_ONE_EDIT_TITLE N_("Drag only one edit") -#define MOVE_NO_EDITS_TITLE N_("Drag source only") -#define MOVE_EDITS_DISABLED_TITLE N_("No effect") - - AppearancePrefs::AppearancePrefs(MWindow *mwindow, PreferencesWindow *pwindow) : PreferencesDialog(mwindow, pwindow) { @@ -139,7 +133,34 @@ void AppearancePrefs::create_objects() add_subwindow(seconds = new TimeFormatSeconds(pwindow, this, pwindow->thread->edl->session->time_format == TIME_SECONDS, x, y)); + x = x0; y += 35; + add_subwindow(new BC_Bar(5, y, get_w()/2 - 30)); + y += 15; + + add_subwindow(new BC_Title(x, y, _("Color:"), LARGEFONT, + resources->text_default)); + y += 35; + add_subwindow(title = new BC_Title(x, y, _("Highlighting Inversion color:"))); + x += title->get_w() + margin; + char hex_color[BCSTRLEN]; + sprintf(hex_color, "%06x", preferences->highlight_inverse); + add_subwindow(new HighlightInverseColor(pwindow, x, y, hex_color)); + y += 35; + + x = x0; + add_subwindow(title = new BC_Title(x, y, _("YUV color space:"))); + x += title->get_w() + margin; + add_subwindow(yuv_color_space = new YuvColorSpace(x, y, pwindow)); + yuv_color_space->create_objects(); + y += yuv_color_space->get_h() + 5; + + x = x0; + add_subwindow(title = new BC_Title(x, y, _("YUV color range:"))); + x += title->get_w() + margin; + add_subwindow(yuv_color_range = new YuvColorRange(x, y, pwindow)); + yuv_color_range->create_objects(); + y += yuv_color_range->get_h() + 5; UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1); add_subwindow(tip_win); @@ -156,6 +177,9 @@ void AppearancePrefs::create_objects() PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1); add_subwindow(pop_win); y1 += pop_win->get_h() + 5; + GrabFocusPolicy *grab_input_focus = new GrabFocusPolicy(pwindow, x1, y1); + add_subwindow(grab_input_focus); + y1 += grab_input_focus->get_h() + 5; ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1); add_subwindow(focus_activate); y1 += focus_activate->get_h() + 5; @@ -166,6 +190,10 @@ void AppearancePrefs::create_objects() add_subwindow(displacement); y1 += displacement->get_h() + 5; add_subwindow(thumbnails = new ViewThumbnails(x1, y1, pwindow)); + y1 += thumbnails->get_h() + 5; + PerpetualSession *perpetual = new PerpetualSession(x1, y1, pwindow); + add_subwindow(perpetual); + y1 += perpetual->get_h() + 5; if( y < y1 ) y = y1; } @@ -322,14 +350,15 @@ void ViewPluginIcons::create_objects() add_item(new ViewPluginIconItem(this, DEFAULT_PICON)); FileSystem fs; const char *plugin_path = File::get_plugin_path(); - if( fs.update(plugin_path) ) return; + char picon_path[BCTEXTLEN]; + snprintf(picon_path,sizeof(picon_path)-1,"%s/picon", plugin_path); + if( fs.update(picon_path) ) return; for( int i=0; ipath; if( !fs.is_dir(fs_path) ) continue; char *cp = strrchr(fs_path,'/'); cp = !cp ? fs_path : cp+1; - if( strncmp("picon_", cp, 6) ) continue; - if( !strcmp(cp += 6,DEFAULT_PICON) ) continue; + if( !strcmp(cp,DEFAULT_PICON) ) continue; add_item(new ViewPluginIconItem(this, cp)); } } @@ -439,6 +468,19 @@ int PopupMenuBtnup::handle_event() return 1; } +GrabFocusPolicy::GrabFocusPolicy(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, (pwindow->thread->preferences->grab_input_focus) != 0, + _("Set Input Focus when window entered")) +{ + this->pwindow = pwindow; +} + +int GrabFocusPolicy::handle_event() +{ + pwindow->thread->preferences->grab_input_focus = get_value(); + return 1; +} + ActivateFocusPolicy::ActivateFocusPolicy(PreferencesWindow *pwindow, int x, int y) : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_ACTIVATE) != 0, _("Click to activate text focus")) @@ -484,3 +526,122 @@ int ForwardRenderDisplacement::handle_event() return 1; } +HighlightInverseColor::HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex) + : BC_TextBox(x, y, 80, 1, hex) +{ + this->pwindow = pwindow; +} + +int HighlightInverseColor::handle_event() +{ + int inverse_color = strtoul(get_text(),0,16); + if( (inverse_color &= 0xffffff) == 0 ) { + inverse_color = 0xffffff; + char string[BCSTRLEN]; + sprintf(string,"%06x", inverse_color); + update(string); + } + pwindow->thread->preferences->highlight_inverse = inverse_color; + return 1; +} + + +const char *YuvColorSpace::color_space[] = { + N_("BT601"), + N_("BT709"), + N_("BT2020"), +}; + +YuvColorSpace::YuvColorSpace(int x, int y, PreferencesWindow *pwindow) + : BC_PopupMenu(x, y, 100, + _(color_space[pwindow->thread->preferences->yuv_color_space]), 1) +{ + this->pwindow = pwindow; +} +YuvColorSpace::~YuvColorSpace() +{ +} + +void YuvColorSpace::create_objects() +{ + for( int id=0,nid=sizeof(color_space)/sizeof(color_space[0]); idthread->preferences->yuv_color_space]); + return 1; +} + +YuvColorSpaceItem::YuvColorSpaceItem(YuvColorSpace *popup, const char *text, int id) + : BC_MenuItem(text) +{ + this->popup = popup; + this->id = id; +} + +int YuvColorSpaceItem::handle_event() +{ + popup->set_text(get_text()); + popup->pwindow->thread->preferences->yuv_color_space = id; + return popup->handle_event(); +} + + +const char *YuvColorRange::color_range[] = { + N_("JPEG"), + N_("MPEG"), +}; + +YuvColorRange::YuvColorRange(int x, int y, PreferencesWindow *pwindow) + : BC_PopupMenu(x, y, 100, + _(color_range[pwindow->thread->preferences->yuv_color_range]), 1) +{ + this->pwindow = pwindow; +} +YuvColorRange::~YuvColorRange() +{ +} + +void YuvColorRange::create_objects() +{ + for( int id=0,nid=sizeof(color_range)/sizeof(color_range[0]); idthread->preferences->yuv_color_range]); + return 1; +} + +YuvColorRangeItem::YuvColorRangeItem(YuvColorRange *popup, const char *text, int id) + : BC_MenuItem(text) +{ + this->popup = popup; + this->id = id; +} + +int YuvColorRangeItem::handle_event() +{ + popup->set_text(get_text()); + popup->pwindow->thread->preferences->yuv_color_range = id; + return popup->handle_event(); +} + +PerpetualSession::PerpetualSession(int x, int y, PreferencesWindow *pwindow) + : BC_CheckBox(x, y, + pwindow->thread->preferences->perpetual_session, _("Perpetual session")) +{ + this->pwindow = pwindow; +} + +int PerpetualSession::handle_event() +{ + pwindow->thread->preferences->perpetual_session = get_value(); + return 1; +} +