2 #include "edlsession.h"
3 #include "samplescroll.h"
4 #include "localsession.h"
5 #include "maincursor.h"
7 #include "mwindowgui.h"
9 #include "mainsession.h"
12 #include "trackcanvas.h"
15 SampleScroll::SampleScroll(MWindow *mwindow,
29 this->mwindow = mwindow;
33 SampleScroll::~SampleScroll()
37 int SampleScroll::flip_vertical()
42 int SampleScroll::in_use()
48 int SampleScroll::resize_event()
50 reposition_window(mwindow->theme->mhscroll_x,
51 mwindow->theme->mhscroll_y,
52 mwindow->theme->mhscroll_w);
56 int SampleScroll::set_position()
58 if(!gui->canvas) return 0;
59 long length = Units::round(mwindow->edl->tracks->total_length() *
60 mwindow->edl->session->sample_rate /
61 mwindow->edl->local_session->zoom_sample);
62 long position = mwindow->edl->local_session->view_start;
63 long handle_size = mwindow->theme->mcanvas_w -
64 BC_ScrollBar::get_span(SCROLL_VERT);
70 oldposition = position;
74 int SampleScroll::handle_event()
76 //printf("SampleScroll::handle_event 1 %d %d\n", mwindow->edl->session->sample_rate, get_value());
77 mwindow->edl->local_session->view_start = get_value();
80 //printf("SampleScroll::handle_event 1 %ld\n", mwindow->edl->local_session->view_start);
81 mwindow->gui->canvas->draw();
82 mwindow->gui->cursor->draw(1);
84 //printf("SampleScroll::handle_event 1\n");
85 mwindow->gui->canvas->flash();
87 //printf("SampleScroll::handle_event 1\n");
88 mwindow->gui->patchbay->update();
90 //printf("SampleScroll::handle_event 1\n");
91 mwindow->gui->timebar->update();
94 //printf("SampleScroll::handle_event 2\n");