file probe prefs, updated dcraw, bugs - garbage, accel, ffmpeg/giphy.gif
[goodguy/history.git] / cinelerra-5.1 / cinelerra / interfaceprefs.C
index 3789bc1042bd941fc227c2118481c9a631060db8..1a3f1be553c983b84575215abed6d205d00857c8 100644 (file)
@@ -146,9 +146,12 @@ void InterfacePrefs::create_objects()
        PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1);
        add_subwindow(pop_win);
        y1 += pop_win->get_h() + 5;
-       TextboxFocusPolicy *focus_policy = new TextboxFocusPolicy(pwindow, x1, y1);
-       add_subwindow(focus_policy);
-       y1 += focus_policy->get_h() + 5;
+       ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1);
+       add_subwindow(focus_activate);
+       y1 += focus_activate->get_h() + 5;
+       DeactivateFocusPolicy *focus_deactivate = new DeactivateFocusPolicy(pwindow, x1, y1);
+       add_subwindow(focus_deactivate);
+       y1 += focus_deactivate->get_h() + 5;
 
        if( y < y1 ) y = y1;
        y += 10;
@@ -157,16 +160,17 @@ void InterfacePrefs::create_objects()
        y += 5;
 
        add_subwindow(new BC_Title(x, y, _("Index files"), LARGEFONT, resources->text_default));
+       add_subwindow(ffmpeg_marker_files = new IndexFFMPEGMarkerFiles(this, x1, y));
 
 
-       y += 25;
+       y += 30;
        add_subwindow(new BC_Title(x, y + 5,
                _("Index files go here:"), MEDIUMFONT, resources->text_default));
        add_subwindow(ipathtext = new IndexPathText(x + 230, y,
                pwindow,
                pwindow->thread->preferences->index_directory));
        add_subwindow(ipath = new BrowseButton(mwindow->theme, this, ipathtext,
-               x + 230 + ipathtext->get_w(), y,
+               x1 = x + 230 + ipathtext->get_w(), y,
                pwindow->thread->preferences->index_directory,
                _("Index Path"),
                _("Select the directory for index files"),
@@ -187,9 +191,6 @@ void InterfacePrefs::create_objects()
        add_subwindow(deleteall = new DeleteAllIndexes(mwindow, pwindow, 350, y));
 
 
-
-
-
        y += 35;
        add_subwindow(new BC_Bar(5, y,  get_w() - 10));
        y += 5;
@@ -289,23 +290,12 @@ void InterfacePrefs::create_objects()
 
 const char* InterfacePrefs::behavior_to_text(int mode)
 {
-       switch(mode)
-       {
-               case MOVE_ALL_EDITS:
-                       return _(MOVE_ALL_EDITS_TITLE);
-                       break;
-               case MOVE_ONE_EDIT:
-                       return _(MOVE_ONE_EDIT_TITLE);
-                       break;
-               case MOVE_NO_EDITS:
-                       return _(MOVE_NO_EDITS_TITLE);
-                       break;
-               case MOVE_EDITS_DISABLED:
-                       return _(MOVE_EDITS_DISABLED_TITLE);
-                       break;
-               default:
-                       return "";
-                       break;
+       switch(mode) {
+               case MOVE_ALL_EDITS: return _(MOVE_ALL_EDITS_TITLE);
+               case MOVE_ONE_EDIT:  return _(MOVE_ONE_EDIT_TITLE);
+               case MOVE_NO_EDITS:  return _(MOVE_NO_EDITS_TITLE);
+               case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE);
+               default: return "";
        }
 }
 
@@ -326,17 +316,6 @@ int InterfacePrefs::update(int new_value)
 
 
 
-
-
-
-
-
-
-
-
-
-
-
 IndexPathText::IndexPathText(int x,
        int y,
        PreferencesWindow *pwindow,
@@ -400,15 +379,22 @@ int IndexCount::handle_event()
 
 
 
+IndexFFMPEGMarkerFiles::IndexFFMPEGMarkerFiles(InterfacePrefs *iface_prefs, int x, int y)
+ : BC_CheckBox(x, y,
+       iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes,
+       _("build ffmpeg marker indexes"))
+{
+       this->iface_prefs = iface_prefs;
+}
+IndexFFMPEGMarkerFiles::~IndexFFMPEGMarkerFiles()
+{
+}
 
-
-
-
-
-
-
-
-
+int IndexFFMPEGMarkerFiles::handle_event()
+{
+       iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes = get_value();
+       return 1;
+}
 
 
 
@@ -746,16 +732,35 @@ int PopupMenuBtnup::handle_event()
        return 1;
 }
 
-TextboxFocusPolicy::TextboxFocusPolicy(PreferencesWindow *pwindow, int x, int y)
- : BC_CheckBox(x, y, pwindow->thread->preferences->textbox_focus_policy,
+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"))
+{
+       this->pwindow = pwindow;
+}
+
+int ActivateFocusPolicy::handle_event()
+{
+       if( get_value() )
+               pwindow->thread->preferences->textbox_focus_policy |= CLICK_ACTIVATE;
+       else
+               pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_ACTIVATE;
+       return 1;
+}
+
+DeactivateFocusPolicy::DeactivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_DEACTIVATE) != 0,
        _("Click to deactivate text focus"))
 {
        this->pwindow = pwindow;
 }
 
-int TextboxFocusPolicy::handle_event()
+int DeactivateFocusPolicy::handle_event()
 {
-       pwindow->thread->preferences->textbox_focus_policy = get_value();
+       if( get_value() )
+               pwindow->thread->preferences->textbox_focus_policy |= CLICK_DEACTIVATE;
+       else
+               pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_DEACTIVATE;
        return 1;
 }