r802: Remove renderframfsclient and renderfarmfsserver .h and .C from Makefile.am...
[cinelerra_cv/mob.git] / cinelerra / ctimebar.C
blob6f280e86508499bb7ebebdc1c1bbc3e9b5d2710b
1 #include "ctimebar.h"
2 #include "cwindow.h"
3 #include "cwindowgui.h"
4 #include "edl.h"
5 #include "localsession.h"
6 #include "maincursor.h"
7 #include "mbuttons.h"
8 #include "mwindow.h"
9 #include "mwindowgui.h"
10 #include "theme.h"
13 CTimeBar::CTimeBar(MWindow *mwindow, 
14                 CWindowGUI *gui,
15                 int x,
16                 int y,
17                 int w, 
18                 int h)
19  : TimeBar(mwindow, 
20                 gui,
21                 x, 
22                 y,
23                 w,
24                 h)
26         this->mwindow = mwindow;
27         this->gui = gui;
30 int CTimeBar::resize_event()
32         reposition_window(mwindow->theme->ctimebar_x,
33                 mwindow->theme->ctimebar_y,
34                 mwindow->theme->ctimebar_w,
35                 mwindow->theme->ctimebar_h);
36         update();
37         return 1;
41 EDL* CTimeBar::get_edl()
43         return mwindow->edl;
46 void CTimeBar::draw_time()
48         get_edl_length();
49         draw_range();
53 void CTimeBar::update_preview()
55         gui->slider->set_position();
59 void CTimeBar::select_label(double position)
61         EDL *edl = mwindow->edl;
63         gui->unlock_window();
64         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1);
65         gui->lock_window();
67         position = mwindow->edl->align_to_frame(position, 1);
69         if(shift_down())
70         {
71                 if(position > edl->local_session->get_selectionend(1) / 2 + 
72                         edl->local_session->get_selectionstart(1) / 2)
73                 {
74                 
75                         edl->local_session->set_selectionend(position);
76                 }
77                 else
78                 {
79                         edl->local_session->set_selectionstart(position);
80                 }
81         }
82         else
83         {
84                 edl->local_session->set_selectionstart(position);
85                 edl->local_session->set_selectionend(position);
86         }
88 // Que the CWindow
89         mwindow->cwindow->update(1, 0, 0, 0, 1);
91 //printf("CTimeBar::select_label 1\n");
93         mwindow->gui->lock_window();
94         mwindow->gui->cursor->hide();
95         mwindow->gui->cursor->draw();
96         mwindow->gui->update(0,
97                 1,      // 1 for incremental drawing.  2 for full refresh
98                 1,
99                 0,
100                 1, 
101                 1,
102                 0);
103         mwindow->gui->unlock_window();
104 //printf("CTimeBar::select_label 2\n");