diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-03-20 13:29:29 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-03-20 13:29:45 -0400 |
commit | 9df3157dfc59c596bf8f044fc4ab5445a12f02a1 (patch) | |
tree | b2f25278a186abc18ca7b8005329594e4b85e743 /gtk2_ardour/editor.h | |
parent | 01c6266909bc7b1dce27a4d58d46be17f76c3f76 (diff) |
big rework of scrolling, horizontal part considered almost 100% done.
Many more changes than I would typically like in a single commit, but this was all very intertwined.
Vertical scrolling using track-stepping still to follow.
Diffstat (limited to 'gtk2_ardour/editor.h')
-rw-r--r-- | gtk2_ardour/editor.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index b1edb26737..bf52948b4b 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -207,7 +207,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD account any scrolling offsets. */ - framepos_t pixel_to_sample (double pixel) const { + framepos_t pixel_to_sample_from_event (double pixel) const { /* pixel can be less than zero when motion events are processed. since we've already run the world->canvas @@ -222,6 +222,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD } } + framepos_t pixel_to_sample (double pixel) const { + return pixel * samples_per_pixel; + } + double sample_to_pixel (framepos_t sample) const { return sample / samples_per_pixel; } @@ -408,7 +412,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD return _drags; } - void maybe_autoscroll (bool, bool, bool, bool); + void maybe_autoscroll (bool, bool, bool); + bool autoscroll_active() const; Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; } void set_canvas_cursor (Gdk::Cursor*, bool save=false); @@ -1022,6 +1027,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD static int _idle_visual_changer (void *arg); int idle_visual_changer (); + void visual_changer (const VisualChange&); void ensure_visual_change_idle_handler (); /* track views */ @@ -1072,8 +1078,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtkmm2ext::ActionMap editor_action_map; Gtkmm2ext::Bindings key_bindings; - int ensure_cursor (framepos_t* pos); - void cut_copy (Editing::CutCopyOp); bool can_cut_copy () const; void cut_copy_points (Editing::CutCopyOp); @@ -1722,22 +1726,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* autoscrolling */ - bool autoscroll_active; - int autoscroll_timeout_tag; - int autoscroll_x; - int autoscroll_y; - int last_autoscroll_x; - int last_autoscroll_y; - uint32_t autoscroll_cnt; - framecnt_t autoscroll_x_distance; - double autoscroll_y_distance; - - bool _autoscroll_fudging; - int autoscroll_fudge_threshold () const; + sigc::connection autoscroll_connection; + bool autoscroll_horizontal_allowed; + bool autoscroll_vertical_allowed; + uint32_t autoscroll_cnt; + Gtk::Widget* autoscroll_widget; + ArdourCanvas::Rect autoscroll_boundary; - static gint _autoscroll_canvas (void *); bool autoscroll_canvas (); - void start_canvas_autoscroll (int x, int y); + void start_canvas_autoscroll (bool allow_horiz, bool allow_vert); void stop_canvas_autoscroll (); /* trimming */ |