4 * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "edlsession.h"
24 #include "localsession.h"
25 #include "maincursor.h"
27 #include "mwindowgui.h"
29 #include "mainsession.h"
31 #include "timelinepane.h"
32 #include "trackcanvas.h"
34 #include "trackscroll.h"
36 TrackScroll::TrackScroll(MWindow *mwindow,
49 this->mwindow = mwindow;
55 TrackScroll::TrackScroll(MWindow *mwindow,
68 this->mwindow = mwindow;
69 this->gui = mwindow->gui;
74 TrackScroll::~TrackScroll()
78 long TrackScroll::get_distance()
80 return get_value() - old_position;
83 int TrackScroll::update()
88 int TrackScroll::resize_event()
90 reposition_window(mwindow->theme->mvscroll_x,
91 mwindow->theme->mvscroll_y,
92 mwindow->theme->mvscroll_h);
97 int TrackScroll::resize_event(int x, int y, int h)
106 int TrackScroll::flip_vertical(int top, int bottom)
111 void TrackScroll::set_position()
114 mwindow->edl->get_tracks_height(mwindow->theme),
115 mwindow->edl->local_session->track_start[pane->number],
120 int TrackScroll::handle_event()
122 int64_t distance = get_value() -
123 mwindow->edl->local_session->track_start[pane->number];
124 mwindow->trackmovement(distance, pane->number);
125 // mwindow->edl->local_session->track_start[pane->number] = get_value();
126 // if(pane->number == TOP_RIGHT_PANE)
127 // mwindow->edl->local_session->track_start[TOP_LEFT_PANE] =
128 // mwindow->edl->local_session->track_start[pane->number];
130 // if(pane->number == BOTTOM_RIGHT_PANE)
131 // mwindow->edl->local_session->track_start[BOTTOM_LEFT_PANE] =
132 // mwindow->edl->local_session->track_start[pane->number];
134 // mwindow->edl->tracks->update_y_pixels(mwindow->theme);
135 // mwindow->gui->draw_canvas(0, 0);
136 // mwindow->gui->draw_cursor(1);
137 // mwindow->gui->update_patchbay();
138 // mwindow->gui->flash_canvas(1);
139 // Scrollbar must be active to trap button release events
140 // mwindow->gui->canvas->activate();
141 old_position = get_value();