00001 #include "bcsignals.h"
00002 #include "ctimebar.h"
00003 #include "cwindow.h"
00004 #include "cwindowgui.h"
00005 #include "edl.h"
00006 #include "localsession.h"
00007 #include "maincursor.h"
00008 #include "mbuttons.h"
00009 #include "mwindow.h"
00010 #include "mwindowgui.h"
00011 #include "theme.h"
00012
00013
00014 CTimeBar::CTimeBar(MWindow *mwindow,
00015 CWindowGUI *gui,
00016 int x,
00017 int y,
00018 int w,
00019 int h)
00020 : TimeBar(mwindow,
00021 gui,
00022 x,
00023 y,
00024 w,
00025 h)
00026 {
00027 this->mwindow = mwindow;
00028 this->gui = gui;
00029 }
00030
00031 int CTimeBar::resize_event()
00032 {
00033 reposition_window(mwindow->theme->ctimebar_x,
00034 mwindow->theme->ctimebar_y,
00035 mwindow->theme->ctimebar_w,
00036 mwindow->theme->ctimebar_h);
00037 update();
00038 return 1;
00039 }
00040
00041
00042 EDL* CTimeBar::get_edl()
00043 {
00044 return mwindow->edl;
00045 }
00046
00047 void CTimeBar::draw_time()
00048 {
00049 get_edl_length();
00050 draw_range();
00051 }
00052
00053
00054 void CTimeBar::update_preview()
00055 {
00056 gui->slider->set_position();
00057 }
00058
00059
00060 void CTimeBar::select_label(double position)
00061 {
00062 EDL *edl = mwindow->edl;
00063
00064 gui->unlock_window();
00065 mwindow->gui->mbuttons->transport->handle_transport(STOP, 1, 0, 0);
00066 gui->lock_window();
00067
00068 position = mwindow->edl->align_to_frame(position, 1);
00069
00070 if(shift_down())
00071 {
00072 if(position > edl->local_session->get_selectionend(1) / 2 +
00073 edl->local_session->get_selectionstart(1) / 2)
00074 {
00075
00076 edl->local_session->set_selectionend(position);
00077 }
00078 else
00079 {
00080 edl->local_session->set_selectionstart(position);
00081 }
00082 }
00083 else
00084 {
00085 edl->local_session->set_selectionstart(position);
00086 edl->local_session->set_selectionend(position);
00087 }
00088
00089
00090 mwindow->cwindow->update(1, 0, 0, 0, 1);
00091
00092
00093
00094 mwindow->gui->lock_window();
00095 mwindow->gui->cursor->hide(0);
00096 mwindow->gui->cursor->draw(1);
00097 mwindow->gui->update(0,
00098 1,
00099 1,
00100 0,
00101 1,
00102 1,
00103 0);
00104 mwindow->gui->unlock_window();
00105 mwindow->update_plugin_guis();
00106
00107 }
00108
00109
00110
00111
00112