r1053: Add Russian translation.
[cinelerra_cv.git] / cinelerra / vtimebar.C
blob210bcecd1db7c9db2251ed393c3538bf1547999a
1 #include "edl.h"
2 #include "localsession.h"
3 #include "mwindow.h"
4 #include "theme.h"
5 #include "vtimebar.h"
6 #include "vwindow.h"
7 #include "vwindowgui.h"
10 VTimeBar::VTimeBar(MWindow *mwindow, 
11                 VWindowGUI *gui,
12                 int x,
13                 int y,
14                 int w, 
15                 int h)
16  : TimeBar(mwindow, 
17                 gui,
18                 x, 
19                 y,
20                 w,
21                 h)
23         this->mwindow = mwindow;
24         this->gui = gui;
27 int VTimeBar::resize_event()
29         reposition_window(mwindow->theme->vtimebar_x,
30                 mwindow->theme->vtimebar_y,
31                 mwindow->theme->vtimebar_w,
32                 mwindow->theme->vtimebar_h);
33         update();
34         return 1;
37 EDL* VTimeBar::get_edl()
39         return gui->vwindow->get_edl();
42 void VTimeBar::draw_time()
44         draw_range();
47 void VTimeBar::update_preview()
49         gui->slider->set_position();
53 void VTimeBar::select_label(double position)
55         EDL *edl = get_edl();
57         if(edl)
58         {
59                 unlock_window();
60                 gui->transport->handle_transport(STOP, 1, 0, 0);
61                 lock_window();
63                 position = mwindow->edl->align_to_frame(position, 1);
65                 if(shift_down())
66                 {
67                         if(position > edl->local_session->get_selectionend(1) / 2 + 
68                                 edl->local_session->get_selectionstart(1) / 2)
69                         {
71                                 edl->local_session->set_selectionend(position);
72                         }
73                         else
74                         {
75                                 edl->local_session->set_selectionstart(position);
76                         }
77                 }
78                 else
79                 {
80                         edl->local_session->set_selectionstart(position);
81                         edl->local_session->set_selectionend(position);
82                 }
84 // Que the CWindow
85                 mwindow->vwindow->update_position(CHANGE_NONE, 
86                         0, 
87                         1);
88                 update();
89         }