fix trace locks hang, drag handle rework-again, 12 reset btns on plugins, booby on
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / zoombar.C
index 408473d6ec0167c6ca7d1a722ffbc245e5bc1fd3..38f18aeb4b5b8cde6b942f6b5d0ed6d19811ad54 100644 (file)
@@ -39,8 +39,6 @@
 #include "zoombar.h"
 
 
-
-
 ZoomBar::ZoomBar(MWindow *mwindow, MWindowGUI *gui)
  : BC_SubWindow(mwindow->theme->mzoom_x,
        mwindow->theme->mzoom_y,
@@ -49,7 +47,6 @@ ZoomBar::ZoomBar(MWindow *mwindow, MWindowGUI *gui)
 {
        this->gui = gui;
        this->mwindow = mwindow;
-       old_position = 0;
 }
 
 ZoomBar::~ZoomBar()
@@ -107,14 +104,14 @@ 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_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);
        update_formatting(to_value);
 
-       add_subwindow(playback_value = new BC_Title(x, 100, "--", MEDIUMFONT, RED));
-
-       add_subwindow(zoom_value = new BC_Title(x, 100, "--", MEDIUMFONT, BLACK));
        update();
 }
 
@@ -198,19 +195,41 @@ int ZoomBar::update_clocks()
        return 0;
 }
 
-int ZoomBar::update_playback(int64_t new_position)
+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)
 {
-       if(new_position != old_position)
-       {
-               Units::totext(string, new_position,
-                               mwindow->edl->session->sample_rate,
-                               mwindow->edl->session->time_format,
-                               mwindow->edl->session->frame_rate,
-                               mwindow->edl->session->frames_per_foot);
-               playback_value->update(string);
-               old_position = new_position;
-       }
-       return 0;
+       this->mwindow = mwindow;
+       this->zoombar = zoombar;
+       set_precision(0.01);
+       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 TitleAlphaText::handle_event()
+{
+       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;
 }
 
 int ZoomBar::resize_event(int w, int h)