2 #include "edlsession.h"
3 #include "localsession.h"
4 #include "maincursor.h"
6 #include "mwindowgui.h"
8 #include "mainsession.h"
10 #include "trackcanvas.h"
12 #include "trackscroll.h"
14 TrackScroll::TrackScroll(MWindow *mwindow, MWindowGUI *gui, int pixels)
15 : BC_ScrollBar(mwindow->theme->mcanvas_x +
16 mwindow->theme->mcanvas_w -
17 BC_ScrollBar::get_span(SCROLL_VERT),
18 mwindow->theme->mcanvas_y,
25 this->mwindow = mwindow;
30 TrackScroll::~TrackScroll()
34 long TrackScroll::get_distance()
36 return get_value() - old_position;
39 int TrackScroll::update()
44 int TrackScroll::resize_event()
46 reposition_window(mwindow->theme->mcanvas_x +
47 mwindow->theme->mcanvas_w -
48 BC_ScrollBar::get_span(SCROLL_VERT),
49 mwindow->theme->mcanvas_y,
50 mwindow->theme->mcanvas_h -
51 BC_ScrollBar::get_span(SCROLL_HORIZ)); // fix scrollbar
56 int TrackScroll::flip_vertical(int top, int bottom)
61 int TrackScroll::handle_event()
63 mwindow->edl->local_session->track_start = get_value();
64 mwindow->edl->tracks->update_y_pixels(mwindow->theme);
65 mwindow->gui->canvas->draw();
66 mwindow->gui->cursor->draw();
67 mwindow->gui->patchbay->update();
68 mwindow->gui->canvas->flash();
69 // Scrollbar must be active to trap button release events
70 // mwindow->gui->canvas->activate();
71 old_position = get_value();