transition length popup rework
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / zoombar.C
index 9f1c95bcb0e9d596f7562176179350e226ec2fe9..79ecfd9cdf7da2bd319f77e06c9c3b93e22c954d 100644 (file)
@@ -104,7 +104,9 @@ void ZoomBar::create_objects()
        x += length_value->get_w() + 5;
        add_subwindow(to_value = new ToTextBox(mwindow, this, x, y));
        x += to_value->get_w() + 5;
-       add_subwindow(title_alpha = new TitleBarAlpha(mwindow, this, x, y));
+       add_subwindow(title_alpha_bar = new TitleAlphaBar(mwindow, this, x, y));
+       x += title_alpha_bar->get_w() + 5;
+       add_subwindow(title_alpha_text = new TitleAlphaText(mwindow, this, x, y));
 
        update_formatting(from_value);
        update_formatting(length_value);
@@ -146,9 +148,22 @@ int ZoomBar::draw()
 }
 
 void ZoomBar::update_autozoom()
+{
+       update_autozoom(mwindow->edl->local_session->zoombar_showautocolor);
+}
+
+void ZoomBar::update_autozoom(int grouptype, int color)
+{
+       mwindow->edl->local_session->zoombar_showautotype = grouptype;
+       update_autozoom(color);
+}
+
+void ZoomBar::update_autozoom(int color)
 {
        char string[BCTEXTLEN];
        int autogroup_type = mwindow->edl->local_session->zoombar_showautotype;
+       mwindow->edl->local_session->zoombar_showautocolor = color;
+       if( color < 0 ) color = get_resources()->default_text_color;
        switch( autogroup_type ) {
        case AUTOGROUPTYPE_AUDIO_FADE:
        case AUTOGROUPTYPE_VIDEO_FADE:
@@ -171,9 +186,10 @@ void ZoomBar::update_autozoom()
        }
        auto_zoom_text->update(string);
        const char *group_name = AutoTypeMenu::to_text(autogroup_type);
-       auto_type->set_text(group_name);
+       auto_type->set_text(group_name, color);
 }
 
+
 int ZoomBar::update()
 {
        sample_zoom->update(mwindow->edl->local_session->zoom_sample);
@@ -193,18 +209,38 @@ int ZoomBar::update_clocks()
        return 0;
 }
 
-TitleBarAlpha::TitleBarAlpha(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
+TitleAlphaBar::TitleAlphaBar(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
  : BC_FSlider(x, y, 0, 150, 200, 0, 1.0, mwindow->session->title_bar_alpha, 0)
 {
        this->mwindow = mwindow;
        this->zoombar = zoombar;
        set_precision(0.01);
-       set_tooltip(_("TitleBar Alpha"));
+       enable_show_value(0);
+}
+
+int TitleAlphaBar::handle_event()
+{
+       float v = get_value();
+       mwindow->session->title_bar_alpha = v;
+       zoombar->title_alpha_text->update(v);
+       mwindow->gui->draw_trackmovement();
+       mwindow->gui->flush();
+       return 1;
+}
+
+TitleAlphaText::TitleAlphaText(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
+ : BC_TextBox(x, y, 48, 1, mwindow->session->title_bar_alpha, 0, MEDIUMFONT, 2)
+{
+       this->mwindow = mwindow;
+       this->zoombar = zoombar;
+       set_tooltip(_("Title Alpha"));
 }
 
-int TitleBarAlpha::handle_event()
+int TitleAlphaText::handle_event()
 {
-       mwindow->session->title_bar_alpha = get_value();
+       float v = atof(get_text());
+       mwindow->session->title_bar_alpha = v;
+       zoombar->title_alpha_bar->update(v);
        mwindow->gui->draw_trackmovement();
        mwindow->gui->flush();
        return 1;