r553: Modern gccs require __attribute__((used)) for variables used only in assembly.
[cinelerra_cv/mob.git] / cinelerra / trackscroll.C
blobedb44ac8d16ab4dd84d96dbf8d76866ea36ed800
1 #include "edl.h"
2 #include "edlsession.h"
3 #include "localsession.h"
4 #include "maincursor.h"
5 #include "mwindow.h"
6 #include "mwindowgui.h"
7 #include "patchbay.h"
8 #include "mainsession.h"
9 #include "theme.h"
10 #include "trackcanvas.h"
11 #include "tracks.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, 
19         SCROLL_VERT, 
20         pixels, 
21         0, 
22         0, 
23         0)
25         this->mwindow = mwindow;
26         this->gui = gui;
27         old_position = 0;
30 TrackScroll::~TrackScroll()
34 long TrackScroll::get_distance()
36         return get_value() - old_position;
39 int TrackScroll::update()
41         return 0;
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
52         update();
53         return 0;
56 int TrackScroll::flip_vertical(int top, int bottom)
58         return 0;
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();
72         flush();
73         return 1;