diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-18 01:25:13 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-18 01:25:13 +0100 |
commit | c8d6ddfd10db825e10ba40567dfc854b545f9cec (patch) | |
tree | fd835264c8f79568db5e82978a4fc4ab08c9fd05 | |
parent | 85e3d2158e53df7450e56cbef3d2b3b3aebeb59b (diff) |
Don't scroll-jump when selecting all tracks
-rw-r--r-- | gtk2_ardour/editor.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 6 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 2 |
5 files changed, 15 insertions, 2 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 75c9da4269..512e9ef58e 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -393,6 +393,7 @@ Editor::Editor () , _all_region_actions_sensitized (false) , _ignore_region_action (false) , _last_region_menu_was_main (false) + , _track_selection_change_without_scroll (false) , cd_marker_bar_drag_rect (0) , range_bar_drag_rect (0) , transport_bar_drag_rect (0) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 0efacd98eb..fb1e4b4bdc 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1606,6 +1606,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void queue_visual_videotimeline_update (); void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true); + bool track_selection_change_without_scroll () const { + return _track_selection_change_without_scroll; + } + PBD::Signal0<void> EditorFreeze; PBD::Signal0<void> EditorThaw; @@ -1856,6 +1860,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void point_selection_changed (); void marker_selection_changed (); + bool _track_selection_change_without_scroll; + void cancel_selection (); void cancel_time_selection (); diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 42111c5ffa..d214d48a32 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -21,6 +21,7 @@ #include <cstdlib> #include "pbd/stacktrace.h" +#include "pbd/unwind.h" #include "ardour/midi_region.h" #include "ardour/playlist.h" @@ -174,6 +175,7 @@ Editor::select_all_tracks () visible_views.push_back (*i); } } + PBD::Unwinder<bool> uw (_track_selection_change_without_scroll, true); selection->set (visible_views); } @@ -966,7 +968,9 @@ Editor::track_selection_changed () * selected, because we always append to that list. */ set_selected_mixer_strip (*(selection->tracks.back())); - ensure_time_axis_view_is_visible (*(selection->tracks.back()), false); + if (!_track_selection_change_without_scroll) { + ensure_time_axis_view_is_visible (*(selection->tracks.back()), false); + } break; } diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 7d27e54654..12d015d2f8 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -857,7 +857,7 @@ Mixer_UI::sync_treeview_from_presentation_info (PropertyChange const & what_chan } } - if (!_selection.axes.empty()) { + if (!_selection.axes.empty() && !PublicEditor::instance().track_selection_change_without_scroll ()) { move_stripable_into_view ((*_selection.axes.begin())->stripable()); } } diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index d1dc082ad4..5cfedb11f1 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -343,6 +343,8 @@ class PublicEditor : public Gtkmm2ext::Tabbable { virtual void set_video_timeline_height (const int h) = 0; virtual void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true) = 0; + virtual bool track_selection_change_without_scroll () const = 0; + virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0; virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, PBD::PropertyID) const = 0; |