remove v4l/lml/buz, add symbolic folders, more xlat update, yuyv fixes, v4l2 upgrades
[goodguy/history.git] / cinelerra-5.1 / cinelerra / interfaceprefs.C
index c80a8e916ee99abc3eb7e6bdadb2f61dd3af88a2..8df5e9938278be2b48a13465183abd00aadcd92c 100644 (file)
@@ -85,13 +85,14 @@ void InterfacePrefs::create_objects()
        x = mwindow->theme->preferencesoptions_x;
        y = mwindow->theme->preferencesoptions_y;
 
-       add_subwindow(new BC_Title(x, y, 
-               _("Time Format"), 
-               LARGEFONT, 
+       add_subwindow(new BC_Title(x, y, _("Time Format"), LARGEFONT, 
+               resources->text_default));
+       int x1 = get_w()/2;
+       add_subwindow(new BC_Title(x1, y, _("Flags"), LARGEFONT, 
                resources->text_default));
 
        y += get_text_height(LARGEFONT) + 5;
-
+       int y1 = y;
 
        add_subwindow(hms = new TimeFormatHMS(pwindow, this, 
                pwindow->thread->edl->session->time_format == TIME_HMS, 
@@ -113,27 +114,36 @@ void InterfacePrefs::create_objects()
                pwindow->thread->edl->session->time_format == TIME_FRAMES, 
                x, y));
        y += 20;
-       int x1 = x;
+       int x0 = x;
        add_subwindow(feet = new TimeFormatFeet(pwindow, this, 
                pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES, 
-               x1, y));
-       x1 += feet->get_w() + margin;
+               x0, y));
+       x0 += feet->get_w() + 15;
        BC_Title *title;
-       add_subwindow(title = new BC_Title(x1, y, _("Frames per foot:")));
-       x1 += title->get_w() + margin;
+       add_subwindow(title = new BC_Title(x0, y, _("Frames per foot:")));
+       x0 += title->get_w() + margin;
        sprintf(string, "%0.2f", pwindow->thread->edl->session->frames_per_foot);
        add_subwindow(new TimeFormatFeetSetting(pwindow, 
-               x1, y - 5,      string));
+               x0, y - 5,      string));
        y += 20;
        add_subwindow(seconds = new TimeFormatSeconds(pwindow, this, 
                pwindow->thread->edl->session->time_format == TIME_SECONDS, 
                x, y));
-
        y += 35;
-       add_subwindow(new UseTipWindow(pwindow, x, y));
-       add_subwindow(new UseWarnIndecies(pwindow, x+200, y));
 
-       y += 35;
+       UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1);
+       add_subwindow(tip_win);
+       y1 += tip_win->get_h() + 5;
+       UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1);
+       add_subwindow(idx_win);
+       y1 += idx_win->get_h() + 5;
+       UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1);
+       add_subwindow(ver_win);
+       y1 += ver_win->get_h() + 5;
+       PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1);
+       add_subwindow(pop_win);
+       y1 += pop_win->get_h() + 25;
+
        add_subwindow(new BC_Bar(5, y,  get_w() - 10));
        y += 5;
 
@@ -160,7 +170,6 @@ void InterfacePrefs::create_objects()
                MEDIUMFONT, 
                resources->text_default));
        sprintf(string, "%jd", pwindow->thread->preferences->index_size);
-       x1 = x + 230;
        add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string));
        add_subwindow(new ScanCommercials(pwindow, 350,y));
        y += 30;
@@ -179,11 +188,16 @@ void InterfacePrefs::create_objects()
 
        add_subwindow(new BC_Title(x, y, _("Editing"), LARGEFONT, resources->text_default));
 
+       y1 = y + 5;
        y += 35;
-
-       add_subwindow(thumbnails = new ViewThumbnails(x, y, pwindow));
+       add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:")));
+       x1 = x + title->get_w() + 10;
+       keyframe_reticle = new KeyframeReticle(x1, y, &pwindow->thread->preferences->keyframe_reticle);
+       add_subwindow(keyframe_reticle);
+       keyframe_reticle->create_objects();
 
        int x2 = x + 400, y2 = y;
+       add_subwindow(thumbnails = new ViewThumbnails(x2, y1, pwindow));
        AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y2);
        add_subwindow(android_remote);
        y2 += android_remote->get_h() + 10;
@@ -673,9 +687,7 @@ int UseTipWindow::handle_event()
 
 
 UseWarnIndecies::UseWarnIndecies(PreferencesWindow *pwindow, int x, int y)
- : BC_CheckBox(x, 
-       y, 
-       pwindow->thread->preferences->warn_indexes, 
+ : BC_CheckBox(x, y, pwindow->thread->preferences->warn_indexes, 
        _("ffmpeg probe warns rebuild indexes"))
 {
        this->pwindow = pwindow;
@@ -687,7 +699,31 @@ int UseWarnIndecies::handle_event()
        return 1;
 }
 
+UseWarnVersion::UseWarnVersion(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->warn_version, 
+       _("EDL version warns if mismatched"))
+{
+       this->pwindow = pwindow;
+}
 
+int UseWarnVersion::handle_event()
+{
+       pwindow->thread->preferences->warn_version = get_value();
+       return 1;
+}
+
+PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup, 
+       _("Popups activate on button up"))
+{
+       this->pwindow = pwindow;
+}
+
+int PopupMenuBtnup::handle_event()
+{
+       pwindow->thread->preferences->popupmenu_btnup = get_value();
+       return 1;
+}
 
 
 ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
@@ -795,3 +831,50 @@ int StillImageDuration::handle_event()
        return 1;
 }
 
+
+HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline)
+ : BC_MenuItem(popup->hairline_to_string(hairline))
+{
+       this->popup = popup;
+       this->hairline = hairline;
+}
+
+HairlineItem::~HairlineItem()
+{
+}
+
+int HairlineItem::handle_event()
+{
+       popup->set_text(get_text());
+       *(popup->output) = hairline;
+       return 1;
+}
+
+
+KeyframeReticle::KeyframeReticle(int x, int y, int *output)
+ : BC_PopupMenu(x, y, 175, hairline_to_string(*output))
+{
+       this->output = output;
+}
+
+KeyframeReticle::~KeyframeReticle()
+{
+}
+
+const char *KeyframeReticle::hairline_to_string(int type)
+{
+       switch( type ) {
+       case HAIRLINE_NEVER:    return _("Never");
+       case HAIRLINE_DRAGGING: return _("Dragging");
+       case HAIRLINE_ALWAYS:   return _("Always");
+       }
+       return _("Unknown");
+}
+
+void KeyframeReticle::create_objects()
+{
+       add_item(new HairlineItem(this, HAIRLINE_NEVER));
+       add_item(new HairlineItem(this, HAIRLINE_DRAGGING));
+       add_item(new HairlineItem(this, HAIRLINE_ALWAYS));
+}
+